Rep message on main page

Started on the old forum in August 2009 · view the original in the archive · old links redirect here

8 replies · 472 views · started 17 years ago · 1 min read

5 participants
riderz Lead · 975 posts #1

Hey guys im having lil prob with a code that i have everything are well in the code i have after updating the image and message it must show on main page like the following but it dont show anything

[rep icon] - Username (msg)

i dnt know where i done wrong here are my useage code

$daytm = 7*60;

  $reptime = time() - $daytm;

  $rminfo = mysql_fetch_array (mysql_query("SELECT id, name, ficon, fmsg FROM ibwf_users WHERE reputation>='50' AND ficon!='' AND fmsg!='' AND lastact>'".$reptime."' ORDER BY RAND() LIMIT 1"));

  //if(isbanned($rminfo[0]) $rminfo[0] = 0;

  if($rminfo[0]>0)

  {

mysql_query("UPDATE ibwf_users SET ruse=ruse+1 WHERE id='".$rminfo[0 ]."' LIMIT 1");
echo "
<img src=\"$rminfo[2]\" height=\"40\" width=\"45\" alt=\"R.\"/><br/>
<a href=\"index.php?action=viewuser&sid=$sid&who=$rminfo[0]\"> $rminfo[1]</a> (".htmlspecialchars($rminfo[3]).")<br/>";

}

Jacques jacques@gw-designs.co.za http://coding.biz.tm Come join and lets make it a place to learn all the noobies how to code


NEVER FORGET TO CLICK THE TANX BUTTON IF U LIKE WHAT IM SHARING OR HELPING WITH

CreativityKills Lead · 833 posts #2

riderz wrote: Hey guys im having lil prob with a code that i have everything are well in the code i have after updating the image and message it must show on main page like the following but it dont show anything

[rep icon] - Username (msg)

i dnt know where i done wrong here are my useage code

$daytm = 7*60;

  $reptime = time() - $daytm;

  $rminfo = mysql_fetch_array (mysql_query("SELECT id, name, ficon, fmsg FROM ibwf_users WHERE reputation>='50' AND ficon!='' AND fmsg!='' AND lastact>'".$reptime."' ORDER BY RAND() LIMIT 1"));

  //if(isbanned($rminfo[0]) $rminfo[0] = 0;

  if($rminfo[0]>0)

  {

mysql_query("UPDATE ibwf_users SET ruse=ruse+1 WHERE id='".$rminfo[0 ]."' LIMIT 1");
echo "
<img src=\"$rminfo[2]\" height=\"40\" width=\"45\" alt=\"R.\"/><br/>
<a href=\"index.php?action=viewuser&sid=$sid&who=$rminfo[0]\"> $rminfo[1]</a> (".htmlspecialchars($rminfo[3]).")<br/>";

}

i think its ya sql? Namely $rminfo = mysql_fetch_array (mysql_query("SELECT id, name, ficon, fmsg FROM ibwf_users WHERE reputation>'49' AND ficon IS NOT NULL AND fmsg IS NOT NULL AND lastact>'".$reptime."' ORDER BY RAND() LIMIT 1"));

riderz Lead · 975 posts #3

this is my sql in ibwf_users

 `ruse` int(100) NOT NULL default '0',
  `ficon` varchar(50) NOT NULL default '',
  `reputation` int(100) NOT NULL default '0',
  `fmsg` varchar(50) NOT NULL default '',
    `reps` int(10) NOT NULL default '0',

Jacques jacques@gw-designs.co.za http://coding.biz.tm Come join and lets make it a place to learn all the noobies how to code


NEVER FORGET TO CLICK THE TANX BUTTON IF U LIKE WHAT IM SHARING OR HELPING WITH

kiLLeR-eyEd_14 Senior · 382 posts #4

riderz wrote: Hey guys im having lil prob with a code that i have everything are well in the code i have after updating the image and message it must show on main page like the following but it dont show anything

[rep icon] - Username (msg)

i dnt know where i done wrong here are my useage code

$daytm = 7*60;

  $reptime = time() - $daytm;

  $rminfo = mysql_fetch_array (mysql_query("SELECT id, name, ficon, fmsg FROM ibwf_users WHERE reputation>='50' AND ficon!='' AND fmsg!='' AND lastact>'".$reptime."' ORDER BY RAND() LIMIT 1"));

  //if(isbanned($rminfo[0]) $rminfo[0] = 0;

  if($rminfo[0]>0)

  {

mysql_query("UPDATE ibwf_users SET ruse=ruse+1 WHERE id='".$rminfo[0 ]."' LIMIT 1");
echo "
<img src=\"$rminfo[2]\" height=\"40\" width=\"45\" alt=\"R.\"/><br/>
<a href=\"index.php?action=viewuser&sid=$sid&who=$rminfo[0]\"> $rminfo[1]</a> (".htmlspecialchars($rminfo[3]).")<br/>";

}

maybe ur reputation or ur ficon or ur fmsg or ur lastact is against all in rminfo..lol..or any of it..too many requirements..hard to get it that's why it doesn't appear..Any of them falses will return the script false and will not show it..

something else Fellow · 2,296 posts #5

try:

$daytm = 7*60;
$reptime = time() - $daytm;
$rminfos = mysql_query("SELECT id, name, ficon, fmsg FROM ibwf_users WHERE reputation>='50' AND ficon!='' AND fmsg!='' AND lastact>'".$reptime."' ORDER BY RAND() LIMIT 1");
while ($rminfo = mysql_fetch_array($rminfos)){
mysql_query("UPDATE ibwf_users SET ruse=ruse+1 WHERE id='".$rminfo[0 ]."'");
echo "
<img src=\"$rminfo[2]\" height=\"40\" width=\"45\" alt=\"R.\"/><br/>
<a href=\"index.php?action=viewuser&sid=$sid&who=$rminfo[0]\"> $rminfo[1]</a> (".htmlspecialchars($rminfo[3]).")<br/>";
}
riderz Lead · 975 posts #8

tried it but still no response 🙁 seems like it dnt won work with me hehe


Jacques jacques@gw-designs.co.za http://coding.biz.tm Come join and lets make it a place to learn all the noobies how to code


NEVER FORGET TO CLICK THE TANX BUTTON IF U LIKE WHAT IM SHARING OR HELPING WITH

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