x changed setup code to automagically find Settings.php (hopefully)
* rearranged stuff in template to use less room (set <form>-block margin to 0) + calculate /Sources/ directory dynamically from SMF setup
This commit is contained in:
@ -1,10 +1,12 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
function template_shout_box() {
|
function template_shout_box() {
|
||||||
global $context, $settings, $options, $txt, $user_info, $scripturl, $modSettings, $forum_version, $sourcedir;
|
global $context, $settings, $options, $txt, $user_info, $scripturl, $modSettings,
|
||||||
|
$forum_version, $sourcedir, $boarddir, $boardurl;
|
||||||
|
|
||||||
$themedir = $settings['default_theme_url'];
|
$themedir = $settings['default_theme_url'];
|
||||||
$imgdir = $themedir."/images/";
|
$imgdir = $themedir."/images/";
|
||||||
|
$sourceurl = str_replace($boarddir, $boardurl, $sourcedir);
|
||||||
|
|
||||||
echo '
|
echo '
|
||||||
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
|
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
|
||||||
@ -23,35 +25,39 @@ function template_shout_box() {
|
|||||||
<table border="0" width="100%" cellspacing="1" cellpadding="4" class="bordercolor">
|
<table border="0" width="100%" cellspacing="1" cellpadding="4" class="bordercolor">
|
||||||
<tr class="windowbg" align="right" style="width:13%">
|
<tr class="windowbg" align="right" style="width:13%">
|
||||||
<td class="windowbg" style="width:87%">
|
<td class="windowbg" style="width:87%">
|
||||||
<form name="sbox" action="Sources/sboxDB.php?action=write" method="post" target="sboxframe" onsubmit="setTimeout(\'clearSbox()\', 500);">
|
<table width="100%" border="0" cellspacing="1" cellpadding="0">
|
||||||
<input type="hidden" name="ts" value="'.forum_time(true).'">
|
<tr>
|
||||||
<table width="100%" border="0" cellspacing="1" cellpadding="0">
|
<td align="right">
|
||||||
<tr>
|
<form name="sbox" action="' . $sourceurl . '/sboxDB.php?action=write" method="post" target="sboxframe" style="margin: 0;" onsubmit="setTimeout(\'clearSbox()\', 500);">
|
||||||
<td align="right">
|
<a href="' . $sourceurl . '/sboxDB.php?" target="sboxframe"><img src="'.$imgdir.'sbox_refresh.gif" border="0" width="16" height="17" align="middle" alt="' . $txt['sbox_Refresh'] . '" /></a>';
|
||||||
<a href="Sources/sboxDB.php?" target="sboxframe"><img src="'.$imgdir.'sbox_refresh.gif" border="0" width="16" height="17" align="middle" alt="' . $txt['sbox_Refresh'] . '" /></a>';
|
if ((!$context['user']['is_guest']) || ($modSettings['sbox_GuestAllowed'] == "1")) {
|
||||||
if ((!$context['user']['is_guest']) || ($modSettings['sbox_GuestAllowed'] == "1"))
|
echo '
|
||||||
echo '
|
<input type="hidden" name="ts" value="'.forum_time(true).'">
|
||||||
<input class="windowbg2" type="text" name="sboxText" size="100" maxlength="320" /> <input type="submit" class="input" value=" shout " />';
|
<input class="windowbg2" type="text" name="sboxText" size="100" maxlength="320" /> <input type="submit" class="input" value=" shout " />';
|
||||||
echo '
|
}
|
||||||
</td>
|
echo '
|
||||||
</tr>';
|
</form>
|
||||||
|
</td>
|
||||||
|
</tr>';
|
||||||
|
|
||||||
if (($modSettings['sbox_SmiliesVisible'] == "1") && ((!$context['user']['is_guest']) || ($modSettings['sbox_GuestAllowed'] == "1"))) {
|
if (($modSettings['sbox_SmiliesVisible'] == "1") && ((!$context['user']['is_guest']) || ($modSettings['sbox_GuestAllowed'] == "1"))) {
|
||||||
sbox_loadSmileys();
|
sbox_loadSmileys();
|
||||||
echo '
|
echo '
|
||||||
<tr>
|
<tr>
|
||||||
<td align="center">';
|
<td align="center">';
|
||||||
sbox_printSmileys();
|
sbox_printSmileys();
|
||||||
|
echo '
|
||||||
|
</td>
|
||||||
|
</tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
echo'
|
echo'
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<iframe name="sboxframe" src="Sources/sboxDB.php?" width="100%" height="'.$modSettings['sbox_Height'].'"></iframe>
|
<iframe name="sboxframe" src="' . $sourceurl . '/sboxDB.php?" width="100%" height="'.$modSettings['sbox_Height'].'"></iframe>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
</form>
|
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
@ -47,7 +47,7 @@ else
|
|||||||
|
|
||||||
if ((isset($_REQUEST['man'])) || (!isset($db_name)))
|
if ((isset($_REQUEST['man'])) || (!isset($db_name)))
|
||||||
{
|
{
|
||||||
include_once ("Settings.php");
|
require_once (dirname(realpath($_SERVER['SCRIPT_FILENAME'])) . "/Settings.php");
|
||||||
$dbcon = mysql_connect($db_server, $db_user, $db_passwd);
|
$dbcon = mysql_connect($db_server, $db_user, $db_passwd);
|
||||||
mysql_select_db($db_name);
|
mysql_select_db($db_name);
|
||||||
}
|
}
|
||||||
|
@ -47,7 +47,7 @@ else
|
|||||||
|
|
||||||
if ((isset($_REQUEST['man'])) || (!isset($db_name)))
|
if ((isset($_REQUEST['man'])) || (!isset($db_name)))
|
||||||
{
|
{
|
||||||
include_once ("Settings.php");
|
require_once (dirname(realpath($_SERVER['SCRIPT_FILENAME'])) . '/Settings.php');
|
||||||
$dbcon = mysql_connect($db_server, $db_user, $db_passwd);
|
$dbcon = mysql_connect($db_server, $db_user, $db_passwd);
|
||||||
mysql_select_db($db_name);
|
mysql_select_db($db_name);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user