Przedszkolak
Postów: 52 Ostrzeżeń: 3
v7.02.05 Data rejestracji: 18.10.2007 19:22
|
Dokładnie jak zaktualizowałem sobie PHP-Fusion do najnowszej wersji mój shoutbox też nie działa. Mam go dodanego do pliku theme przez include.
oto kod mojego pliku:
<?
if (!defined("IN_FUSION")) { die("Access Denied"); }
if (file_exists(INFUSIONS."shout_panel/locale/".$settings['locale']."")) {
include INFUSIONS."shout_panel/locale/".$settings['locale']."";
} else {
include INFUSIONS."shout_panel/locale/Polish.php";
}
$link = FUSION_SELF.(FUSION_QUERY ? "?".FUSION_QUERY : "");
$link = preg_replace("^(&|\?)s_action=(edit|delete)&shout_id=\d*^", "", $link);
$sep = stristr($link, "?") ? "&" : "?";
if (iMEMBER && (isset($_GET['s_action']) && $_GET['s_action'] == "delete") && (isset($_GET['shout_id']) && isnum($_GET['shout_id']))) {
if ((iADMIN && checkrights("S")) || (iMEMBER && dbcount("(shout_id)", DB_SHOUTBOX, "shout_id='".$_GET['shout_id']."' AND shout_name='".$userdata['user_id']."'"))) {
$result = dbquery("DELETE FROM ".DB_SHOUTBOX." WHERE shout_id='".$_GET['shout_id']."'".(iADMIN ? "" : " AND shout_name='".$userdata['user_id']."'"));
}
redirect($link);
}
function sbwrap($text) {
global $locale;
$i = 0; $tags = 0; $chars = 0; $res = "";
$str_len = strlen($text);
for ($i = 0; $i < $str_len; $i++) {
$chr = mb_substr($text, $i, 1, $locale['charset']);
if ($chr == "<") {
if (mb_substr($text, ($i + 1), 6, $locale['charset']) == "a href" || mb_substr($text, ($i + 1), 3, $locale['charset']) == "img") {
$chr = " ".$chr;
$chars = 0;
}
$tags++;
} elseif ($chr == "&") {
if (mb_substr($text, ($i + 1), 5, $locale['charset']) == "quot;") {
$chars = $chars - 5;
} elseif (mb_substr($text, ($i + 1), 4, $locale['charset']) == "amp;" || mb_substr($text, ($i + 1), 4, $locale['charset']) == "#39;" || mb_substr($text, ($i + 1), 4, $locale['charset']) == "#92;") {
$chars = $chars - 4;
} elseif (mb_substr($text, ($i + 1), 3, $locale['charset']) == "lt;" || mb_substr($text, ($i + 1), 3, $locale['charset']) == "gt;") {
$chars = $chars - 3;
}
} elseif ($chr == ">") {
$tags--;
} elseif ($chr == " ") {
$chars = 0;
} elseif (!$tags) {
$chars++;
}
if (!$tags && $chars == 18) {
$chr .= "<br />";
$chars = 0;
}
$res .= $chr;
}
return $res;
}
include_once INFUSIONS."shout_panel/shout_panel_funkcje.php";
include_once INCLUDES."bbcode_include.php";
if ((iMEMBER || $settings['guestposts'] == "1") && isset($_POST['post_shout'])) {
$flood = false;
if (iMEMBER) {
$shout_name = $userdata['user_id'];
} elseif ($settings['guestposts'] == "1") {
$shout_name = trim(stripinput($_POST['shout_name']));
$shout_name = preg_replace("(^[0-9]*)", "", $shout_name);
if (isnum($shout_name)) { $shout_name = ""; }
include_once INCLUDES."securimage/securimage.php";
$securimage = new Securimage();
if (!isset($_POST['sb_captcha_code']) || $securimage->check($_POST['sb_captcha_code']) == false) { redirect($link); }
}
$shout_message = str_replace("\n", " ", $_POST['shout_message']);
$shout_message = preg_replace("/^(.{255}).*$/", "$1", $shout_message);
$shout_message = trim(stripinput(censorwords($shout_message)));
if (iMEMBER && (isset($_GET['s_action']) && $_GET['s_action'] == "edit") && (isset($_GET['shout_id']) && isnum($_GET['shout_id']))) {
$comment_updated = false;
if ((iADMIN && checkrights("S")) || (iMEMBER && dbcount("(shout_id)", DB_SHOUTBOX, "shout_id='".$_GET['shout_id']."' AND shout_name='".$userdata['user_id']."'"))) {
if ($shout_message) {
$result = dbquery("UPDATE ".DB_SHOUTBOX." SET shout_message='$shout_message' WHERE shout_id='".$_GET['shout_id']."'".(iADMIN ? "" : " AND shout_name='".$userdata['user_id']."'"));
}
}
redirect($link);
} elseif ($shout_name && $shout_message) {
require_once INCLUDES."flood_include.php";
if (!flood_control("shout_datestamp", DB_SHOUTBOX, "shout_ip='".USER_IP."'")) {
$result = dbquery("INSERT INTO ".DB_SHOUTBOX." (shout_name, shout_message, shout_datestamp, shout_ip, shout_hidden) VALUES ('$shout_name', '$shout_message', '".time()."', '".USER_IP."', '0')");
}
}
redirect($link);
}
if (iMEMBER && (isset($_GET['s_action']) && $_GET['s_action'] == "edit") && (isset($_GET['shout_id']) && isnum($_GET['shout_id']))) {
$esresult = dbquery(
"SELECT ts.shout_id, ts.shout_name, ts.shout_message, tu.user_id, tu.user_name
FROM ".DB_SHOUTBOX." tsosobiście nie lubię AirMaxów...
LEFT JOIN ".DB_USERS." tu ON ts.shout_name=tu.user_id
WHERE ts.shout_id='".$_GET['shout_id']."'"
);
if (dbrows($esresult)) {
$esdata = dbarray($esresult);
if ((iADMIN && checkrights("S")) || (iMEMBER && $esdata['shout_name'] == $userdata['user_id'] && isset($esdata['user_name']))) {
if ((isset($_GET['s_action']) && $_GET['s_action'] == "edit") && (isset($_GET['shout_id']) && isnum($_GET['shout_id']))) {
$edit_url = $sep."s_action=edit&shout_id=".$esdata['shout_id'];
} else {
$edit_url = "";
}
$shout_link = $link.$edit_url;
$shout_message = $esdata['shout_message'];
}
} else {
$shout_link = $link;
$shout_message = "";
}
} else {
$shout_link = $link;
$shout_message = "";
}
$numrows = dbcount("(shout_id)", DB_SHOUTBOX, "shout_hidden='0'");
$result = dbquery(
"SELECT ts.shout_id, ts.shout_name, ts.shout_message, ts.shout_datestamp, tu.user_id, tu.user_name, tu.user_avatar, tu.user_lastvisit, tu.user_status
FROM ".DB_SHOUTBOX." ts
LEFT JOIN ".DB_USERS." tu ON ts.shout_name=tu.user_id
WHERE shout_hidden='0'
ORDER BY ts.shout_datestamp DESC LIMIT 0,".$settings['numofshouts']
);
if (dbrows($result)) {
$i = 0;
echo" <div class='tbls' style='height:200px; overflow:auto;'>";
while ($data = dbarray($result)) {
echo "<div class='shoutboxname'>";
if ($data['user_name']) {
if ($data['user_avatar'] && file_exists(IMAGES."avatars/".$data['user_avatar'])) {
echo "<img src='".IMAGES."avatars/".$data['user_avatar']."' alt='".$locale['sb_av1']."' hspace='6' align='left' width='40px' height='40px' border='1' style='vertical-align:middle;
/>\n";
} else {
echo "<img src='http://saintseiya.netserwer.pl/images/imagenotfound.jpg' alt='".$locale['sb_noav1']."' width='40px' height='40px' hspace='6' align='left' border='1' style='vertical-align:middle;/>";
}
echo " <span class='side'> ".profile_link($data['shout_name'], $data['user_name'], $data['user_status'])."</span>\n";
} else {
echo $data['shout_name']."\n";
}
if ($data['user_lastvisit']<(time()-60)) {
echo " <img src='".BASEDIR."infusions/shout_panel/obrazki/offline.gif' alt='".$data['user_name']." ".$locale['sb_off1']."' title='".$data['user_name']." ".$locale['sb_off1']."' style='vertical-align:middle; border:0px;'/> <BR><small>".showdate("shortdate", $data['shout_datestamp'])."</small> </div>";
} else {
echo " <img src='".BASEDIR."infusions/shout_panel/obrazki/online.gif' alt='".$data['user_name']."".$locale['sb_on1']."' title='".$data['user_name']." ".$locale['sb_on1']."' style='vertical-align:middle; border:0px;' /> <BR><small>".showdate("shortdate", $data['shout_datestamp'])."</small> </div>";
}
echo "<div class='shoutbox'>".sbwrap(parseubb(parsesmileys($data['shout_message']), "b|i|u|url|color"))."</div>";
echo "
<BR>\n";
$i++;
if ($i != $numrows) { echo "\n"; }
}
echo "</div>\n";
} else {
echo "<div>".$locale['global_156']."</div>\n";
}
echo "<a id='edit_shout' name='edit_shout'></a>\n";
echo "<form name='shout_form' method='post' action='".$shout_link."'>\n";
if (iGUEST && $settings['guestposts'] == "1") {
echo $locale['global_151']."<br />\n";
echo "<input type='text' name='shout_name' value='' class='textbox2' style='width:140px' /><br />\n";
echo $locale['global_152']."<br />\n";
}
$delay_spam = 86400; // 24 Hours
if (iMEMBER && ((time()-$userdata['user_joined'])<$delay_spam)) {
echo"<br /><div class='admin-message' style='text-align: center;margin:auto'><strong>".$locale['sb_spam001']."</strong></div><br />";
}elseif(iMEMBER || $settings['guestposts'] == "1"){
if ($numrows > $settings['numofshouts']) {
}
echo"<table border='0' width='100%'><tr>
<td><textarea name='shout_message' maxlength='400' rows='1' cols='80' class='textbox2' style='width:850px' align='left' >".$shout_message."</textarea><br /><center>
<span class='counterb'>".$locale['sb_count1']."</span> <span class='counter' ></span> <span class='counterb'>".$locale['sb_count2']."</span></center></td><td>\n";
echo display_bbcodes("150px;", "shout_message", "shout_form", "smiley|b|i|u|url")."";
echo "</td><td text-align='left'><input style='vertical-align:middle;' type='submit' name='post_shout' value='".$locale['global_153']."' class='button' /></td></tr>
</table>\n";
echo "<div style='text-align:center'><a href='".INFUSIONS."shout_panel/shout_archiwum.php' class='side'>
<img src='http://saintseiya.netserwer.pl/themes/saintseiya-g-angeltheme/images/archiwum.jpg' style='vertical-align:middle;
opacity:0.6;filter:alpha(opacity=60)'
onmouseover='this.style.opacity=1;this.filters.alpha.opacity=100'
onmouseout='this.style.opacity=0.6;this.filters.alpha.opacity=60'''/></a></div>";
echo "</form></div></div>";
} else {
echo "<div style='text-align:center'>".$locale['global_154']."</div></center><br />\n";
}
echo"</div>";
?>
|