Witam!
Wiec tak mam taki problem że przerabiam sobie shoutboxa, (modyfikacja pawkow) wcześniej miałem shoutbox_central_panel ale on nie zdał egzaminu z tego powodu ze sam sie odświeżał co 15 sec. a transfer mi na tym poleciał maxymalnie.. wiec tak w tym SB co przerabiam mam już prawie wszystko brakuje mi już tylko odświeżania wybiórczego cos na styl eX-Chat (shoutbox znajdujący się na extreme fusion) z tym że ja nie potrzebuje ajaxu tylko samo to odświeżanie efekt ajaxu mnie nie interesuje;p a druga sprawa jest coś takiego jak np jest w archiwum SB ze pierwsza wypowiedz ma tło tbl1 a druga tbl2 i coś mi nie wychodzi podam kod mojej modyfikacji SB
i od razu z góry dzięki za jaką kol wiek pomoc pozdrawiam. (czerwonym zaznaczyłem z czym mam problemy)
<?php
/*---------------------------------------------------+
| PHP-Fusion 6 Content Management System
+----------------------------------------------------+
| Copyright © 2002 - 2006 Nick Jones
| http://www.php-fusion.co.uk/
+----------------------------------------------------+
| Released under the terms & conditions of v2 of the
| GNU General Public License. For details refer to
| the included gpl.txt file or visit http://gnu.org
+----------------------------------------------------*/
if (!defined("IN_FUSION")) { header("Location: ../../index.php"); exit; }
opentable($locale['120']);
if (iMEMBER || $settings['guestposts'] == "1") {
if (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="";
}
$shout_message = str_replace("\n", " ", $_POST['shout_message']);
$shout_message = preg_replace("/^(.{255}).*$/", "$1", $shout_message);
$shout_message = preg_replace("/([^\s]{25})/", "$1\n", $shout_message);
$shout_message = trim(stripinput(censorwords($shout_message)));
$shout_message = str_replace("\n", "<br>", $shout_message);
if ($shout_name != "" && $shout_message != "") {
$result = dbquery("SELECT MAX(shout_datestamp) AS last_shout FROM ".$db_prefix."shoutbox WHERE shout_ip='".USER_IP."'");
if (!iSUPERADMIN || dbrows($result) > 0) {
$data = dbarray($result);
if ((time() - $data['last_shout']) < $settings['flood_interval']) {
$flood = true;
$result = dbquery("INSERT INTO ".$db_prefix."flood_control (flood_ip, flood_timestamp) VALUES ('".USER_IP."', '".time()."')");
if (dbcount("(flood_ip)", "flood_control", "flood_ip='".USER_IP."'") > 4) {
if (iMEMBER) $result = dbquery("UPDATE ".$db_prefix."users SET user_status='1' WHERE user_id='".$userdata['user_id']."'");
}
}
}
if (!$flood) $result = dbquery("INSERT INTO ".$db_prefix."shoutbox (shout_name, shout_message, shout_datestamp, shout_ip) VALUES ('$shout_name', '$shout_message', '".time()."', '".USER_IP."')");
}
fallback(FUSION_SELF.(FUSION_QUERY ? "?".FUSION_QUERY : ""));
}
$result = dbquery("SELECT count(shout_id) FROM ".$db_prefix."shoutbox");
$numrows = dbresult($result, 0);
$result = dbquery(
"SELECT * FROM ".$db_prefix."shoutbox LEFT JOIN ".$db_prefix."users
ON ".$db_prefix."shoutbox.shout_name=".$db_prefix."users.user_id
ORDER BY shout_datestamp DESC LIMIT 0,".$settings['numofshouts']
);
if (dbrows($result) != 0) {
$i = 0;
echo '<script language="javascript">
function sb_move_up() {
sb_scroll_clipper.scrollTop = sb_scroll_clipper.scrollTop-1;
}
function sb_move_down() {
sb_scroll_clipper.scrollTop = sb_scroll_clipper.scrollTop+1;
}
</script>
<div id="sb_scroll_clipper" style="overflow: hidden; height: 150px">
<div id="sb_scroll_text">';
while ($data = dbarray($result)) {
echo "<table width='100%' cellpadding='0' cellspacing='1'>
<tr>
<td class='[color=red]".($i% 2==0?"tbl1":"tbl2")."[/color]'><span class='shoutboxname'><img src='".THEME."images/bullet.gif' alt=''> ";
if ($data['user_name']) {
echo "<a href='".BASEDIR."profile.php?lookup=".$data['shout_name']."' class='slink' style='color:#".$data['user_color']."'>".$data['user_prefix'].$data['user_name']."</a>\n";
} else {
echo $data['shout_name']."\n";
}
echo "</span>\n | <span class='shoutboxdate'><font style='font-style:italic;font-family:Tahoma;font-size:8;color:#777777;'>".showdate("shortdate", $data['shout_datestamp'])."</font></span>";
if (iADMIN && checkrights("S")) {
echo "\n || [<a href='".ADMIN."shoutbox.php".$aidlink."&action=edit&shout_id=".$data['shout_id']."' class='side'>".$locale['048']."</a>]";
}
echo "<br>\n<span class='shoutbox'>".parsesmileys($data['shout_message'])."</span><br>\n";
if ($i != $numrows) echo "</td></tr></table>\n";
}
echo '</div></div>';
// przewijanie
echo '<div align="right"><span onmouseover="t=setInterval(\'sb_move_up()\', 10);" onmouseout="clearInterval(t);" style="cursor: hand; cursor: pointer;"><img src="'.THEME.'images/up.gif" alt=""></span> Przewiń <span onmouseover="t=setInterval(\'sb_move_down()\', 10);" onmouseout="clearInterval(t);" style="cursor: hand; cursor: pointer;"><img src="'.THEME.'images/down.gif" alt=""></span></div>';
// pole textowe
echo "<form name='chatform' method='post' action='".FUSION_SELF.(FUSION_QUERY ? "?".str_replace("&","&",FUSION_QUERY) : "")."'>
<table align='left' cellpadding='4' cellspacing='0'>
<tr>
<td colspan='2'>\n";
if (iGUEST) {
echo $locale['121']."<br>
<input type='text' name='shout_name' value='' class='textbox' maxlength='30' style='width:140px;'><br>
".$locale['122']."<br>\n";
}
echo '<textarea onfocus=\'if(this.value=="'.$settings['shout_def_text'].'")this.value="";\' onblur=\'if(this.value=="")this.value="'.$settings['shout_def_text'].'";\' name="shout_message" rows="4" class="textbox" style="width: 400px; height: 24px;">'.$settings['shout_def_text'].'</textarea>
</td>';
echo "<td><input type='submit' name='post_shout' value='".$locale['123']."' class='button'></td>
<td align='right' class='small'><a href='".INFUSIONS."shoutbox_panel/shoutboxhelp.php' class='side'>".$locale['124']."</a></td>
<td>";
if ($numrows > $settings['numofshouts']) {
echo "/ <a href='".INFUSIONS."shoutbox_panel/shoutbox_archive.php' class='side'>".$locale['126']."</a>\n";
}
} else {
echo "<div align='left'>".$locale['127']."</div>\n";
}
echo "</td>
</tr>
</table>
</form>
<br>\n";
} else {
echo "<center>".$locale['125']."</center><br>\n";
}
closetable();
?>
Zmieniłem nazwę tematu ale nie wiem czy dobrze, jeżeli nie to sory i choć jakoś mnie pokieruj, bo może sie mylę..
Edytowane przez Pieka dnia 29.07.2007 16:06:28
|