any chance some one can help me soi can get my shoutbox to show 3 messages not just one i looked on my script and can not find where i change it so it shows 3 instead of one i'm using script thats like site link this is not my site i use coding like this and thanks to any one that can help me out it be great help iff some one can post the code here please
shout box messages
Collapse
X
-
core.php
Code:function getshoutbox($sid){ $shbox = "<small>"; $lshout = mysql_query("SELECT shout, shouter, id FROM ibwf_shouts ORDER BY shtime DESC LIMIT 2"); while ($shots = mysql_fetch_array($lshout)) { $shnick = getnick_uid($shots[1]); if(isonline($shots[1])){ $bulb="<img src=\"images/onl.gif\" alt=\"On\"/>"; } else{ $bulb="<img src=\"images/ofl.gif\" alt=\"Off\"/>"; } $shbox .= "$bulb<i><a href=\"index.php?action=viewuser&sid=$sid&who=$shots[1]\">".$shnick."</a></i>: "; $fshout = htmlspecialchars($shots[0]); $fshout = getsmilies($fshout); $fshout = getbbcode($fshout, $sid); $shbox .= $fshout; //if (ismod(getuid_sid($sid))){ //$shbox .= ", <a href=\"modproc.php?action=delsh&sid=$sid&shid=$shots[2]\">delete</a>"; //} $shbox .= "<br/>"; } if (isshoutblocked(getuid_sid($sid))){ $shbox .= "»post shout(Blocked!!)"; }else{ $shbox .= "<a href=\"lists.php?action=shouts&sid=$sid\">»post shout</a>"; } $shbox .= "</small>"; return $shbox; } function getshouts($sid){ boxstart("Shoutbox"); $uid=getuid_sid($sid); if(!isshoutblocked($uid)){ echo getshoutbox($sid); } boxend(); }
Code://////////////////////////////////////////shout else if($action=="shout") { $shtxt = $_POST["shtxt"]; if (isshoutblocked(getuid_sid($sid))){ echo "Your shoutbox access has been blocked by a moderator!!!<br/><br/>"; echo "<a href=\"index.php?action=main&sid=$sid\">Main Menu</a></center>"; boxend(); echo "</font></body></html>"; exit(); } if ($shtxt==""){ echo "This seems to be a blank shout!!! Please go back and try again.<br/><br/>"; echo "<a href=\"index.php?action=main&sid=$sid\">Main Menu</a></center>"; boxend(); getfooter($sid); echo "</font></body></html>"; exit(); } addonline(getuid_sid($sid),"Shouting",""); $shtxt = $shtxt; //$uid = getuid_sid($sid); $shtm = time(); $res = mysql_query("INSERT INTO ibwf_shouts SET shout='".$shtxt."', shouter='".$uid."', shtime='".$shtm."'"); if($res) { $shts = mysql_fetch_array(mysql_query("SELECT shouts,plusses from ibwf_users WHERE id='".$uid."'")); $jshts = $shts[0]+1; $shpl = $shts[1]+1; $sql=mysql_query("UPDATE ibwf_users SET shouts='".$jshts."', plusses='".$shpl."' WHERE id='".$uid."'"); echo "<img src=\"images/ok.gif\" alt=\"O\"/>Shout added successfully!"; }else{ echo "<img src=\"images/notok.gif\" alt=\"X\"/>Database Error!"; } echo "<br/><br/><a href=\"lists.php?action=shouts&sid=$sid\">"; echo "Shouts</a>"; }
Code://///////////////////////////shouts else if($action=="shouts") { addonline(getuid_sid($sid),"Shouts","lists.php?action=$action"); boxstart("Shouts"); echo "Add shout(255 chars max):<br/><form action=\"genproc.php?action=shout&sid=$sid\" method=\"post\"><textarea id=\"inputText\" name=\"shtxt\"></textarea><br/>"; echo "<input id=\"inputButton\" type=\"submit\" value=\"Send\"/></form><br/>"; $who = $_GET["who"]; if($page=="" || $page<=0)$page=1; if($who=="") { $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_shouts")); }else{ $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_shouts WHERE shouter='".$who."'")); } $num_items = $noi[0]; //changable $items_per_page= 10; $num_pages = ceil($num_items/$items_per_page); if(($page>$num_pages)&&$page!=1)$page= $num_pages; $limit_start = ($page-1)*$items_per_page; //changable sql if($who =="") { $sql = "SELECT id, shout, shouter, shtime FROM ibwf_shouts ORDER BY shtime DESC LIMIT $limit_start, $items_per_page"; }else{ $sql = "SELECT id, shout, shouter, shtime FROM ibwf_shouts WHERE shouter='".$who."'ORDER BY shtime DESC LIMIT $limit_start, $items_per_page"; } $items = mysql_query($sql); echo mysql_error(); if(mysql_num_rows($items)>0) { while ($item = mysql_fetch_array($items)) { $shnick = getnick_uid($item[2]); if(isonline($item[2])){ $iml = "<img src=\"images/onl.gif\" alt=\"+\"/>"; }else{ $iml = "<img src=\"images/ofl.gif\" alt=\"-\"/>"; } $sht = htmlspecialchars($item[1]); $shdt = date("d/m/Y h:i:s A", $item[3]+(addhours())); if(isadmin($item[2])) {$lnk = "$iml<a href=\"index.php?action=viewuser&who=$item[2]&sid=$sid\"><font color='red'>$shnick</font></a>: $shdt<br/><br/>".getbbcode(getsmilies($sht));} else if(ismod($item[2])) {$lnk = "$iml<a href=\"index.php?action=viewuser&who=$item[2]&sid=$sid\"><font color='blue'>$shnick</font></a>: $shdt<br/><br/>".getbbcode(getsmilies($sht));} else {$lnk = "$iml<a href=\"index.php?action=viewuser&who=$item[2]&sid=$sid\">$shnick</a>: $shdt<br/><br/>".getbbcode(getsmilies($sht));} if(ismod(getuid_sid($sid))) { $dlsh = "[<a href=\"lists.php?action=chiledit&sid=$sid&shid=$item[0]\">E</a>]|[<a href=\"adctrlpr.php?action=chilmit&sid=$sid&shid=$item[0]\">D</a>]<br/><br/>"; }else{ $dlsh = "<br/><br/>"; } echo "$lnk $dlsh"; } } echo "<p align=\"center\">"; if($page>1) { $ppage = $page-1; echo "<a href=\"lists.php?action=shouts&page=$ppage&sid=$sid&who=$who\">«PREV</a> "; } if($page<$num_pages) { $npage = $page+1; echo "<a href=\"lists.php?action=shouts&page=$npage&sid=$sid&who=$who\">Next»</a>"; } echo "<br/>Page $page of $num_pages<br/>"; if($num_pages>2) { $rets = "<center>Jump to page<form action=\"lists.php\" method=\"get\"><input id=\"inputText\" name=\"page\" format=\"*N\" size=\"3\"/>"; $rets .= "<input type=\"hidden\" name=\"action\" value=\"$action\"/>"; $rets .= "<input type=\"hidden\" name=\"sid\" value=\"$sid\"/>"; $rets .= "<input type=\"hidden\" name=\"who\" value=\"$who\"/>"; $rets .= "<input id=\"inputButton\" type=\"submit\" value=\"Go\"/></form></center>"; echo $rets; } ////// UNTILL HERE >> echo "<p align=\"center\">"; echo "<a href=\"index.php?action=main&sid=$sid&clid=$clid\">"; echo "Back</a><br/>"; echo "</p>"; } ////////////////////////Edit Shout else if($action=="chiledit"){ $shid = $_GET["shid"]; $getsht = mysql_fetch_array(mysql_query("SELECT shout FROM ibwf_shouts WHERE id = '".$shid."'")); boxstart("Edit Shout"); echo "<p>"; echo "<br/>Edit:<br/> "; echo "<form action=\"shout.php?action=chileditfin&sid=$sid&id=$shid\" method=\"post\"><textarea id=\"inputText\" name=\"shtxt\">$getsht[0]</textarea> "; echo "<br/><input id=\"inputButton\" type=\"submit\" value=\"Edit\"/>"; echo "</form>"; echo "</p>"; }
Code:///////////////////////////////////////Delete shout else if($action=="chilmit"){ $shid = $_GET["shid"]; echo "<p align=\"center\">"; $res = mysql_query("DELETE FROM ibwf_shouts WHERE id ='".$shid."'"); if($res){ $sql = mysql_fetch_array(mysql_query("SELECT shout, shouter FROM ibwf_shouts WHERE id='".$shid."'")); $modname = getnick_uid(getuid_sid($sid)); $shouter = getnick_uid($sql[1]); $shout = substr("$sql[0]", 0, 30); mysql_query("INSERT INTO ibwf_mlog SET action='shouts', details='<b>".$modname."</b> Deleted Shout Number <b>".$shid."</b>', actdt='".time()."'"); echo "<img src=\"images/ok.gif\" alt=\"O\"/>Shout deleted"; }else{ echo "<img src=\"images/notok.gif\" alt=\"X\"/>Database Error"; } echo "<br/><br/>"; echo "</p>"; getfooter($sid); } //////////////////////////Edit Shout///////////////////////////// else if($action=="chileditfin"){ $shid = $_GET["id"]; $shtxt = $_POST["shtxt"]; echo "<p align=\"center\">"; $res = mysql_query("UPDATE ibwf_shouts SET shout='".$shtxt."' WHERE id='".$shid."'"); if($res){ $sql = mysql_fetch_array(mysql_query("SELECT shout, shouter FROM ibwf_shouts WHERE id='".$shid."'")); $modname = getnick_uid(getuid_sid($sid)); $shouter = getnick_uid($sql[1]); $shout = substr("$sql[0]", 0, 30); mysql_query("INSERT INTO ibwf_mlog SET action='shouts', details='<b>".$modname."</b> Edited <b>".$shouter."</b>\'s Shout <b><i>".$shout."...</i></b>', actdt='".time()."'"); echo "<img src=\"images/ok.gif\" alt=\"O\"/>Shout Edited!<br/><br/><a href=\"lists.php?action=shouts&sid=$sid\">Shouts</a>"; }else{ echo "<img src=\"images/notok.gif\" alt=\"X\"/>Database Error!<br/><br/><a href=\"lists.php?action=shouts&sid=$sid\">Shouts</a>"; } echo "<br/><br/>"; echo "</p>"; getfooter($sid); }
Code:`shoutb` int(1) default '0',
Comment
-
Originally posted by xchellx View Postthat dont work
does it display any error?
or...?It's better to keep your mouth shut and give the impression that you're stupid, than to open it and remove all doubt.
ⓣⓗⓔ ⓠⓤⓘⓔⓣⓔⓡ ⓨⓞⓤ ⓑⓔ©ⓞⓜⓔ, ⓣⓗⓔ ⓜⓞⓡⓔ ⓨⓞⓤ â“â“¡â“” â“ⓑⓛⓔ ⓣⓞ â“—â“”â“â“¡ !
ιη тнєσÑу, тнє ÏÑα¢тι¢є ιѕ α Ñєѕυℓт σƒ тнє тнєσÑу, вυт ιη ÏÑα¢тι¢є ιѕ тнє σÏÏσѕιтє.
Comment
-
Originally posted by metulj View Posthow you know it doesnt work?
does it display any error?
or...?
this is what i got in my core.php
Code://///////////////////////////////////////////Function shoutboxpage function getshoutboxpage($sid) { echo "<p align=\"center\">"; $who = $_GET["who"]; //////ALL LISTS SCRIPT << if($page=="" || $page<=0)$page=1; if($who=="") { $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_shouts")); }else{ $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_shouts WHERE shouter='".$who."'")); } $num_items = $noi[0]; //changable $items_per_page= 10; $num_pages = ceil($num_items/$items_per_page); if(($page>$num_pages)&&$page!=1)$page= $num_pages; $limit_start = ($page-1)*$items_per_page; //changable sql if($who =="") { $sql = "SELECT id, shout, shouter, shtime FROM ibwf_shouts ORDER BY shtime DESC LIMIT $limit_start, $items_per_page"; }else{ $sql = "SELECT id, shout, shouter, shtime FROM ibwf_shouts WHERE shouter='".$who."'ORDER BY shtime DESC LIMIT $limit_start, $items_per_page"; } $items = mysql_query($sql); echo mysql_error(); if(mysql_num_rows($items)>0) { while ($item = mysql_fetch_array($items)) { $shnick = getnick_uid($item[2]); $sht = parsepm($item[1], $sid); $shdt = date("d m y-H:i", $item[3]); $sex = mysql_fetch_array(mysql_query("SELECT sex FROM ibwf_users WHERE who='$item[2]'")); if($sex[0]=="M"){$usersex = "";$color=" style=\"color:#00CC33\"";} if($sex[0]=="F"){$usersex = "";$color=" style=\"color:#FF0066\"";} if($sex[0]==""){$usersex = "";} $lnk = "<a href=\"index.php?action=viewuser&who=$item[2]&sid=$sid\"$color>$shnick</a>: $sht<br/>$shdt"; if(ismod(getuid_sid($sid))) { $dlsh = "<a href=\"modproc.php?action=delsh&sid=$sid&shid=$item[0]\"$color>[x]</a>"; }else{ $dlsh = ""; } echo "$lnk $dlsh<br/>"; } } if($page>1) { $ppage = $page-1; echo "<a href=\"lists.php?action=shouts&page=$ppage&sid=$sid&who=$who\">«Prev</a> "; } if($page<$num_pages) { $npage = $page+1; echo "<a href=\"lists.php?action=shouts&page=$npage&sid=$sid&who=$who\">Next»</a>"; } echo "<br/>$page/$num_pages<br/>"; if($num_pages>2) { $rets = "<form action=\"lists.php\" method=\"get\">"; $rets .= "<input name=\"page\" format=\"*N\" size=\"3\"/>"; $rets .= "<input type=\"hidden\" name=\"action\" value=\"$action\">"; $rets .= "<input type=\"hidden\" name=\"sid\" value=\"$sid\">"; $rets .= "<input type=\"hidden\" name=\"who\" value=\"$who\">"; $rets .= "<input type=\"Submit\" name=\"Submit\" Value=\"Go To Page\"></form>"; echo $rets; } // $shbox .= "<a href=\"lists.php?action=shouts&sid=$sid\">more</a>, "; echo "<a href=\"index.php?action=shout&sid=$sid\">shout</a>"; echo "</p>"; } /////////////////////////////////////////////function Shoutbox 1msg function getshoutbox($sid) { $shbox .= "<form action=\"genproc.php?action=shout&sid=$sid\" method=\"post\"><center>"; $lshout = mysql_fetch_array(mysql_query("SELECT shout, shouter, id FROM ibwf_shouts ORDER BY shtime DESC LIMIT 3")); $shnick = getnick_uid($lshout[1]); $sex=mysql_fetch_array(mysql_query("SELECT sex FROM ibwf_users WHERE name='$shnick'")); if($sex[0]=="M"){$color=" style=\"color:#00CC33\"";} if($sex[0]=="F"){$color=" style=\"color:#FF0066\"";} if($sex[0]==""){} $shbox .= "<i><a href=\"index.php?action=viewuser&sid=$sid&who=$lshout[1]\"$color>".$shnick."</a></i> - "; $text = parsepm($lshout[0], $sid); $shbox .= $text; $shbox .= "<br/>"; $shbox .= "<a href=\"lists.php?action=shouts&sid=$sid\">more</a>"; if (ismod(getuid_sid($sid))) { $shbox .= " <a href=\"modproc.php?action=delsh&sid=$sid&shid=$lshout[2]\">delete</a>"; } if(getplusses(getuid_sid($sid))<75) { $shbox .= "<br/>You need at least 75 plusses to shout!"; }else{ $shbox .= "<br/>ShoutBox Message:<br/><input name=\"shtxt\" maxlength=\"100\"/><br/>"; $shbox .= "<input type=\"Submit\" name=\"shout\" Value=\"Add Shout\"></center></form>"; } return $shbox; }
Code:echo getshoutbox($sid); echo "</p>";
Code://////////////////////////////////shouts else if($action=="shouts") { addonline(getuid_sid($sid),"Seeing Who Been Shouting",""); echo "<head>"; echo "<title>Shouts</title>"; echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">"; echo "</head>"; echo "<body>"; $who = mysql_real_escape_string( $_GET["who"] ); //////ALL LISTS SCRIPT << if($page=="" || $page<=0)$page=1; if($who=="") { $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_shouts")); }else{ $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_shouts WHERE shouter='".$who."'")); } $num_items = $noi[0]; //changable $items_per_page= 10; $num_pages = ceil($num_items/$items_per_page); if(($page>$num_pages)&&$page!=1)$page= $num_pages; $limit_start = ($page-1)*$items_per_page; //changable sql if($who =="") { $sql = "SELECT id, shout, shouter, shtime FROM ibwf_shouts ORDER BY shtime DESC LIMIT $limit_start, $items_per_page"; }else{ $sql = "SELECT id, shout, shouter, shtime FROM ibwf_shouts WHERE shouter='".$who."'ORDER BY shtime DESC LIMIT $limit_start, $items_per_page"; } echo "<p><small>"; $items = mysql_query($sql); echo mysql_error(); if(mysql_num_rows($items)>0) { while ($item = mysql_fetch_array($items)) { $shnick = getnick_uid($item[2]); $sht2 = parsepm($item[1], $sid); $shdt = date("d m y-H:i", $item[3]); $lnk = "<a href=\"index.php?action=viewuser&who=$item[2]&sid=$sid\">$shnick</a>: $sht2<br/>$shdt"; if(ismod(getuid_sid($sid))) { $dlsh = "<a href=\"modproc.php?action=delsh&sid=$sid&shid=$item[0]\">[x]</a>"; }else{ $dlsh = ""; } echo "$lnk $dlsh<br/>"; } } echo "</small></p>"; echo "<p align=\"center\">"; if($page>1) { $ppage = $page-1; echo "<a href=\"lists.php?action=shouts&page=$ppage&sid=$sid&who=$who\">«PREV</a> "; } if($page<$num_pages) { $npage = $page+1; echo "<a href=\"lists.php?action=shouts&page=$npage&sid=$sid&who=$who\">Next»</a>"; } echo "<br/>$page/$num_pages<br/>"; if($num_pages>2) { $rets = "<form action=\"lists.php\" method=\"get\">"; $rets .= "<input name=\"page\" style=\"-wap-input-format: '*N'\" size=\"2\"/>"; $rets .= "<input type=\"hidden\" name=\"action\" value=\"$action\"/>"; $rets .= "<input type=\"hidden\" name=\"sid\" value=\"$sid\"/>"; $rets .= "<input type=\"hidden\" name=\"who\" value=\"$who\"/>"; $rets .= "<input type=\"submit\" value=\"Go To Page\"/>"; $rets .= "</form>"; echo $rets; } echo "</p>"; ////// UNTILL HERE >> echo "<p align=\"center\">"; echo "<a accesskey=\"0\" href=\"index.php?action=main&sid=$sid\"><img src=\"../phpThumb/phpThumb.php?src=../images/home.png\" alt=\"\"/>Home</a>"; echo "</p>"; echo "</body>"; exit(); }
thanks to any one that can help out
Comment
-
i think this is the only line u have to edit to show 3 shout messages
$lshout = mysql_fetch_array(mysql_query("SELECT shout, shouter, id FROM ibwf_shouts ORDER BY shtime DESC LIMIT 3"));
and how come it doesnt work for u when it works for us??LDSWAPWORLD sigpic
site closed.
im busy with other things in life like facebook , send me PM so i can add you
www.pinoySG.com
don't ask for help if you're not even helping yourself!
i am tired of seeing the line "best site", i want to see something NEW and UNIQUE. maybe if i find one, ill go back to my wap life again.
Comment
Comment