Hi, what i wana do is each members starts with 0 plusses but earns 10 plusses from a pm 20 plusses from a shout and same from games? Then it shows whos winning on the leaderboard the first person to 5000 wins a topup or sumthing like that. Any ideas or help on how i could do this. Thanks
Help Creating Plusses Leaderboard
Collapse
X
-
GuestTags: None
-
code to update plusses after shout
replace this action in genproc.php
code to update plusses after sending PMCode://////////////////////////////////////////shout else if($action=="shout") { $shtxt = $_POST["shtxt"]; addonline(getuid_sid($sid),"close your ears im Shouting",""); echo "<card id=\"main\" title=\"Shout\">"; echo "<p align=\"center\">"; if(getplusses(getuid_sid($sid))<5) { echo "<img src=\"images/notok.gif\" alt=\"X\"/>You should have at least 5 plusses to shout!"; }else{ $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 from ibwf_users WHERE id='".$uid."'")); $shts = $shts[0]+1; mysql_query("UPDATE ibwf_users SET shouts='".$shts."' WHERE id='".$uid."'"); $cow = mysql_fetch_array(mysql_query("SELECT plusses FROM ibwf_users WHERE id='".$uid."'")); $cow = $cow[0]+20; mysql_query("UPDATE ibwf_users SET plusses='".$cow."' 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 " <a href=\"index.php?action=main&sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>"; echo "Home</a>"; echo "</p>"; echo "</card>"; }
replace these actions in inbxproc.php
code to show members having >4999Code:if($action=="sendpm") { echo "<card id=\"main\" title=\"Inbox\">"; echo "<p align=\"center\">"; $whonick = getnick_uid($who); $byuid = getuid_sid($sid); $tm = time(); $lastpm = mysql_fetch_array(mysql_query("SELECT MAX(timesent) FROM ibwf_private WHERE byuid='".$byuid."'")); $pmfl = $lastpm[0]+getpmaf(); if($byuid==1)$pmfl=0; if($pmfl<$tm) { if(!isblocked($pmtext,$byuid)) { if((!isignored($byuid, $who))&&(!istrashed($byuid))) { $res = mysql_query("INSERT INTO ibwf_private SET text='".$pmtext."', byuid='".$byuid."', touid='".$who."', timesent='".$tm."'"); }else{ $res = true; } if($res) { $cow = mysql_fetch_array(mysql_query("SELECT plusses FROM ibwf_users WHERE id='".$uid."'")); $cow = $cow[0]+10; mysql_query("UPDATE ibwf_users SET plusses='".$cow."' WHERE id='".$uid."'"); echo "<img src=\"images/ok.gif\" alt=\"O\"/>"; echo "PM was sent successfully to $whonick "; echo parsepm($pmtext, $sid); }else{ echo "<img src=\"images/notok.gif\" alt=\"X\"/>"; echo "Can't Send PM to $whonick "; } }else{ $bantime = time() + (7*24*60*60); echo "<img src=\"images/notok.gif\" alt=\"X\"/>"; echo "Can't Send PM to $whonick "; echo "You just sent a link to one of the crapiest sites on earth The members of these sites spam here a lot, so go to that site and stay there if you don't like it here as a result of your stupid action: 1. you have lost your sheild 2. you have lost all your plusses 3. You are BANNED!"; mysql_query("INSERT INTO ibwf_penalties SET uid='".$byuid."', penalty='1', exid='1', timeto='".$bantime."', pnreas='Banned: Automatic Ban for spamming for a crap site'"); mysql_query("UPDATE ibwf_users SET plusses='0', shield='0' WHERE id='".$byuid."'"); mysql_query("INSERT INTO ibwf_private SET text='".$pmtext."', byuid='".$byuid."', touid='2', timesent='".$tm."'"); } }else{ $rema = $pmfl - $tm; echo "<img src=\"images/notok.gif\" alt=\"X\"/>"; echo "Flood control: $rema Seconds "; } echo " <a href=\"inbox.php?action=main&sid=$sid\">Back to inbox</a> "; echo "<a href=\"index.php?action=main&sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>"; echo "Home</a>"; echo "</p>"; echo "</card>"; } else if($action=="sendto") { echo "<card id=\"main\" title=\"Inbox\">"; echo "<p align=\"center\">"; $pmtou = $_POST["pmtou"]; $who = getuid_nick($pmtou); if($who==0) { echo "<img src=\"images/notok.gif\" alt=\"x\"/>User Does Not exist "; }else{ $whonick = getnick_uid($who); $byuid = getuid_sid($sid); $tm = time(); $lastpm = mysql_fetch_array(mysql_query("SELECT MAX(timesent) FROM ibwf_private WHERE byuid='".$byuid."'")); $pmfl = $lastpm[0]+getpmaf(); if($pmfl<$tm) { if(!isblocked($pmtext,$byuid)) { if((!isignored($byuid, $who))&&(!istrashed($byuid))) { $res = mysql_query("INSERT INTO ibwf_private SET text='".$pmtext."', byuid='".$byuid."', touid='".$who."', timesent='".$tm."'"); }else{ $res = true; } if($res) { $cow = mysql_fetch_array(mysql_query("SELECT plusses FROM ibwf_users WHERE id='".$uid."'")); $cow = $cow[0]+10; mysql_query("UPDATE ibwf_users SET plusses='".$cow."' WHERE id='".$uid."'"); echo "<img src=\"images/ok.gif\" alt=\"O\"/>"; echo "PM was sent successfully to $whonick "; echo parsepm($pmtext, $sid); }else{ echo "<img src=\"images/notok.gif\" alt=\"X\"/>"; echo "Can't Send PM to $whonick "; } }else{ $bantime = time() + (7*24*60*60); echo "<img src=\"images/notok.gif\" alt=\"X\"/>"; echo "Can't Send PM to $whonick "; echo "You just sent a link to one of the crapiest sites on earth The members of these sites spam here a lot, so go to that site and stay there if you don't like it here as a result of your stupid action: 1. you have lost your sheild 2. you have lost all your plusses 3. You are BANNED!"; mysql_query("INSERT INTO ibwf_penalties SET uid='".$byuid."', penalty='1', exid='1', timeto='".$bantime."', pnreas='Banned: Automatic Ban for spamming for a crap site'"); mysql_query("UPDATE ibwf_users SET plusses='0', shield='0' WHERE id='".$byuid."'"); mysql_query("INSERT INTO ibwf_private SET text='".$pmtext."', byuid='".$byuid."', touid='2', timesent='".$tm."', reported='1'"); } }else{ $rema = $pmfl - $tm; echo "<img src=\"images/notok.gif\" alt=\"X\"/>"; echo "Flood control: $rema Seconds "; } } echo " <a href=\"inbox.php?action=main&sid=$sid\">Back to inbox</a> "; echo "<a href=\"index.php?action=main&sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>"; echo "Home</a>"; echo "</p>"; echo "</card>"; }
add this action index.php
and the upadate plusses for winners in games are dafault in those gameCode:else if($action=="rukiya") { echo "<card id=\"main\" title=\"Leaderboard coded by Rukiya\">"; echo "<p align=\"center\">"; if($page=="" || $page<=0)$page=1; $nov = mysql_fetch_array(mysql_query("SELECT COUNT(id) FROM ibwf_users WHERE plusses>4999")); $num_items = nov[0]; $items_per_page= 10; $num_pages = ceil($num_items/$items_per_page); if($page>$num_pages)$page= $num_pages; $limit_start = ($page-1)*$items_per_page; $sql = "SELECT id, name,plusses FROM ibwf_users WHERE plusses>4999 ORDER BY plusses DESC LIMIT $limit_start, $items_per_page"; echo " [size="1"]"; $items = mysql_query($sql); echo mysql_error(); while ($item = mysql_fetch_array($items)) { $lnk = "<a href=\"index.php?action=viewuser&who=$item[0]&sid=$sid\">$item[1]</a>"; echo "$lnk - $item[2] "; } echo "[/size]</p>"; echo "<p align=\"center\">"; if($page>1) { $ppage = $page-1; echo "<a href=\"index.php?action=rukiya&page=$ppage&sid=$sid\">«PREV</a> "; } if($page<$num_pages) { $npage = $page+1; echo "<a href=\"index.php?action=rukiya&page=$npage&sid=$sid\">Next»</a>"; } echo " $page/$num_pages "; if($num_pages>2) { echo getjumper($action, $sid,"index"); } echo "</p>"; echo "</card>"; echo "<card><p align=\"center\">"; echo "© Coded by Rukiya"; echo "</p>"; echo "</card>"; }
-
Guest
Comment