Help Creating Plusses Leaderboard

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Help Creating Plusses Leaderboard

    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

    #2
    code to update plusses after shout
    replace this action in genproc.php
    Code:
    //////////////////////////////////////////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=&#39;".$shtxt."&#39;, shouter=&#39;".$uid."&#39;, shtime=&#39;".$shtm."&#39;");
        if($res)
        {
        $shts = mysql_fetch_array(mysql_query("SELECT shouts from ibwf_users WHERE id=&#39;".$uid."&#39;"));
        $shts = $shts[0]+1;
        mysql_query("UPDATE ibwf_users SET shouts=&#39;".$shts."&#39; WHERE id=&#39;".$uid."&#39;");
        $cow = mysql_fetch_array(mysql_query("SELECT plusses FROM ibwf_users WHERE id=&#39;".$uid."&#39;"));
        $cow = $cow[0]+20;
        mysql_query("UPDATE ibwf_users SET plusses=&#39;".$cow."&#39; WHERE id=&#39;".$uid."&#39;");
        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&amp;sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>";
    echo "Home</a>";
        echo "</p>";
        echo "</card>";
    }
    code to update plusses after sending PM
    replace these actions in inbxproc.php
    Code:
    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=&#39;".$byuid."&#39;"));
      $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=&#39;".$pmtext."&#39;, byuid=&#39;".$byuid."&#39;, touid=&#39;".$who."&#39;, timesent=&#39;".$tm."&#39;");
      }else{
        $res = true;
      }
      if($res)
      { 
        $cow = mysql_fetch_array(mysql_query("SELECT plusses FROM ibwf_users WHERE id=&#39;".$uid."&#39;"));
        $cow = $cow[0]+10;
        mysql_query("UPDATE ibwf_users SET plusses=&#39;".$cow."&#39; WHERE id=&#39;".$uid."&#39;");
    
        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&#39;t Send PM to $whonick
    
    ";
      }
      }else{
        $bantime = time() + (7*24*60*60);
        echo "<img src=\"images/notok.gif\" alt=\"X\"/>";
        echo "Can&#39;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&#39;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=&#39;".$byuid."&#39;, penalty=&#39;1&#39;, exid=&#39;1&#39;, timeto=&#39;".$bantime."&#39;, pnreas=&#39;Banned: Automatic Ban for spamming for a crap site&#39;");
        mysql_query("UPDATE ibwf_users SET plusses=&#39;0&#39;, shield=&#39;0&#39; WHERE id=&#39;".$byuid."&#39;");
        mysql_query("INSERT INTO ibwf_private SET text=&#39;".$pmtext."&#39;, byuid=&#39;".$byuid."&#39;, touid=&#39;2&#39;, timesent=&#39;".$tm."&#39;");
      }
      }else{
        $rema = $pmfl - $tm;
        echo "<img src=\"images/notok.gif\" alt=\"X\"/>";
        echo "Flood control: $rema Seconds
    
    ";
      }
      echo "
    
    <a href=\"inbox.php?action=main&amp;sid=$sid\">Back to inbox</a>
    ";
      echo "<a href=\"index.php?action=main&amp;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=&#39;".$byuid."&#39;"));
      $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=&#39;".$pmtext."&#39;, byuid=&#39;".$byuid."&#39;, touid=&#39;".$who."&#39;, timesent=&#39;".$tm."&#39;");
      }else{
        $res = true;
      }
      if($res)
      { $cow = mysql_fetch_array(mysql_query("SELECT plusses FROM ibwf_users WHERE id=&#39;".$uid."&#39;"));
        $cow = $cow[0]+10;
        mysql_query("UPDATE ibwf_users SET plusses=&#39;".$cow."&#39; WHERE id=&#39;".$uid."&#39;");
        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&#39;t Send PM to $whonick
    
    ";
      }
      }else{
       $bantime = time() + (7*24*60*60);
        echo "<img src=\"images/notok.gif\" alt=\"X\"/>";
        echo "Can&#39;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&#39;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=&#39;".$byuid."&#39;, penalty=&#39;1&#39;, exid=&#39;1&#39;, timeto=&#39;".$bantime."&#39;, pnreas=&#39;Banned: Automatic Ban for spamming for a crap site&#39;");
        mysql_query("UPDATE ibwf_users SET plusses=&#39;0&#39;, shield=&#39;0&#39; WHERE id=&#39;".$byuid."&#39;");
        mysql_query("INSERT INTO ibwf_private SET text=&#39;".$pmtext."&#39;, byuid=&#39;".$byuid."&#39;, touid=&#39;2&#39;, timesent=&#39;".$tm."&#39;, reported=&#39;1&#39;");
      }
      }else{
        $rema = $pmfl - $tm;
        echo "<img src=\"images/notok.gif\" alt=\"X\"/>";
        echo "Flood control: $rema Seconds
    
    ";
      }
    
        }
      
      echo "
    
    <a href=\"inbox.php?action=main&amp;sid=$sid\">Back to inbox</a>
    ";
      echo "<a href=\"index.php?action=main&amp;sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>";
    echo "Home</a>";
      echo "</p>";
        echo "</card>";
    }
    code to show members having >4999
    add this action index.php
    Code:
    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&amp;who=$item[0]&amp;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&amp;page=$ppage&amp;sid=$sid\">«PREV</a> ";
        }
        if($page<$num_pages)
        {
          $npage = $page+1;
          echo "<a href=\"index.php?action=rukiya&amp;page=$npage&amp;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>";
    }
    and the upadate plusses for winners in games are dafault in those game

    Comment


      #3
      Why buy somebody a topup?.. what happends if 10 people get to 5000 at the same time?.. you would have to spend £100 on topups

      Comment


        #4
        Why buy somebody a topup?.. what happends if 10 people get to 5000 at the same time?.. you would have to spend £100 on topups[/b]
        Really? But I spent 100seconds to fix it.
        [attachment=1645:rukiya.txt]
        Attached Files

        Comment


          #5
          sorry I have not checked the previous rukiya.txt when I coded it but now I have fixed the bugs.Here it is
          [attachment=1646:rukiya.txt]
          Attached Files

          Comment


            #6
            Thank you mate means alot

            Comment

            Working...
            X