this dont show 3 shouts why ??

Started on the old forum in September 2010 · view the original in the archive · old links redirect here

6 replies · 630 views · started 16 years ago · 1 min read

3 participants
nclemale36 Lead · 537 posts #1
function getshoutbox($sid)
{
   $shbox .= "<form action=\"genproc.php?action=shout&sid=$sid\" method=\"post\"><center>";
  $shbox .= "<b></b>";
  $lshout = mysql_fetch_array(mysql_query("SELECT shout, shouter, id FROM ibwf_shouts ORDER BY shtime DESC LIMIT 3"));
  $shnick = getnick_uid($lshout[1]);
  $shbox .= "<i><a href=\"index.php?action=viewuser&sid=$sid&who=$lshout[1]\">".$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;
}

anyone help

something else Fellow · 2,296 posts #2

Because you havent looped your results:

function getshoutbox($sid)
{
   $shbox .= "<form action=\"genproc.php?action=shout&sid=$sid\" method=\"post\"><center>";
  $shbox .= "<b></b>";
while($lshout=mysql_fetch_array(mysql_query("SELECT shout, shouter, id FROM ibwf_shouts ORDER BY shtime DESC LIMIT 3"))){
$shnick = getnick_uid($lshout[1]);
  $shbox .= "<i><a href=\"index.php?action=viewuser&sid=$sid&who=$lshout[1]\">".$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;
}
nclemale36 Lead · 537 posts #3

wont load the main page now .

Added after 11 minutes:

Fatal error: Maximum execution time of 30 seconds exceeded in /home/public_html/web/core.php on line 3204

which is my bbcode function. .

ignore above its any line that incorperates the shoutbox . wont load fullstop

something else Fellow · 2,296 posts #4

oops infintive loop lol

function getshoutbox($sid) 
{ 
   $shbox .= "<form action=\"genproc.php?action=shout&sid=$sid\" method=\"post\"><center>"; 
  $shbox .= "<b></b>"; 
$data = mysql_query("SELECT shout, shouter, id FROM ibwf_shouts ORDER BY shtime DESC LIMIT 3");
while($lshout=mysql_fetch_array($data)){ 
$shnick = getnick_uid($lshout[1]); 
  $shbox .= "<i><a href=\"index.php?action=viewuser&sid=$sid&who=$lshout[1]\">".$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; 
} 
Vayne Developer · 106 posts #6

shoud be working

$data = mysql_query("SELECT shout, shouter, id FROM ibwf_shouts ORDER BY shtime DESC LIMIT 3"); 
while($lshout=mysql_fetch_array($data)){ 
 
  $shbox .= " <a href=\"modproc.php?action=delsh&sid=$sid&shid=$lshout[2]\">delete</a>"; 

Nous Ne Dansos Pas, Nous Sommes Le Danse.!

something else Fellow · 2,296 posts #7

yeah the: $shbox .= " <a href="modproc.php?action=delsh&sid=$sid&shid=$lshout[2]">delete</a>"; need putting inside the while($lshout=mysql_fetch_array($data)){ so it knows which shout to delete otherwize you will be only deleting last shout

Write your reply now; next you create a free account (or sign in) and it is posted right away. Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close