rank at trivia

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

7 replies · 657 views · started 17 years ago · 1 min read

3 participants
valentinbr Junior · 26 posts #1
/////////////////////////////////////////Statutus trivia put tihs in core

function trivia($uid)
{
  $info= mysql_fetch_array(mysql_query("SELECT trivia, sex FROM lib3rtymrc_users WHERE id='".$uid."'"));
  if(isbanned($uid))
  {
    return "Banat(a)!";
  }
     if($info[0]<1000)
    {
      return "Left";
    }else if($info[0]<5000)
    {
       return "Beginner";
    }else if($info[0]<10000)
    {
        return "Amateur";
    }else if($info[0]<15000)
    {
       return "advanced";
    }else if($info[0]<40000)
    {
        return "good";
    }else if($info[0]<70000)
    {
        return "very good";
    }else if($info[0]<80000)
    {
        return "    Super Advanced";
    }else 
    {
        return "Genius";
    }
  }
////////////////////tihis in profil
  echo "<small>Rang Trivia: <a href=\"trivia.php?actiune=top&sid=$sid\"><b>".trivia($who)."</b></a></small><br/>";
//////////////////// end tihs in trivia.php
//////////////////////////////////Top Trivia

else if($actiune=="top")

{

    addonline(getuid_sid($sid),"Vizualizeaza Top Trivia","trivia.php?actiune=$actiune&wap=$r");

    echo "<card id=\"main\" title=\"Top Trivia\">";

    echo "<p align=\"center\">";

    echo "<b>Top Trivia</b>";

    echo "</p>";

     

 

    //////ALL LISTS SCRIPT <<

    if($page=="" || $page<=0)$page=1;

    $num_items = regmemcount(); //changable

    $items_per_page= 20;

    $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

        $sql = "SELECT id, name, trivia FROM lib3rtymrc_users ORDER BY trivia DESC LIMIT $limit_start, $items_per_page";

    echo "<p>";

    $items = mysql_query($sql);

     //$cou =1;

    $cou = $limit_start;

    echo mysql_error();

    if(mysql_num_rows($items)>0)

    {
while ($item = mysql_fetch_array($items))

    {
    
      $cou++;

      $simbol = getsimbol($item[0]);

      $lnk = "<small><b>Locul $cou :</b> <a href=\"profil.php?who=$item[0]&sid=$sid\"> $simbol$item[1]</a> -  $item[2] puncte <br/>".trivia($item[0])."</small>";

      echo "$lnk<br/>";
      echo "----<br/>";

  

    }

    }

    echo "</p>";

    echo "<p align=\"left\">";

    if($page>1)

    {

      $ppage = $page-1;

      echo "<small><a href=\"trivia.php?actiune=top&page=$ppage&sid=$sid&view=$view\">pagina anterioara</a></small><br/> ";

   }

    if($page<$num_pages)

    {

      $npage = $page+1;

      echo "<small><a href=\"trivia.php?actiune=top&page=$npage&sid=$sid&view=$view\">pagina urmatoare</a></small>";

    }

    echo "<br/>$page din $num_pages<br/>";

    if($num_pages>2)

    {

      $rets = "Du-te la pagina:<input name=\"pg\" format=\"*N\" size=\"3\"/>";

        $rets .= "<anchor>[du-te]";

        $rets .= "<go href=\"trivia.php\" method=\"get\">";

        $rets .= "<postfield name=\"actiune\" value=\"$actiune\"/>";

        $rets .= "<postfield name=\"sid\" value=\"$sid\"/>";

        $rets .= "<postfield name=\"page\" value=\"$(pg)\"/>";

        $rets .= "</go></anchor>";

        echo $rets;

    }

    echo "</p>";
mazalo Developer · 50 posts #2

I would very grateful if you would set the entire script of trivia, search everywhere, but not generous.Tnx

i0nutzxp Developer · 150 posts #3

it's my work :-W ahhh X(

here is it 😛

<?php unlink('World/Europe/Romania.country'); ?>
Attachments: triviax.rar
mazalo Developer · 50 posts #4

Missing me yet another pair of details.Probably go in core.php

addtotrivia()

I thank you a lot!!!!

i0nutzxp Developer · 150 posts #5
function addtotrivia($uid)
{
  $timeto = 150;
  $timenw = time();
  $timeout = $timenw - $timeto;
  $exec = mysql_query("DELETE FROM lib3rtymrc_onlinetrivia WHERE lton<'".$timeout."'");
  $res = mysql_query("INSERT INTO lib3rtymrc_onlinetrivia SET lton='".time()."', uid='".$uid."'");
  if(!$res)
  {
    mysql_query("UPDATE lib3rtymrc_onlinetrivia SET lton='".time()."' WHERE uid='".$uid."'");
  }
}
<?php unlink('World/Europe/Romania.country'); ?>
mazalo Developer · 50 posts #6

Sorry bro but this miss too Call to undefined function isoprit() And thanks again!

i0nutzxp Developer · 150 posts #7
function isoprit($str,$sender)
{
  $str = str_replace(" ","",$str);
  $str = strtolower($str);
    $res = mysql_query("SELECT browser FROM lib3rtymrc_pc");
while ($row = mysql_fetch_array($res)) 
{
   $sites[] = $row[0];
}
  for($i=0;$i<count($sites);$i++)
  {
        $nosf = substr_count($str,$sites[$i]);
    if($nosf>0)
    {
      return false;
    }
  }
  return true;
}
--
-- Structura de tabel pentru tabelul `lib3rtymrc_pc`
--

CREATE TABLE IF NOT EXISTS `lib3rtymrc_pc` (
  `id` int(11) NOT NULL auto_increment,
  `browser` varchar(255) NOT NULL default '',
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=52 ;

--
-- Salvarea datelor din tabel `lib3rtymrc_pc`
--
<?php unlink('World/Europe/Romania.country'); ?>
mazalo Developer · 50 posts #8

Tnx mete 🙂 You helped me a lot!

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