Lava Private Profile

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

    Lava Private Profile

    Can somebody please do this for me ive been doin it since 6pm and cant seem to get it right, will u do it for me

    PHP Code:
    if (shad0w($uid,$who)) {

    >>>
    code profile<<<

    }else{
    echo 
    "<b>Privacy Profile !!!</ b> <br/> This profile can only see members with a list of friends and members of the Administration<br/> ";

    I need it added into the bit below so it will show private profiles...

    PHP Code:

    viewuser profile
    <?php

    include("config.php");
    include(
    "core.php");
    header("Cache-Control: no-cache, must-revalidate");           // Prevent caching, HTTP/1.1
    header("Pragma: no-cache");
    //header('Content-type: application/vnd.wap.xhtml+xml'); 
    echo "<?xml version=\"1.0\"?>";
    echo 
    "<!DOCTYPE html PUBLIC \"-//WAPFORUM//DTD XHTML Mobile 1.0//EN\" \"http://www.wapforum.org/DTD/xhtml-mobile10.dtd\">";
    ?>
    <html xmlns="http://www.w3.org/1999/xhtml">
    <?php
    $bcon 
    connectdb();
    if (!
    $bcon)
    {
        echo 
    "<head>";
        echo 
    "<title>Error!!!</title>";
        echo 
    "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/black_medium.css\">";
        echo 
    "</head>";
        echo 
    "<body>";
        echo 
    "<p align=\"center\">";
        echo 
    "<img src=\"../images/notok.gif\" alt=\"!\"/><br/>";
        echo 
    "<b><strong>Error! Cannot Connect To Database...</strong></b><br/><br/>";
        echo 
    "This error happens usually when backing up the database, please be patient...";
        echo 
    "</p>";
        echo 
    "</body>";
        echo 
    "</html>";
        exit();
    }

    $brws explode("/",$HTTP_USER_AGENT);
    $ubr $brws[0];
    $uip getip();
    $action $_GET["action"];
    $sid $_GET["sid"];
    $page $_GET["page"];
    $who $_GET["who"];
    $uid getuid_sid($sid);
    $theme mysql_fetch_array(mysql_query("SELECT theme FROM ibwf_users WHERE id='".$uid."'"));
    $sitename mysql_fetch_array(mysql_query("SELECT value FROM ibwf_settings WHERE name='sitename'"));
    $sitename $sitename[0];
    cleardata();

    if(
    isipbanned($uip,$ubr))
      {
    if(!
    isshield(getuid_sid($sid)))
      {
      echo 
    "<head>";
      echo 
    "<title>Ip Block!</title>";
      echo 
    "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/black_medium.css\">";
      echo 
    "</head>";
      echo 
    "<body>";
      echo 
    "<p align=\"center\">";
      echo 
    "<div><img src=\"../images/notok.gif\" alt=\"!\"/></div>";
      echo 
    "<b>This IP address is blocked!!!</b><br/>";
      echo 
    "<br/>";
      echo 
    "How ever we grant a shield against IP-Ban for our great users, you can try to see if you are shielded by trying to log-in, if you kept coming to this page that means you are not shielded, so come back when the ip-ban period is over<br/><br/>";
      
    $banto mysql_fetch_array(mysql_query("SELECT  timeto FROM ibwf_penalties WHERE  penalty='2' AND ipadd='".$uip."' AND browserm='".$ubr."' LIMIT 1 "));
      
    $remain =  $banto[0] - time();
      
    $rmsg gettimemsg($remain);
      echo 
    "<b>Time Left: </b>$rmsg<br/>";
      echo 
    "</p>";
      echo 
    "<p align=\"center\"><form action=\"login.php\" method=\"get\">";
      echo 
    "<b>Username:</b><br/><input align=\"center\" name=\"loguid\" style=\"-wap-input-format: '*x'\" size=\"12\" maxlength=\"12\"/><br/>";
      echo 
    "<b>Password:</b><br/><input align=\"center\" type=\"password\" name=\"logpwd\" size=\"10\" maxlength=\"10\"/><br/>";
      echo 
    "<input name=\"LOGIN\" type=\"submit\" value=\"Login!\"></form></p>";
      echo 
    "<p align=\"center\"><br/>Not registered yet? <br/><a href=\"register.php\">Join Us</a><br/>";
      echo 
    "<a href=\"index.php?action=terms&amp;sid=$sid\">The Rules</a><br/>";
      echo 
    "</p>";
      echo 
    "<p align=\"center\">";
      
    $onu getnumonline();
      echo 
    "Members Inside: $onu<br/><br/>";
      echo 
    "<a href=\"../wap/index.php\">Wap Version4  **** fones lol</a></p>";
      
    //echo mobads();
      
    echo "<div><b>©2006-2009<br/>$sitename</b></div>";
      echo 
    "</body>";
      echo 
    "</html>";
      exit();
      }
    }

    if((
    $action != "") && ($action!="terms"))
      {
        
    $uid getuid_sid($sid);
        if((
    islogged($sid)==false)||($uid==0))
        {
          echo 
    "<head>";
          echo 
    "<title>Error!!!</title>";
          echo 
    "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/black_medium.css\">";
          echo 
    "</head>";
          echo 
    "<body>";
          echo 
    "<p align=\"center\">";
          echo 
    "You are not logged in<br/>";
          echo 
    "Or Your session has been expired<br/><br/>";
          echo 
    "<a href=\"index.php\">Login</a>";
          echo 
    "</p>";
          echo 
    "</body>";
          echo 
    "</html>";
          exit();
        }            
     }

    //echo isbanned($uid);
    if(isbanned($uid))
        {
          echo 
    "<head>";
          echo 
    "<title>Error!!!</title>";
          echo 
    "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
          echo 
    "</head>";
          echo 
    "<body>";
          echo 
    "<p align=\"center\">";
          echo 
    "<img src=\"../images/notok.gif\" alt=\"x\"/><br/>";
          echo 
    "<b>You are Banned</b><br/><br/>";
          
    $banto mysql_fetch_array(mysql_query("SELECT timeto, pnreas, exid FROM ibwf_penalties WHERE uid='".$uid."' AND penalty='1' OR uid='".$uid."' AND penalty='2'"));
       
    $banres mysql_fetch_array(mysql_query("SELECT lastpnreas FROM ibwf_users WHERE id='".$uid."'"));
          
    $remain $banto[0]- time();
          
    $rmsg gettimemsg($remain);
          echo 
    "<b>Time Left: </b>$rmsg<br/>";
          
    $nick getnick_uid($banto[2]);
       echo 
    "<b>By: </b>$nick<br/>";
       echo 
    "<b>Reason: </b>$banto[1]";
          
    //echo "<a href=\"index.php\">Login</a>";
          
    echo "</p>";
          echo 
    "</body>";
          echo 
    "</html>";
          exit();
        }
    $res mysql_query("UPDATE ibwf_users SET browserm='".$ubr."', ipadd='".$uip."' WHERE id='".getuid_sid($sid)."'");

    ////////////////////////////////////////MAIN PAGE
    if($action=="main")
    {
      
    addvisitor();
      
    addonline(getuid_sid($sid),"Been Boring On Main Menu","index.php?action=$action");
      
    //saveuinfo($sid);
      
    $nick getnick_sid($sid);
      echo 
    "<head>";
      echo 
    "<title>$nick@$sitename</title>";
      
    $thmname=$theme["theme"];
      
    $them=explode("_",$thmname);
      
    $them2=$them[0];
      if(
    $them2=="Custom")
          {
        include(
    "custom_theme.inc.php");
        }else{
      echo 
    "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
        }

      echo 
    "</head>";
      echo 
    "<body>";
      
    $time time() - (60 60);
      
    $newtime date("H:i",$time);
      
    $date strtotime('-0 hours');
      
    $newdate date('D jS M y',$date);

      echo 
    "<div><img src=\"../images/logo.gif\" alt=\"logo\"/><br/>";
      echo 
    "".$newtime." - ".$newdate."</div>";
      echo 
    popup($sid);
      
    $nick getnick_sid($sid);
      echo 
    "<p align=\"center\"></a>";
      echo 
    "<p align=\"center\">Welcome Back $nick</p>"
      
    $diena=date("z");
      
    $days=365-$diena;
      echo 
    "<p align=\"center\">";
      echo 
    "<i><b>$days</b> days left till 2012 !</i><br/>";   
      
    $fmsg getbbcode(getfmsg(), $sid0);
      echo 
    "<p align=\"center\">$fmsg</p>";
      echo 
    "<p align=\"center\"><img src=\"../images/banner.gif\" alt=\"banner\"/></p>";
      echo 
    "<p align=\"center\">";  

    echo 
    getshoutbox($sid);
      echo 
    "</p>";


     echo 
    "<p align=\"center\"><img src=\"../images/banner.gif\" alt=\"banner\"/></p>";
      echo 
    "<p align=\"center\">";
      
    $norm mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_users"));
      
    $memid mysql_fetch_array(mysql_query("SELECT id, name  FROM ibwf_users ORDER BY regdate DESC LIMIT 0,1"));
      echo 
    "We Have $norm[0]<br/>Registered Members<br/><a href=\"index.php?action=viewuser&amp;who=$memid[0]&amp;sid=$sid\">$memid[1]</a><br/>has now joined<br/>$sitename :o)<br/><br/>";
      
    $noi mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_users where month(`birthday`) = month(curdate()) and dayofmonth(`birthday`) = dayofmonth(curdate());"));
      if(
    $noi[0]!=0){
      
    $sql mysql_fetch_array(mysql_query("SELECT id, name, birthday  FROM ibwf_users where month(`birthday`) = month(curdate()) and dayofmonth(`birthday`) = dayofmonth(curdate()) ORDER BY RAND() LIMIT 1"));
      
    $uage getage($sql[2]);
      
    $lnk "Happy Birthday<br/><a href=\"index.php?action=viewuser&amp;who=$sql[0]&amp;sid=$sid\">$sql[1]</a>";
      echo 
    "$lnk<br/>what ya wapping for go out get pissed get laid lol<br/><br/>";
      }
      
     



    echo 
    "<a href=\"index.php?action=last15topic&amp;sid=$sid\">Latest Forum Topics</a><br/>";

      echo 
    "<p align=\"center\">";
      if(
    ishost(getuid_sid($sid)))
      {
      echo 
    "<a href=\"hostcp.php?action=hostcp&amp;sid=$sid\">Host Tools</a><br/>";
      
    $noi mysql_fetch_array(mysql_query("SELECT count(*) FROM ibwf_users WHERE validated='0'"));
    if(
    $noi[0]>0)
      {
      echo 
    "<a href=\"hostcp.php?action=validatelist&amp;sid=$sid\">validate list($noi[0])</a><br/>";
      }
      }
    if(
    isowner(getuid_sid($sid)))
      {
      echo 
    "<a href=\"ownercp.php?action=ownercp&amp;sid=$sid\">Owner Tools</a><br/>";
      
    $noi mysql_fetch_array(mysql_query("SELECT count(*) FROM ibwf_users WHERE validated='0'"));
    if(
    $noi[0]>0)
      {
      echo 
    "<a href=\"ownercp.php?action=validatelist&amp;sid=$sid\">validate list($noi[0])</a><br/>";
      }
      }
    if(
    isheadadmin(getuid_sid($sid)))
      {
      echo 
    "<a href=\"headadmincp.php?action=headadmincp&amp;sid=$sid\">Head Admin Tools</a><br/>";
      
    $noi mysql_fetch_array(mysql_query("SELECT count(*) FROM ibwf_users WHERE validated='0'"));
    if(
    $noi[0]>0)
      {
      echo 
    "<a href=\"headadmincp.php?action=validatelist&amp;sid=$sid\">validate list19/02/2009 19:17:31($noi[0])</a><br/>";
      }
      
      }
      if(
    ismod($uid))
      {
    if(!
    ishost(getuid_sid($sid)))
      {
      if(!
    isowner(getuid_sid($sid)))
      {
    if(!
    isheadadmin(getuid_sid($sid)))
      {
      echo 
    "<a href=\"admincp.php?action=admincp&amp;sid=$sid\">Admin Tools</a><br/>";
      }
     }
      }
      }
      if(
    ismod($uid))
      {
      
    $adminclub "1";
      
    $ismem mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_clubmembers WHERE clid='".$adminclub."' AND uid='".$uid."'"));
      if(
    $ismem[0]==0)
      {
      echo 
    "<a href=\"genproc.php?action=reqjc&amp;sid=$sid&amp;clid=$adminclub\">Join Admin Club Now!</a><br/>";
      }else{
      
    $clinfo mysql_fetch_array(mysql_query("SELECT name, owner, description, rules, logo, plusses, created FROM ibwf_clubs WHERE id='".$adminclub."'"));
      
    $clnm htmlspecialchars($clinfo[0]);
      
    $fid mysql_fetch_array(mysql_query("SELECT id FROM ibwf_forums WHERE clubid='".$adminclub."'"));
      
    $rid mysql_fetch_array(mysql_query("SELECT id FROM ibwf_rooms WHERE clubid='".$adminclub."'"));
      
    $tps mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_topics WHERE fid='".$fid[0]."'"));
      
    $pss mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_posts a INNER JOIN ibwf_topics b ON a.tid = b.id WHERE b.fid='".$fid[0]."'"));
      
    $cango mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_clubmembers WHERE clid='".$adminclub."' AND uid='".$uid."' AND accepted='1'"));
      if((
    $cango[0]>0)||(isheadadmin($uid))||(isowner($uid)))
      {
      
    $noa mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_announcements WHERE clid='".$adminclub."'"));
      echo 
    "<a href=\"lists.php?action=annc&amp;sid=$sid&amp;clid=$adminclub\">Announcements($noa[0])</a><br/>";
      
    $noa mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_chat WHERE rid='".$rid[0]."'"));
      
    $chs mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_chonline WHERE rid='".$rid[0]."'"));
      echo 
    "<a href=\"chat.php?sid=$sid&amp;rid=$rid[0]\">$clnm Chat($chs[0])</a><br/>";
      echo 
    "<a href=\"index.php?action=viewfrm&amp;sid=$sid&amp;fid=$fid[0]\">$clnm Forum($tps[0]/$pss[0])</a><br/>";
      if(
    $clinfo[1]==$uid)
      {
      
    $mems mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_clubmembers WHERE clid='".$adminclub."' AND accepted='0'"));
      if(
    $mems[0]>0)
      {
      echo 
    "<a href=\"lists.php?action=clreq&amp;sid=$sid&amp;clid=$adminclub\">Requests($mems[0])</a><br/>";
      }
      }
      }
      }
        
    $tnor mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_private WHERE reported='1'"));
        
    $tot $tnor[0];
        
    $tnor mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_popups WHERE reported='1'"));
        
    $tot += $tnor[0];
        
    $tnor mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_posts WHERE reported='1'"));
        
    $tot += $tnor[0];
        
    $tnor mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_topics WHERE reported='1'"));
        
    $tot += $tnor[0];
        
    $tnol mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_mlog"));
        
    $tol $tnol[0];
        if(
    $tol+$tot>0)
        {
        echo 
    "<a href=\"modcp.php?action=main&amp;sid=$sid\">Reports/Logs($tot/$tol)</a><br/><br/>";
        }
        }
       


    echo 
    "<b></b><a accesskey=\"1\" href=\"index.php?action=online&amp;sid=$sid\">Online Members(".getnumonline().")</a><br/>";
      
    $tmsg getpmcount(getuid_sid($sid));
      
    $umsg getunreadpm(getuid_sid($sid));
      echo 
    "<b></b><a accesskey=\"2\" href=\"inbox.php?action=main&amp;sid=$sid\">Inbox($umsg/$tmsg)</a><br/>";
      
    $reqs getnreqs($uid);
      if(
    $reqs>0)
      {

        
    $request "! <a href=\"lists.php?action=reqs&amp;sid=$sid\">$reqs</a>";
      }
      
    $uid getuid_sid($sid);
      
    $mybuds getnbuds($uid);
      
    $onbuds getonbuds($uid);
      echo 
    "<b></b><a accesskey=\"3\" href=\"lists.php?action=buds&amp;sid=$sid\">Buds($onbuds/$mybuds)</a>$request<br/>";
      
    $chs mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_clubs"));
      echo 
    "<b></b><a accesskey=\"4\" href=\"index.php?action=clmenu&amp;sid=$sid\">Clubs($chs[0])</a><br/>";
    if(
    getfview()==0)
      {
      
    $topics mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_topics"));
      
    $posts mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_posts"));
      echo 
    "<b></b><a accesskey=\"5\" href=\"index.php?action=forumindx&amp;sid=$sid\">Forums($topics[0]/$posts[0])</a><br/>";
      }
      
    $fcats mysql_query("SELECT id, name FROM ibwf_fcats ORDER BY position, id");
      while(
    $fcat=mysql_fetch_array($fcats))
      {
        
    $forums mysql_query("SELECT id, name FROM ibwf_forums WHERE cid='".$fcat[0]."' AND clubid='0' ORDER BY position, id, name");

        if(
    getfview()==1)
        {
        echo 
    "<b>$fcat[1]</b><br/>";
        while(
    $forum=mysql_fetch_array($forums))
            {
          if(
    canaccess(getuid_sid($sid),$forum[0]))
          {
          echo 
    "<a href=\"index.php?action=viewfrm&amp;sid=$sid&amp;fid=$forum[0]\">$forum[1]</a><br/>";
          }
        }
        }else if(
    getfview()==2)
        {
        
    $topics mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_topics a INNER JOIN ibwf_forums b ON a.fid = b.id WHERE b.cid='".$fcat[0]."'"));
        
    $posts mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_posts a INNER JOIN ibwf_topics b ON a.tid = b.id INNER JOIN ibwf_forums c ON b.fid = c.id WHERE c.cid='".$fcat[0]."'"));
        echo 
    "<b></b><a accesskey=\"5\" href=\"index.php?action=viewcat&amp;sid=$sid&amp;cid=$fcat[0]\">$fcat[1]($topics[0]/$posts[0])</a><br/>";
        }else if(
    getfview()==3)
        {
      echo 
    "<form action=\"index.php\" method=\"get\">";
      echo 
    "<b>$fcat[1]</b><br/><select name=\"fid\">";
      while(
    $forum=mysql_fetch_array($forums))
      {
    if(
    canaccess(getuid_sid($sid),$forum[0]))
      {
      
    $topics mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_topics WHERE fid='".$forum[0]."'"));
      
    $posts mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_posts a INNER JOIN ibwf_topics b ON a.tid = b.id WHERE b.fid='".$forum[0]."'"));
      echo 
    "<option value=\"$forum[0]\">$forum[1]($topics[0]/$posts[0])</option>";
      }
      }
      echo 
    "</select><br/>";
      echo 
    "<input type=\"hidden\" name=\"action\" value=\"viewfrm\"/>";
      echo 
    "<input type=\"hidden\" name=\"sid\" value=\"$sid\"/>";
      echo 
    "<input type=\"hidden\" name=\"fid\" value=\"$(fid)\"/>";
      echo 
    "<input type=\"submit\" value=\"[view]\"/>";
      echo 
    "</form>";
        }
      }
      
    $chs mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_chonline"));
      echo 
    "<b></b><a accesskey=\"6\" href=\"index.php?action=chat&amp;sid=$sid\">Chatrooms($chs[0])</a><br/>";

    if(!(
    $dp opendir("../pics/"))) die ("Cannot open ./");
    $files = array(); 
    while (
    $pics readdir ($dp))
       {
       if(
    substr($pics,0,1) != '.' and $pics!= "index.php")
          {
          
    $files[] =  $pics;
          }
       }
    $file_count count ($files);
    sort ($files);
      echo 
    "<b></b><a accesskey=\"7\" href=\"../pics/index.php?action=gallindex&amp;sid=$sid&amp;script=xhtml\">Gallery Pix</a><br/>";
        

    echo 
    "<a href=\"dating.php?action=main&amp;sid=$sid\">Dating Adverts</a><br/>";
      echo 
    "<b></b><a accesskey=\"8\" href=\"shop.php?action=shop&amp;sid=$sid\">Points Shop</a><br/>";
      echo 
    "<b></b><a accesskey=\"0\" href=\"index.php?action=cpanel&amp;sid=$sid\">Settings</a><br/>";
     
    //echo "<a href=\"http://my.wapshare.us/guestbook.php?id=12507\">Site Guest Book<span style=\"color:cyan\">*New*</span></a>";
    echo "<a href=\"extras.php?sid=$sid\"><span style=\"color:yellow\">Site Extras</span></a><br/>";

      echo 
    "<a accesskey=\"#\" href=\"index.php?action=logout&amp;sid=$sid&amp;who=$uid\">Piss off</a>";
      echo 
    "</p>";
     
    //echo "<p align=\"center\"><a href=\"index.php?action=logout&amp;sid=$sid&amp;who=$uid\"><img src=\"../images/logout.gif\" alt=\"banner\"/></a>";
      
    echo "<p align=\"center\">"
      
    //echo "<a href=\"index.php?action=free&amp;sid=$sid\"><span style=\"color:blue\">free downloads</span></a><br/>";
      
      //echo "<a href=\"lists.php?action=usersmilies&amp;sid=$sid\">User Smilies</a><br/>";
      //echo "<a href=\"index.php?action=funm&amp;sid=$sid\"><span style=\"color:yellow\">fun and games</span></a><br/>";
      

    $norm mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_users"));
      echo 
    "Members:<a href=\"lists.php?action=members&amp;sid=$sid\">$norm[0]</a><br/>";
      
    $noi2 mysql_fetch_array(mysql_query("SELECT count(*) FROM ibwf_users WHERE perm>'0'"));
      
    $timeout 300;
      
    $timeon time()-$timeout;
      
    $noi mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_users WHERE perm>'0' AND lastact>'".$timeon."'"));
      echo 
    "Staff Team: <a href=\"index.php?action=stfol&amp;sid=$sid\">".$noi[0]."/$noi2[0]</a></p>";
      echo 
    "<p align=\"center\"><img src=\"../images/hostlogo.gif\" alt=\"banner\"/></p>";
      echo 
    "<p align=\"center\">";  
    if(
    ismod($uid))
      {
      echo 
    "<p align=\"center\"><a href=\"staffinfo.php?sid=$sid\">Staff Rules and Info</a><br/>";
      }
      echo 
    "<a href=\"index.php?action=terms&amp;sid=$sid\">Site Rules</a><br/>";
      
    //echo "<a href=\"index.php?action=stats&amp;sid=$sid\">Site Stats</a></p>";
      //echo mobads();
      
      
    echo "<div><b>©2011<br/>$sitename</b></div>";
      echo 
    "</body>";
    }
    ///////////////////////////Logout///////////////////////////////

    else if($action=="logout")
    {
      
    $who $_GET["who"];
      
    $user getnick_uid($who);
      echo 
    "<head>";
      echo 
    "<title>Piss Off</title>";
      
    $thmname=$theme["theme"];
      
    $them=explode("_",$thmname);
      
    $them2=$them[0];
      if(
    $them2=="Custom")
          {
        include(
    "custom_theme.inc.php");
        }else{
      echo 
    "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
        }
      echo 
    "</head>";
      echo 
    "<body>";
      echo 
    "<p align=\"center\">";
      
    $uid getuid_sid($sid);
      if(
    $who!=$uid){ 
      echo 
    "<b><img src=\"../images/notok.gif\" alt=\"x\"/><br/>Error!!!<br/>Permission Denied...</b><br/>";
      echo 
    "<br/>$user, U Cannot Log Someone Out<br/>This Is An Attempt To Breach Site Security<br/>If U Are Caught Trying This Again U Will Be Banned<br/>";
      echo 
    "<br/><a accesskey=\"1\" href=\"index.php?action=main&amp;sid=$sid\"><img src=\"../images/home.gif\" alt=\"\"/>Ok!</a>";
      echo 
    "</p>";
      }else{
      echo 
    "<br/>";
      
    $res mysql_query("DELETE FROM ibwf_ses WHERE uid='".$who."'");
      if(
    $res)
      {
      
    addonline($who,"Logging Out","");
      echo 
    "<img src=\"../images/ok.gif\" alt=\"O\"/><b>$user</b><br/>U Hav Successfully Logged Out Pls Come Back Soon :o)<br/>";
      }else{
      echo 
    "<img src=\"../images/notok.gif\" alt=\"X\"/>Error Logging Out";
      }
      echo 
    "<br/><a accesskey=\"1\" href=\"index.php\"><img src=\"../images/home.gif\" alt=\"\"/>ok!</a>";
      echo 
    "</p>";
      }
      echo 
    "</body>";
    }
    ///////////////////////////////////

    else if($action=="forumindx")
    {
      
    addonline(getuid_sid($sid),"Forum Index","index.php?action=$action");
      
    $sid $_GET["sid"];
      
    $uid getuid_sid($sid);
      echo 
    "<head>";
      echo 
    "<title>Forum Index</title>";
      echo 
    "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
      echo 
    "</head>";
      echo 
    "<body>";
      echo 
    "<p>";
      echo 
    "<p align=\"center\">";
      echo 
    "<b>Our Forum Categories</b><br/>";
      
    $fcats mysql_query("SELECT id, name FROM ibwf_fcats ORDER BY position, id");
      
    $iml "<img src=\"../images/1.gif\" alt=\"\"/>";
      while(
    $fcat=mysql_fetch_array($fcats))
      {
        
    $catlink "<a href=\"index.php?action=viewcat&amp;sid=$sid&amp;cid=$fcat[0]\">$iml$fcat[1]</a>";
        echo 
    "<br/>$catlink";
        
    $forums mysql_query("SELECT id, name FROM ibwf_forums WHERE cid='".$fcat[0]."' AND clubid='0' ORDER BY position, id, name");
        if(
    getfview()==0)
        {
        echo 
    "<br/>";
        while(
    $forum=mysql_fetch_array($forums))
            {
      
    $notp mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_topics WHERE fid='".$forum[0]."'"));
      
    $nops mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_posts a INNER JOIN ibwf_topics b ON a.tid = b.id WHERE b.fid='".$forum[0]."'"));
          echo 
    "<a href=\"index.php?action=viewfrm&amp;sid=$sid&amp;fid=$forum[0]\">$forum[1]($notp[0]/$nops[0])</a><br/>";
          }
        }
      }
      echo 
    "</p>";
      echo 
    "<p align=\"center\">";
      echo 
    "<br/><a href=\"index.php?action=main&amp;sid=$sid\"><img src=\"../images/home.gif\" alt=\"\"/>Home</a>";
      echo 
    "</p>";
      echo 
    "</body>";
    }

    //////////last 15 forum topics/////////////


    else if($action=="last15topic")
    {

      
    addonline(getuid_sid($sid),"Viewing Latest Forum Topics","index.php?action=$action");

          echo 
    "<head>";
          echo 
    "<title>Latest Forum Topics</title>";
          echo 
    "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
          echo 
    "</head>";

        
    $sql "SELECT id, name, crdate, authorid FROM ibwf_topics ibwf_topics ORDER BY lastpost DESC LIMIT 0 , 15";
       echo 
    "<p>";
       echo 
    "<small>";
    $items mysql_query($sql);
        echo 
    mysql_error();
        if(
    mysql_num_rows($items)>0)
        {
        while (
    $item mysql_fetch_array($items))
        {
          if(
    canaccess(getuid_sid($sid),getfid_tid($item[0])))
          {
      
    $tun getnick_uid($item[3]);
            echo 
    "<a href=\"index.php?action=viewtpc&amp;sid=$sid&amp;tid=$item[0]&amp;go=last\">$tun:".htmlspecialchars($item[1])."</a><br/>";
            }else{
              echo 
    "Private Post<br/>";
            }
        }
        }
    echo 
    "</p>";
      echo 
    "<p align=\"center\">";
      echo 
    "<a href=\"index.php?action=main&amp;sid=$sid\"><img src=\"../images/home.gif\" alt=\"\"/>Home</a>";
      echo 
    "</p>";

    }







    ///////////////////////////////////

    else if($action=="clmop")
    {
        
    $clid $_GET["clid"];
        
    $who $_GET["who"];
        
    addonline(getuid_sid($sid),"Moderating Club Member","");
          echo 
    "<head>";
          echo 
    "<title>Moderate Member</title>";
      
    $thmname=$theme["theme"];
      
    $them=explode("_",$thmname);
      
    $them2=$them[0];
      if(
    $them2=="Custom")
          {
        include(
    "custom_theme.inc.php");
        }else{
      echo 
    "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
        }
          echo 
    "</head>";
          echo 
    "<body>";
        echo 
    "<p align=\"center\">";
        
    $whnick getnick_uid($who);
        echo 
    "<b>$whnick</b>";
        echo 
    "</p>";
        echo 
    "<p>";
        
    $exs mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_clubmembers WHERE uid='".$who."' AND clid=".$clid.""));
    $cow mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_clubs WHERE owner='".$uid."' AND id=".$clid.""));
    if(
    $exs[0]>&& $cow[0]>0)
    {
        echo 
    "<b>7 </b><a accesskey=\"7\" href=\"genproc.php?action=dcm&amp;sid=$sid&amp;who=$who&amp;clid=$clid\">»Kick $whnick out</a><br/>";
        echo 
    "<b>8 </b><a accesskey=\"8\" href=\"index.php?action=gcp&amp;sid=$sid&amp;who=$who&amp;clid=$clid\">»$whnick's Club Points</a><br/>";
        echo 
    "<b>9 </b><a accesskey=\"9\" href=\"index.php?action=gpl&amp;sid=$sid&amp;who=$who&amp;clid=$clid\">»Give $whnick Plusses</a><br/>";
        }else{
          echo 
    "<img src=\"../images/notok.gif\" alt=\"X\"/>Missing Info!";
        }
        echo 
    "</p>";

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

      echo 
    "<b>0 </b><a accesskey=\"0\" href=\"index.php?action=main&amp;sid=$sid\"><img src=\"../images/home.gif\" alt=\"\"/>Home</a>";
      echo 
    "</p>";
        echo 
    "</body>";
    }

    else if(
    $action=="gcp")
    {
        
    $clid $_GET["clid"];
        
    $who $_GET["who"];
        
    addonline(getuid_sid($sid),"Moderating Club Member","");
          echo 
    "<head>";
          echo 
    "<title>Moderate Member</title>";
      
    $thmname=$theme["theme"];
      
    $them=explode("_",$thmname);
      
    $them2=$them[0];
      if(
    $them2=="Custom")
          {
        include(
    "custom_theme.inc.php");
        }else{
      echo 
    "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
        }
          echo 
    "</head>";
          echo 
    "<body>";
        echo 
    "<p align=\"center\">";
        
    $whnick getnick_uid($who);
        echo 
    "<b>$whnick</b>";
        echo 
    "</p>";
        echo 
    "<p>";
        
    $exs mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_clubmembers WHERE uid='".$who."' AND clid=".$clid.""));
    $cow mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_clubs WHERE owner='".$uid."' AND id=".$clid.""));
    if(
    $exs[0]>&& $cow[0]>0)
    {
        echo 
    "<form action=\"genproc.php?action=gcp&amp;sid=$sid&amp;who=$who&amp;clid=$clid\" method=\"post\">";
        echo 
    "Action: <select name=\"giv\">";
        echo 
    "<option value=\"1\">Add</option>";
        echo 
    "<option value=\"0\">Subtract</option>";
        echo 
    "</select><br/>";
        echo 
    "Points: <input name=\"pnt\" style=\"-wap-input-format: '*N'\" size=\"2\" maxlength=\"2\"/><br/>";
        echo 
    "<input type=\"submit\" value=\"GO\"/>";
        echo 
    "</form>";
        }else{
        echo 
    "<img src=\"../images/notok.gif\" alt=\"X\"/>Missing Info!";
        }
        echo 
    "</p>";
        echo 
    "<p align=\"center\">";
        echo 
    "<b>0 </b><a accesskey=\"0\" href=\"index.php?action=main&amp;sid=$sid\"><img src=\"../images/home.gif\" alt=\"\"/>Home</a>";
        echo 
    "</p>";
        echo 
    "</body>";
    }

    else if(
    $action=="gpl")
    {
        
    $clid $_GET["clid"];
        
    $who $_GET["who"];
        
    addonline(getuid_sid($sid),"Moderating Club Member","");
          echo 
    "<head>";
          echo 
    "<title>Moderate Member</title>";
      
    $thmname=$theme["theme"];
      
    $them=explode("_",$thmname);
      
    $them2=$them[0];
      if(
    $them2=="Custom")
          {
        include(
    "custom_theme.inc.php");
        }else{
      echo 
    "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
        }
          echo 
    "</head>";
          echo 
    "<body>";
        echo 
    "<p align=\"center\">";
        
    $whnick getnick_uid($who);
        echo 
    "<b>$whnick</b>";
        echo 
    "</p>";
        echo 
    "<p>";
        
    $exs mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_clubmembers WHERE uid='".$who."' AND clid=".$clid.""));
    $cow mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_clubs WHERE owner='".$uid."' AND id=".$clid.""));
    if(
    $exs[0]>&& $cow[0]>0)
    {
        echo 
    "<small><img src=\"../images/point.gif\" alt=\"!\"/>You can only give plusses, these are real plusses, you can't subtract plusses<br/>";
        
    $cpl mysql_fetch_array(mysql_query("SELECT plusses FROM ibwf_clubs WHERE id='".$clid."'"));
        echo 
    "<img src=\"../images/point.gif\" alt=\"!\"/>Your club plusses credit is $cpl[0]<br/>";
        echo 
    "<img src=\"../images/point.gif\" alt=\"!\"/>Do not abuse giving of plusses to users, your club could be deleted<br/></small><br/>";
        echo 
    "<form action=\"genproc.php?action=gpl&amp;sid=$sid&amp;who=$who&amp;clid=$clid\" method=\"post\">";
        echo 
    "Plusses: <input name=\"pnt\" style=\"-wap-input-format: '*N'\" size=\"2\" maxlength=\"2\"/><br/>";
        echo 
    "<input type=\"submit\" value=\"GO\"/>";    
        echo 
    "</form>";
        }else{
          echo 
    "<img src=\"../images/notok.gif\" alt=\"X\"/>Missing Info!";
        }
        echo 
    "</p>";

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

        echo 
    "<b>0 </b><a accesskey=\"0\" href=\"index.php?action=main&amp;sid=$sid\"><img src=\"../images/home.gif\" alt=\"\"/>Home</a>";
        echo 
    "</p>";
        echo 
    "</body>";
    }
    ///////////////////////////////////Control Panel

    else if($action=="cpanel")
    {
      
    addonline(getuid_sid($sid),"Browsin My Tools Lol","index.php?action=cpanel");
      echo 
    "<head>";
      echo 
    "<title>Settings</title>";
      
    $thmname=$theme["theme"];
      
    $them=explode("_",$thmname);
      
    $them2=$them[0];
      if(
    $them2=="Custom")
          {
        include(
    "custom_theme.inc.php");
        }else{
      echo 
    "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
        }
      echo 
    "</head>";
      echo 
    "<body>";
      echo 
    "<p align=\"center\">";
      echo 
    "<img src=\"../images/cpanel.gif\" alt=\"CPanel\"/><br/>";
      echo 
    "<b>Control Panel</b>";
      echo 
    "</p>";
      echo 
    "<p>";
      echo 
    "<br/><b>---General Options---</b><br/>";
      echo 
    "<a href=\"index.php?action=viewuser&amp;sid=$sid&amp;who=$uid\">»View Your Profile</a><br/>";
      echo 
    "<a href=\"index.php?action=uset&amp;sid=$sid\">»Update Profile</a><br/>";
      
     
    $viewpro mysql_fetch_array(mysql_query("SELECT viewpro FROM ibwf_users WHERE id = '".$uid."'"));

     if(
    $viewpro[0]=="1")
     {
     echo 
    "<a href=\"genproc.php?action=viewpro&amp;sid=$sid&amp;act=dis\">Make Profile Public </a><br/>";
     }else{
     echo 
    "<a href=\"genproc.php?action=viewpro&amp;sid=$sid&amp;act=enb\">Make Profile Private </a><br/>";
     }




    echo 
    "<a href=\"index.php?action=chngpass&amp;sid=$sid\">»Change Password</a><br/>";
      echo 
    "<a href=\"index.php?action=uxset&amp;sid=$sid\">»Extended Settings</a><br/>";
      echo 
    "<a href=\"index.php?action=pws&amp;sid=$sid\">»Personal Wap site</a><br/>";
      
    $popmsgs mysql_fetch_array(mysql_query("SELECT popmsg FROM ibwf_users WHERE id='".$uid."'"));
      if(
    $popmsgs[0]==0){
      echo 
    "<a href=\"index.php?action=popenable&amp;sid=$sid\">»Enable Pop-ups</a><br/>";
      }else{
      echo 
    "<a href=\"index.php?action=popdisable&amp;sid=$sid\">»Disable Pop-ups</a><br/>";
      }
      if(
    automsgs($uid)){
      echo 
    "<a href=\"index.php?action=automsgsoff&amp;sid=$sid\">»Disable Automsgs</a><br/>";
      }else{
      echo 
    "<a href=\"index.php?action=automsgson&amp;sid=$sid\">»Enable Automsgs</a><br/>";
      }
      
    $sml mysql_fetch_array(mysql_query("SELECT hvia FROM ibwf_users WHERE id='".$uid."'"));
      if(
    $sml[0]=="1")
      {
      echo 
    "<a href=\"genproc.php?action=shsml&amp;sid=$sid&amp;act=dis\">»Disable Smilies</a><br/>";
      }else{
      echo 
    "<a href=\"genproc.php?action=shsml&amp;sid=$sid&amp;act=enb\">»Enable Smilies</a><br/>";
      }
      echo 
    "<a href=\"index.php?action=sitethms&amp;sid=$sid\">»Change Theme</a><br/>";
      
    $thmname=$theme["theme"];
      
    $them=explode("_",$thmname);
      
    $them2=$them[0];
      if(
    $them2=="Custom")
      {
      echo 
    "<br/><b>---XHTML Text/Color Settings---</b><br/>";  
      echo 
    "<a href=\"index.php?action=bgcol&amp;sid=$sid\">»Set Your Background Color</a><br/>";
      
    //echo "<a href=\"index.php?action=altbgcol&amp;sid=$sid\">»Set Your Alternate Background Color</a><br/>";
      
    echo "<a href=\"index.php?action=txtcol&amp;sid=$sid\">»Set Your Text Color</a><br/>";
      echo 
    "<a href=\"index.php?action=lnkcol&amp;sid=$sid\">»Set Your Link Color</a></p>";
      echo 
    "<form action=\"index.php?action=txtsizeset&amp;sid=$sid\" method=\"post\">";
      echo 
    "<p>Choose Site Text Size: <br/><select name=\"size\">";
      echo 
    "<option label=\"xx-small\">XX-Small</option>";
      echo 
    "<option label=\"x-small\">X-Small</option>";
      echo 
    "<option label=\"small\">Small</option>";
      echo 
    "<option label=\"medium\" selected=\"selected\">Medium</option>";
      echo 
    "<option label=\"large\">Large</option>";
      echo 
    "<option label=\"x-large\">X-Large</option>";
      echo 
    "<option label=\"xx-large\">XX-Large</option>";
      echo 
    "</select>";
      echo 
    "<input type=\"submit\" value=\"Set Size\" name=\"submit\"/></p></form><p>";
      }
      echo 
    "<br/><b>---Other Options---</b><br/>";
      echo 
    "<a href=\"index.php?action=rwidc&amp;sid=$sid\">»$sitename ID card.</a><br/>";
      echo 
    "<a href=\"index.php?action=myclub&amp;sid=$sid\">»My Clubs</a><br/>";
      
    $noi mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_vault WHERE uid='".$uid."'"));
      echo 
    "<a href=\"lists.php?action=vault&amp;sid=$sid&amp;who=$uid\">»My Download Links($noi[0])</a><br/>";
      
    $noi mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_ignore WHERE name='".$uid."'"));
      echo 
    "<a href=\"lists.php?action=ignl&amp;sid=$sid\">»Ignore List($noi[0])</a><br/>";
      
    $noi mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_gbook WHERE gbowner='".$uid."'"));
      echo 
    "<a href=\"lists.php?action=gbook&amp;sid=$sid&amp;who=$uid\">»Guestbook($noi[0])</a><br/>";
      echo 
    "<a href=\"index.php?action=poll&amp;sid=$sid\">»My Poll</a><br/>";
      
    $noi mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_blogs WHERE bowner='".$uid."'"));
      echo 
    "<a href=\"lists.php?action=blogs&amp;sid=$sid&amp;who=$uid\">»Blogs($noi[0])</a><br/>";
      echo 
    "<a href=\"lists.php?action=chmood&amp;sid=$sid\">»Chatmood</a><br/>";
      echo 
    "<a href=\"lists.php?action=bbcode&amp;sid=$sid\">»BBCode</a><br/>";
      echo 
    "</p>";
      echo 
    "<p align=\"center\">";  
      echo 
    "<b>0 </b><a accesskey=\"0\" href=\"index.php?action=main&amp;sid=$sid\"><img src=\"../images/home.gif\" alt=\"\"/>Home</a>";
      echo 
    "</p>";
      echo 
    "</body>";
    }

    else if(
    $action=="sitethms")
    {
      
    addonline(getuid_sid($sid),"Site Themes","");
      echo 
    "<head>";
      echo 
    "<title>Site Themes</title>";
      
    $thmname=$theme["theme"];
      
    $them=explode("_",$thmname);
      
    $them2=$them[0];
      if(
    $them2=="Custom")
          {
        include(
    "custom_theme.inc.php");
        }else{
      echo 
    "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
        }
      echo 
    "</head>";
      echo 
    "<body>";
      echo 
    "<p align=\"center\">";
      echo 
    "<b>Site Themes</b></p>";
      echo 
    "<p>changing ur site theme will change all the colors of the site eg:<br/>backround, text, links, typing fields etc..<br/>";
      echo 
    "<form action=\"genproc.php?action=updtthme&amp;sid=$sid\" method=\"post\">";
      echo 
    "<select name=\"thms\">";
      echo 
    "<option value=\"white\">White</option>";
      echo 
    "<option value=\"black\">Black</option>";
      echo 
    "<option value=\"red\">Red</option>";
      echo 
    "<option value=\"blue\">Blue</option>";
      echo 
    "<option value=\"green\">Green</option>";
      echo 
    "<option value=\"pink\">Pink</option>";
      echo 
    "<option value=\"cuteyx\">Cuteyx</option>";
      echo 
    "<option value=\"cutey2\">Cuteyx2</option>";
      echo 
    "<option value=\"themaster\">themaster</option>";
      echo 
    "<option value=\"blacknpurple\">Blacknpurple</option>";
      echo 
    "<option value=\"funky\">Funky</option>";
      echo 
    "<option value=\"thedoc\">Thedoc</option>";
      echo 
    "<option value=\"hippie\">Hippie</option>";
      echo 
    "<option value=\"themaster3\">themaster3</option>";
      echo 
    "<option value=\"fluff\">Fluff</option>";
      echo 
    "<option value=\"themasterpink\">Pink n Black</option>";
      echo 
    "<option value=\"Custom\">Make ur own</option>";


      

      echo 
    "</select>";
      echo 
    "<select name=\"size\">";
      echo 
    "<option value=\"small\">Small</option>";
      echo 
    "<option value=\"medium\">Medium</option>";
      echo 
    "<option value=\"large\">Large</option>";
      echo 
    "<option value=\"Custom\">Make ur own</option>";

      echo 
    "</select>";
      echo 
    "<input type=\"Submit\" name=\"submit\" Value=\"Save\"></form>";
      echo 
    "</p>";
      echo 
    "<p align=\"center\">";
      echo 
    "<b>9 </b><a accesskey=\"9\" href=\"index.php?action=cpanel&amp;sid=$sid\">Settings</a><br/>";
      echo 
    "<b>0 </b><a accesskey=\"0\" href=\"index.php?action=main&amp;sid=$sid\"><img src=\"../images/home.gif\" alt=\"\"/>Home</a>";
      echo 
    "</p>";
      echo 
    "</body>";
    }


    else if (
    $action=="lnkcol")

           {
                 
    addonline(getuid_sid($sid),"Site Themes","");

      echo 
    "<head>";

      echo 
    "<title>Site Themes</title>";

      
    $thmname=$theme["theme"];
      
    $them=explode("_",$thmname);
      
    $them2=$them[0];
      if(
    $them2=="Custom")
          {
        include(
    "custom_theme.inc.php");
        }else{
      echo 
    "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
        }
      echo 
    "</head>";

      echo 
    "<body>";

            echo 
    "<p align=\"center\">
            <b>Here You Can Choose the Color of the Links on site<br/>again, try to steer clear of colours you've already used elsewhere.</b></p>"
    ;


        
    $query "select * from xhtml_hex order by color";
        
    $result mysql_query($query);
        
    $num_rows mysql_num_rows($result);
        
    $row mysql_fetch_array($result);

        while (
    $row)
            {
            
    $color $row["color"];
            
    $hex $row["hex"];

            if (
    $hex != "$trcol&& $hex != "$txtco&& $hex != "$meco&& $hex != "$bogc")
                {
            
    $hex str_replace("#","","$hex");
            echo 
    "<p align=\"center\" style=\"background-color: #$hex;\"><a href=\"./index.php?sid=$sid&amp;hex=$hex&amp;action=lnkset\">$color</a></p>";
                }
            
    $row mysql_fetch_array($result);
                       }

            echo 
    "<p align=\"center\" class=\"break\">$breaker";


            echo 
    "<a href=\"index.php?action=main&amp;sid=$sid\"><";
    echo 
    "Home</a></p>";

    echo 
    "</body>";
           }
           
           
    else if (
    $action=="lnkset")
           {
    $hex=$_GET["hex"];

    addonline(getuid_sid($sid),"Site Themes","");

      echo 
    "<head>";

      echo 
    "<title>Site Themes</title>";

      
    $thmname=$theme["theme"];
      
    $them=explode("_",$thmname);
      
    $them2=$them[0];
      if(
    $them2=="Custom")
          {
        include(
    "custom_theme.inc.php");
        }else{
      echo 
    "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
        }
      echo 
    "</head>";

      echo 
    "<body>";

         echo 
    "<p>";
        
    $ncl mysql_query("UPDATE ibwf_users SET lnkcol='".$hex."' WHERE id='".$uid."'");
        echo 
    "Your New Site Link color Has Been Set. You Will See the changes when you return to the home page.<br/>";
        echo 
    "</p>";

        echo 
    "<p>";

        echo 
    "<a href=\"index.php?action=main&amp;sid=$sid\">";
    echo 
    "Home</a>";
      echo 
    "</p>";

          echo 
    "</body>";
           }

    else if (
    $action=="txtsizeset")
           {
    $size=$_POST["size"];

                 
    addonline(getuid_sid($sid),"Site Themes","");

      echo 
    "<head>";

      echo 
    "<title>Site Themes</title>";

      
    $thmname=$theme["theme"];
      
    $them=explode("_",$thmname);
      
    $them2=$them[0];
      if(
    $them2=="Custom")
          {
        include(
    "custom_theme.inc.php");
        }else{
      echo 
    "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
        }
      echo 
    "</head>";

      echo 
    "<body>";

        echo 
    "<p>";
        
    $ncl mysql_query("UPDATE ibwf_users SET txtsize='".$size."' WHERE id='".$uid."'");
        echo 
    "Your New Site text size Has Been Set. You Will See the changes when you return to the home page.<br/>";
        echo 
    "</p>";

        echo 
    "<p>";

        echo 
    "<a href=\"index.php?action=main&amp;sid=$sid\">";
    echo 
    "Home</a>";
      echo 
    "</p>";


        echo 
    "</body>";
           }
    else if (
    $action=="txtcol")

           {

                 
    addonline(getuid_sid($sid),"Site Themes","");

      echo 
    "<head>";

      echo 
    "<title>Site Themes</title>";

      
    $thmname=$theme["theme"];
      
    $them=explode("_",$thmname);
      
    $them2=$them[0];
      if(
    $them2=="Custom")
          {
        include(
    "custom_theme.inc.php");
        }else{
      echo 
    "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
        }
      echo 
    "</head>";

      echo 
    "<body>";

            echo 
    "<p>
            <b>Select the text colour.<br/>please don't pick one similar to your background.</b></p>"
    ;


        
    $query "select * from xhtml_hex order by color";
        
    $result mysql_query($query);
        
    $num_rows mysql_num_rows($result);
        
    $row mysql_fetch_array($result);



        while (
    $row)
            {
            
    $color $row["color"];
            
    $hex $row["hex"];


            if (
    $hex != "$trcol&& $hex != "$txtco&& $hex != "$meco&& $hex != "$bogc")
                {
            
    $hex str_replace("#","","$hex");
            echo 
    "<p align=\"center\" style=\"background-color: #$hex;\"><a href=\"./index.php?sid=$sid&amp;hex=$hex&amp;action=textset\">$color</a></p>";
                }
            
    $row mysql_fetch_array($result);
                       }



            echo 
    "<p>";


            echo 
    "<a href=\"index.php?action=main&amp;sid=$sid\"><img src=\"http://coding-talk.com/images/home.gif\" alt=\"*\"/>";
    echo 
    "Home</a></p>";


    echo 
    "</body>";
           }
           else if (
    $action=="textset")

           {
    $hex=$_GET["hex"];

                 
    addonline(getuid_sid($sid),"Site Themes","");

      echo 
    "<head>";

      echo 
    "<title>Site Themes</title>";

      
    $thmname=$theme["theme"];
      
    $them=explode("_",$thmname);
      
    $them2=$them[0];
      if(
    $them2=="Custom")
          {
        include(
    "custom_theme.inc.php");
        }else{
      echo 
    "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
        }
      echo 
    "</head>";

      echo 
    "<body>";        

        echo 
    "<p>";
        
    $ncl mysql_query("UPDATE ibwf_users SET txtcol='".$hex."' WHERE id='".$uid."'");
        echo 
    "Your New Site Text color Has Been Set. You Will See the changes when you return to the home page.<br/>";
        echo 
    "</p>";

        echo 
    "<p>";

        echo 
    "<a href=\"index.php?action=main&amp;sid=$sid\"><img src=\"http://coding-talk.com/images/home.gif\" alt=\"*\"/>";
    echo 
    "Home</a>";
      echo 
    "</p>";


        echo 
    "</body>";
           }
    else if (
    $action=="bgcol")

           {

                 
    addonline(getuid_sid($sid),"Site Themes","");

      echo 
    "<head>";

      echo 
    "<title>Site Themes</title>";

      
    $thmname=$theme["theme"];
      
    $them=explode("_",$thmname);
      
    $them2=$them[0];
      if(
    $them2=="Custom")
          {
        include(
    "custom_theme.inc.php");
        }else{
      echo 
    "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
        }
      echo 
    "</head>";

      echo 
    "<body>";  

            echo 
    "<p>
            <b>select your background colour, please be aware that you might obscure some text colours when you do this, if it goes a bit west and no colour combination you choose looks right, if you can't see the links, please inform a owner and we'll reset your colours for you.</b></p>"
    ;

        
    $query "select * from xhtml_hex order by color";
        
    $result mysql_query($query);
        
    $num_rows mysql_num_rows($result);
        
    $row mysql_fetch_array($result);




        while (
    $row)
               
            {
            
    $color $row["color"];
            
    $hex $row["hex"];

            if (
    $hex != "$trcol&& $hex != "$txtco&& $hex != "$meco&& $hex != "$bogc")
                {
            
    $hex str_replace("#","","$hex");
            echo 
    "<p align=\"center\" style=\"background-color: #$hex;\"><a href=\"./index.php?sid=$sid&amp;hex=$hex&amp;action=bgcolorset\">$color</a></p>";
                }
            
    $row mysql_fetch_array($result);
                       }



            echo 
    "<p>";


            echo 
    "<a href=\"index.php?action=main&amp;sid=$sid\"><img src=\"http://coding-talk.com/images/home.gif\" alt=\"*\"/>";
    echo 
    "Home</a></p>";


    echo 
    "</body>";
           }
           
    else if (
    $action=="bgcolorset")
    {
        
    $hex=$_GET["hex"];

                 
    addonline(getuid_sid($sid),"Site Themes","");

      echo 
    "<head>";

      echo 
    "<title>Site Themes</title>";

      
    $thmname=$theme["theme"];
      
    $them=explode("_",$thmname);
      
    $them2=$them[0];
      if(
    $them2=="Custom")
          {
        include(
    "custom_theme.inc.php");
        }else{
      echo 
    "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
        }
      echo 
    "</head>";

      echo 
    "<body>";

        echo 
    "<p>";
        
    $ncl mysql_query("UPDATE ibwf_users SET bgcol='".$hex."' WHERE id='".$uid."'");
        echo 
    "Your New Site Background color Has Been Set. You Will See the changes when you return to the home page.<br/>";
        echo 
    "</p>";

        echo 
    "<p>";

        echo 
    "<a href=\"index.php?action=main&amp;sid=$sid\"><img src=\"http://coding-talk.com/images/home.gif\" alt=\"*\"/>";
    echo 
    "Home</a>";
      echo 
    "</p>";


        echo 
    "</body>";
    }       

    else if (
    $action=="altbgcol")

           {

                 
    addonline(getuid_sid($sid),"Site Themes","");

      echo 
    "<head>";

      echo 
    "<title>Site Themes</title>";

      
    $thmname=$theme["theme"];
      
    $them=explode("_",$thmname);
      
    $them2=$them[0];
      if(
    $them2=="Custom")
          {
        include(
    "custom_theme.inc.php");
        }else{
      echo 
    "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
        }
      echo 
    "</head>";

      echo 
    "<body>";


            echo 
    "<p>
            <b>select your Alternate background colour, This color highlights certain parts of the main page in a different color<br/>please be aware that you might obscure some text colours when you do this, if it goes a bit west and no colour combination you choose looks right, if you can't see the links, please inform a owner and we'll reset your colours for you.</b></p>"
    ;

        
    $query "select * from xhtml_hex order by color";
        
    $result mysql_query($query);
        
    $num_rows mysql_num_rows($result);
        
    $row mysql_fetch_array($result);




        while (
    $row)
               
            {
            
    $color $row["color"];
            
    $hex $row["hex"];

            if (
    $hex != "$trcol&& $hex != "$txtco&& $hex != "$meco&& $hex != "$bogc")
                {
            
    $hex str_replace("#","","$hex");
            echo 
    "<p align=\"center\" style=\"background-color: #$hex;\"><a href=\"./index.php?sid=$sid&amp;hex=$hex&amp;action=altbgcolorset\">$color</a></p>";
                }
            
    $row mysql_fetch_array($result);
                       }



            echo 
    "<p>";


            echo 
    "<a href=\"index.php?action=main&amp;sid=$sid\"><img src=\"http://coding-talk.com/images/home.gif\" alt=\"*\"/>";
    echo 
    "Home</a></p>";

    echo 
    "</body>";
           }
           
    else if (
    $action=="altbgcolorset")
    {
        
    $hex=$_GET["hex"];

                 
    addonline(getuid_sid($sid),"Site Themes","");

      echo 
    "<head>";

      echo 
    "<title>Site Themes</title>";

      
    $thmname=$theme["theme"];
      
    $them=explode("_",$thmname);
      
    $them2=$them[0];
      if(
    $them2=="Custom")
          {
        include(
    "custom_theme.inc.php");
        }else{
      echo 
    "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
        }
      echo 
    "</head>";

      echo 
    "<body>";

        echo 
    "<p>";
        
    $ncl mysql_query("UPDATE ibwf_users SET altbg='".$hex."' WHERE id='".$uid."'");
        echo 
    "Your New Alternate Background color Has Been Set. You Will See the changes when you return to the home page.<br/>";
        echo 
    "</p>";

        echo 
    "<p>";

        echo 
    "<a href=\"index.php?action=main&amp;sid=$sid\"><img src=\"http://coding-talk.com/images/home.gif\" alt=\"*\"/>";
    echo 
    "Home</a>";
      echo 
    "</p>";
      echo 
    "</body>";
    }       


    ///////////////////////////////////Clubs Menu

    else if($action=="clmenu")
    {
        
    addonline(getuid_sid($sid),"List Of Clubs","");
        echo 
    "<head>";
        echo 
    "<title>Clubs Menu</title>";
      
    $thmname=$theme["theme"];
      
    $them=explode("_",$thmname);
      
    $them2=$them[0];
      if(
    $them2=="Custom")
          {
        include(
    "custom_theme.inc.php");
        }else{
      echo 
    "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
        }
        echo 
    "</head>";
        echo 
    "<body>";
        echo 
    "<p align=\"center\">";
        echo 
    "<b>Clubs Menu</b>";
        echo 
    "</p>";
        echo 
    "<p>";
        
    $myid getuid_sid($sid);
      echo 
    "<b>1 </b><a accesskey=\"1\" href=\"index.php?action=clubs&amp;sid=$sid\">»All Clubs</a><br/>";
      echo 
    "<b>2 </b><a accesskey=\"2\" href=\"index.php?action=myclub&amp;sid=$sid\">»My Clubs</a><br/>";
      echo 
    "<b>3 </b><a accesskey=\"3\" href=\"lists.php?action=clm&amp;who=$myid&amp;sid=$sid&amp;who=$uid\">»Clubs I'm a member of</a><br/>";
      echo 
    "<b>4 </b><a accesskey=\"4\" href=\"lists.php?action=pclb&amp;sid=$sid&amp;who=$uid\">»Clubs By popularity</a><br/>";
      echo 
    "<b>5 </b><a accesskey=\"5\" href=\"lists.php?action=aclb&amp;sid=$sid&amp;who=$uid\">»Clubs By Activity</a><br/>";
      echo 
    "<b>6 </b><a accesskey=\"6\" href=\"lists.php?action=rclb&amp;sid=$sid&amp;who=$uid\">»5 Random Clubs</a><br/><br/>";
      
    $ncl mysql_fetch_array(mysql_query("SELECT id, name FROM ibwf_clubs ORDER BY created DESC LIMIT 1"));
      echo 
    "The Newest Club Is: <b>* </b><a accesskey=\"*\" href=\"index.php?action=gocl&amp;clid=$ncl[0]&amp;sid=$sid\">".htmlspecialchars($ncl[1])."</a><br/>";
      echo 
    "</p>";
      echo 
    "<p align=\"center\">";
      echo 
    "<b>0 </b><a accesskey=\"0\" href=\"index.php?action=main&amp;sid=$sid\"><img src=\"../images/home.gif\" alt=\"\"/>Home</a>";
      echo 
    "</p>";
      echo 
    "</body>";
    }

    else if(
    $action=="popread")
    {
        echo 
    "<head>";
        echo 
    "<title>Pop-Up Read</title>";
      
    $thmname=$theme["theme"];
      
    $them=explode("_",$thmname);
      
    $them2=$them[0];
      if(
    $them2=="Custom")
          {
        include(
    "custom_theme.inc.php");
        }else{
      echo 
    "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
        }
        echo 
    "</head>";
        echo 
    "<body>";
        echo 
    "<p align=\"center\">";
        
    $lastloc=$_GET["lastloc"];
        
    $pmid=$_GET["pmid"];
       
    $ncl mysql_query("UPDATE ibwf_private SET read='1' WHERE id='".$pmid."'");
      echo 
    "Pm Now Marked As Read Visit Your Inbox To Reply Or delete the message.<br/>";
        echo 
    "</p>";

        echo 
    "<p align=\"center\">";
        if(
    $lastloc=="indxmain"){
        echo 
    "<a href=\"index.php?action=main&amp;sid=$sid\">";
        }else if(
    $lastloc=="cht"){
        
    $rid=$_GET["rid"];
        echo 
    "<a href=\"chat.php?sid=$sid&amp;rid=$rid\">";
        }
        echo 
    "Back To Where You Where Before</a>";
        echo 
    "</p>";
        echo 
    "</body>";
    }

    else if(
    $action=="popenable")
    {
        echo 
    "<head>";
        echo 
    "<title>Enable Pop-Up Msgs</title>";
      
    $thmname=$theme["theme"];
      
    $them=explode("_",$thmname);
      
    $them2=$them[0];
      if(
    $them2=="Custom")
          {
        include(
    "custom_theme.inc.php");
        }else{
      echo 
    "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
        }
        echo 
    "</head>";
        echo 
    "<body>";
        echo 
    "<p align=\"center\">";
       
    $ncl mysql_query("UPDATE ibwf_users SET popmsg='1' WHERE id='".$uid."'");
      echo 
    "Pop-Up PMs Have Now Been Enabled On your Profile.<br/>";
        echo 
    "</p>";
        echo 
    "<p align=\"center\">";
      echo 
    "<b>0 </b><a accesskey=\"0\" href=\"index.php?action=main&amp;sid=$sid\"><img src=\"../images/home.gif\" alt=\"\"/>Home</a>";
        echo 
    "</p>";
        echo 
    "</body>";
    }
    else if(
    $action=="popdisable")
    {
        echo 
    "<head>";
        echo 
    "<title>Disable Pop-Up Msgs</title>";
      
    $thmname=$theme["theme"];
      
    $them=explode("_",$thmname);
      
    $them2=$them[0];
      if(
    $them2=="Custom")
          {
        include(
    "custom_theme.inc.php");
        }else{
      echo 
    "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
        }
        echo 
    "</head>";
        echo 
    "<body>";
        echo 
    "<p align=\"center\">";
        
    $ncl mysql_query("UPDATE ibwf_users SET popmsg='0' WHERE id='".$uid."'");
        echo 
    "Pop-Up PMs Have Now Been Disabled On your Profile.<br/>";
        echo 
    "</p>";
        echo 
    "<p align=\"center\">";
      echo 
    "<b>0 </b><a accesskey=\"0\" href=\"index.php?action=main&amp;sid=$sid\"><img src=\"../images/home.gif\" alt=\"\"/>Home</a>";
        echo 
    "</p>";
        echo 
    "</body>";
    }


    else if(
    $action=="automsgson")
    {
        echo 
    "<head>";
        echo 
    "<title>Enable Auto Msgs</title>";
      
    $thmname=$theme["theme"];
      
    $them=explode("_",$thmname);
      
    $them2=$them[0];
      if(
    $them2=="Custom")
          {
        include(
    "custom_theme.inc.php");
        }else{
      echo 
    "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
        }
        echo 
    "</head>";
        echo 
    "<body>";
        echo 
    "<p align=\"center\">";
        
    $ncl mysql_query("UPDATE ibwf_users SET automsgs='1' WHERE id='".$uid."'");
        echo 
    "Automsgs Have Now Been Enabled.<br/>";
        echo 
    "</p>";
        echo 
    "<p align=\"center\">";
        echo 
    "<b>0 </b><a accesskey=\"0\" href=\"index.php?action=main&amp;sid=$sid\"><img src=\"../images/home.gif\" alt=\"\"/>Home</a>";
        echo 
    "</p>";
        echo 
    "</body>";
    }
    else if(
    $action=="automsgsoff")
    {
        echo 
    "<head>";
        echo 
    "<title>Disable Auto Msgs</title>";
      
    $thmname=$theme["theme"];
      
    $them=explode("_",$thmname);
      
    $them2=$them[0];
      if(
    $them2=="Custom")
          {
        include(
    "custom_theme.inc.php");
        }else{
      echo 
    "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
        }
        echo 
    "</head>";
        echo 
    "<body>";
        echo 
    "<p align=\"center\">";
        
    $ncl mysql_query("UPDATE ibwf_users SET automsgs='0' WHERE id='".$uid."'");
        echo 
    "Automsgs Have Now Been Disabled.<br/>";
        echo 
    "</p>";
        echo 
    "<p align=\"center\">";
        echo 
    "<b>0 </b><a accesskey=\"0\" href=\"index.php?action=main&amp;sid=$sid\"><img src=\"../images/home.gif\" alt=\"\"/>Home</a>";
        echo 
    "</p>";
        echo 
    "</body>";
    }
    else if(
    $action=="rwidc")
    {
        
    addonline(getuid_sid($sid),"My $sitename ID","");
        echo 
    "<head>";
        echo 
    "<title>$sitename Id Card</title>";
      
    $thmname=$theme["theme"];
      
    $them=explode("_",$thmname);
      
    $them2=$them[0];
      if(
    $them2=="Custom")
          {
        include(
    "custom_theme.inc.php");
        }else{
      echo 
    "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
        }
        echo 
    "</head>";
        echo 
    "<body>";
        echo 
    "<p align=\"center\">";
        echo 
    "<b>$sitename ID card</b><br/>";
        
    $uid getuid_sid($sid);
        echo 
    "<img src=\"../rwidc.php?id=$uid\" alt=\"Id Card\"/><br/><br/>";
        echo 
    "This ID card is updated automatically everytime someone request it, the source to your card is $sitename/rwidc.php?id=$uid<br/><br/>";
        echo 
    "you can use it as an avatar in other sites<br/><br/>";
        echo 
    "To look at others cards view the user profile then go to more information&gt;$sitename ID card.";
        echo 
    "</p>";
        echo 
    "<p align=\"center\">";
      echo 
    "<b>0 </b><a accesskey=\"0\" href=\"index.php?action=main&amp;sid=$sid\"><img src=\"../images/home.gif\" alt=\"\"/>Home</a>";
        echo 
    "</p>";
        echo 
    "</body>";
    }

    ///////////////////////////////////My Clubs

    else if($action=="myclub")
    {
        
    addonline(getuid_sid($sid),"My Clubs","");
        echo 
    "<head>";
        echo 
    "<title>My Clubs</title>";
      
    $thmname=$theme["theme"];
      
    $them=explode("_",$thmname);
      
    $them2=$them[0];
      if(
    $them2=="Custom")
          {
        include(
    "custom_theme.inc.php");
        }else{
      echo 
    "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
        }
        echo 
    "</head>";
        echo 
    "<body>";
        echo 
    "<p align=\"center\">";
        echo 
    "<b>My Clubs</b>";
        echo 
    "</p>";
        echo 
    "<p>";
        
    $uid getuid_sid($sid);
        if(
    getplusses($uid)<500)
        {
          echo 
    "Clubs are small communities that users can create, every community should have things in common, for example a community for goths, sex freaks, alocholics, rappers and anythin else you can think of, currently people who have more than 500 plusses can only create clubs, every user can create up to maximum of 3 clubs, to get plusses post in the forums, or invite friends";
        }else{
          
    $uclubs mysql_query("SELECT id, name FROM ibwf_clubs WHERE owner='".$uid."'");
          while(
    $club=mysql_fetch_array($uclubs))
          {
            echo 
    "<a href=\"index.php?action=gocl&amp;clid=$club[0]&amp;sid=$sid\">$club[1]</a>";
            echo 
    ", <a href=\"genproc.php?action=dlcl&amp;clid=$club[0]&amp;sid=$sid\">[DELETE]</a><br/><br/>";
          }
          
    $noi mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_clubs WHERE owner='".$uid."'"));
          if(
    $noi[0]<3)
          {
          echo 
    "<b>1 </b><a accesskey=\"1\" href=\"index.php?action=addcl&amp;sid=$sid\">Add Club</a>";
          }
        }
        echo 
    "</p>";
        echo 
    "<p align=\"center\">";
      echo 
    "<b>0 </b><a accesskey=\"0\" href=\"index.php?action=main&amp;sid=$sid\"><img src=\"../images/home.gif\" alt=\"\"/>Home</a>";
        echo 
    "</p>";
        echo 
    "</body>";
    }

    ///////////////////////////////////My Clubs

    else if($action=="clubs")
    {
        
    addonline(getuid_sid($sid),"My Clubs","");
        
        echo 
    "<head>";
        echo 
    "<title>My Clubs List</title>";
      
    $thmname=$theme["theme"];
      
    $them=explode("_",$thmname);
      
    $them2=$them[0];
      if(
    $them2=="Custom")
          {
        include(
    "custom_theme.inc.php");
        }else{
      echo 
    "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
        }    echo 
    "</head>";
        echo 
    "<body>";
        echo 
    "<p align=\"center\">";
        echo 
    "<b>Clubs List</b>";
        echo 
    "</p>";
        
    //////ALL LISTS SCRIPT <<

        
    if($page=="" || $page<=0)$page=1;
        
    $noi mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_clubs"));
        
    $num_items $noi[0]; //changable
        
    $items_per_page5;
        
    $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, owner, description, created FROM ibwf_clubs ORDER BY created DESC LIMIT $limit_start$items_per_page";


        echo 
    "<p>";
        
    $items mysql_query($sql);
        if(
    mysql_num_rows($items)>0)
        {
        while (
    $item mysql_fetch_array($items))
        {
            
    $item[1]=htmlspecialchars($item[1]);
            
    $mems mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_clubmembers WHERE clid='".$item[0]."' AND accepted='1'"));
          
    $lnk "<a href=\"index.php?action=gocl&amp;clid=$item[0]&amp;sid=$sid\">$item[1]($mems[0])</a> <small>Owner: <a href=\"index.php?action=viewuser&amp;who=$item[2]&amp;sid=$sid\">".getnick_uid($item[2])."</a></small>";
          echo 
    "$lnk<br/><small>";
          echo 
    htmlspecialchars($item[3])."<br/>Creation Date: (".date("d/m/y"$item[4]).")</small><br/><br/>";
        }
        }
        echo 
    "</p>";
        echo 
    "<p align=\"center\">";
        if(
    $page>1)
        {
          
    $ppage $page-1;
          echo 
    "<a href=\"index.php?action=$action&amp;page=$ppage&amp;sid=$sid&amp;view=$view\">«PREV</a> ";
        }
        if(
    $page<$num_pages)
        {
          
    $npage $page+1;
          echo 
    "<a href=\"index.php?action=$action&amp;page=$npage&amp;sid=$sid&amp;view=$view\">Next»</a>";
        }
        echo 
    "<br/>$page/$num_pages<br/>";
        if(
    $num_pages>2)
        {
            
    $rets "<form action=\"index.php\" method=\"get\">";
            
    $rets .= "<input name=\"page\" style=\"-wap-input-format: '*N'\" size=\"3\"/>";
            
    $rets .= "<input type=\"hidden\" name=\"action\" value=\"$action\"/>";
            
    $rets .= "<input type=\"hidden\" name=\"sid\" value=\"$sid\"/>";
            
    $rets .= "<input type=\"submit\" value=\"Go To Page\"/>";
            
    $rets .= "</form>";

            echo 
    $rets;
        }
        echo 
    "</p>";
        echo 
    "<p align=\"center\">";
      echo 
    "<b>0 </b><a accesskey=\"0\" href=\"index.php?action=main&amp;sid=$sid\"><img src=\"../images/home.gif\" alt=\"\"/>Home</a>";
        echo 
    "</p>";
        echo 
    "</body>";
    }

    else if(
    $action=="gocl")
    {
      
    $clid $_GET["clid"];
      
    $clinfo mysql_fetch_array(mysql_query("SELECT name, owner, description, rules, logo, plusses, created FROM ibwf_clubs WHERE id='".$clid."'"));
        
    addonline(getuid_sid($sid),"Nosing At A Club","");
        
    $clnm htmlspecialchars($clinfo[0]);
        echo 
    "<head>";
        echo 
    "<title>$Clnm</title>";
      
    $thmname=$theme["theme"];
      
    $them=explode("_",$thmname);
      
    $them2=$them[0];
      if(
    $them2=="Custom")
          {
        include(
    "custom_theme.inc.php");
        }else{
      echo 
    "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
        }    echo 
    "</head>";
        echo 
    "<body>";
        echo 
    "<p align=\"center\">";
        echo 
    "<b>$clnm</b><br/>";
        if(
    trim($clinfo[4])=="")
        {
          echo 
    "<img src=\"../images/logo.gif\" alt=\"logo\"/>";
        }else{
            echo 
    "<img src=\"$clinfo[4]\" alt=\"logo\"/>";
        }
        echo 
    "</p>";
        echo 
    "<p>";
        echo 
    "Club ID: <b>$clid</b><br/>";
        
    $uid getuid_sid($sid);
        
    $cango mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_clubmembers WHERE clid='".$clid."' AND uid='".$uid."' AND accepted='1'"));
        echo 
    "Owner: <a href=\"index.php?action=viewuser&amp;who=$clinfo[1]&amp;sid=$sid\">".getnick_uid($clinfo[1])."</a><br/>";
          
    $mems mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_clubmembers WHERE clid='".$clid."' AND accepted='1'"));
          echo 
    "Members: <a href=\"lists.php?action=clmem&amp;sid=$sid&amp;clid=$clid\">$mems[0]</a><br/>";
          echo 
    "Created On: ".date("d/m/y"$clinfo[6])."<br/>";
          echo 
    "Plusses credit: $clinfo[5]<br/>";
          
    $mod mysql_fetch_array(mysql_query("SELECT moderation FROM ibwf_clubs WHERE id='".$clid."'"));
          
    $fid mysql_fetch_array(mysql_query("SELECT id FROM ibwf_forums WHERE clubid='".$clid."'"));
          
    $rid mysql_fetch_array(mysql_query("SELECT id FROM ibwf_rooms WHERE clubid='".$clid."'"));
          
    $tps mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_topics WHERE fid='".$fid[0]."'"));
          
    $pss mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_posts a INNER JOIN ibwf_topics b ON a.tid = b.id WHERE b.fid='".$fid[0]."'"));
          
        if(
    $cango[0]>0||(isadmin($uid)&&$mod[0]==1))
        {
            
    $noa mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_announcements WHERE clid='".$clid."'"));
            echo 
    "<br/><b>1 </b><a accesskey=\"1\" href=\"lists.php?action=annc&amp;sid=$sid&amp;clid=$clid\"><img src=\"../images/annc.gif\" alt=\"!\"/>Announcements($noa[0])</a><br/>";
            
    $noa mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_chat WHERE rid='".$rid[0]."'"));
            echo 
    "<b>2 </b><a accesskey=\"2\" href=\"chat.php?sid=$sid&amp;rid=$rid[0]\"><img src=\"../images/chat.gif\" alt=\"*\"/>$clnm Chat($noa[0])</a><br/>";
            echo 
    "<b>3 </b><a accesskey=\"3\" href=\"index.php?action=viewfrm&amp;sid=$sid&amp;fid=$fid[0]\"><img src=\"../images/1.gif\" alt=\"*\"/>$clnm Forum($tps[0]/$pss[0])</a><br/><br/>";
          
    $ismem mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_clubmembers WHERE clid='".$clid."' AND uid='".getuid_sid($sid)."'"));
          
          if(
    $ismem[0]>0)
          {
             
    //unjoin 
             
    if($clinfo[1]!=$uid)
             {
                echo 
    "<b>4 </b><a accesskey=\"4\" href=\"genproc.php?action=unjc&amp;sid=$sid&amp;clid=$clid\">Unjoin Club</a>";
             }
          }else{
             echo 
    "<b>4 </b><a accesskey=\"4\" href=\"genproc.php?action=reqjc&amp;sid=$sid&amp;clid=$clid\">Join Now!</a>";
          }
          if(
    isowner(getuid_sid($sid)))
          {
             echo 
    "<br/><b>5 </b><a accesskey=\"5\" href=\"admincp.php?action=club&amp;sid=$sid&amp;clid=$clid\">Admin Tools</a>";
          }
            if(
    $clinfo[1]==$uid)
          {
            
    //club owner
            
    $mems mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_clubmembers WHERE clid='".$clid."' AND accepted='0'"));
            echo 
    "<br/><b>6 </b><a accesskey=\"6\" href=\"lists.php?action=clreq&amp;sid=$sid&amp;clid=$clid\">»Requests($mems[0])</a><br/>";
          }
        }else{
          echo 
    "Topics: <b>$tps[0]</b>, Posts: <b>$pss[0]</b><br/>";
          echo 
    "<b>Description:</b><br/>";
          echo 
    htmlspecialchars($clinfo[2]);
          echo 
    "<br/><br/>";
          echo 
    "<b>Rules:</b><br/>";
          echo 
    htmlspecialchars($clinfo[3]);
          echo 
    "<br/><br/>";
          echo 
    "Seems Good? <b>1 </b><a accesskey=\"1\" href=\"genproc.php?action=reqjc&amp;sid=$sid&amp;clid=$clid\">Join Now!</a>";
        }
        echo 
    "</p>";
        echo 
    "<p align=\"center\">";
        echo 
    "<b>9 </b><a accesskey=\"9\" href=\"index.php?action=clubs&amp;sid=$sid\">Clubs list</a><br/>";
      echo 
    "<b>0 </b><a accesskey=\"0\" href=\"index.php?action=main&amp;sid=$sid\"><img src=\"../images/home.gif\" alt=\"\"/>Home</a>";
      echo 
    "</p>";
        echo 
    "</body>";
    }

    else if(
    $action=="addcl")
    {
        
    addonline(getuid_sid($sid),"Adding A Club","");
        echo 
    "<head>";
        echo 
    "<title>Adding A Club</title>";
      
    $thmname=$theme["theme"];
      
    $them=explode("_",$thmname);
      
    $them2=$them[0];
      if(
    $them2=="Custom")
          {
        include(
    "custom_theme.inc.php");
        }else{
      echo 
    "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
        }    echo 
    "</head>";
        echo 
    "<body>";
        echo 
    "<p align=\"center\">";
        echo 
    "<b>Add Club</b>";
        echo 
    "</p>";
        echo 
    "<p>";
        if(
    getplusses($uid)>=500)
        {
        
    $noi mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_clubs WHERE owner='".$uid."'"));
          if(
    $noi[0]<3)
          {
            echo 
    "<small><img src=\"../images/point.gif\" alt=\"*\"/>All Info are required except the logo<br/>";
            echo 
    "<img src=\"../images/point.gif\" alt=\"*\"/>Beside you, mods can moderate your club forums and chat<br/>";
            echo 
    "<img src=\"../images/point.gif\" alt=\"*\"/>Any leading spaces for description, name, logo, or rules will be removed<br/>";
            echo 
    "<img src=\"../images/point.gif\" alt=\"*\"/>Admins will delete your club and subtract your plusses if you abuse the rules of owning a club<br/>";
            echo 
    "<img src=\"../images/point.gif\" alt=\"*\"/>Admins have the right to delete your club if it wasnt active or if it was useless<br/></small><br/>";
            echo 
    "<form action=\"genproc.php?action=addcl&amp;sid=$sid\" method=\"post\">";
            echo 
    "Club Name:<input name=\"clnm\" maxlength=\"30\"/><br/>";
            echo 
    "Description:<input name=\"clds\" maxlength=\"200\"/><br/>";
            echo 
    "Rules:<input name=\"clrl\" maxlength=\"500\"/><br/>";
            echo 
    "Logo:<input name=\"cllg\" maxlength=\"200\"/><br/>";
            echo 
    "<input type=\"submit\" value=\"Create\"/>";        
           echo 
    "</form>";
          }else{
            echo 
    "You already have 3 clubs";
          }
          }else{

          echo 
    "You cant add any clubs :op ";
          }
        echo 
    "</p>";

        echo 
    "<p align=\"center\">";
      echo 
    "<b>0 </b><a accesskey=\"0\" href=\"index.php?action=main&amp;sid=$sid\"><img src=\"../images/home.gif\" alt=\"\"/>Home</a>";
        echo 
    "</p>";
        echo 
    "</body>";
    }
    ///////////////////////////////////Search

    else if($action=="search")
    {
        
    addonline(getuid_sid($sid),"Searching For Something","");
        echo 
    "<head>";
        echo 
    "<title>Search Menu</title>";
      
    $thmname=$theme["theme"];
      
    $them=explode("_",$thmname);
      
    $them2=$them[0];
      if(
    $them2=="Custom")
          {
        include(
    "custom_theme.inc.php");
        }else{
      echo 
    "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
        }    echo 
    "</head>";
        echo 
    "<body>";
        echo 
    "<p align=\"center\">";
        echo 
    "<img src=\"../images/search.gif\" alt=\"*\"/><br/>";
        echo 
    "<b>Search Menu</b>";
        echo 
    "</p>";
        echo 
    "<p>";
        echo 
    "<b>1 </b><a accesskey=\"1\" href=\"search.php?action=tpc&amp;sid=$sid\">»In Topics</a><br/>";
        echo 
    "<b>2 </b><a accesskey=\"2\" href=\"search.php?action=blg&amp;sid=$sid\">»In Blogs</a><br/>";
        echo 
    "<b>3 </b><a accesskey=\"3\" href=\"search.php?action=nbx&amp;sid=$sid\">»In My Inbox</a><br/>";
        echo 
    "<b>4 </b><a accesskey=\"4\" href=\"search.php?action=clb&amp;sid=$sid\">»In Clubs</a><br/><br/>";
       echo 
    "Find Members:<br/>";
        echo 
    "<b>5 </b><a accesskey=\"5\" href=\"search.php?action=mbrn&amp;sid=$sid\">»In Nicknames</a><br/>";
       
    //echo "<b>6 </b><a accesskey=\"6\" href=\"search.php?action=mbrl&amp;sid=$sid\">»In Location</a><br/>";
       //echo "<b>7 </b><a accesskey=\"7\" href=\"search.php?action=mbrs&amp;sid=$sid\">»By sex orientation</a><br/>";
       
    echo "More search options for members are to come<br/>";
        echo 
    "<br/><small>or you can just type the Username of the member and view its profile</small><br/>";
        echo 
    "<br/>Username:<br/>";
    echo 
    "<form action=\"index.php?action=viewuser&amp;sid=$sid\" method=\"post\">";
        echo 
    "<br/><input name=\"mnick\" maxlength=\"15\"/><br/>";
    echo 
    "<input type=\"submit\" value=\"View\"/>";
        echo 
    "</form>";

      echo 
    "</p>";

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

      echo 
    "<b>0 </b><a accesskey=\"0\" href=\"index.php?action=main&amp;sid=$sid\"><img src=\"../images/home.gif\" alt=\"\"/>Home</a>";
      echo 
    "</p>";
        echo 
    "</body>";
    }

    ///////////////////////////////////Settings

    else if($action=="uset")
    {
      
    addonline(getuid_sid($sid),"User Settings","");
      echo 
    "<head>";
      echo 
    "<title>User Settings</title>";
      
    $thmname=$theme["theme"];
      
    $them=explode("_",$thmname);
      
    $them2=$them[0];
      if(
    $them2=="Custom")
          {
        include(
    "custom_theme.inc.php");
        }else{
      echo 
    "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
        }  echo 
    "</head>";
      echo 
    "<body>";
      
    $uid getuid_sid($sid);
      
    $avat getavatar($uid);
      
    $email mysql_fetch_array(mysql_query("SELECT email FROM ibwf_users WHERE id='".$uid."'"));
      
    $bdy mysql_fetch_array(mysql_query("SELECT birthday FROM ibwf_users WHERE id='".$uid."'"));
      
    $uloc mysql_fetch_array(mysql_query("SELECT location FROM ibwf_users WHERE id='".$uid."'"));
      
    $usig mysql_fetch_array(mysql_query("SELECT signature FROM ibwf_users WHERE id='".$uid."'"));
      
    $sx mysql_fetch_array(mysql_query("SELECT sex FROM ibwf_users WHERE id='".$uid."'"));
      
    $uloc[0] = htmlspecialchars($uloc[0]);
      echo 
    "<p align=\"center\">";
      echo 
    "<b>Settings</b>";
      echo 
    "</p>";
      echo 
    "<p>";
      echo 
    "<form action=\"genproc.php?action=uprof&amp;sid=$sid\" method=\"post\">";
      echo 
    "Profile Pic: <input name=\"savat\" maxlength=\"100\" value=\"$avat\"/><br/>";
      echo 
    "E-Mail: <input name=\"semail\" maxlength=\"100\" value=\"$email[0]\"/><br/>";
      echo 
    "Birthday(YYYY-MM-DD): <input name=\"ubday\" maxlength=\"50\" value=\"$bdy[0]\"/><br/>";
      echo 
    "Location: <input name=\"uloc\" maxlength=\"50\" value=\"$uloc[0]\"/><br/>";
      echo 
    "Info: <input name=\"usig\" maxlength=\"100\" value=\"$usig[0]\"/><br/>";
      echo 
    "Sex: <select name=\"usex\" value=\"$sx[0]\">";
      echo 
    "<option value=\"M\">Male</option>";
      echo 
    "<option value=\"F\">Female</option>";
      echo 
    "</select><br/>";
      echo 
    "<input type=\"submit\" value=\"Update\"/>";
      echo 
    "</form>";
      echo 
    "</p>";
      echo 
    "<p align=\"center\">";
      echo 
    "<b>9 </b><a accesskey=\"9\" href=\"index.php?action=cpanel&amp;sid=$sid\">Settings</a><br/>";
      echo 
    "<b>0 </b><a accesskey=\"0\" href=\"index.php?action=main&amp;sid=$sid\"><img src=\"../images/home.gif\" alt=\"\"/>Home</a>";
      echo 
    "</p>";
      echo 
    "</body>";
    }

    ///////////////////////////////////Settings

    else if($action=="chngpass")
    {
      
    addonline(getuid_sid($sid),"User Settings","");
      echo 
    "<head>";
      echo 
    "<title>User Settings</title>";
      
    $thmname=$theme["theme"];
      
    $them=explode("_",$thmname);
      
    $them2=$them[0];
      if(
    $them2=="Custom")
          {
        include(
    "custom_theme.inc.php");
        }else{
      echo 
    "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
        }
      echo 
    "</head>";
      echo 
    "<body>";
      echo 
    "<p align=\"center\">";
      echo 
    "<b>Change Password</b>";
      echo 
    "</p>";
      echo 
    "<p>";
      echo 
    "<form action=\"genproc.php?action=upwd&amp;sid=$sid\" method=\"post\">";
      echo 
    "Old Password: <input type=\"password\" name=\"opwd\" style=\"-wap-input-format: '*x'\" maxlength=\"15\"/><br/>";
      echo 
    "Password: <input type=\"password\" name=\"npwd\" style=\"-wap-input-format: '*x'\" maxlength=\"15\"/><br/>";
      echo 
    "Password again: <input type=\"password\" name=\"cpwd\" style=\"-wap-input-format: '*x'\" maxlength=\"15\"/><br/>";
      echo 
    "<input type=\"submit\" value=\"Change\"/>";
      echo 
    "</form><br/>";
      echo 
    "<b>0 </b><a accesskey=\"0\" href=\"index.php?action=main&amp;sid=$sid\"><img src=\"../images/home.gif\" alt=\"\"/>Home</a>";
      echo 
    "</p>";
    }

    ///////////////////////////////////Poll Topic
    else if($action=="poll")
    {
        
    addonline(getuid_sid($sid),"Administrating Poll","");
        echo 
    "<head>";
        echo 
    "<title>Your Poll</title>";
      
    $thmname=$theme["theme"];
      
    $them=explode("_",$thmname);
      
    $them2=$them[0];
      if(
    $them2=="Custom")
          {
        include(
    "custom_theme.inc.php");
        }else{
      echo 
    "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
        }    echo 
    "</head>";
        echo 
    "<body>";
        echo 
    "<p>";
        
    $uid getuid_sid($sid);
        if(
    getplusses($uid)<50)
        {
          echo 
    "Minimum plusses required to administrate your poll is 50 plusses";
        }else{
            
    $pid mysql_fetch_array(mysql_query("SELECT pollid FROM ibwf_users WHERE id='".$uid."'"));
            if(
    $pid[0] == 0)
            {
              echo 
    "<b>1 </b><a accesskey=\"1\" href=\"index.php?action=crpoll&amp;sid=$sid\">Create Poll</a>";
            }else{
              echo 
    "<b>2 </b><a accesskey=\"2\" href=\"index.php?action=viewpl&amp;sid=$sid&amp;who=$uid\">View Your Poll</a><br/>";
                echo 
    "<b>3 </b><a accesskey=\"3\" href=\"genproc.php?action=dlpoll&amp;sid=$sid\">Delete Your Poll</a><br/>";
            }
        }
        echo 
    "</p>";
        
        echo 
    "<p align=\"center\">";

      echo 
    "<b>0 </b><a accesskey=\"0\" href=\"index.php?action=main&amp;sid=$sid\"><img src=\"../images/home.gif\" alt=\"\"/>Home</a>";
      echo 
    "</p>";
        echo 
    "</body>";
        
    }else if(
    $action=="crpoll")
    {
        
    addonline(getuid_sid($sid),"Creating A New Poll","");
        echo 
    "<head>";
        echo 
    "<title>Create Poll</title>";
      
    $thmname=$theme["theme"];
      
    $them=explode("_",$thmname);
      
    $them2=$them[0];
      if(
    $them2=="Custom")
          {
        include(
    "custom_theme.inc.php");
        }else{
      echo 
    "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
        }    echo 
    "</head>";
        echo 
    "<body>";
        echo 
    "<p>";
        if(
    getplusses(getuid_sid($sid))>=50)
        {
        
    $pid mysql_fetch_array(mysql_query("SELECT pollid FROM ibwf_users WHERE id='".$uid."'"));
            if(
    $pid[0] == 0)
            {
    echo 
    "<form action=\"genproc.php?action=crpoll&amp;sid=$sid\" method=\"post\">";

              echo 
    "Question:<input name=\"pques\" maxlength=\"250\"/><br/>";
              echo 
    "Option 1:<input name=\"opt1\" maxlength=\"100\"/><br/>";
              echo 
    "Option 2:<input name=\"opt2\" maxlength=\"100\"/><br/>";
              echo 
    "Option 3:<input name=\"opt3\" maxlength=\"100\"/><br/>";
              echo 
    "Option 4:<input name=\"opt4\" maxlength=\"100\"/><br/>";
              echo 
    "Option 5:<input name=\"opt5\" maxlength=\"100\"/><br/>";
    echo 
    "<input type=\"submit\" value=\"Create\"/>";          
    echo 
    "</form>";
              }else{
                echo 
    "<img src=\"../images/notok.gif\" alt=\"x\"/>You already have a poll, delete your current one before adding a new one";
              }
              }else{
                echo 
    "<img src=\"../images/notok.gif\" alt=\"x\"/>You should have at least 50 plusses to create a poll";
              }
        echo 
    "</p>";

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

      echo 
    "<b>0 </b><a accesskey=\"0\" href=\"index.php?action=main&amp;sid=$sid\"><img src=\"../images/home.gif\" alt=\"\"/>Home</a>";
      echo 
    "</p>";
        echo 
    "</body>";
    }
    else if(
    $action=="pws")
    {
        
    addonline(getuid_sid($sid),"My Personal Wap Site","");
        echo 
    "<head>";
        echo 
    "<title>My Personal Wap Site</title>";
      
    $thmname=$theme["theme"];
      
    $them=explode("_",$thmname);
      
    $them2=$them[0];
      if(
    $them2=="Custom")
          {
        include(
    "custom_theme.inc.php");
        }else{
      echo 
    "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
        }    echo 
    "</head>";
        echo 
    "<body>";
        echo 
    "<p>";
        echo 
    "»Welcome Image<br/>";
       echo 
    "<small>The image on main page<br/>";
       echo 
    "In Image field: type smilie code for smilie like -hi-, the image URL for external image, leave blank for other options</small><br/>";
       echo 
    "<form action=\"genproc.php?action=pws&amp;sid=$sid\" method=\"post\">";
       echo 
    "<select name=\"imgt\">";
       echo 
    "<option value=\"idc\">My ID Card</option>";
       echo 
    "<option value=\"avt\">My Current Avatar</option>";
       echo 
    "<option value=\"sml\">Smilie</option>";
       echo 
    "<option value=\"ilk\">Image URL</option>";
       echo 
    "</select><br/>";
       echo 
    "Image:<input name=\"imgo\" maxlength=\"200\"/><br/><br/>";
       echo 
    "»Welcome Message<br/>";
       echo 
    "<small>The message that appears on first page of your site, smilies are allowed</small><br/>";
       echo 
    "Message:<input name=\"smsg\" maxlength=\"250\"/><br/><br/>";
       echo 
    "»Theme<br/>";
       echo 
    "<small>Themes available only on phones supporting XHTML</small><br/>";
       echo 
    "<select name=\"thms\">";
       
    $themes mysql_query("SELECT id, name FROM ibwf_themes");
       while (
    $theme mysql_fetch_array($themes))
       {
       echo 
    "<option value=\"$theme[0]\">".htmlspecialchars($theme[1])."</option>";
       }
       echo 
    "</select><br/>";
       echo 
    "<input type=\"Submit\" Name=\"Update\" Value=\"Update\"></form>";
        echo 
    "</p>";
        echo 
    "<p align=\"center\">";
      echo 
    "<b>0 </b><a accesskey=\"0\" href=\"index.php?action=main&amp;sid=$sid\"><img src=\"../images/home.gif\" alt=\"\"/>Home</a>";
           echo 
    "</p>";
        echo 
    "</body>";
    }

    else if(
    $action=="pltpc")
    {
      
    $tid $_GET["tid"];
        
    addonline(getuid_sid($sid),"Creating A Poll","");
        echo 
    "<head>";
        echo 
    "<title>Creating A Poll</title>";
      
    $thmname=$theme["theme"];
      
    $them=explode("_",$thmname);
      
    $them2=$them[0];
      if(
    $them2=="Custom")
          {
        include(
    "custom_theme.inc.php");
        }else{
      echo 
    "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
        }    echo 
    "</head>";
        echo 
    "<body>";
        echo 
    "<p>";
        if((
    getplusses(getuid_sid($sid))>=500)||ismod($uid))
        {
        
    $pid mysql_fetch_array(mysql_query("SELECT pollid FROM ibwf_topics WHERE id='".$tid."'"));
            if(
    $pid[0] == 0)
            {
           echo 
    "<form action=\"genproc.php?action=pltpc&amp;sid=$sid&amp;tid=$tid\" method=\"post\">";
              echo 
    "Question:<input name=\"pques\" maxlength=\"250\"/><br/>";
              echo 
    "Option 1:<input name=\"opt1\" maxlength=\"100\"/><br/>";
              echo 
    "Option 2:<input name=\"opt2\" maxlength=\"100\"/><br/>";
              echo 
    "Option 3:<input name=\"opt3\" maxlength=\"100\"/><br/>";
              echo 
    "Option 4:<input name=\"opt4\" maxlength=\"100\"/><br/>";
              echo 
    "Option 5:<input name=\"opt5\" maxlength=\"100\"/><br/>";
              echo 
    "<input type=\"Submit\" name=\"Create\" Value=\"Create\"></form>";
              }else{
                echo 
    "<img src=\"../images/notok.gif\" alt=\"x\"/>The topic already have a poll";
              }
              }else{
                echo 
    "<img src=\"../images/notok.gif\" alt=\"x\"/>You should have at least 500 plusses to create a poll";
              }
        echo 
    "</p>";

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

      echo 
    "<b>0 </b><a accesskey=\"0\" href=\"index.php?action=main&amp;sid=$sid\"><img src=\"../images/home.gif\" alt=\"\"/>Home</a>";
      echo 
    "</p>";
        echo 
    "</body>";
    }

    else if(
    $action=="stats")
    {
        
    addonline(getuid_sid($sid),"Site stats","index.php?action=stats");
        echo 
    "<head>";
        echo 
    "<title>Site Stats</title>";
      
    $thmname=$theme["theme"];
      
    $them=explode("_",$thmname);
      
    $them2=$them[0];
      if(
    $them2=="Custom")
          {
        include(
    "custom_theme.inc.php");
        }else{
      echo 
    "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
        }    echo 
    "</head>";
        echo 
    "<body>";
        echo 
    popup($sid);
        echo 
    "<p align=\"center\">";
        
    $norm mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_users"));
        echo 
    "Registered Members: <b>$norm[0]</b> ";
        
    $memid mysql_fetch_array(mysql_query("SELECT id, name  FROM ibwf_users ORDER BY regdate DESC LIMIT 0,1"));
        echo 
    "The Newsest Member is: <b><a href=\"index.php?action=viewuser&amp;who=$memid[0]&amp;sid=$sid\">$memid[1]</a></b><br/>";
        
    $mols mysql_fetch_array(mysql_query("SELECT name, value FROM ibwf_settings WHERE id='2'"));
        echo 
    "Most Users Online: <b>$mols[1]</b> Members on $mols[0]<br/>";
        
    $mols mysql_fetch_array(mysql_query("SELECT ppl, dtm FROM ibwf_mpot WHERE ddt='".date("d m y")."'"));
        echo 
    "Most Users Online(<a href=\"lists.php?action=moto&amp;sid=$sid\"> For today only</a>): <b>$mols[0]</b> Members at $mols[1]<br/>";
        
    $tm24 time() - (24*60*60);
        
    $aut mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_users WHERE lastact>'".$tm24."'"));
        echo 
    mysql_error();
        echo 
    "Active users today <b>$aut[0]</b><br/>";
        
    $notc mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_topics"));
        
    $nops mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_posts"));
        echo 
    "Number of Topics: <b>$notc[0]</b> - Number of Posts: <b>$nops[0]</b><br/>";
        
    $nopm mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_private"));
        echo 
    "Number of Inboxes: <b>$nopm[0]</b><br/>";
        
    $nopm mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_popups"));
        echo 
    "Number of Popups: <b>$nopm[0]</b><br/>";
        
    $nopm mysql_fetch_array(mysql_query("SELECT value FROM ibwf_settings WHERE name='Counter'"));
        echo 
    "Counter: <b>$nopm[0]</b>";
         echo 
    "</p>";
        echo 
    "<p>";
        
    //echo "<a href=\"index.php?action=l24&amp;sid=$sid\">»Whats Happened Here In Last 24 Hours</a><br/>";
        
    $norm mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_users"));
        echo 
    "<a href=\"lists.php?action=members&amp;sid=$sid\">»Members($norm[0])</a><br/>";
        
    $norm mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_users WHERE sex='M'"));

        echo 
    "<a href=\"lists.php?action=males&amp;sid=$sid\">-»Males($norm[0])</a><br/>";
        
    $norm mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_users WHERE sex='F'"));
        echo 
    "<a href=\"lists.php?action=fems&amp;sid=$sid\">-»Females($norm[0])</a><br/>";

        
    $tbday=mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_users where month(`birthday`) = month(curdate()) and dayofmonth(`birthday`) = dayofmonth(curdate());"));
        echo 
    "<a href=\"lists.php?action=bdy&amp;sid=$sid\">»Today's Birthday($tbday[0])</a><br/>";
        
        
    $noi mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_blogs"));
        echo 
    "<a href=\"lists.php?action=allbl&amp;sid=$sid\">»Blogs($noi[0])</a><br/>";
        
    $noi mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_users WHERE pollid>'0'"));
        echo 
    "<a href=\"lists.php?action=polls&amp;sid=$sid\">»Polls($noi[0])</a><br/>";
        echo 
    "<a href=\"lists.php?action=topp&amp;sid=$sid\">»Top Posters</a><br/>";
        echo 
    "<a href=\"lists.php?action=tchat&amp;sid=$sid\">»Top Chatters</a><br/>";
        echo 
    "<a href=\"lists.php?action=tgame&amp;sid=$sid\">»Top Gamers</a><br/>";
        echo 
    "<a href=\"lists.php?action=pviews&amp;sid=$sid\">»Top Profile Views</a><br/>";
        echo 
    "<a href=\"lists.php?action=tshout&amp;sid=$sid\">»Top Shouters</a><br/>";
        
    $nobr=mysql_fetch_array(mysql_query("SELECT COUNT(DISTINCT browserm) FROM ibwf_users WHERE browserm IS NOT NULL "));
        echo 
    "<a href=\"lists.php?action=brows&amp;sid=$sid\">»Browsers($nobr[0])</a><br/>";
        
    $noi mysql_fetch_array(mysql_query("SELECT count(*) FROM ibwf_judges"));
        echo 
    "<a href=\"lists.php?action=judg&amp;sid=$sid\">»Battles Judges($noi[0])</a>";

       
        echo 
    "</p>";
        echo 
    "<p align=\"center\">";
          echo 
    "<b>6 </b><a accesskey=\"6\" href=\"inbox.php?action=main&amp;sid=$sid\">Inbox</a><br/>";
             echo 
    "<b>7 </b><a accesskey=\"7\" href=\"lists.php?action=buds&amp;sid=$sid\">BuddyList</a><br/>";
             echo 
    "<b>8 </b><a accesskey=\"8\" href=\"index.php?action=chat&amp;sid=$sid\">Chat</a><br/>";
            echo 
    forumlink($sid,9);

      echo 
    "<b>0 </b><a accesskey=\"0\" href=\"index.php?action=main&amp;sid=$sid\"><img src=\"../images/home.gif\" alt=\"\"/>Home</a>";
      echo 
    "</p>";
        echo 
    "</body>";
    }

    else if(
    $action=="l24")
    {
        
    addonline(getuid_sid($sid),"Site stats","");
        echo 
    "<head>";
        echo 
    "<title>Site Stats</title>";
      
    $thmname=$theme["theme"];
      
    $them=explode("_",$thmname);
      
    $them2=$them[0];
      if(
    $them2=="Custom")
          {
        include(
    "custom_theme.inc.php");
        }else{
      echo 
    "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
        }    echo 
    "</head>";
        echo 
    "<body>";
        echo 
    "<p>";
        
    /////
        
    echo "Things that have happened in $sitename during last 24 hours<br/><br/>";
        
    $tm24 time() - (24*60*60);
        
    $aut mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_users WHERE lastact>'".$tm24."'"));
        echo 
    "Active Members: <b>$aut[0]</b><br/>";
    $aut mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_users WHERE regdate>'".$tm24."'"));
        echo 
    "Registered Members: <b>$aut[0]</b><br/>";
        
    $aut mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_blogs WHERE bgdate>'".$tm24."'"));
        echo 
    "Blogs Created: <b>$aut[0]</b><br/>";
        
    $aut mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_clubmembers WHERE joined>'".$tm24."' AND accepted='1'"));
        echo 
    "Members Joined Clubs: <b>$aut[0]</b><br/>";
        
    $aut mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_clubs WHERE created>'".$tm24."'"));
        echo 
    "Clubs Created: <b>$aut[0]</b><br/>";
        
    $aut mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_buddies WHERE reqdt>'".$tm24."' AND agreed='1'"));
        echo 
    "Buddies Added: <b>$aut[0]</b><br/>";
        
    $aut mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_gbook WHERE dtime>'".$tm24."'"));
        echo 
    "Guestbooks Signed: <b>$aut[0]</b><br/>";
        if(
    ismod(getuid_sid($sid))){
        
    $aut mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_mlog WHERE actdt>'".$tm24."'"));
        echo 
    "ModLog Actions: <b>$aut[0]</b><br/>";
      }
      
    $aut mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_polls WHERE pdt>'".$tm24."'"));
        echo 
    "Polls Added: <b>$aut[0]</b><br/>";
        
    $aut mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_posts WHERE dtpost>'".$tm24."'"));
        echo 
    "Posts: <b>$aut[0]</b><br/>";
        
    $aut mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_private WHERE timesent>'".$tm24."'"));
        echo 
    "PMs Sent: <b>$aut[0]</b><br/>";
        
    $aut mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_shouts WHERE shtime>'".$tm24."'"));
        echo 
    "Shouts: <b>$aut[0]</b><br/>";
        
    $aut mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_topics WHERE crdate>'".$tm24."'"));
        echo 
    "Topics Created: <b>$aut[0]</b><br/>";
        
    $aut mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_vault WHERE pudt>'".$tm24."'"));
        echo 
    "Vault Items Added: <b>$aut[0]</b><br/>;";
        echo 
    "</p>";
        echo 
    "<p align=\"center\">";

    echo 
    "<b>5 </b><a accesskey=\"5\" href=\"index.php?action=stats&amp;sid=$sid\">Statistics</a><br/>";
      echo 
    "<br/><b>6 </b><a accesskey=\"6\" href=\"inbox.php?action=main&amp;sid=$sid\">Inbox</a><br/>";
             echo 
    "<b>7 </b><a accesskey=\"7\" href=\"lists.php?action=buds&amp;sid=$sid\">BuddyList</a><br/>";
             echo 
    "<b>8 </b><a accesskey=\"8\" href=\"index.php?action=chat&amp;sid=$sid\">Chat</a><br/>";
            echo 
    forumlink($sid,9);

      echo 
    "<b>0 </b><a accesskey=\"0\" href=\"index.php?action=main&amp;sid=$sid\"><img src=\"../images/home.gif\" alt=\"\"/>Home</a>";
      echo 
    "</p>";
        echo 
    "</body>";
    }

    //////////////////////////////////View category

    else if($action=="viewcat")
    {

      
    $cid $_GET["cid"];
      
    addonline(getuid_sid($sid),"Bein Delicious In Forums","index.php?action=viewcat&amp;cid=$cid");
      
    $cinfo mysql_fetch_array(mysql_query("SELECT name from ibwf_fcats WHERE id='".$cid."'"));
      echo 
    "<head>";
      echo 
    "<title>$cinfo[0]</title>";
      
    $thmname=$theme["theme"];
      
    $them=explode("_",$thmname);
      
    $them2=$them[0];
      if(
    $them2=="Custom")
          {
        include(
    "custom_theme.inc.php");
        }else{
      echo 
    "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
        }  echo 
    "</head>";
      echo 
    "<body>";
      
    //echo "<div><img src=\"logos/forums.gif\" alt=\"Forums\"/></div>";
      
    echo popup($sid);
      
    $umsg getunreadpm(getuid_sid($sid));
      if(
    $umsg>0)
      {
      echo 
    "<p align=\"center\">";
      echo 
    "<br/><b>6 </b><a href=\"inbox.php?action=main&amp;sid=$sid\">$umsg New Inbox!</a>";
      echo 
    "</p>";
      }
      
    $forums mysql_query("SELECT id, name FROM ibwf_forums WHERE cid='".$cid."' AND clubid='0' ORDER BY position, id, name");
      
    //echo "<b>$cinfo[0]</b></p><br/>";
      
    echo "<p>";
      while(
    $forum mysql_fetch_array($forums))
      {
      
    $notp mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_topics WHERE fid='".$forum[0]."'"));
      
    $nops mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_posts a INNER JOIN ibwf_topics b ON a.tid = b.id WHERE b.fid='".$forum[0]."'"));
      
    $iml "<img src=\"../images/1.gif\" alt=\"*\"/>";
      echo 
    "<a href=\"index.php?action=viewfrm&amp;sid=$sid&amp;fid=$forum[0]\">$iml$forum[1]($notp[0]/$nops[0])</a><br/>";
      
    $lpt mysql_fetch_array(mysql_query("SELECT id, name FROM ibwf_topics WHERE fid='".$forum[0]."' ORDER BY lastpost DESC LIMIT 0,1"));
      
    $nops mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_posts WHERE tid='".$lpt[0]."'"));
      if(
    $nops[0]==0)
      {
      
    $pinfo mysql_fetch_array(mysql_query("SELECT authorid FROM ibwf_topics WHERE id='".$lpt[0]."'"));
      
    $tluid $pinfo[0];
      }else{
      
    $pinfo mysql_fetch_array(mysql_query("SELECT  uid  FROM ibwf_posts WHERE tid='".$lpt[0]."' ORDER BY dtpost DESC LIMIT 0, 1"));
      
    $tluid $pinfo[0];
      }
      
    $tlnm htmlspecialchars($lpt[1]);
      
    $tlnick getnick_uid($tluid);
      
    $tpclnk "<a href=\"index.php?action=viewtpc&amp;sid=$sid&amp;tid=$lpt[0]&amp;go=last\">$tlnm</a>";
      
    $vulnk "<a href=\"index.php?action=viewuser&amp;sid=$sid&amp;who=$tluid\">$tlnick</a>";
      if(
    $pinfo[0]>0)
      {
      echo 
    "Last Post: $tpclnk<br/>By: $vulnk<br/>";
      }
      }
      echo 
    "</p>";
      echo 
    "<p align=\"center\">";
      echo 
    "<b>6 </b><a accesskey=\"6\" href=\"inbox.php?action=main&amp;sid=$sid\">Inbox</a><br/>";
      echo 
    "<b>7 </b><a accesskey=\"7\" href=\"lists.php?action=buds&amp;sid=$sid\">BuddyList</a><br/>";
      echo 
    "<b>8 </b><a accesskey=\"8\" href=\"index.php?action=chat&amp;sid=$sid\">Chat</a><br/>";
      echo 
    forumlink($sid,9);
      echo 
    "<b>0 </b><a accesskey=\"0\" href=\"index.php?action=main&amp;sid=$sid\"><img src=\"../images/home.gif\" alt=\"\"/>Home</a>";
      echo 
    "</p>";
      echo 
    "</body>";
    }

    //////////////////////////////////View Topic

    else if($action=="viewtpc")
    {
      
    $tid $_GET["tid"];
      
    $go $_GET["go"];
      
    addonline(getuid_sid($sid),"Nosing Forum Topic","index.php?action=viewtpc&amp;tid=$tid");
      
    $tfid mysql_fetch_array(mysql_query("SELECT fid FROM ibwf_topics WHERE id='".$tid."'"));
      if(!
    canaccess(getuid_sid($sid), $tfid[0]))
        {
        echo 
    "<head>";
        echo 
    "<title>View Topic</title>";
      
    $thmname=$theme["theme"];
      
    $them=explode("_",$thmname);
      
    $them2=$them[0];
      if(
    $them2=="Custom")
          {
        include(
    "custom_theme.inc.php");
        }else{
      echo 
    "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
        }    
        echo 
    "</head>";
        echo 
    "<body>";
          echo 
    "<p align=\"center\">";
          echo 
    "You Don't Have A Permission To View The Contents Of This Forum<br/><br/>";
          echo 
    "<a href=\"index.php?action=main&amp;sid=$sid\">Home</a>";
          echo 
    "</p>";
          echo 
    "</body>";
          echo 
    "</html>";
          exit();
        }
        
        
    $tinfo mysql_fetch_array(mysql_query("SELECT name, text, authorid, crdate, views, fid, pollid from ibwf_topics WHERE id='".$tid."'"));
        
    $tnm htmlspecialchars($tinfo[0]);
        echo 
    "<head>";
        echo 
    "<title>View Topic</title>";
      
    $thmname=$theme["theme"];
      
    $them=explode("_",$thmname);
      
    $them2=$them[0];
      if(
    $them2=="Custom")
          {
        include(
    "custom_theme.inc.php");
        }else{
      echo 
    "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
        }
            echo 
    "</head>";
        echo 
    "<body>";
        echo 
    popup($sid);
        echo 
    "<p align=\"center\">";
        
    $umsg getunreadpm(getuid_sid($sid));
        if(
    $umsg>0)
        {
        echo 
    "<br/><b>6 </b><a href=\"inbox.php?action=main&amp;sid=$sid\">$umsg New Inbox!</a><br/>";
        }
        
    $num_pages getnumpages($tid);
        if(
    $page==""||$page<1)$page=1;
        if(
    $go!="")$page=getpage_go($go,$tid);
        
    $posts_per_page 5;
        if(
    $page>$num_pages)$page=$num_pages;
        
    $limit_start $posts_per_page *($page-1);
        echo 
    "<b>1 </b><a accesskey=\"1\" href=\"index.php?action=post&amp;sid=$sid&amp;tid=$tid\">Post reply</a>";
        
    $lastlink "<b>3 </b><a accesskey=\"3\" href=\"index.php?action=$action&amp;tid=$tid&amp;sid=$sid&amp;go=last\">Last Page</a>";
        
    $firstlink "<b>2 </b><a accesskey=\"2\" href=\"index.php?action=$action&amp;tid=$tid&amp;sid=$sid&amp;page=1\">First Page</a> ";
        
    $golink "";
        if(
    $page>1)
        {
          
    $golink $firstlink;
        }
        if(
    $page<$num_pages)
        {
          
    $golink .= $lastlink;
        }
        if(
    $golink !="")
        {
          echo 
    "<br/>$golink";
        }
        echo 
    "</p>";
        echo 
    "<p align=\"center\">";
        
    $vws $tinfo[4]+1;
        
    $rpls mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_posts WHERE tid='".$tid."'"));
        echo 
    "Replies: $rpls[0] - Views: $vws<br/>";
        
    ///fm here
        
        
    if($page==1)
        {
          
    $posts_per_page=4;
          
    mysql_query("UPDATE ibwf_topics SET views='".$vws."' WHERE  id='".$tid."'");
          
    $ttext mysql_fetch_array(mysql_query("SELECT authorid, text, crdate, pollid FROM ibwf_topics WHERE id='".$tid."'"));
          
    $unick getnick_uid($ttext[0]);
          if(
    isonline($ttext[0]))
        {
          
    $iml "<img src=\"../images/onl.gif\" alt=\"+\"/>";
        }else{
            
    $iml "<img src=\"../images/ofl.gif\" alt=\"-\"/>";
        }
        
    $usl "<br/><a href=\"index.php?action=viewuser&amp;sid=$sid&amp;who=$ttext[0]\">$iml$unick</a>";
        
    $topt "<a href=\"index.php?action=tpcopt&amp;sid=$sid&amp;tid=$tid\">*</a>";
        if(
    $go==$tid)
        {
          
    $fli "<img src=\"../images/flag.gif\" alt=\"!\"/>";
        }else{
          
    $fli ="";
        }
        
    $pst parsemsg($ttext[1],$sid);
        echo 
    "$usl$fli$pst $topt<br/>";
        
    $dtot date("d-m-y - H:i:s",$ttext[2]);
        echo 
    $dtot;
        echo 
    "<br/>";
        if(
    $ttext[3]>0)
        {
          echo 
    "<b>4 </b><a accesskey=\"4\" href=\"index.php?action=viewtpl&amp;sid=$sid&amp;who=$tid\">POLL</a><br/>";
        }
      }
      if(
    $page>1)
      {
        
    $limit_start--;
      }
      
    $sql "SELECT id, text, uid, dtpost, quote FROM ibwf_posts WHERE tid='".$tid."' ORDER BY dtpost LIMIT $limit_start$posts_per_page";
      
    $posts mysql_query($sql);
      while(
    $post mysql_fetch_array($posts))
      {
        
    $unick getnick_uid($post[2]);
        if(
    isonline($post[2]))
        {
          
    $iml "<img src=\"../images/onl.gif\" alt=\"+\"/>";
        }else{
            
    $iml "<img src=\"../images/ofl.gif\" alt=\"-\"/>";
        }
        
    $usl "<br/><a href=\"index.php?action=viewuser&amp;sid=$sid&amp;who=$post[2]\">$iml$unick</a>";
        
    $pst parsemsg($post[1], $sid);
        
    $topt "<a href=\"index.php?action=pstopt&amp;sid=$sid&amp;pid=$post[0]&amp;page=$page&amp;fid=$tinfo[5]\">*</a>";
        if(
    $post[4]>0)
        {
            
    $qtl "<small><i><a href=\"index.php?action=viewtpc&amp;sid=$sid&amp;tid=$tid&amp;pst=\">(quote:p=blaze,d=16-04-2006)</a></i></small>";
        }
        if(
    $go==$post[0])
        {
          
    $fli "<img src=\"../images/flag.gif\" alt=\"!\"/>";
        }else{
          
    $fli ="";
        }
        echo 
    "$usl$fli$pst $topt<br/>";
        
    $dtot date("d-m-y - H:i:s",$post[3]);
        echo 
    $dtot;
        echo 
    "<br/>";
      }
        
    ///to here
        
    echo "</p>";
        echo 
    "<p align=\"center\">";
        if(
    $page>1)
        {
          
    $ppage $page-1;
          echo 
    "<a href=\"index.php?action=viewtpc&amp;page=$ppage&amp;sid=$sid&amp;tid=$tid\">«PREV</a> ";
        }
        if(
    $page<$num_pages)
        {
          
    $npage $page+1;
          echo 
    "<a href=\"index.php?action=viewtpc&amp;page=$npage&amp;sid=$sid&amp;tid=$tid\">Next»</a>";
        }
        echo 
    "<br/>$page/$num_pages<br/>";
        if(
    $num_pages>2)
        {
          
    $rets "<form action=\"index.php\" method=\"get\">";
       
    $rets .= "<input name=\"page\" style=\"-wap-input-format: '*N'\" size=\"2\"/>";
       
    $rets .= "<input type=\"hidden\" name=\"action\" value=\"$action\"/>";
       
    $rets .= "<input type=\"hidden\" name=\"tid\" value=\"$tid\"/>";
       
    $rets .= "<input type=\"hidden\" name=\"sid\" value=\"$sid\"/>";
       
    $rets .= "<input type=\"Submit\" value=\"Go To Page\" Name=\"Submit\"/></form>";

            echo 
    $rets;
        }
      echo 
    "<br/>";
      echo 
    "<b>1 </b><a href=\"index.php?action=post&amp;sid=$sid&amp;tid=$tid\">Post reply</a>";
      echo 
    "</p>";
      echo 
    "<p align=\"center\">";
      
    $fid $tinfo[5];
      
    $fname getfname($fid);
      
    $cid mysql_fetch_array(mysql_query("SELECT cid FROM ibwf_forums WHERE id='".$fid."'"));
      
    $cinfo mysql_fetch_array(mysql_query("SELECT name FROM ibwf_fcats WHERE id='".$cid[0]."'"));
      
    $cname $cinfo[0];
      
    $cid mysql_fetch_array(mysql_query("SELECT cid FROM ibwf_forums WHERE id='".$fid."'"));
      
    $fname htmlspecialchars($fname);
      echo 
    "<b>4 </b><a accesskey=\"4\" href=\"index.php?action=viewfrm&amp;sid=$sid&amp;fid=$fid\">Back To $fname</a><br/>";
      if(
    $cid[0]>0)
      {
      echo 
    "<b>5 </b><a accesskey=\"5\" href=\"inbox.php?action=main&amp;sid=$sid\">Inbox</a><br/>";
      echo 
    "<b>6 </b><a accesskey=\"6\" href=\"lists.php?action=buds&amp;sid=$sid\">BuddyList</a><br/>";
      echo 
    "<b>7 </b><a accesskey=\"7\" href=\"index.php?action=chat&amp;sid=$sid\">Chat</a><br/>";
      
    $cinfo mysql_fetch_array(mysql_query("SELECT name FROM ibwf_fcats WHERE id='".$cid[0]."'"));
      
    $cname htmlspecialchars($cinfo[0]);
      echo 
    "<b>8 </b><a accesskey=\"8\" href=\"index.php?action=viewcat&amp;sid=$sid&amp;cid=$cid[0]\">$cname</a><br/>";
      echo 
    forumlink($sid,9);
      }else{
      echo 
    "<b>5 </b><a accesskey=\"5\" href=\"inbox.php?action=main&amp;sid=$sid\">Inbox</a><br/>";
      echo 
    "<b>6 </b><a accesskey=\"6\" href=\"lists.php?action=buds&amp;sid=$sid\">BuddyList</a><br/>";
      echo 
    "<b>7 </b><a accesskey=\"7\" href=\"index.php?action=chat&amp;sid=$sid\">Chat</a><br/>";
      
    $cid mysql_fetch_array(mysql_query("SELECT clubid FROM ibwf_forums WHERE id='".$fid."'"));
      
    $cinfo mysql_fetch_array(mysql_query("SELECT name FROM ibwf_clubs WHERE id='".$cid[0]."'"));
      
    $cname htmlspecialchars($cinfo[0]);
      echo 
    "<b>8 </b><a accesskey=\"8\" href=\"index.php?action=gocl&amp;sid=$sid&amp;clid=$cid[0]\">$cname Club</a><br/>";
      echo 
    forumlink($sid,9);
      }
      echo 
    "<b>0 </b><a accesskey=\"0\" href=\"index.php?action=main&amp;sid=$sid\"><img src=\"../images/home.gif\" alt=\"\"/>Home</a>";
      echo 
    "</p>";
        echo 
    "</body>";
    }
    //////////////////////////////////View Forum

    else if($action=="viewfrm")
    {
      
        
    $fid $_GET["fid"];
       
    $view $_GET["view"];
        if(!
    canaccess(getuid_sid($sid), $fid))
        {
          
    addonline(getuid_sid($sid),"im viewing admin forum naughty me","");
        echo 
    "<head>";
        echo 
    "<title>View Forum</title>";
      
    $thmname=$theme["theme"];
      
    $them=explode("_",$thmname);
      
    $them2=$them[0];
      if(
    $them2=="Custom")
          {
        include(
    "custom_theme.inc.php");
        }else{
      echo 
    "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
        }
            echo 
    "</head>";
        echo 
    "<body>";
          echo 
    "<p align=\"center\">";
          echo 
    "You Don't Have A Permission To View The Contents Of This Forum<br/><br/>";
          echo 
    "<a href=\"index.php?action=main&amp;sid=$sid\">Home</a>";
          echo 
    "</p>";
          echo 
    "</body>";
          echo 
    "</html>";
          exit();
        }
        
    addonline(getuid_sid($sid),"Nosing At Forum","index.php?action=viewfrm&amp;sid=$sid&amp;fid=$fid");
        
    $finfo mysql_fetch_array(mysql_query("SELECT name from ibwf_forums WHERE id='".$fid."'"));
        
    $fnm htmlspecialchars($finfo[0]);
        echo 
    "<head>";
        echo 
    "<title>View Forum</title>";
      
    $thmname=$theme["theme"];
      
    $them=explode("_",$thmname);
      
    $them2=$them[0];
      if(
    $them2=="Custom")
          {
        include(
    "custom_theme.inc.php");
        }else{
      echo 
    "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
        }
        
        echo 
    "</head>";
        echo 
    "<body>";
        echo 
    "<p align=\"center\">";
        
    $umsg getunreadpm(getuid_sid($sid));
        if(
    $umsg>0)
        {
        echo 
    "<br/><b>6 </b><a href=\"inbox.php?action=main&amp;sid=$sid\">$umsg New Inbox!</a><br/>";
        }
        
    $norf mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_rss WHERE fid='".$fid."'"));
        if(
    $norf[0]>0)
        {
            echo 
    "<a href=\"rwrss.php?action=showfrss&amp;sid=$sid&amp;fid=$fid\"><img src=\"../images/rss.gif\" alt=\"rss\"/>$finfo[0] Extras</a><br/>";
        }
        echo 
    "<b>1 </b><a accesskey=\"1\" href=\"index.php?action=newtopic&amp;sid=$sid&amp;fid=$fid\">New Topic</a><br/>";
        echo 
    "<form action=\"index.php\" method=\"get\">";
        echo 
    "View: <select name=\"view\">";
        echo 
    "<option value=\"all\">All</option>";
        echo 
    "<option value=\"new\">Since Last Visit</option>";
        echo 
    "<option value=\"myps\">I posted In</option>";
        echo 
    "</select>";
        echo 
    "<input type=\"submit\" value=\"Go\"/>";
        echo 
    "<input type=\"hidden\" name=\"action\" value=\"$action\"/>";
        echo 
    "<input type=\"hidden\" name=\"fid\" value=\"$fid\"/>";
        echo 
    "<input type=\"hidden\" name=\"sid\"  value=\"$sid\"/>";
        echo 
    "</form>";
        echo 
    "<br/>";
       if(
    $view=="new")
       {
          echo 
    "<small>Viewing topics that has no new posts since your last visit</small>";
       }else if(
    $view=="myps")
       {
          echo 
    "<small>Viewing topics contain posts by you</small>";
       }else {
       echo 
    "<small>Viewing All topics</small>";
       }
        echo 
    "</p>";
        echo 
    "<p>";
        if(
    $page=="" || $page<=0)$page=1;
        if(
    $page==1)
        {
          
    ///////////pinned topics
          
    $topics mysql_query("SELECT id, name, closed, views, pollid FROM ibwf_topics WHERE fid='".$fid."' AND pinned='1' ORDER BY lastpost DESC, name, id LIMIT 0,5");
          while(
    $topic mysql_fetch_array($topics))
        {
          
    $iml "<img src=\"../images/normal.gif\" alt=\"*\"/>";
          
    $iml "*";
          
    $atxt ="";
          if(
    $topic[2]=='1')
          {
            
    //closed
            
    $atxt "(X)";
          }
          if(
    $topic[4]>0)
          {
            
    $pltx "(P)";
          }else{
            
    $pltx "";
          }
          
    $tnm htmlspecialchars($topic[1]);
          
    $nop mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_posts WHERE tid='".$topic[0]."'"));
          echo 
    "<a href=\"index.php?action=viewtpc&amp;sid=$sid&amp;tid=$topic[0]\">$iml$pltx$tnm($nop[0])$atxt</a><br/>";

        }
        echo 
    "<br/>";
      }
      
    $uid getuid_sid($sid);
      if(
    $view=="new")
      {
      
      
    $ulv mysql_fetch_array(mysql_query("SELECT lastvst FROM ibwf_users WHERE id='".$uid."'"));
      
    $noi mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_topics WHERE fid='".$fid."' AND pinned='0' AND lastpost >='".$ulv[0]."'"));
      }
      else if(
    $view=="myps")
      {
       
    $noi mysql_fetch_array(mysql_query("SELECT COUNT(DISTINCT a.id) FROM ibwf_topics a INNER JOIN ibwf_posts b ON a.id = b.tid WHERE a.fid='".$fid."' AND a.pinned='0' AND b.uid='".$uid."'"));
      }
      else{
      
    $noi mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_topics WHERE fid='".$fid."' AND pinned='0'"));
      }
        
    $num_items $noi[0]; //changable
        
    $items_per_page10;
        
    $num_pages ceil($num_items/$items_per_page);
        if(
    $page>$num_pages)$page$num_pages;
        
    $limit_start = ($page-1)*$items_per_page;
        if(
    $limit_start<0)$limit_start=0;
       if(
    $view=="new")
       {
       
    $ulv mysql_fetch_array(mysql_query("SELECT lastvst FROM ibwf_users WHERE id='".$uid."'"));
        
    $topics mysql_query("SELECT id, name, closed, views, moved, pollid FROM ibwf_topics WHERE fid='".$fid."' AND pinned='0' AND lastpost >='".$ulv[0]."' ORDER BY lastpost DESC, name, id LIMIT $limit_start$items_per_page");
       }
       else if(
    $view=="myps"){
       
    $topics mysql_query("SELECT a.id, a.name, a.closed, a.views, a.moved, a.pollid FROM ibwf_topics a INNER JOIN ibwf_posts b ON a.id = b.tid WHERE a.fid='".$fid."' AND a.pinned='0' AND b.uid='".$uid."' GROUP BY a.id ORDER BY a.lastpost DESC, a.name, a.id  LIMIT $limit_start$items_per_page");
       }
       else{
       
    $topics mysql_query("SELECT id, name, closed, views, moved, pollid FROM ibwf_topics WHERE fid='".$fid."' AND pinned='0' ORDER BY lastpost DESC, name, id LIMIT $limit_start$items_per_page");
       }
        
        while(
    $topic mysql_fetch_array($topics))
        {
          
          
    $nop mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_posts WHERE tid='".$topic[0]."'"));
          
    $iml "<img src=\"../images/normal.gif\" alt=\"*\"/>";
          if(
    $nop[0]>24)
          {
            
    $iml "<img src=\"../images/hot.gif\" alt=\"*\"/>";
          }
          if(
    $topic[4]=='1')
          {
            
    $iml "<img src=\"../images/moved.gif\" alt=\"*\"/>";
          }
          if(
    $topic[2]=='1')
          {
            
    $iml "<img src=\"../images/closed.gif\" alt=\"*\"/>";
          }
          if(
    $topic[5]>0)
          {
            
    $iml "<img src=\"../images/poll.gif\" alt=\"*\"/>";
          }
          
    $atxt ="";
          if(
    $topic[2]=='1')
          {
            
    //closed
            
    $atxt "(X)";
          }
          
    $tnm htmlspecialchars($topic[1]);
          echo 
    "<a href=\"index.php?action=viewtpc&amp;sid=$sid&amp;tid=$topic[0]\">$iml$tnm($nop[0])$atxt</a><br/>";

        }


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

        if(
    $page>1)
        {
          
    $ppage $page-1;
          echo 
    "<a href=\"index.php?action=viewfrm&amp;page=$ppage&amp;sid=$sid&amp;fid=$fid&amp;view=$view\">«PREV</a> ";
        }
        if(
    $page<$num_pages)
        {
          
    $npage $page+1;
          echo 
    "<a href=\"index.php?action=viewfrm&amp;page=$npage&amp;sid=$sid&amp;fid=$fid&amp;view=$view\">Next»</a>";
        }
        echo 
    "<br/>$page/$num_pages<br/>";
        if(
    $num_pages>2)
        {
            
    $rets "<form action=\"index.php\" method=\"get\">";
            
    $rets .= "<input name=\"page\" style=\"-wap-input-format: '*N'\" size=\"2\"/>";
            
    $rets .= "<input type=\"hidden\" name=\"action\" value=\"$action\"/>";
            
    $rets .= "<input type=\"hidden\" name=\"fid\" value=\"$fid\"/>";
            
    $rets .= "<input type=\"hidden\" name=\"sid\" value=\"$sid\"/>";
         
    $rets .= "<input type=\"hidden\" name=\"view\" value=\"$view\"/>";
            
    $rets .= "<input type=\"submit\" value=\"Go To Page\"/>";
            
    $rets .= "</form>";

            echo 
    $rets;
        }

        echo 
    "<br/><br/><b>1 </b><a href=\"index.php?action=newtopic&amp;sid=$sid&amp;fid=$fid\">New Topic</a><br/>";
        
    $cid mysql_fetch_array(mysql_query("SELECT cid FROM ibwf_forums WHERE id='".$fid."'"));
        if(
    $cid[0]>0)
        {
      echo 
    "<br/><br/><b>5 </b><a accesskey=\"5\" href=\"inbox.php?action=main&amp;sid=$sid\">Inbox</a><br/>";
             echo 
    "<b>6 </b><a accesskey=\"6\" href=\"lists.php?action=buds&amp;sid=$sid\">BuddyList</a><br/>";
             echo 
    "<b>7 </b><a accesskey=\"7\" href=\"index.php?action=chat&amp;sid=$sid\">Chat</a><br/>";
        
    $cinfo mysql_fetch_array(mysql_query("SELECT name FROM ibwf_fcats WHERE id='".$cid[0]."'"));
        
    $cname htmlspecialchars($cinfo[0]);
        echo 
    "<b>8 </b><a accesskey=\"8\" href=\"index.php?action=viewcat&amp;sid=$sid&amp;cid=$cid[0]\">$cname</a><br/>";
        echo 
    forumlink($sid,9);
        }else{
      echo 
    "<br/><br/><b>5 </b><a accesskey=\"5\" href=\"inbox.php?action=main&amp;sid=$sid\">Inbox</a><br/>";
             echo 
    "<b>6 </b><a accesskey=\"6\" href=\"lists.php?action=buds&amp;sid=$sid\">BuddyList</a><br/>";
             echo 
    "<b>7 </b><a accesskey=\"7\" href=\"index.php?action=chat&amp;sid=$sid\">Chat</a><br/>";
            
    $cid mysql_fetch_array(mysql_query("SELECT clubid FROM ibwf_forums WHERE id='".$fid."'"));
            
    $cinfo mysql_fetch_array(mysql_query("SELECT name FROM ibwf_clubs WHERE id='".$cid[0]."'"));
            
    $cname htmlspecialchars($cinfo[0]);
        echo 
    "<b>8 </b><a accesskey=\"8\" href=\"index.php?action=gocl&amp;sid=$sid&amp;clid=$cid[0]\">$cname Club</a><br/>";
        echo 
    forumlink($sid,9);
        }
      echo 
    "<b>0 </b><a accesskey=\"0\" href=\"index.php?action=main&amp;sid=$sid\"><img src=\"../images/home.gif\" alt=\"\"/>Home</a>";
      echo 
    "</p>";
        echo 
    "</body>";
    }
    //////////////////////////////////ONLINE USERS
    else if($action=="newtopic")
    {
      
    $fid $_GET["fid"];
      if(!
    canaccess(getuid_sid($sid), $fid))
        {
        echo 
    "<head>";
        echo 
    "<title>New Topic</title>";
      
    $thmname=$theme["theme"];
      
    $them=explode("_",$thmname);
      
    $them2=$them[0];
      if(
    $them2=="Custom")
          {
        include(
    "custom_theme.inc.php");
        }else{
      echo 
    "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
        }
        echo 
    "</head>";
        echo 
    "<body>";
          echo 
    "<p align=\"center\">";
          echo 
    "You Don't Have A Permission To View The Contents Of This Forum<br/><br/>";
          echo 
    "<a href=\"index.php?action=main&amp;sid=$sid\">Home</a>";
          echo 
    "</p>";
          echo 
    "</body>";
          echo 
    "</html>";
          exit();
        }
        
    addonline(getuid_sid($sid),"Creating new topic","index.php?action=online");
        echo 
    "<head>";
        echo 
    "<title>New Topic</title>";
      
    $thmname=$theme["theme"];
      
    $them=explode("_",$thmname);
      
    $them2=$them[0];
      if(
    $them2=="Custom")
          {
        include(
    "custom_theme.inc.php");
        }else{
      echo 
    "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
        }
        echo 
    "</head>";
        echo 
    "<body>";
        echo 
    "<p align=\"center\">";
        echo 
    "<form action=\"genproc.php?action=newtopic&amp;sid=$sid\" method=\"post\">";
        echo 
    "Title:<input name=\"ntitle\" maxlength=\"30\"/><br/>";
        echo 
    "Text:<input name=\"tpctxt\" maxlength=\"500\"/><br/>";
        echo 
    "<input type=\"hidden\" name=\"fid\" value=\"$fid\"/>";
        echo 
    "<input type=\"submit\" value=\"Create\"/>";
        echo 
    "</form>";
        
    $fname getfname($fid);
        echo 
    "<br/><br/><b>9 </b><a accesskey=\"9\" href=\"index.php?action=viewfrm&amp;sid=$sid&amp;fid=$fid\">$fname</a><br/>";
        echo 
    "<b>0 </b><a accesskey=\"0\" href=\"index.php?action=main&amp;sid=$sid\"><img src=\"../images/home.gif\" alt=\"\"/>Home</a>";
        echo 
    "</p>";
        echo 
    "</body>";
    }

    //////////////////////////////////////////Post reply

    else if($action=="post")
    {
        
    $tid $_GET["tid"];
        
        
    $tfid mysql_fetch_array(mysql_query("SELECT fid FROM ibwf_topics WHERE id='".$tid."'"));
        
    $fid $tfid[0];
    if(!
    canaccess(getuid_sid($sid), $fid))
        {
        echo 
    "<head>";
        echo 
    "<title>Post Reply</title>";
      
    $thmname=$theme["theme"];
      
    $them=explode("_",$thmname);
      
    $them2=$them[0];
      if(
    $them2=="Custom")
          {
        include(
    "custom_theme.inc.php");
        }else{
      echo 
    "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
    }
        echo 
    "</head>";
        echo 
    "<body>";
          echo 
    "<p align=\"center\">";
          echo 
    "You Don't Have A Permission To View The Contents Of This Forum<br/><br/>";
          echo 
    "<a href=\"index.php?action=main&amp;sid=$sid\">Home</a>";
          echo 
    "</p>";
          echo 
    "</body>";
          echo 
    "</html>";
          exit();
        }
        
    addonline(getuid_sid($sid),"Reply To **** Topic lol","");
        
        echo 
    "<head>";
        echo 
    "<title>Post Reply</title>";
      
    $thmname=$theme["theme"];
      
    $them=explode("_",$thmname);
      
    $them2=$them[0];
      if(
    $them2=="Custom")
          {
        include(
    "custom_theme.inc.php");
        }else{
      echo 
    "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
        }
            echo 
    "</head>";
        echo 
    "<body>";
        
    $qut $_GET["qut"];
        echo 
    "<p align=\"center\">";
        echo 
    "<form action=\"genproc.php?action=post&amp;sid=$sid\" method=\"post\">";
        echo 
    "Text:<input name=\"reptxt\" maxlength=\"500\"/><br/>";
        echo 
    "<input type=\"hidden\" name=\"tid\" value=\"$tid\"/>";
        echo 
    "<input type=\"hidden\" name=\"qut\" value=\"$qut\"/>";
        echo 
    "<input type=\"submit\" value=\"Reply\"/>";
        echo 
    "</form>";
        
    $fid getfid($tid);
        
    $fname getfname($fid);
        echo 
    "<br/><br/><b>8 </b><a accesskey=\"8\" href=\"index.php?action=viewtpc&amp;sid=$sid&amp;tid=$tid\">Back to topic</a>";
        echo 
    "<br/><b>9 </b><a accesskey=\"9\" href=\"index.php?action=viewfrm&amp;sid=$sid&amp;fid=$fid\">$fname</a><br/>";
      echo 
    "<b>0 </b><a accesskey=\"0\" href=\"index.php?action=main&amp;sid=$sid\"><img src=\"../images/home.gif\" alt=\"\"/>Home</a>";
        echo 
    "</p>";
        echo 
    "</body>";
    }

    //////////////////////////////////////////shout

    else if($action=="shout")
    {
        
    addonline(getuid_sid($sid),"Close Your Ears Im Shouting","");

        echo 
    "<head>";
        echo 
    "<title>Shout</title>";
      
    $thmname=$theme["theme"];
      
    $them=explode("_",$thmname);
      
    $them2=$them[0];
      if(
    $them2=="Custom")
          {
        include(
    "custom_theme.inc.php");
        }else{
      echo 
    "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
        }
            echo 
    "</head>";
        echo 
    "<body>";
        echo 
    "<p align=\"center\">";
        if(
    getplusses(getuid_sid($sid))<75)
        {
            echo 
    "You need at least 75 plusses to shout!";
        }else{
        
       echo 
    "<small>please take note: $nick all your plusses will be removed if you spam or flood the shoutbox</small><br/>";
        echo 
    "<small>also smilies and BBcode do not work in shoutbox</small><br/><br/>";
       echo 
    "<form action=\"genproc.php?action=shout&amp;sid=$sid\" method=\"post\">";
       echo 
    "Text:<input name=\"shtxt\" maxlength=\"100\">";
        echo 
    "<input type=\"Submit\" value=\"Shout\" name=\"Shout\"></form>";
                }
      echo 
    "<br/><br/><b>0 </b><a accesskey=\"0\" href=\"index.php?action=main&amp;sid=$sid\"><img src=\"../images/home.gif\" alt=\"\"/>Home</a>";
        echo 
    "</p>";
        echo 
    "</body>";
    }

    //////////////////////////////////////////shout

    else if($action=="annc")
    {
        
    addonline(getuid_sid($sid),"Adding An Announcement","");
        
    $clid $_GET["clid"];
        echo 
    "<head>";
        echo 
    "<title>Announce</title>";
      
    $thmname=$theme["theme"];
      
    $them=explode("_",$thmname);
      
    $them2=$them[0];
      if(
    $them2=="Custom")
          {
        include(
    "custom_theme.inc.php");
        }else{
      echo 
    "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
        }
            echo 
    "</head>";
        echo 
    "<body>";
        echo 
    "<p align=\"center\">";
        
    $cow mysql_fetch_array(mysql_query("SELECT owner FROM ibwf_clubs WHERE id='".$clid."'"));
        
    $uid getuid_sid($sid);
        if(
    $cow[0]!=$uid)
        {
            echo 
    "This club is not yours!";
        }else{
        echo 
    "<form action=\"genproc.php?action=annc&amp;sid=$sid&amp;clid=$clid\" method=\"post\">";
        echo 
    "Text:<input name=\"antx\" maxlength=\"200\"><br/>";
        echo 
    "<input type=\"Submit\" name=\"Announce\" Value=\"Announce\"></form>";
                }
      echo 
    "<br/><br/><b>0 </b><a accesskey=\"0\" href=\"index.php?action=main&amp;sid=$sid\"><img src=\"../images/home.gif\" alt=\"\"/>Home</a>";
        echo 
    "</p>";
        echo 
    "</body>";
    }

    //////////////////////////////////////////Guestbook

    else if($action=="addblg")
    {

        
    if(!
    getplusses(getuid_sid($sid))>50)
        {
        echo 
    "<head>";
        echo 
    "<title>Add Blog</title>";
      
    $thmname=$theme["theme"];
      
    $them=explode("_",$thmname);
      
    $them2=$them[0];
      if(
    $them2=="Custom")
          {
        include(
    "custom_theme.inc.php");
        }else{
      echo 
    "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
        }
            echo 
    "</head>";
        echo 
    "<body>";
          echo 
    "<p align=\"center\">";
          echo 
    "you should have 50 plusses to add a blog<br/><br/>";
          echo 
    "<a href=\"index.php?action=main&amp;sid=$sid\">Home</a>";
          echo 
    "</p>";
          echo 
    "</body>";
          echo 
    "</html>";
          exit();
        }
        
    addonline(getuid_sid($sid),"Adding a blog","");

        echo 
    "<head>";
        echo 
    "<title>Add Blog</title>";
      
    $thmname=$theme["theme"];
      
    $them=explode("_",$thmname);
      
    $them2=$them[0];
      if(
    $them2=="Custom")
          {
        include(
    "custom_theme.inc.php");
        }else{
      echo 
    "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
        }
            echo 
    "</head>";
        echo 
    "<body>";

        echo 
    "<p align=\"center\">";
             echo 
    "<form action=\"genproc.php?action=addblg&amp;sid=$sid\" method=\"post\">";
        echo 
    "Title:<input name=\"btitle\" maxlength=\"30\"/><br/>";
        echo 
    "Text:<input name=\"msgtxt\" maxlength=\"500\"/><br/>";
    echo 
    "<input type=\"submit\" value=\"Add Blog\"/>";    
    echo 
    "</form>";
       
      echo 
    "<br/><br/><b>0 </b><a accesskey=\"0\" href=\"index.php?action=main&amp;sid=$sid\"><img src=\"../images/home.gif\" alt=\"\"/>Home</a>";
        echo 
    "</p>";
        echo 
    "</body>";
    }

    //////////////////////////////////////////add vault

    else if($action=="addvlt")
    {


    if(!
    getplusses(getuid_sid($sid))>25)
        {
        echo 
    "<head>";
        echo 
    "<title>Add To Vault</title>";
      
    $thmname=$theme["theme"];
      
    $them=explode("_",$thmname);
      
    $them2=$them[0];
      if(
    $them2=="Custom")
          {
        include(
    "custom_theme.inc.php");
        }else{
      echo 
    "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
        }
            echo 
    "</head>";
        echo 
    "<body>";
          echo 
    "<p align=\"center\">";
          echo 
    " you should have 25 plusses to add an item to your vault<br/><br/>";
          echo 
    "<a href=\"index.php?action=main&amp;sid=$sid\">Home</a>";
          echo 
    "</p>";
          echo 
    "</body>";
          echo 
    "</html>";
          exit();
        }
        
    addonline(getuid_sid($sid),"Adding a vault item","");

        echo 
    "<head>";
        echo 
    "<title>Add To Vault</title>";
      
    $thmname=$theme["theme"];
      
    $them=explode("_",$thmname);
      
    $them2=$them[0];
      if(
    $them2=="Custom")
          {
        include(
    "custom_theme.inc.php");
        }else{
      echo 
    "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
        }
            echo 
    "</head>";
        echo 
    "<body>";
        echo 
    "<p align=\"center\">";
        echo 
    "<small>The vault is used to store your downloadable links,like images, mp3's, games  etc...<br/>WARNING: if you used it to wapsites links they will got deleted and you'll lose some plusses, if you used it for ranking sites links like 2wap, mradar, you'll be banned</small><br/><br/>";
    echo 
    "<form action=\"genproc.php?action=addvlt&amp;sid=$sid\" method=\"post\">";
        echo 
    "The vault is used to store your downloadable links,like images, mp3's, games  etc...<br/>WARNING: if you used it to wapsites links they will got deleted and you'll lose some plusses, if you used it for ranking sites links like 2wap, mradar, you'll be banned<br/><br/>";
        echo 
    "Item Name:<input name=\"viname\" maxlength=\"50\"/><br/>";
        echo 
    "Item Url:<input name=\"vilink\" maxlength=\"255\"/><br/>";
    echo 
    "<input type=\"submit\" value=\"Add Item\"/>";    
    echo 
    "</form>";

      echo 
    "<br/><br/><b>0 </b><a accesskey=\"0\" href=\"index.php?action=main&amp;sid=$sid\"><img src=\"../images/home.gif\" alt=\"\"/>Home</a>";
        echo 
    "</p>";
        echo 
    "</body>";
    }
    //////////////////////////////////////////Guestbook

    else if($action=="signgb")
    {
    $who=$_GET["who"];
    addonline(getuid_sid($sid),"Signing Users guestbook","");
    if(!
    cansigngb(getuid_sid($sid), $who))
        {
        echo 
    "<head>";
        echo 
    "<title>Sign Guestbook</title>";

          
    $thmname=$theme["theme"];
      
    $them=explode("_",$thmname);
      
    $them2=$them[0];
      if(
    $them2=="Custom")
          {
        include(
    "custom_theme.inc.php");
        }else{
      echo 
    "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
        }
            echo 
    "</head>";
        echo 
    "<body>";
          echo 
    "<p align=\"center\">";
          echo 
    "You cant Sign this user guestbook<br/><br/>";
          echo 
    "<a href=\"index.php?action=main&amp;sid=$sid\">Home</a>";
          echo 
    "</p>";
          echo 
    "</body>";
          echo 
    "</html>";
          exit();
        }
        

    echo 
    "<head>";
    echo 
    "<title>Sign Guestbook</title>";
      
    $thmname=$theme["theme"];
      
    $them=explode("_",$thmname);
      
    $them2=$them[0];
      if(
    $them2=="Custom")
          {
        include(
    "custom_theme.inc.php");
        }else{
    echo 
    "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
        }
    echo 
    "</head>";
    echo 
    "<body>";
    echo 
    "<p align=\"center\">";
    echo 
    "<form action=\"genproc.php?action=signgb&amp;sid=$sid\" method=\"post\">";
    echo 
    "<input type=\"hidden\" name=\"who\" Value=\"$who\">";
    echo 
    "Text:<input name=\"msgtxt\" maxlength=\"500\"/><br/>";
    echo 
    "<input type=\"Submit\" name=\"Add\" Value=\"Add\"></form>";
    echo 
    "<br/><br/><b>0 </b><a accesskey=\"0\" href=\"index.php?action=main&amp;sid=$sid\"><img src=\"../images/home.gif\" alt=\"\"/>Home</a>";
    echo 
    "</p>";
    echo 
    "</body>";
    }

    ///////////////////////online mood!!

    else if($action=="mood")
    {
    addonline(getuid_sid($sid),"Updating online msg &amp; mood","");
    echo 
    "<head>";
    echo 
    "<title>Change Online Mood</title>";
    echo 
    "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
    echo 
    "</head>";
    echo 
    "<p align=\"center\">";
    echo 
    "<form action=\"index.php?action=upolm&sid=$sid\" method=\"post\">";
    echo 
    "Set Mood To: <input name=\"kiss\" maxlength=\"100\"/><br/>";
    echo 
    "<input type=\"Submit\" name=\"submit\" Value=\"Submit\"></form>";
    echo 
    "</p>";
    echo 
    "<p align=\"center\">";
    echo 
    "<b>0 </b><a accesskey=\"0\" href=\"index.php?action=main&amp;sid=$sid\"><img src=\"../images/home.gif\" alt=\"\"/>Home</a>";
    echo 
    "</p>";
    echo 
    "</body>";

    }
    //////////////////////////////////////////Update online mood with smilies!!
    else if($action=="upolm")
    {
    addonline(getuid_sid($sid),"Updating online msg &amp; mood","");
    $kiss mysql_real_escape_string($_POST["kiss"]);
    echo 
    "<head>";
    echo 
    "<title>Change Online Mood</title>";
    echo 
    "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
    echo 
    "</head>";
    echo 
    "<p align=\"center\">";
    $res mysql_query("UPDATE ibwf_users SET onlinemsg='".$kiss."' WHERE id='".$uid."'");
      if(
    $res)
      {
        echo 
    "<img src=\"../images/ok.gif\" alt=\"o\"/>Your online msg was updated successfully<br/>";
      }else{
        echo 
    "<img src=\"../images/notok.gif\" alt=\"x\"/>Error updating your online msg<br/>";
      }
    echo 
    "</p>";
    echo 
    "<p align=\"center\">";
    echo 
    "<b>0 </b><a accesskey=\"0\" href=\"index.php?action=main&amp;sid=$sid\"><img src=\"../images/home.gif\" alt=\"\"/>Home</a>";
    echo 
    "</p>";
    echo 
    "</body>";

    }
    /////////////////////////online list
    else if($action=="online")
    {
      
    addonline(getuid_sid($sid),"Online List","index.php?action=online");
        echo 
    "<head>";
        echo 
    "<title>Online List</title>";
        echo 
    "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
        echo 
    "<p align=\"center\">";

        echo 
    "</head>";
        echo 
    "<body>";
        
    //echo "<div><img src=\"../images/onlinelist.gif\" alt=\"Online List\"/></div>";
      
    echo popup($sid);
      
    //////ALL LISTS SCRIPT <<

        
    if($page=="" || $page<=0)$page=1;
        
    $num_items getnumonline(); //changable
        
    $items_per_page10;
        
    $num_pages ceil($num_items/$items_per_page);
        if(
    $page>$num_pages)$page$num_pages;
        
    $limit_start = ($page-1)*$items_per_page;

        
    //changable sql
        
    $sql "SELECT
                a.name, a.perm, b.place, b.userid, a.onlinemsg, a.ghost FROM ibwf_users a
                INNER JOIN ibwf_online b ON a.id = b.userid WHERE ghost='0'
                GROUP BY 1,2
                LIMIT 
    $limit_start$items_per_page
        "
    ;
      echo 
    "<p align=\"center\">";
        
    $items mysql_query($sql);
        echo 
    mysql_error();
        while (
    $item mysql_fetch_array($items))
        {
            if(
    $item[1]=='0')
            {
              
    $tit "<img src=\"../images/member.gif\" alt=\"(Member)\"/>";
            }if(
    $item[1]=='1')
            {
              
    $tit "<img src=\"../images/moderator.gif\" alt=\"(Mod)\"/>";
            }if(
    $item[1]=='2')
            {
              
    $tit "<img src=\"../images/admin1.gif\" alt=\"(admin)\"/>";
            } if(
    $item[1]=='3')
            {
              
    $tit "<img src=\"../images/headadmin.gif\" alt=\"(head)\"/>";
            } if(
    $item[1]=='4')
            {
              
    $tit "<img src=\"../images/owner.gif\" alt=\"(owner)\"/>)";
             } if(
    $item[1]=='5')
            {
              
    $tit "<img src=\"../images/host.gif\" alt=\"(H)\"/>";
            }
    $sex mysql_fetch_array(mysql_query("SELECT sex FROM ibwf_users WHERE name='$item[0]'"));
    if(
    $sex[0]=="M"){$usersex "<img src=\"../images/male.gif\" alt=\"(M)\"/>";}
    if(
    $sex[0]=="F"){$usersex "<img src=\"../images/female.gif\" alt=\"(F)\"/>";}
    if(
    $sex[0]==""){$usersex "";}
    $text parsepm($item[4], $sid);
          
    $lnk "$usersex<a href=\"index.php?action=viewuser&amp;who=$item[3]&amp;sid=$sid\">$tit$item[0]</a>";
          echo 
    "$lnk ($text) - $item[2] <br/>";
        }
        echo 
    "</p>";
        echo 
    "<p align=\"center\">";
        if(
    $page>1)
        {
          
    $ppage $page-1;
          echo 
    "<a href=\"index.php?action=online&amp;page=$ppage&amp;sid=$sid\">«Prev</a> ";
        }
        if(
    $page<$num_pages)
        {
          
    $npage $page+1;
          echo 
    "<a href=\"index.php?action=online&amp;page=$npage&amp;sid=$sid\">Next»</a>";
        }
        echo 
    "<br/>$page/$num_pages<br/>";
        if(
    $num_pages>2)
        {
        echo 
    getjumper($action$sid,"index");
        }
        echo 
    "</p>";
      
    ////// UNTILL HERE >>
      
    $tmsg getpmcount(getuid_sid($sid));
      
    $umsg getunreadpm(getuid_sid($sid));
      echo 
    "<p align=\"center\">";
      
        echo 
    "<a href=\"index.php?action=mood&amp;sid=$sid\"><span style=\"color:red\">change ya mood</span></a><br/>";
    echo 
    "<b> </b><a accesskey=\"7\" href=\"inbox.php?action=main&amp;sid=$sid\">Inbox($umsg/$tmsg)</a><br/>";
      echo 
    "<b> </b><a accesskey=\"8\" href=\"lists.php?action=buds&amp;sid=$sid\">BuddyList</a><br/>";
      echo 
    "<b> </b><a accesskey=\"9\" href=\"index.php?action=chat&amp;sid=$sid\">Chatrooms</a><br/>";
      echo 
    forumlink($sid,9);
      echo 
    "<b> </b><a accesskey=\"0\" href=\"index.php?action=main&amp;sid=$sid\"><img src=\"../images/home.gif\" alt=\"\"/>Home</a>";
      echo 
    "</p>";
      echo 
    "</body>";
    }
    else if(
    $action=="viewpl")
    {
      
    $who $_GET["who"];
      
    addonline(getuid_sid($sid),"Viewing A Users Poll","");
        echo 
    "<head>";
        echo 
    "<title>View Poll</title>";
      
    $thmname=$theme["theme"];
      
    $them=explode("_",$thmname);
      
    $them2=$them[0];
      if(
    $them2=="Custom")
          {
        include(
    "custom_theme.inc.php");
        }else{
      echo 
    "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
        }
            echo 
    "</head>";
        echo 
    "<body>";
        echo 
    "<p>";
        
    $uid getuid_sid($sid);
        
    $pollid mysql_fetch_array(mysql_query("SELECT pollid FROM ibwf_users WHERE id='".$who."'"));
        if(
    $pollid[0]>0)
        {
            
    $polli mysql_fetch_array(mysql_query("SELECT id, pqst, opt1, opt2, opt3, opt4, opt5, pdt FROM ibwf_polls WHERE id='".$pollid[0]."'"));
            if(
    trim($polli[1])!="")
            {
                
    $qst parsepm($polli[1], $sid);
                echo 
    $qst."<br/><br/>";
                
    $vdone mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_presults WHERE uid='".$uid."' AND pid='".$pollid[0]."'"));
                
    $nov mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_presults WHERE pid='".$pollid[0]."'"));
                
    $nov $nov[0];
                if(
    $vdone[0]>0)
                {
                  
    $votedtrue;
                }else{
                  
    $voted false;
                }
                
    $opt1 $polli[2];
                if (
    trim($opt1)!="")
                {
                  
    $opt1 htmlspecialchars($opt1);
                  
    $nov1 mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_presults WHERE pid='".$pollid[0]."' AND ans='1'"));
                  
    $nov1 $nov1[0];
                  if(
    $nov>0)
                  {
                  
    $per floor(($nov1/$nov)*100);
                  
    $rests "Votes: $nov1($per%)";
                  }else{
                    
    $rests "Votes: 0(0%)";
                  }
                    if(
    $voted)
                    {
                      
    $lnk "1.$opt1 <small>$rests</small><br/>";
                    }else{
                  
    $lnk "1.<a href=\"genproc.php?action=votepl&amp;sid=$sid&amp;plid=$pollid[0]&amp;ans=1\">$opt1</a> <small>$rests</small><br/>";
                  }
                  echo 
    "$lnk";
                }
                
    $opt2 $polli[3];
                if (
    trim($opt2)!="")
                {
                  
    $opt2 htmlspecialchars($opt2);
                  
    $nov2 mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_presults WHERE pid='".$pollid[0]."' AND ans='2'"));
                  
    $nov2 $nov2[0];
                  if(
    $nov>0)
                  {
                  
    $per floor(($nov2/$nov)*100);
                  
    $rests "Votes: $nov2($per%)";
                  }else{
                    
    $rests "Votes: 0(0%)";
                  }
                  if(
    $voted)
                    {
                      
    $lnk "2.$opt2 <small>$rests</small><br/>";
                    }else{
                  
    $lnk "2.<a href=\"genproc.php?action=votepl&amp;sid=$sid&amp;plid=$pollid[0]&amp;ans=2\">$opt2</a> <small>$rests</small><br/>";
                  }
                  echo 
    "$lnk";
                }
                
    $opt3 $polli[4];
                if (
    trim($opt3)!="")
                {
                  
    $opt3 htmlspecialchars($opt3);
                  
    $nov3 mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_presults WHERE pid='".$pollid[0]."' AND ans='3'"));
                  
    $nov3 $nov3[0];
                  if(
    $nov>0)
                  {
                  
    $per floor(($nov3/$nov)*100);
                  
    $rests "Votes: $nov3($per%)";
                  }else{
                    
    $rests "Votes: 0(0%)";
                  }
                  if(
    $voted)
                    {
                      
    $lnk "3.$opt3 <small>$rests</small><br/>";
                    }else{
                  
    $lnk "3.<a href=\"genproc.php?action=votepl&amp;sid=$sid&amp;plid=$pollid[0]&amp;ans=3\">$opt3</a> <small>$rests</small><br/>";
                  }
                  echo 
    "$lnk";
                }
                
    $opt4 $polli[5];
                if (
    trim($opt4)!="")
                {
                  
    $opt4 htmlspecialchars($opt4);
                  
    $nov4 mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_presults WHERE pid='".$pollid[0]."' AND ans='4'"));
                  
    $nov4 $nov4[0];
                  if(
    $nov>0)
                  {
                  
    $per floor(($nov4/$nov)*100);
                  
    $rests "Votes: $nov4($per%)";
                  }else{
                    
    $rests "Votes: 0(0%)";
                  }
                  if(
    $voted)
                    {
                      
    $lnk "4.$opt4 <small>$rests</small><br/>";
                    }else{
                  
    $lnk "4.<a href=\"genproc.php?action=votepl&amp;sid=$sid&amp;plid=$pollid[0]&amp;ans=4\">$opt4</a> <small>$rests</small><br/>";
                  }
                  echo 
    "$lnk";
                }
                
    $opt5 $polli[6];
                if (
    trim($opt5)!="")
                {
                  
    $opt5 htmlspecialchars($opt5);
                  
    $nov5 mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_presults WHERE pid='".$pollid[0]."' AND ans='5'"));
                  
    $nov5 $nov5[0];
                  if(
    $nov>0)
                  {
                  
    $per floor(($nov5/$nov)*100);
                  
    $rests "Votes: $nov5($per%)";
                  }else{
                    
    $rests "Votes: 0(0%)";
                  }
                  if(
    $voted)
                    {
                      
    $lnk "5.$opt5 <small>$rests</small><br/>";
                    }else{
                  
    $lnk "5.<a href=\"genproc.php?action=votepl&amp;sid=$sid&amp;plid=$pollid[0]&amp;ans=5\">$opt5</a> <small>$rests</small><br/>";
                  }
                  echo 
    "$lnk";
                }
                echo 
    "<small>".date("d m y - H:i",$polli[7])."</small>";
            }else{
                echo 
    "<img src=\"../images/notok.gif\" alt=\"x\"/>This poll doesn't exist";
            }
        }else{
            echo 
    "<img src=\"../images/notok.gif\" alt=\"x\"/>This user have no poll";
        }
        echo 
    "</p>";
        echo 
    "<p align=\"center\">";
      echo 
    "<b>0 </b><a accesskey=\"0\" href=\"index.php?action=main&amp;sid=$sid\"><img src=\"../images/home.gif\" alt=\"\"/>Home</a>";
      echo 
    "</p>";
      echo 
    "</body>";
        
    }

    else if(
    $action=="viewtpl")
    {
      
    $who $_GET["who"];
      
    addonline(getuid_sid($sid),"Viewing a poll","");
        echo 
    "<head>";
        echo 
    "<title>View Poll</title>";
      
    $thmname=$theme["theme"];
      
    $them=explode("_",$thmname);
      
    $them2=$them[0];
      if(
    $them2=="Custom")
          {
        include(
    "custom_theme.inc.php");
        }else{
      echo 
    "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
        }
            echo 
    "</head>";
        echo 
    "<body>";
        echo 
    "<p>";
        
    $uid getuid_sid($sid);
        
    $pollid mysql_fetch_array(mysql_query("SELECT pollid FROM ibwf_topics WHERE id='".$who."'"));
        if(
    $pollid[0]>0)
        {
            
    $polli mysql_fetch_array(mysql_query("SELECT id, pqst, opt1, opt2, opt3, opt4, opt5, pdt FROM ibwf_polls WHERE id='".$pollid[0]."'"));
            if(
    trim($polli[1])!="")
            {
                
    $qst parsepm($polli[1], $sid);
                echo 
    $qst."<br/><br/>";
                
    $vdone mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_presults WHERE uid='".$uid."' AND pid='".$pollid[0]."'"));
                
    $nov mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_presults WHERE pid='".$pollid[0]."'"));
                
    $nov $nov[0];
                if(
    $vdone[0]>0)
                {
                  
    $votedtrue;
                }else{
                  
    $voted false;
                }
                
    $opt1 $polli[2];
                if (
    trim($opt1)!="")
                {
                  
    $opt1 htmlspecialchars($opt1);
                  
    $nov1 mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_presults WHERE pid='".$pollid[0]."' AND ans='1'"));
                  
    $nov1 $nov1[0];
                  if(
    $nov>0)
                  {
                  
    $per floor(($nov1/$nov)*100);
                  
    $rests "Votes: $nov1($per%)";
                  }else{
                    
    $rests "Votes: 0(0%)";
                  }
                    if(
    $voted)
                    {
                      
    $lnk "1.$opt1 <small>$rests</small><br/>";
                    }else{
                  
    $lnk "1.<a href=\"genproc.php?action=votepl&amp;sid=$sid&amp;plid=$pollid[0]&amp;ans=1\">$opt1</a> <small>$rests</small><br/>";
                  }
                  echo 
    "$lnk";
                }
                
    $opt2 $polli[3];
                if (
    trim($opt2)!="")
                {
                  
    $opt2 htmlspecialchars($opt2);
                  
    $nov2 mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_presults WHERE pid='".$pollid[0]."' AND ans='2'"));
                  
    $nov2 $nov2[0];
                  if(
    $nov>0)
                  {
                  
    $per floor(($nov2/$nov)*100);
                  
    $rests "Votes: $nov2($per%)";
                  }else{
                    
    $rests "Votes: 0(0%)";
                  }
                  if(
    $voted)
                    {
                      
    $lnk "2.$opt2 <small>$rests</small><br/>";
                    }else{
                  
    $lnk "2.<a href=\"genproc.php?action=votepl&amp;sid=$sid&amp;plid=$pollid[0]&amp;ans=2\">$opt2</a> <small>$rests</small><br/>";
                  }
                  echo 
    "$lnk";
                }
                
    $opt3 $polli[4];
                if (
    trim($opt3)!="")
                {
                  
    $opt3 htmlspecialchars($opt3);
                  
    $nov3 mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_presults WHERE pid='".$pollid[0]."' AND ans='3'"));
                  
    $nov3 $nov3[0];
                  if(
    $nov>0)
                  {
                  
    $per floor(($nov3/$nov)*100);
                  
    $rests "Votes: $nov3($per%)";
                  }else{
                    
    $rests "Votes: 0(0%)";
                  }
                  if(
    $voted)
                    {
                      
    $lnk "3.$opt3 <small>$rests</small><br/>";
                    }else{
                  
    $lnk "3.<a href=\"genproc.php?action=votepl&amp;sid=$sid&amp;plid=$pollid[0]&amp;ans=3\">$opt3</a> <small>$rests</small><br/>";
                  }
                  echo 
    "$lnk";
                }
                
    $opt4 $polli[5];
                if (
    trim($opt4)!="")
                {
                  
    $opt4 htmlspecialchars($opt4);
                  
    $nov4 mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_presults WHERE pid='".$pollid[0]."' AND ans='4'"));
                  
    $nov4 $nov4[0];
                  if(
    $nov>0)
                  {
                  
    $per floor(($nov4/$nov)*100);
                  
    $rests "Votes: $nov4($per%)";
                  }else{
                    
    $rests "Votes: 0(0%)";
                  }
                  if(
    $voted)
                    {
                      
    $lnk "4.$opt4 <small>$rests</small><br/>";
                    }else{
                  
    $lnk "4.<a href=\"genproc.php?action=votepl&amp;sid=$sid&amp;plid=$pollid[0]&amp;ans=4\">$opt4</a> <small>$rests</small><br/>";
                  }
                  echo 
    "$lnk";
                }
                
    $opt5 $polli[6];
                if (
    trim($opt5)!="")
                {
                  
    $opt5 htmlspecialchars($opt5);
                  
    $nov5 mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_presults WHERE pid='".$pollid[0]."' AND ans='5'"));
                  
    $nov5 $nov5[0];
                  if(
    $nov>0)
                  {
                  
    $per floor(($nov5/$nov)*100);
                  
    $rests "Votes: $nov5($per%)";
                  }else{
                    
    $rests "Votes: 0(0%)";
                  }
                  if(
    $voted)
                    {
                      
    $lnk "5.$opt5 <small>$rests</small><br/>";
                    }else{
                  
    $lnk "5.<a href=\"genproc.php?action=votepl&amp;sid=$sid&amp;plid=$pollid[0]&amp;ans=5\">$opt5</a> <small>$rests</small><br/>";
                  }
                  echo 
    "$lnk";
                }
                echo 
    "<small>".date("d m y - H:i",$polli[7])."</small>";
            }else{
                echo 
    "<img src=\"../images/notok.gif\" alt=\"x\"/>This poll doesn't exist";
            }
        }else{
            echo 
    "<img src=\"../images/notok.gif\" alt=\"x\"/>This user have no poll";
        }
        echo 
    "</p>";
        echo 
    "<p align=\"center\">";
      echo 
    "<b>0 </b><a accesskey=\"0\" href=\"index.php?action=main&amp;sid=$sid\"><img src=\"../images/home.gif\" alt=\"\"/>Home</a>";
      echo 
    "</p>";
      echo 
    "</body>";

    }
    else if(
    $action=="stfol")
    {

      
    addonline(getuid_sid($sid),"Lookin At Site Team","");
      echo 
    "<head>";
      echo 
    "<title>Staff List</title>";
      
    $thmname=$theme["theme"];
      
    $them=explode("_",$thmname);
      
    $them2=$them[0];
      if(
    $them2=="Custom")
          {
        include(
    "custom_theme.inc.php");
        }else{
      echo 
    "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
        }
          echo 
    "</head>";
      echo 
    "<body>";
      
    $sql "SELECT id, name, perm FROM ibwf_users WHERE perm='5' ORDER BY name";
      echo 
    "<p>";
      echo 
    "<b>Host(s):</b><br/>";
      
    $query mysql_query($sql);
      echo 
    mysql_error();
      if(
    mysql_num_rows($query)>0)
      {
      while (
    $owners mysql_fetch_array($query))
      {
      
    $lnk "<a href=\"index.php?action=viewuser&amp;who=$owners[0]&amp;sid=$sid\">$owners[1]</a>";
      echo 
    "$lnk<br/>";
      }
      }else{
      echo 
    "No Hosts(s) Atm...<br/>";
      }
      
    $sql "SELECT id, name, perm FROM ibwf_users WHERE perm='4' ORDER BY name";
      echo 
    "<p>";
      echo 
    "<b>Owner(s):</b><br/>";
      
    $query mysql_query($sql);
      echo 
    mysql_error();
      if(
    mysql_num_rows($query)>0)
      {
      while (
    $owners mysql_fetch_array($query))
      {
      
    $lnk "<a href=\"index.php?action=viewuser&amp;who=$owners[0]&amp;sid=$sid\">$owners[1]</a>";
      echo 
    "$lnk<br/>";
      }
      }else{
      echo 
    "No Owner(s) Atm...<br/>";
      }
      
    $sql "SELECT id, name, perm FROM ibwf_users WHERE perm='3' ORDER BY name";
      echo 
    "<b>Head Admin(s):</b><br/>";
      
    $query mysql_query($sql);
      echo 
    mysql_error();
      if(
    mysql_num_rows($query)>0)
      {
      while (
    $headadmins mysql_fetch_array($query))
      {
      
    $lnk "<a href=\"index.php?action=viewuser&amp;who=$headadmins[0]&amp;sid=$sid\">$headadmins[1]</a>";
      echo 
    "$lnk<br/>";
      }
      }else{
      echo 
    "No Head Admin(s) Atm...<br/>";
      }
      
    $sql "SELECT id, name, perm FROM ibwf_users WHERE perm='2' ORDER BY name";
      echo 
    "<b>Admin(s):</b><br/>";
      
    $query mysql_query($sql);
      echo 
    mysql_error();
      if(
    mysql_num_rows($query)>0)
      {
      while (
    $admins mysql_fetch_array($query))
      {
      
    $lnk "<a href=\"index.php?action=viewuser&amp;who=$admins[0]&amp;sid=$sid\">$admins[1]</a>";
      echo 
    "$lnk<br/>";
      }
      }else{
      echo 
    "No Admins(s) Atm...<br/>";
      }
      
    $sql "SELECT id, name, perm FROM ibwf_users WHERE perm='1' ORDER BY name";
      echo 
    "<b>Mods (s):</b><br/>";
      
    $query mysql_query($sql);
      echo 
    mysql_error();
      if(
    mysql_num_rows($query)>0)
      {
      while (
    $mods mysql_fetch_array($query))
      {
      
    $lnk "<a href=\"index.php?action=viewuser&amp;who=$mods[0]&amp;sid=$sid\">$mods[1]</a>";
      echo 
    "$lnk<br/>";
      }
      }else{
      echo 
    "No Mods(s) Atm...<br/>";
      }

      
    $timeout 300;
      
    $timeon time()-$timeout;
      
    $noi mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_users WHERE perm>'0' AND lastact>'".$timeon."'"));
      echo 
    "<b>Staff Online:($noi[0])</b><br/>";
      
    $sql "SELECT name, perm,ghost, id FROM ibwf_users WHERE perm>'0' AND lastact>'".$timeon."'";
      
    $items mysql_query($sql);
      echo 
    mysql_error();
      while (
    $item mysql_fetch_array($items))
      {
      
    $lnk "<a href=\"index.php?action=viewuser&amp;who=$item[2]&amp;sid=$sid\">$item[0]</a>";
      if(
    $item[1]==1)
      {
    $item[1] = "Mod";}
      else if(
    $item[1]==2)
      {
    $item[1] = "Admin";}
      else if(
    $item[1]==3)
      {
    $item[1] = "Head Admin";}
      else if(
    $item[1]==4)
      {
    $item[1] = "Owner";}
    else if(
    $item[1]==5)
      {
    $item[1] = "Host";}
      echo 
    "$lnk - $item[1] <br/>";
      }
      echo 
    "</p>";
      echo 
    "<p align=\"center\">";
      echo 
    "<b>0 </b><a accesskey=\"0\" href=\"index.php?action=main&amp;sid=$sid\"><img src=\"../images/home.gif\" alt=\"\"/>Home</a>";
      echo 
    "</p>";
      echo 
    "</body>";
    }
    else if(
    $action=="chbmsg")
    {
      
    addonline(getuid_sid($sid),"Buddy Message","");
        echo 
    "<head>";
        echo 
    "<title>Set Mood</title>";
      
    $thmname=$theme["theme"];
      
    $them=explode("_",$thmname);
      
    $them2=$them[0];
      if(
    $them2=="Custom")
          {
        include(
    "custom_theme.inc.php");
        }else{
      echo 
    "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
        }
            echo 
    "</head>";
        echo 
    "<body>";
        echo 
    "<p align=\"center\">";

             echo 
    "<form action=\"genproc.php?action=upbmsg&amp;sid=$sid\" method=\"post\">";

        echo 
    "Text:<input name=\"bmsg\" maxlength=\"100\" value=\"$cmsg\"/><br/>";
    echo 
    "<input type=\"submit\" value=\"Save\"/>";
        echo 
    "</form><br/>";
     echo 
    "<a href=\"lists.php?action=buds&amp;sid=$sid\">";
    echo 
    "Buddies List</a><br/>";
      echo 
    "<b>0 </b><a accesskey=\"0\" href=\"index.php?action=main&amp;sid=$sid\"><img src=\"../images/home.gif\" alt=\"\"/>Home</a>";
      echo 
    "</p>";
      echo 
    "</body>";
    }
    ///////////////////last ten profile views

    else if($action=="10pv")
    {
    addonline(getuid_sid($sid),"Viewing Last 10 profileviewers","");
    if(
    $who==""||$who==0)
    {
    $mnick $_POST["mnick"];
    $who getuid_nick($mnick);
    }
    $whonick getnick_uid($who);

    echo 
    "<head>";
    echo 
    "<title>Viewing Last Ten Profile Views</title>";
    echo 
    "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/black_medium.css\">";
    echo 
    "</head>";
    echo 
    "<body>";
    echo 
    "<p align=\"center\">";
    $sqlmysql_query("SELECT lastview,ltime FROM ibwf_lastview WHERE whonick='".$whonick."'ORDER BY ltime DESC LIMIT 10");
    while(
    $row mysql_fetch_array($sql))
    {
    $a getuid_nick($row[0]);
    echo 
    "<a href=\"index.php?action=viewuser&amp;sid=$sid&amp;who=$a\">$row[0]</a>";
    $newtime =$row[1]+(*60 *60);
    echo 
    " <b>".date("D d M y - h:i:s a",$newtime)."</b><br/>";
    echo 
    "------------<br />";
    }
    $a getuid_nick($whonick);
    echo 
    "back to <a href=\"index.php?action=viewuser&amp;sid=$sid&amp;who=$a\">$whonick</a>'s profile<br/>";
    echo 
    "<b>0 </b><a accesskey=\"0\" href=\"index.php?action=main&amp;sid=$sid\"><img src=\"../images/home.gif\" alt=\"\"/>Home</a>";
    echo 
    "</p>";
    echo 
    "</body>";
    }
    /////////////////////////////////viewuser profile

    else if($action=="viewuser")
    {
      
    addonline(getuid_sid($sid),"Lookin At A Flirty Profile ","index.php?action=viewuser&amp;who=$who");
        echo 
    "<head>";
        echo 
    "<title>View Profile</title>";
      
    $thmname=$theme["theme"];
      
    $them=explode("_",$thmname);
      
    $them2=$them[0];
      if(
    $them2=="Custom")
          {
        include(
    "custom_theme.inc.php");
        }else{
      echo 
    "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
        }
            echo 
    "</head>";
        echo 
    "<body>";
       echo 
    "<p align=\"center\">";
      
    $lastloc=$_GET["lstloc"];
    if(
    $lastloc=="cht"){
       
    $rid$_GET["rid"];
        
    $rooms mysql_fetch_array(mysql_query("SELECT id, name FROM ibwf_rooms WHERE id='".$rid."'"));
        
    $rname $rooms[1];
    }
      if(
    $who==""||$who==0)
      {
        
    $mnick $_POST["mnick"];
        
    $who getuid_nick($mnick);
      }
      
    $whonick getnick_uid($who);
      if(
    $whonick!="")
      {


    if(
    ishost(getuid_sid($sid)))
      {
      echo 
    "<a href=\"hostcp.php?action=user&amp;sid=$sid&amp;who=$who\">*Host Tools*</a><br/>";
      }
    if(
    isowner(getuid_sid($sid)))
      {
      echo 
    "<a href=\"ownercp.php?action=user&amp;sid=$sid&amp;who=$who\">*Owner Tools*</a><br/>";
      }
    if(
    isheadadmin(getuid_sid($sid)))
      {
      echo 
    "<a href=\"headadmincp.php?action=user&amp;sid=$sid&amp;who=$who\">*Head Admin Tools*</a><br/>";
      }
      if(
    ismod($uid))
      {
    if(!
    ishost(getuid_sid($sid)))
      {
      if(!
    isowner(getuid_sid($sid)))
      {
      if(!
    isheadadmin(getuid_sid($sid)))
      {
      echo 
    "<a href=\"admincp.php?action=user&amp;sid=$sid&amp;who=$who\">*Admin Tools*</a><br/>";
      }
    }
      }
      }

      
    $avlink getavatar($who);
      if(
    $avlink=="")
      {
      echo 
    "";
      }else{
      echo 
    "<img src=\"$avlink\" alt=\"$whonick\"/><br/>";
      }
      if(
    cansee(getuid_sid($sid), $who))
      {
        
    $unol mysql_fetch_array(mysql_query("SELECT lastpnreas FROM ibwf_users WHERE id='".$who."'"));
        
    /*if($unol[0]!="")
        {
        echo "Last Penalty Reason: $unol[0]<br/>";
        }
        $unol = mysql_fetch_array(mysql_query("SELECT lastplreas FROM ibwf_users WHERE id='".$who."'"));
        if($unol[0]!="")
        {
        echo "Last Plusses Reason: $unol[0]<br/>";
        }*/
      
    }
      echo 
    "<b>Username:</b> $whonick<br/>";
      echo 
    "<b>Status:</b> ".getstatus($who)."<br/>";
      
    $nopl mysql_fetch_array(mysql_query("SELECT regdate FROM ibwf_users WHERE id='".$who."'"));
      echo 
    "<b>UserId:</b> $who<br/>";
      
    $nopl mysql_fetch_array(mysql_query("SELECT sex, birthday, location FROM ibwf_users WHERE id='".$who."'"));
      
    $uage getage($nopl[1]);
      if(
    $nopl[0]=='M')
      {
        
    $usex "Male";
      }else if(
    $nopl[0]=='F'){
        
    $usex "Female";
      }else{
        
    $usex "Argh! No Profile!";
      }
      
    $nopl[2] = htmlspecialchars($nopl[2]);
      echo 
    "<b>Asl:</b> $uage/$usex/$nopl[2]<br/>";
      
    $nopl mysql_fetch_array(mysql_query("SELECT regdate FROM ibwf_users WHERE id='".$who."'"));
      
    $jdt date("H:i - D jS M y",$nopl[0]);
      echo 
    "<b>Joined:</b> $jdt<br/>";
      
    $membrage time() - $nopl[0];
      
    $membrage gettimemsg($membrage);
      echo 
    "<b>Member For:</b> $membrage<br/>";
      
    $nopl mysql_fetch_array(mysql_query("SELECT refer FROM ibwf_users WHERE id='".$who."'"));
      
    echo 
    "<b>Refered by:</b> $nopl[0]<br/>";
      
    $nob mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_buddies WHERE (uid='".$who."' OR tid='".$who."') AND agreed='1'"));
      echo 
    "<b>Buddies:</b> $nob[0]<br/>";
    ////////////PROFILE VIEWS/////////////
    $vws mysql_fetch_array(mysql_query("SELECT proviews FROM ibwf_users WHERE id='".$who."'"));
    $views $vws[0]+1;

       echo 
    "<b>Profile Views:</b> $views<br/>";
    /////////////// last ten profile views

    $sql mysql_fetch_array(mysql_query("SELECT COUNT(id) FROM ibwf_lastview WHERE whonick='".$whonick."'"));
    if (
    $sql[0]>10)
    {
    $sql mysql_fetch_array(mysql_query("SELECT MAX(id) FROM ibwf_lastview WHERE whonick='".$whonick."'"));
    $sql $sql[0]<9;
    mysql_query("DELETE FROM ibwf_lastview WHERE whonick='".$whonick."' AND id='".$sql."'");
    }
    $lv=getnick_sid($sid);
    $a getuid_nick($whonick);
    if(
    $a=$uid)
    {
    mysql_query("INSERT INTO ibwf_lastview SET lastview='".$lv."', whonick='".$whonick."', ltime='".time()."'");
    }
    $sqlmysql_fetch_array(mysql_query("SELECT lastview, ltime FROM ibwf_lastview WHERE whonick='".$whonick."'ORDER BY ltime DESC LIMIT 1"));
    $a getuid_nick($sql[0]);
    $link "<a href=\"index.php?action=viewuser&amp;sid=$sid&amp;who=$a\">$whonick[0]</a>";
    echo 
    "<b>Last profile view:</b>";
    $newtime =$sql[1]+(*60 *60);
    echo 
    date("D d M y - h:i:s a",$newtime);
    echo 
    "<p align=\"center\">";
    echo 
    "<a href=\"index.php?action=10pv&amp;who=$who&amp;sid=$sid\">whos been pervin at me?</a><br/>";





    /////////EDIT MY PROFILE////////////
      
    if(mypro(getuid_sid($sid), $who))
      {
    echo 
    "";
      }else{
          
    mysql_query("UPDATE ibwf_users SET proviews='".$views."' WHERE  id='".$who."'");
      }
    /////////////////////////////////


    echo "<br/><span style=\"color:yellow\">Unread Messages: ".getunreadpm($who)."
    </span><br/><br/>"
    ;
     
    echo 
    "<span style=\"color:lime\">Unread Messages From You: ".getunreadpm($who,$uid)."
    </span><br/><br/>"
    ;

     
    $nopl mysql_fetch_array(mysql_query("SELECT email FROM ibwf_users WHERE id='".$who."'"));
      echo 
    "<b>E-mail:</b> $nopl[0]<br/>";
      
    $nopl mysql_fetch_array(mysql_query("SELECT signature FROM ibwf_users WHERE id='".$who."'"));
      
    $sign parsepm($nopl[0], $sid);
      echo 
    "<b>Info:</b> $sign<br/>";
     
    $nopl mysql_fetch_array(mysql_query("SELECT COUNT(id) FROM ibwf_usfun WHERE target='".$who."' AND action='smooch'"));
      echo 
    "Have been Smooched: <b><a href=\"lists.php?action=smd&amp;who=$who&amp;sid=$sid\">$nopl[0]</a></b> Times<br/>";
     
    $nopl mysql_fetch_array(mysql_query("SELECT COUNT(id) FROM ibwf_usfun WHERE target='".$who."' AND action='kick'"));
      echo 
    "Have been Kicked: <b><a href=\"lists.php?action=kcd&amp;who=$who&amp;sid=$sid\">$nopl[0]</a></b> Times<br/>";
      
    $nopl mysql_fetch_array(mysql_query("SELECT COUNT(id) FROM ibwf_usfun WHERE target='".$who."' AND action='poke'"));
      echo 
    "Have been Poked: <b><a href=\"lists.php?action=pkd&amp;who=$who&amp;sid=$sid\">$nopl[0]</a></b> Times<br/>";
     
    $nopl mysql_fetch_array(mysql_query("SELECT COUNT(id) FROM ibwf_usfun WHERE target='".$who."' AND action='hug'"));
      echo 
    "Have been Hugged: <b><a href=\"lists.php?action=hgd&amp;who=$who&amp;sid=$sid\">$nopl[0]</a></b> Times<br/>";

    $couple mysql_fetch_array(mysql_query("SELECT accept, who, partner FROM couple WHERE who='".$who."'"));
      if(
    $couple[0]=='1')
      {
      echo 
    "<b>Wappid to:</b>";
      
    $unick getnick_uid($couple[2]);
      echo 
    "$whonick is owned by: $unick <br/>";
      }
    $couples mysql_fetch_array(mysql_query("SELECT accept, who, partner FROM couple WHERE partner='".$who."'"));
    if(
    $couples[0]=='1')
      {
      echo 
    "<b>Wappid to:</b>";
      
    $nick getnick_uid($couples[1]);
      echo 
    "$whonick is $nick's bitch <br/>";
      }
      
    $noi mysql_fetch_array(mysql_query("SELECT lastact FROM ibwf_users WHERE id='".$who."'"));
      
    $var1 date("His",$noi[0]);
      
    $var2 time();
      
    $var21 date("His",$var2);
      
    $var3 $var21 $var1;
      
    $var4 date("s",$var3);
      echo 
    "<b>Idle For:</b> ";
      
    $remain time() - $noi[0];
      
    $idle gettimemsg($remain);
      echo 
    "$idle<br/>";


     
    $nopl mysql_fetch_array(mysql_query("SELECT browserm FROM ibwf_users WHERE id='".$who."'"));
      echo 
    "<b>Browser:</b> $nopl[0]<br/>";
      
    $ip mysql_fetch_array(mysql_query("SELECT ipadd FROM ibwf_users WHERE id='".$who."'"));
      
    $ip2=explode(",",$ip);
      if(
    strpos($ip2[0],",")){
      
    $exp_ip=explode(",",$ip);
       
    $ip=$exp_ip[0];
      }echo 
    "<b>Network:</b>".network($ip[0]);
      echo 
    "<br/>";
    //////////////site rating
      
    $whonick getuid_nick($whonick);
      echo 
    "<br/><b>Site Rating:</b>";
      echo 
    rating($whonick);
      echo 
    "<br/>";
    /////////////site status
          
    $item mysql_fetch_array(mysql_query("SELECT name,perm FROM ibwf_users WHERE id='".$who."'"));
              if(
    $item[1]=='0')
            {
              
    $pro "<img src=\"../images/member.gif\" alt=\"(Member)\"/>";
            }if(
    $item[1]=='1')
            {
              
    $pro "<img src=\"../images/moderator.gif\" alt=\"(Mod)\"/>";
            }if(
    $item[1]=='2')
            {
              
    $pro "<img src=\"../images/admin1.gif\" alt=\"(admin)\"/>";
            }if(
    $item[1]=='3')
            {
              
    $pro "<img src=\"../images/headadmin.gif\" alt=\"(head)\"/>";
            }if(
    $item[1]=='4')
            {
              
    $pro "<img src=\"../images/owner.gif\" alt=\"(owner)\"/>";
              }if(
    $item[1]=='5')
            {
              
    $pro "<img src=\"../images/host.gif\" alt=\"(H)\"/>";
            }
      echo 
    "<br>$pro<br/>";
      if(
    ismod(getuid_sid($sid)))
      {
      
    $uipadd mysql_fetch_array(mysql_query("SELECT ipadd FROM ibwf_users WHERE id='".$who."'"));
      echo 
    "<b>Ip:</b> <a href=\"lists.php?action=byip&amp;sid=$sid&amp;who=$who\">$uipadd[0]</a><br/>";
      }
     

     if(
    budres($uid$who)==0)
      {
        echo 
    "<a href=\"genproc.php?action=bud&amp;who=$who&amp;sid=$sid&amp;todo=add\">Add Buddy</a><br/>";
      }else if(
    budres($uid$who)==1)
      {
        echo 
    "(Queued Buddy Request)<br/>";
      }else if(
    budres($uid$who)==2)
      {
        echo 
    "<a href=\"genproc.php?action=bud&amp;who=$who&amp;sid=$sid&amp;todo=del\">Del Buddy</a><br/>";
      }
      if (
    arebuds($uid$who))
      {
      echo 
    "<a href=\"inbox.php?action=sendpopup&amp;who=$who&amp;sid=$sid\">Send Popup</a><br/>";
      }
       
    echo 
    "<a href=\"inbox.php?action=sendpm&amp;who=$who&amp;sid=$sid\">Send Inbox</a><br/>";
      
    $ires ignoreres($uid$who);
    if(
    $ires==1)
      {
        echo 
    "<a href=\"genproc.php?action=ign&amp;who=$who&amp;sid=$sid&amp;todo=add\">Ignore</a><br/>";
      }
      if(
    isignored($who$uid))
      {
        echo 
    "<a href=\"genproc.php?action=ign&amp;who=$who&amp;sid=$sid&amp;todo=del\">UnIgnore</a><br/>";
      }
      echo 
    "<a href=\"index.php?action=prostats&amp;who=$who&amp;sid=$sid\">User Stats</a><br/>";
         echo 
    "<a href=\"userfun.php?action=profile&amp;who=$who&amp;sid=$sid\">smooch kick hug poke</a><br/>";

    echo 
    "<a href=\"uinfo.php?who=$who&amp;sid=$sid\">Advanced Profile</a><br/>";
      echo 
    "<a href=\"../users?$whonick\">Personal Wap Site</a><br/>";
       
    $noi mysql_fetch_array(mysql_query("SELECT pollid FROM ibwf_users WHERE id='".$who."'"));
       if(
    $noi[0]>0)
       {
       echo 
    "<a href=\"index.php?action=viewpl&amp;who=$who&amp;sid=$sid\">Poll</a><br/>";
     }

       
    $noi mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_blogs WHERE bowner='".$who."'"));
       if(
    $noi[0]>0)
       {
       echo 
    "<a href=\"lists.php?action=blogs&amp;who=$who&amp;sid=$sid\">Blogs($noi[0])</a><br/>";
     }
     
    $noi mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_vault WHERE uid='".$who."'"));
       if(
    $noi[0]>0)
       {
       echo 
    "<a href=\"lists.php?action=vault&amp;who=$who&amp;sid=$sid\">Vault($noi[0])</a><br/>";
       }
       
    $noi mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_gbook WHERE gbowner='".$who."'"));
       echo 
    "<a href=\"lists.php?action=gbook&amp;who=$who&amp;sid=$sid\">Guestbook($noi[0])</a><br/>";
       
    $judg mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_judges WHERE uid='".getuid_sid($sid)."'"));
      echo 
    "</p>";
      echo 
    "<p align=\"center\">";

       }else{
         echo 
    "<img src=\"../images/notok.gif\" alt=\"X\"/> Member dos not exist<br/>";
       }
         if(
    $lastloc=="cht"){
            
        echo 
    "<b>5 </b><a accesskey=\"5\" href=\"chat.php?sid=$sid&amp;rid=$rid\">Back to $rname</a><br/>"
      echo 
    "<b>6 </b><a accesskey=\"6\" href=\"inbox.php?action=main&amp;sid=$sid\">Inbox</a><br/>";
             echo 
    "<b>7 </b><a accesskey=\"7\" href=\"lists.php?action=buds&amp;sid=$sid\">BuddyList</a><br/>";
             echo 
    "<b>8 </b><a accesskey=\"8\" href=\"index.php?action=chat&amp;sid=$sid\">Chat</a><br/>";
            echo 
    forumlink($sid,9);

      echo 
    "<b>0 </b><a accesskey=\"0\" href=\"index.php?action=main&amp;sid=$sid\"><img src=\"../images/home.gif\" alt=\"\"/>Home</a>";
      echo 
    "</p>";
      echo 
    "</body>";
      }else{
      echo 
    "<b>6 </b><a accesskey=\"6\" href=\"inbox.php?action=main&amp;sid=$sid\">Inbox</a><br/>";
             echo 
    "<b>7 </b><a accesskey=\"7\" href=\"lists.php?action=buds&amp;sid=$sid\">BuddyList</a><br/>";
             echo 
    "<b>8 </b><a accesskey=\"8\" href=\"index.php?action=chat&amp;sid=$sid\">Chat</a><br/>";
            echo 
    forumlink($sid,9);

      echo 
    "<b>0 </b><a accesskey=\"0\" href=\"index.php?action=main&amp;sid=$sid\"><img src=\"../images/home.gif\" alt=\"\"/>Home</a>";
      echo 
    "</p>";
      echo 
    "</body>";
      }
    }
    //////////////////////////////////////////profile stats
    else if($action=="prostats")
    {
        
    addonline(getuid_sid($sid),"Viewing User Stats","");
        echo 
    "<head>";
        echo 
    "<title>User Stats</title>";
      
    $thmname=$theme["theme"];
      
    $them=explode("_",$thmname);
      
    $them2=$them[0];
      if(
    $them2=="Custom")
          {
        include(
    "custom_theme.inc.php");
        }else{
      echo 
    "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
        }
            echo 
    "</head>";
        echo 
    "<body>";
      if(
    $who==""||$who==0)
      {
        
    $mnick $_POST["mnick"];
        
    $who getuid_nick($mnick);
      }
      echo 
    "<p align=\"center\">";
      echo 
    "<b>User Stats</b>";
      echo 
    "</p>";
      echo 
    "<p>";
      
    $uid getuid_sid($sid);
      
    $unol mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_topics WHERE authorid='".$who."'"));
      
    $tlink "<a href=\"lists.php?action=tbuid&amp;sid=$sid&amp;who=$who\">$unol[0]</a>";
      echo 
    "Topics: <b>$tlink</b><br/>";
      
    $unop mysql_fetch_array(mysql_query("SELECT posts FROM ibwf_users WHERE id='".$who."'"));
      
    $unol mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_posts WHERE uid='".$who."'"));
      
    $plink "<a href=\"lists.php?action=uposts&amp;sid=$sid&amp;who=$who\">$unol[0]</a>";
      echo 
    "Posts: <b>$plink/$unop[0]</b><br/>";
      
    $noin mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_private WHERE touid='".$who."'"));
      
    $nout mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_private WHERE byuid='".$who."'"));
      echo 
    "PMs IN: <b>$noin[0]</b> - OUT: <b>$nout[0]</b><br/>";
      
    $nopl mysql_fetch_array(mysql_query("SELECT plusses FROM ibwf_users WHERE id='".$who."'"));
      echo 
    "Plusses: <b>$nopl[0]</b><br/>";
      
    $nopl mysql_fetch_array(mysql_query("SELECT chmsgs FROM ibwf_users WHERE id='".$who."'"));
      echo 
    "Chat Posts: <b>$nopl[0]</b><br/>";
      
    $nopl mysql_fetch_array(mysql_query("SELECT battlep FROM ibwf_users WHERE id='".$who."'"));
      echo 
    "Battle Points: <b>$nopl[0]</b><br/>";
      
    $judg mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_judges WHERE uid='".$who."'"));
      if(
    $judg[0]>0)
      {
      echo 
    "<b>Battle Board Judge</b><br/>";
      }
      
    $nout mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_shouts WHERE shouter='".$who."'"));
      
    $nopl mysql_fetch_array(mysql_query("SELECT shouts FROM ibwf_users WHERE id='".$who."'"));
      echo 
    "Shouts: <b><a href=\"lists.php?action=shouts&amp;sid=$sid&amp;who=$who\">$nout[0]</a>/$nopl[0]</b><br/>";
      
    $nout mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_uploads WHERE uid='".$who."'"));
      echo 
    "Files Uploaded: <b>$nout[0]</b><br/>";
      
    $nopl mysql_fetch_array(mysql_query("SELECT lastact FROM ibwf_users WHERE id='".$who."'"));
      
    $jdt date("d m y-H:i:s",$nopl[0]);
      echo 
    "Last Active: <b>$jdt</b><br/>";
      
    $nopl mysql_fetch_array(mysql_query("SELECT lastvst FROM ibwf_users WHERE id='".$who."'"));
      
    $jdt date("d m y-H:i:s",$nopl[0]);
      echo 
    "Last Visit: <b>$jdt</b><br/>";
      
    $noi mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_clubs WHERE owner='".$who."'"));
      if(
    $noi[0]>0)
      {
      echo 
    "<b>1 </b><a accesskey=\"1\" href=\"lists.php?action=ucl&amp;who=$who&amp;sid=$sid\">Clubs($noi[0])</a><br/>";
      }
     
    $noi mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_clubmembers WHERE uid='".$who."'"));
       if(
    $noi[0]>0)
       {
       echo 
    "<b>2 </b><a accesskey=\"2\" href=\"lists.php?action=clm&amp;who=$who&amp;sid=$sid\">Member In $noi[0] Clubs</a><br/>";
       }
       if(
    ismod(getuid_sid($sid))||$judg[0]>0)
       {
       echo 
    "<b>3 </b><a accesskey=\"3\" href=\"index.php?action=batp&amp;who=$who&amp;sid=$sid\">Battle Points</a><br/>";
       }
      echo 
    "<b>4 </b><a accesskey=\"4\" href=\"userfun.php?action=profile&amp;who=$who&amp;sid=$sid\">Fun And Games</a><br/>";
        echo 
    "</p>";
        echo 
    "<p align=\"center\">";
      echo 
    "<br/><b>6 </b><a accesskey=\"6\" href=\"inbox.php?action=main&amp;sid=$sid\">Inbox</a><br/>";
             echo 
    "<b>7 </b><a accesskey=\"7\" href=\"lists.php?action=buds&amp;sid=$sid\">BuddyList</a><br/>";
             echo 
    "<b>8 </b><a accesskey=\"8\" href=\"index.php?action=chat&amp;sid=$sid\">Chat</a><br/>";
            echo 
    forumlink($sid,9);

      echo 
    "<b>0 </b><a accesskey=\"0\" href=\"index.php?action=main&amp;sid=$sid\"><img src=\"../images/home.gif\" alt=\"\"/>Home</a>";
      echo 
    "</p>";
      echo 
    "</body>";
    }
    ////////////////////////////////////////// uxset
    else if($action=="uxset")
    {
        
    addonline(getuid_sid($sid),"Extended Settings","");
        echo 
    "<head>";
        echo 
    "<title>Extended Settings</title>";
      
    $thmname=$theme["theme"];
      
    $them=explode("_",$thmname);
      
    $them2=$them[0];
      if(
    $them2=="Custom")
          {
        include(
    "custom_theme.inc.php");
        }else{
      echo 
    "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
        }
            echo 
    "</head>";
        echo 
    "<body>";
        echo 
    "<p>";
        echo 
    "<a href=\"index.php?action=uadd&amp;sid=$sid\">»My Address</a><br/>";
        echo 
    "<a href=\"index.php?action=uper&amp;sid=$sid\">»Personality</a><br/>";
        echo 
    "<a href=\"index.php?action=umin&amp;sid=$sid\">»More about me</a><br/>";
        echo 
    "<a href=\"index.php?action=upre&amp;sid=$sid\">»Preferences</a><br/>";
        
        
        echo 
    "</p>";
        echo 
    "<p align=\"center\">";

      echo 
    "<b>0 </b><a accesskey=\"0\" href=\"index.php?action=main&amp;sid=$sid\"><img src=\"../images/home.gif\" alt=\"\"/>Home</a>";
      echo 
    "</p>";
        echo 
    "</body>";
    }

    //////////////////////////////////////////User Address

    else if($action=="uadd")
    {
        
    addonline(getuid_sid($sid),"My Address","");
        echo 
    "<head>";
        echo 
    "<title>My Adderss</title>";
      
    $thmname=$theme["theme"];
      
    $them=explode("_",$thmname);
      
    $them2=$them[0];
      if(
    $them2=="Custom")
          {
        include(
    "custom_theme.inc.php");
        }else{
      echo 
    "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
        }
            echo 
    "</head>";
        echo 
    "<body>";
        
    $ainfo mysql_fetch_array(mysql_query("SELECT country, city, street, phoneno, timezone FROM ibwf_xinfo WHERE uid='".getuid_sid($sid)."'"));
        echo 
    "<p>";
        echo 
    "<small><img src=\"../images/point.gif\" alt=\"!\"/>Go to Preferences and choose buddies only if you want only your buddies to see your street and phone number<br/>";
        echo 
    "<img src=\"../images/point.gif\" alt=\"!\"/>If you don't anyone to see these information just don't type them<br/>";
        echo 
    "<img src=\"../images/point.gif\" alt=\"!\"/>Example on timezone is 2 for +2 hours on GMT, or -2.5 for -2:30 on GMT<br/>";
        echo 
    "<img src=\"../images/point.gif\" alt=\"!\"/>These info. will help you to meet friends and dates from where do you live<br/><br/></small>";
        echo 
    "<form action=\"genproc.php?action=uadd&amp;sid=$sid\" method=\"post\">";
        echo 
    "Country: <input name=\"ucon\" value=\"$ucon\" maxlength=\"50\"><br/>";
        echo 
    "City: <input name=\"ucit\" value=\"$ucit\" maxlength=\"50\"><br/>";
        echo 
    "Street: <input name=\"ustr\" value=\"$ustr\" maxlength=\"50\"><br/>";
        echo 
    "Timezone(e.g +2 or -2.5): <input name=\"utzn\" size=\"5\" value=\"0\" maxlength=\"5\"><br/>";
        echo 
    "Phone No.: <input name=\"uphn\" value=\"$uphn\" maxlength=\"20\"><br/>";
        echo 
    "<input type=\"Submit\" name=\"Submit\" value=\"Submit\"></form>";
        echo 
    "</p>";
        echo 
    "<p align=\"center\">";
      echo 
    "<b>0 </b><a accesskey=\"0\" href=\"index.php?action=main&amp;sid=$sid\"><img src=\"../images/home.gif\" alt=\"\"/>Home</a>";
      echo 
    "</p>";
        echo 
    "</body>";
    }

    //////////////////////////////////////////User Preferences

    else if($action=="upre")
    {
        
    addonline(getuid_sid($sid),"Preferences","");
        echo 
    "<head>";
        echo 
    "<title>User Preferences</title>";
      
    $thmname=$theme["theme"];
      
    $them=explode("_",$thmname);
      
    $them2=$them[0];
      if(
    $them2=="Custom")
          {
        include(
    "custom_theme.inc.php");
        }else{
      echo 
    "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
        }
            echo 
    "</head>";
        echo 
    "<body>";
        
    $ainfo mysql_fetch_array(mysql_query("SELECT budsonly, sexpre FROM ibwf_xinfo WHERE uid='".getuid_sid($sid)."'"));
        echo 
    "<p>";
        echo 
    "<img src=\"../images/point.gif\" alt=\"!\"/>Set buddies only to yes, so only your buddies can see your phone number, street, and real name<br/>";
        echo 
    "<img src=\"../images/point.gif\" alt=\"!\"/>Sex preference will help the correct people to find you";
        echo 
    "<form action=\"genproc.php?action=upre&amp;sid=$sid\" method=\"post\">";
        echo 
    "Buddies Only:<br/>";
        echo 
    "<select name=\"ubon\" value=\"$ainfo[0]\">";
        echo 
    "<option value=\"1\">Yes</option>";
        echo 
    "<option value=\"0\">No</option>";
        echo 
    "</select>";
        echo 
    "<br/>Sex Preference:<br/>";
        echo 
    "<select name=\"usxp\" value=\"$ainfo[1]\">";
        echo 
    "<option value=\"F\">Females</option>";
        echo 
    "<option value=\"M\">Males</option>";
        echo 
    "<option value=\"B\">Both</option>";
        echo 
    "</select>";
        echo 
    "<br/><input type=\"Submit\" name=\"Submit\" value=\"Submit\"></form>";
        echo 
    "</p>";
        echo 
    "<p align=\"center\">";
      echo 
    "<b>0 </b><a accesskey=\"0\" href=\"index.php?action=main&amp;sid=$sid\"><img src=\"../images/home.gif\" alt=\"\"/>Home</a>";
      echo 
    "</p>";
        echo 
    "</body>";
    }

    //////////////////////////////////////////User Personaliy

    else if($action=="uper")
    {
        
    addonline(getuid_sid($sid),"Personality","");
        echo 
    "<head>";
        echo 
    "<title>Personality</title>";
      
    $thmname=$theme["theme"];
      
    $them=explode("_",$thmname);
      
    $them2=$them[0];
      if(
    $them2=="Custom")
          {
        include(
    "custom_theme.inc.php");
        }else{
      echo 
    "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
        }
            echo 
    "</head>";
        echo 
    "<body>";
        
    $ainfo mysql_fetch_array(mysql_query("SELECT height, weight, realname, racerel, eyescolor, profession, hairtype FROM ibwf_xinfo WHERE uid='".getuid_sid($sid)."'"));
        echo 
    "<p>";
        echo 
    "<form action=\"genproc.php?action=uper&amp;sid=$sid\" method=\"post\">";
        echo 
    "Height: <input name=\"uhig\" value=\"$ainfo[0]\" maxlength=\"10\"><br/>";
        echo 
    "Weight: <input name=\"uwgt\" value=\"$ainfo[1]\" maxlength=\"10\"><br/>";
        echo 
    "Real Name: <input name=\"urln\" value=\"$ainfo[2]\" maxlength=\"100\"><br/>";
        echo 
    "Ethnic Origin: <input name=\"ueor\" value=\"$ainfo[3]\" maxlength=\"100\"><br/>";
        echo 
    "Eyes: <input name=\"ueys\" value=\"$ainfo[4]\" maxlength=\"10\"><br/>";
        echo 
    "Hair: <input name=\"uher\" value=\"$ainfo[6]\" maxlength=\"50\"><br/>";
        echo 
    "Profession: <input name=\"upro\" value=\"$ainfo[5]\" maxlength=\"100\"><br/>";
        echo 
    "<input type=\"Submit\" name=\"Submit\" Value=\"Submit\"></form>";
        echo 
    "</p>";
        echo 
    "<p align=\"center\">";
      echo 
    "<b>0 </b><a accesskey=\"0\" href=\"index.php?action=main&amp;sid=$sid\"><img src=\"../images/home.gif\" alt=\"\"/>Home</a>";
      echo 
    "</p>";
        echo 
    "</body>";
    }

    //////////////////////////////////////////User Personaliy

    else if($action=="umin")
    {
        
    addonline(getuid_sid($sid),"More About Me","");
        echo 
    "<head>";
        echo 
    "<title>More About Me</title>";
      
    $thmname=$theme["theme"];
      
    $them=explode("_",$thmname);
      
    $them2=$them[0];
      if(
    $them2=="Custom")
          {
        include(
    "custom_theme.inc.php");
        }else{
      echo 
    "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
        }
        echo 
    "</head>";
        echo 
    "<body>";
        
    $ainfo mysql_fetch_array(mysql_query("SELECT likes, deslikes, habitsb, habitsg, favsport, favmusic, moretext FROM ibwf_xinfo WHERE uid='".getuid_sid($sid)."'"));
        echo 
    "<p>";
        echo 
    "<form action=\"genproc.php?action=umin&amp;sid=$sid\" method=\"post\">";
        echo 
    "Likes: <input name=\"ulik\" value=\"$ainfo[0]\" maxlength=\"250\"><br/>";
        echo 
    "Dislikes: <input name=\"udlk\" value=\"$ainfo[1]\" maxlength=\"250\"><br/>";
        echo 
    "Bad Habbits: <input name=\"ubht\" value=\"$ainfo[2]\" maxlength=\"250\"><br/>";
        echo 
    "Good Habbits: <input name=\"ught\" value=\"$ainfo[3]\" maxlength=\"250\"><br/>";
        echo 
    "Favorite Sports: <input name=\"ufsp\" value=\"$ainfo[4]\" maxlength=\"100\"><br/>";
        echo 
    "Favorite Music: <input name=\"ufmc\" value=\"$ainfo[5]\" maxlength=\"100\"><br/>";
        echo 
    "More Text: <input name=\"umtx\" value=\"$ainfo[6]\" maxlength=\"500\"><br/>";
        echo 
    "<input type=\"Submit\" name=\"Submit\" value=\"Submit\"></form>";
        echo 
    "</p>";
        echo 
    "<p align=\"center\">";
      echo 
    "<b>0 </b><a accesskey=\"0\" href=\"index.php?action=main&amp;sid=$sid\"><img src=\"../images/home.gif\" alt=\"\"/>Home</a>";
      echo 
    "</p>";
        echo 
    "</body>";
    }

    //////////////////////////////////////////G-Mail Settings

    else if($action=="gmset")
    {
        
    addonline(getuid_sid($sid),"GMail Settings","");
        echo 
    "<head>";
        echo 
    "<title>Gmail Settings</title>";
      
    $thmname=$theme["theme"];
      
    $them=explode("_",$thmname);
      
    $them2=$them[0];
      if(
    $them2=="Custom")
          {
        include(
    "custom_theme.inc.php");
        }else{
      echo 
    "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
        }
            echo 
    "</head>";
        echo 
    "<body>";
        
    $ainfo mysql_fetch_array(mysql_query("SELECT gmailun, gmailpw, gmailchk FROM ibwf_xinfo WHERE uid='".getuid_sid($sid)."'"));
        echo 
    "<p>";
        echo 
    "<img src=\"../images/point.gif\" alt=\"!\"/>Set these values only if you want to be auto-logged in your gmail account<br/>";
        echo 
    "<img src=\"../images/point.gif\" alt=\"!\"/>Put in the checking field the time you want $sitename to check your g-mail account<br/>";
        echo 
    "<img src=\"../images/point.gif\" alt=\"!\"/>Putting less than 20 minutes could slow your navigation throw $sitename, suggested period is 30 minutes<br/>";
        echo 
    "<form action=\"genproc.php?action=gmset&amp;sid=$sid\" method=\"post\">";
        echo 
    "G-Mail Username: <input name=\"ugun\" value=\"$ainfo[0]\" maxlength=\"100\"/><br/>";
        echo 
    "G-Mail Password: <input name=\"ugpw\" value=\"$ainfo[1]\" maxlength=\"200\"/><br/>";
        echo 
    "<img src=\"../images/point.gif\" alt=\"!\"/>Valid values 0 - 99 minutes, 0 will check your e-mail with every action you make<br/>";
        echo 
    "G-Mail Checking: <input name=\"ugch\" style=\"-wap-input-format: '*N'\" size=\"2\" value=\"$ainfo[2]\" maxlength=\"2\"/><br/>";
        echo 
    "<input type=\"submit\" name=\"submit\" value=\"Submit\"></form>";
        echo 
    "</p>";
        echo 
    "<p align=\"center\">";
        echo 
    "<a href=\"index.php?action=cpanel&amp;sid=$sid\">User Settings</a><br/>";
      echo 
    "<b>0 </b><a accesskey=\"0\" href=\"index.php?action=main&amp;sid=$sid\"><img src=\"../images/home.gif\" alt=\"\"/>Home</a>";
        echo 
    "</p>";
        echo 
    "</body>";
    }

    //////////////////////////////////////////Give Game Plusses

    else if($action=="givegp")
    {
      
    $who $_GET["who"];
      
    addonline(getuid_sid($sid),"Giving Game Plusses","");
        echo 
    "<head>";
        echo 
    "<title>Give Game Plusses</title>";
      
    $thmname=$theme["theme"];
      
    $them=explode("_",$thmname);
      
    $them2=$them[0];
      if(
    $them2=="Custom")
          {
        include(
    "custom_theme.inc.php");
        }else{
      echo 
    "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
        }
            echo 
    "</head>";
        echo 
    "<body>";
      echo 
    "<p align=\"center\">";
      echo 
    "<b>Give GPs To ".getnick_uid($who)."</b><br/><br/>";
      
    $gps mysql_fetch_array(mysql_query("SELECT gplus FROM ibwf_users WHERE id='".getuid_sid($sid)."'"));
      echo 
    "You have $gps[0] GP's<br/><br/>";
      echo 
    "GP's to give<br/>";
      echo 
    "<form action=\"genproc.php?action=givegp&amp;sid=$sid&amp;who=$who\" method=\"post\">";
      echo 
    "<input name=\"tfgp\" style=\"-wap-input-format: '*N'\" maxlength=\"2\">";
      echo 
    "<br/><input type=\"Submit\" Value=\"Give\" name=\"Give\"></form>";
      echo 
    "<br/><br/><b>0 </b><a accesskey=\"0\" href=\"index.php?action=main&amp;sid=$sid\"><img src=\"../images/home.gif\" alt=\"\"/>Home</a>";
      echo 
    "</p>";
      echo 
    "</body>";
    }

    //////////////////////////////////////////Give Battle points

    else if($action=="batp")
    {
      
    $who $_GET["who"];
      
    addonline(getuid_sid($sid),"Giving Battle Points","");
        echo 
    "<head>";
        echo 
    "<title>Give Battle Points</title>";
      
    $thmname=$theme["theme"];
      
    $them=explode("_",$thmname);
      
    $them2=$them[0];
      if(
    $them2=="Custom")
          {
        include(
    "custom_theme.inc.php");
        }else{
      echo 
    "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
        }
            echo 
    "</head>";
        echo 
    "<body>";
      echo 
    "<p align=\"center\">";
      
    $judg mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_judges WHERE uid='".getuid_sid($sid)."'"));
      if(
    ismod(getuid_sid($sid))||$judg[0]>0)
      {
      echo 
    "<b>Give/Take BPs To ".getnick_uid($who)."</b><br/><br/>";
      echo 
    "<form action=\"genproc.php?action=batp&amp;sid=$sid&amp;who=$who\" method=\"post\">";
      echo 
    "<input name=\"tfbp\" style=\"-wap-input-format: '*N'\" maxlength=\"2\">";
      echo 
    "<br/><input type=\"hidden\" name=\"giv\" value=\"1\">";
      echo 
    "<input type=\"Submit\" name=\"Add\" Value=\"Add\"></form>";
        echo 
    "<form action=\"genproc.php?action=batp&amp;sid=$sid&amp;who=$who\" method=\"post\">";
      echo 
    "<input name=\"tfbp\" style=\"-wap-input-format: '*N'\" maxlength=\"2\">";
      echo 
    "<br/><input type=\"hidden\" name=\"giv\" value=\"0\">";
      echo 
    "<input type=\"Submit\" name=\"Remove\" Value=\"Remove\"></form>";
      }else{
        echo 
    "You Can't Do This";
      }
      echo 
    "<br/><br/><b>0 </b><a accesskey=\"0\" href=\"index.php?action=main&amp;sid=$sid\"><img src=\"../images/home.gif\" alt=\"\"/>Home</a>";
      echo 
    "</p>";
      echo 
    "</body>";
    }

    //////////////////////////////////////////Post Options

    else if($action=="pstopt")
    {
      
    $pid $_GET["pid"];
      
    $page $_GET["page"];
      
    $fid $_GET["fid"];
        
    addonline(getuid_sid($sid),"Post Options","");
        
    $pinfomysql_fetch_array(mysql_query("SELECT uid,tid, text  FROM ibwf_posts WHERE id='".$pid."'"));
        
    $trid $pinfo[0];
        
    $tid $pinfo[1];
        
    $ptext htmlspecialchars($pinfo[2]);
        echo 
    "<head>";
        echo 
    "<title>Post Options</title>";
      
    $thmname=$theme["theme"];
      
    $them=explode("_",$thmname);
      
    $them2=$them[0];
      if(
    $them2=="Custom")
          {
        include(
    "custom_theme.inc.php");
        }else{
      echo 
    "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
        }
            echo 
    "</head>";
        echo 
    "<body>";
      echo 
    "<p align=\"center\">";
      echo 
    "<b>Post Options</b>";
      
      echo 
    "</p>";
      echo 
    "<p>";
      
    $trnick getnick_uid($trid);
      echo 
    "<b>1 </b><a accesskey=\"1\" href=\"inbox.php?action=sendpm&amp;sid=$sid&amp;who=$trid\">»Send PM to $trnick</a><br/>";
      echo 
    "<b>2 </b><a accesskey=\"2\" href=\"index.php?action=viewuser&amp;sid=$sid&amp;who=$trid\">»View $trnick's Profile</a><br/>";
      
    //echo "<b>3 </b><a accesskey=\"3\" href=\"index.php?action=post&amp;sid=$sid&amp;tid=$tid&amp;qut=$pid\">»Quote</a><br/>";
      
    echo "<b>4 </b><a accesskey=\"4\" href=\"genproc.php?action=rpost&amp;sid=$sid&amp;pid=$pid\">»Report</a><br/>";
      echo 
    "<b>5 </b><a accesskey=\"5\" href=\"index.php?action=viewtpc&amp;sid=$sid&amp;tid=$tid&amp;page=$page\">«Back to topic</a><br/>";
      if(
    ismod(getuid_sid($sid)))
      {
        echo 
    "<br/>Text: ";
        echo 
    "<form action=\"modproc.php?action=edtpst&amp;sid=$sid&amp;pid=$pid\" method=\"post\">";
        echo 
    "<input name=\"ptext\" value=\"$ptext\" maxlength=\"500\">";
        echo 
    "<br/><input type=\"Submit\" Value=\"Edit\" name=\"Edit\"></form>";

    echo 
    "<br/><b>6 </b><a accesskey=\"6\" href=\"modproc.php?action=delp&amp;sid=$sid&amp;pid=$pid\">»DELETE</a><br/>";
      }
      echo 
    "</p>";
    echo 
    "<p align=\"center\">";
      echo 
    "<b>7 </b><a accesskey=\"7\" href=\"inbox.php?action=main&amp;sid=$sid\">Inbox</a><br/>";
             echo 
    "<b>8 </b><a accesskey=\"8\" href=\"lists.php?action=buds&amp;sid=$sid\">BuddyList</a><br/>";
             echo 
    "<b>9 </b><a accesskey=\"9\" href=\"index.php?action=chat&amp;sid=$sid\">Chat</a><br/>";
      echo 
    "<b>0 </b><a accesskey=\"0\" href=\"index.php?action=main&amp;sid=$sid\"><img src=\"../images/home.gif\" alt=\"\"/>Home</a>";
      echo 
    "</p>";
      echo 
    "</body>";
    }

    else if(
    $action=="tpcopt")
    {
        
    $tid $_GET["tid"];
        
    addonline(getuid_sid($sid),"Topic Options","");
        
    $tinfomysql_fetch_array(mysql_query("SELECT name,fid, authorid, text, pinned, closed  FROM ibwf_topics WHERE id='".$tid."'"));
        
    $trid $tinfo[2];
        
    $ttext htmlspecialchars($tinfo[3]);
        
    $tname htmlspecialchars($tinfo[0]);
        echo 
    "<head>";
        echo 
    "<title>Toic Options</title>";
      
    $thmname=$theme["theme"];
      
    $them=explode("_",$thmname);
      
    $them2=$them[0];
      if(
    $them2=="Custom")
          {
        include(
    "custom_theme.inc.php");
        }else{
      echo 
    "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
        }
            echo 
    "</head>";
        echo 
    "<body>";
      echo 
    "<p align=\"center\">";
      echo 
    "<b>Topic Options</b>";
      echo 
    "</p>";
      echo 
    "<p>";
      echo 
    "Topic ID: <b>$tid</b><br/>";
      
    $trnick getnick_uid($trid);
      echo 
    "<b>1 </b><a accesskey=\"1\" href=\"inbox.php?action=sendpm&amp;sid=$sid&amp;who=$trid\">»Send PM to $trnick</a><br/>";
      echo 
    "<b>2 </b><a accesskey=\"2\" href=\"index.php?action=viewuser&amp;sid=$sid&amp;who=$trid\">»View $trnick's Profile</a><br/>";
      
    //echo "<b>3 </b><a accesskey=\"3\" href=\"index.php?action=post&amp;sid=$sid&amp;tid=$tid&amp;qut=$pid\">»Quote</a><br/>";
      
    $plid mysql_fetch_array(mysql_query("SELECT pollid FROM ibwf_topics WHERE id='".$tid."'"));
      if(
    $plid[0]==0)
      {
      if(
    ismod($uid))
        {
      echo 
    "<a href=\"index.php?action=pltpc&amp;sid=$sid&amp;tid=$tid\">»Add Poll</a><br/>";
    }
    }else{
      if(
    ismod($uid))
      {
        echo 
    "<a href=\"genproc.php?action=dltpl&amp;sid=$sid&amp;tid=$tid\">»Delete Poll</a><br/>";
        }
    }
      echo 
    "<b>4 </b><a accesskey=\"4\" href=\"genproc.php?action=rtpc&amp;sid=$sid&amp;tid=$tid\">»Report</a><br/>";
      echo 
    "<b>5 </b><a accesskey=\"5\" href=\"index.php?action=viewtpc&amp;sid=$sid&amp;tid=$tid&amp;page=1\">«Back to topic</a><br/>";
      if(
    ismod(getuid_sid($sid)))
      {
        echo 
    "<br/>Title: ";
        echo 
    "<form action=\"modproc.php?action=rentpc&amp;sid=$sid&amp;tid=$tid\" method=\"post\">";
        echo 
    "<input name=\"tname\" value=\"$tname\" maxlength=\"25\"/>";
        echo 
    "<br/><input type=\"Submit\" Name=\"Rename\" Value=\"Rename\"></form>";
        echo 
    "<br/>Text: ";
        echo 
    "<form action=\"modproc.php?action=edttpc&amp;sid=$sid&amp;tid=$tid\" method=\"post\">";
        echo 
    "<input name=\"ttext\" value=\"$ttext\" maxlength=\"500\"/>";
        echo 
    "<br/><input type=\"Submit\" Name=\"Edit\" Value=\"Edit\"></form>";

    echo 
    "<br/><a href=\"modproc.php?action=delt&amp;sid=$sid&amp;tid=$tid\">»DELETE</a><br/>";
        echo 
    "<br/>";
        if(
    $tinfo[5]=='1')
        {
          
    $ctxt "Open";
          
    $cact "0";
        }else{
            
    $ctxt "Close";
          
    $cact "1";
        }
        echo 
    "<a href=\"modproc.php?action=clot&amp;sid=$sid&amp;tid=$tid&amp;tdo=$cact\">»$ctxt</a><br/>";
        if(
    $tinfo[4]=='1')
        {
          
    $ptxt "Unpin";
          
    $pact "0";
        }else{
            
    $ptxt "Pin";
          
    $pact "1";
        }
      echo 
    "<a href=\"modproc.php?action=pint&amp;sid=$sid&amp;tid=$tid&amp;tdo=$pact\">»$ptxt</a><br/>";
      
    //echo "<a href=\"index.php?action=post&amp;sid=$sid&amp;tid=$tid&amp;qut=$pid\">»Quote</a><br/>";
      
    echo "<br/>Move to:<br/>";
      
    $forums mysql_query("SELECT id, name FROM ibwf_forums WHERE clubid='0'");
      echo 
    "<form action=\"modproc.php?action=mvt&amp;sid=$sid&amp;tid=$tid\" method=\"post\">";
      echo 
    "<select name=\"mtf\">";
      while (
    $forum mysql_fetch_array($forums))
      {
        echo 
    "<option value=\"$forum[0]\">$forum[1]</option>";
      }
      echo 
    "</select><br/>";
      echo 
    "<input type=\"Submit\" Value=\"Move\" name=\"Move\"></form>";
      }
      echo 
    "</p>";
    echo 
    "<p align=\"center\">";
      echo 
    "<b>7 </b><a accesskey=\"7\" href=\"inbox.php?action=main&amp;sid=$sid\">Inbox</a><br/>";
             echo 
    "<b>8 </b><a accesskey=\"8\" href=\"lists.php?action=buds&amp;sid=$sid\">BuddyList</a><br/>";
             echo 
    "<b>9 </b><a accesskey=\"9\" href=\"index.php?action=chat&amp;sid=$sid\">Chat</a><br/>";
      echo 
    "<b>0 </b><a accesskey=\"0\" href=\"index.php?action=main&amp;sid=$sid\"><img src=\"../images/home.gif\" alt=\"\"/>Home</a>";
      echo 
    "</p>";
      echo 
    "</body>";
    }
    else if (
    $action=="chat")           {
            
    addonline(getuid_sid($sid),"Lookin At ChatRooms","index.php?action=chat");
            echo 
    "<head>";
            echo 
    "<title>Chatroom List</title>";
      
    $thmname=$theme["theme"];
      
    $them=explode("_",$thmname);
      
    $them2=$them[0];
      if(
    $them2=="Custom")
          {
        include(
    "custom_theme.inc.php");
        }else{
      echo 
    "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
        }
                echo 
    "</head>";
            echo 
    "<body>";
            
    //echo "<div><img src=\"../images/chat.gif\" alt=\"\"/></div>";
            
    echo popup($sid);
            echo 
    "<p align=\"center\">";
            
    $rooms mysql_query("SELECT id, name, perms, mage, chposts FROM ibwf_rooms WHERE static='1' AND clubid='0'");
            while (
    $roommysql_fetch_array($rooms))
            {
              
              
    /*if(canenter($room[0], $sid))
              {*/
                
    $noi mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_chonline WHERE rid='".$room[0]."'"));
                echo 
    "<a href=\"chat.php?sid=$sid&amp;rid=$room[0]\">$room[1]($noi[0])</a><br/>";
              
    /*}*/
              
            
    }
            echo 
    "<br/>";
            echo 
    "<b>5 </b><a accesskey=\"5\" href=\"index.php?action=uchat&amp;sid=$sid\">Private Rooms</a><br/>";
            echo 
    "<b>6 </b><a accesskey=\"6\" href=\"inbox.php?action=main&amp;sid=$sid\">Inbox</a><br/>";
            echo 
    "<b>7 </b><a accesskey=\"7\" href=\"lists.php?action=buds&amp;sid=$sid\">BuddyList</a><br/>";
            echo 
    "<b>8 </b><a accesskey=\"8\" href=\"index.php?action=chat&amp;sid=$sid\">Chatrooms</a><br/>";
            echo 
    forumlink($sid,9);

      echo 
    "<b>0 </b><a accesskey=\"0\" href=\"index.php?action=main&amp;sid=$sid\"><img src=\"../images/home.gif\" alt=\"\"/>Home</a>";
            echo 
    "</p>";
            echo 
    "</body>";
                                               }
    else if (
    $action=="uchat")           {
    addonline(getuid_sid($sid),"Chat Menu","");
        echo 
    "<head>";
        echo 
    "<title>Chat Menu</title>";
      
    $thmname=$theme["theme"];
      
    $them=explode("_",$thmname);
      
    $them2=$them[0];
      if(
    $them2=="Custom")
          {
        include(
    "custom_theme.inc.php");
        }else{
      echo 
    "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
        }
            echo 
    "</head>";
        echo 
    "<body>";
            echo 
    "<p align=\"center\">";
            echo 
    "<img src=\"../images/chat.gif\" alt=\"*\"/><br/>";
          echo 
    "</p>";
    echo 
    "<p align=\"center\">";
         echo 
    "<br/>";
            echo 
    "<b>1 </b><a accesskey=\"1\" href=\"index.php?action=chat&amp;sid=$sid\">Public Rooms</a><br/>";
            echo 
    "<b>2 </b><a accesskey=\"2\" href=\"index.php?action=mkroom&amp;sid=$sid\">Create Room</a><br/><br/>";
            
    $rooms mysql_query("SELECT id, name, pass FROM ibwf_rooms WHERE static='0'");
            
    $co=0;
            while (
    $roommysql_fetch_array($rooms))
            {
                
    $co++;
              if(
    canenter($room[0], $sid))
              {
                
    $noi mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_chonline WHERE rid='".$room[0]."'"));
                if(
    $room[2]=="")
                {
                echo 
    "<a href=\"chat.php?sid=$sid&amp;rid=$room[0]\">".htmlspecialchars($room[1])."($noi[0])</a><br/>";
                }else{
    echo 
    htmlspecialchars($room[1]);
                  
    //echo "($noi[0])";
    echo "<form action=\"chat.php\" method=\"get\">";
                  echo 
    "<br/><input format=\"*x\" name=\"rpw\" maxlength=\"10\"/><br/>";
    echo 
    "<input type=\"submit\" value=\"GO\"/>";
                  echo 
    "<input type=\"hidden\" name=\"rid\" value=\"$room[0]\"/>";
                  echo 
    "<input type=\"hidden\" name=\"sid\" value=\"$sid\"/>";
                  echo 
    "</form>";
                }
              }
            }
            echo 
    "<br/><br/><b>6 </b><a accesskey=\"6\" href=\"inbox.php?action=main&amp;sid=$sid\">Inbox</a><br/>";
            echo 
    "<b>7 </b><a accesskey=\"7\" href=\"lists.php?action=buds&amp;sid=$sid\">BuddyList</a><br/>";
            echo 
    "<b>8 </b><a accesskey=\"8\" href=\"index.php?action=chat&amp;sid=$sid\">Chatrooms</a><br/>";
            echo 
    forumlink($sid,9);

      echo 
    "<b>0 </b><a accesskey=\"0\" href=\"index.php?action=main&amp;sid=$sid\"><img src=\"../images/home.gif\" alt=\"\"/>Home</a>";
            echo 
    "</p>";
            echo 
    "</body>";
                                               }
    else if(
    $action=="mkroom")
    {
        
    addonline(getuid_sid($sid),"Creating Chatroom","");
        echo 
    "<head>";
        echo 
    "<title>Create Room</title>";
      
    $thmname=$theme["theme"];
      
    $them=explode("_",$thmname);
      
    $them2=$them[0];
      if(
    $them2=="Custom")
          {
        include(
    "custom_theme.inc.php");
        }else{
      echo 
    "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
        }
            echo 
    "</head>";
        echo 
    "<body>";
            echo 
    "<p>";
            echo 
    "<small><img src=\"../images/point.gif\" alt=\"!\"/>Leave password empty if you dont want to lock the room</small><br/>";
            echo 
    "<small><img src=\"../images/point.gif\" alt=\"!\"/>Don't make the password too personal, it's visible in the database</small><br/><br/>";
            echo 
    "<form action=\"genproc.php?action=mkroom&amp;sid=$sid\" method=\"post\">";
            echo 
    "Room Name: <input name=\"rname\" maxlength=\"30\"><br/>";
            echo 
    "Password: <input name=\"rpass\" style=\"-wap-input-format: '*x'\" maxlength=\"10\"><br/>";
            echo 
    "<input type=\"Submit\" name=\"Create\" Value=\"Create\"></form>";
            echo 
    "</p>";
            echo 
    "<p align=\"center\">";
            echo 
    "<b>6 </b><a accesskey=\"6\" href=\"inbox.php?action=main&amp;sid=$sid\">Inbox</a><br/>";
            echo 
    "<b>7 </b><a accesskey=\"7\" href=\"lists.php?action=buds&amp;sid=$sid\">BuddyList</a><br/>";
            echo 
    "<b>8 </b><a accesskey=\"8\" href=\"index.php?action=chat&amp;sid=$sid\">Chatrooms</a><br/>";
            echo 
    forumlink($sid,9);

      echo 
    "<b>0 </b><a accesskey=\"0\" href=\"index.php?action=main&amp;sid=$sid\"><img src=\"../images/home.gif\" alt=\"\"/>Home</a>";
            echo 
    "</p>";
            echo 
    "</body>";
    }
                                               
    ///////////////////fun menu

    else if ($action=="funm")           {
    addonline(getuid_sid($sid),"Fun Menu","");
        echo 
    "<head>";
        echo 
    "<title>Fun n Games</title>";
        echo 
    "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
        echo 
    "</head>";
        echo 
    "<body>";
            echo 
    "<p align=\"center\">";
            echo 
    "<img src=\"../images/roll.gif\" alt=\"*\"/><br/>";
            echo 
    "Hi and welcome to the game zone.. If your lookin for some fun then you have come to the right place..enjoy";
            echo 
    "</p>";
            echo 
    "<p align=\"center\">";
            echo 
    "<i><u>Newly Added!!</u></i><br/>";
            echo 
    "<a href=\"monster.php?action=main&amp;sid=$sid\">Monster Land - Note this is a work in progress</a><br/>";
            echo 
    "<i><u>Just For Fun!!</u></i><br/>";
            echo 
    "<a  href=\"games.php?action=hangman&amp;sid=$sid\">Hangman</a><br/>";
            echo 
    "<a  href=\"games.php?action=scramble&amp;sid=$sid\">Word Scramble</a><br/>";
            echo 
    "<a  href=\"games.php?action=8ball&amp;sid=$sid\">8ball</a><br/>";
            echo 
    "<a  href=\"games.php?action=fci&amp;sid=$sid\">Fortune Cookie</a><br/>";
            echo 
    "<i><u>Win Plusses!!</u></i><br/>";
            echo 
    "<a href=\"games.php?action=jackpot&amp;sid=$sid\">jackpot</a><br/>";
            echo 
    "<a  href=\"games.php?action=guessgm&amp;sid=$sid\">Guess The Number</a><br/>";
            echo 
    "<a  href=\"games.php?action=casinoi&amp;sid=$sid\">Casino</a><br/>";
            echo 
    "<a href=\"games.php?action=lottoi&amp;sid=$sid\">Lotto</a><br/>";
            echo 
    "<i><u>Meet New Friends!!</u></i><br/>";
            echo 
    "<a href=\"games.php?action=mixabud&amp;sid=$sid\">Mix a Buddy</a><br/>";
            echo 
    "<a href=\"games.php?action=mixabudguy&amp;sid=$sid\">Mix a Guy (For Girls Only)</a><br/>";
            echo 
    "<a href=\"games.php?action=mixabudgirl&amp;sid=$sid\">Mix a Girl (For Guys Only)</a><br/>";
            echo 
    "<i><u>The Quiz Zone!!</u></i><br/>";
            echo 
    "<a  href=\"games.php?action=quiz&amp;sid=$sid\">»Quiz</a><br/>";
            echo 
    "</p>";
      
    $tmsg getpmcount(getuid_sid($sid));
      
    $umsg getunreadpm(getuid_sid($sid));
            echo 
    "<p align=\"center\">";
            echo 
    "<b>7 </b><a accesskey=\"7\" href=\"inbox.php?action=main&amp;sid=$sid\">Inbox($umsg/$tmsg)</a><br/>";
            echo 
    "<b>8 </b><a accesskey=\"8\" href=\"lists.php?action=buds&amp;sid=$sid\">BuddyList</a><br/>";
            echo 
    "<b>9 </b><a accesskey=\"9\" href=\"index.php?action=chat&amp;sid=$sid\">Chatrooms</a><br/>";
            echo 
    forumlink($sid,9);

      echo 
    "<b>0 </b><a accesskey=\"0\" href=\"index.php?action=main&amp;sid=$sid\"><img src=\"../images/home.gif\" alt=\"\"/>Home</a>";
            echo 
    "</p>";
            echo 
    "</body>";
    }
    ////////////////////free zone

    else if ($action=="free")
    {
      
    addonline(getuid_sid($sid),"Free Zone","");
      echo 
    "<head>";
      echo 
    "<title>Site Free Zone!!</title>";
      echo 
    "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
      echo 
    "</head>";
      echo 
    "<body>";
      echo 
    "<p align=\"center\">";
      echo 
    "<img src=\"../images/free.gif\" alt=\"*\"/><br/>";
      echo 
    "Welcome to The Site Free Zone, here u will find free downloads our site file share plus lots lots more";
      echo 
    "</p>";
      echo 
    "<p align=\"center\">";
      echo 
    "<i><u>pix vids n mp3s</u></i><br/>";
      
    $downloads mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_uploads"));
      echo 
    "<a href=\"../uploaded/index.php?sid=$sid&amp;site=web\">Downloads($downloads[0])</a><br/>";
      echo 
    "<i><u>Tunes!!</u></i><br/>";
    if(!(
    $dp opendir("../requests/"))) die ("Cannot open ./");
    $files = array(); 
    while (
    $pics readdir ($dp))
       {
       if(
    substr($pics,0,1) != '.' and $pics!= "index.php")
          {
          
    $files[] =  $pics;
          }
       }
    $count count ($files);
    sort ($files);
      echo 
    "<a href=\"../requests/index.php?action=requests&amp;sid=$sid&amp;script=xhtml\">Mp3 Requests($count)</a><br/>";
      
    //echo "<i><u>Videos!!</u></i><br/>";
      //echo "<a href=\"../3gp/index.php?action=main&amp;sid=$sid&amp;script=xhtml\">Videos</a><br/>";
      //echo "<i><u>Adult!!</u></i><br/>";
      //echo "Not Yet Available keep checkin for updates!!<br/>";
      
    echo "<i><u>Find More Here!!</u></i><br/>";
      
    //echo "<a href=\"http://deelishwap.co.uk/top/in.php?sid=1\"><i>Masters Top Sites</i></a><br/><br/>";
      
    echo "<b>0 </b><a accesskey=\"0\" href=\"index.php?action=main&amp;sid=$sid\"><img src=\"../images/home.gif\" alt=\"\"/>Home</a>";
      echo 
    "</p>";
      echo 
    "</body>";
     }

    ///////////////////////////////view blog

    else if($action=="viewblog")
    {
      
    $bid $_GET["bid"];
      
    addonline(getuid_sid($sid),"Viewing Users Blog","");
        echo 
    "<head>";
        echo 
    "<title>View Blog</title>";
      
    $thmname=$theme["theme"];
      
    $them=explode("_",$thmname);
      
    $them2=$them[0];
      if(
    $them2=="Custom")
          {
        include(
    "custom_theme.inc.php");
        }else{
      echo 
    "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
        }    echo 
    "</head>";
        echo 
    "<body>";
      echo 
    "<p>";

      
    $pminfo mysql_fetch_array(mysql_query("SELECT btext, bname, bgdate,bowner, id FROM ibwf_blogs WHERE id='".$bid."'"));
        
    $bttl htmlspecialchars($pminfo[1]);
        
    $btxt parsemsg($pminfo[0], $sid);
        
    $bnick getnick_uid($pminfo[3]);
      
    $vbbl "<a href=\"index.php?action=viewuser&amp;sid=$sid&amp;who=$pminfo[3]\">$bnick</a><br/>";
      echo 
    "Club ID: <b>$bid</b><br/>";
        echo 
    "<b>$bttl</b> by: $vbbl<br/>";
      echo 
    "$btxt<br/>";
      
    $tmstamp $pminfo[2];
      
    $tmdt date("d m y - h:i:s"$tmstamp);
      echo 
    "<small>$tmdt</small><br/><br/>";
      
    $vb mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_brate WHERE uid='".$uid."' AND blogid='".$bid."'"));
      if(
    $vb[0]==0)
      {
      echo 
    "<form action=\"genproc.php?action=rateb&amp;sid=$sid&amp;bid=$pminfo[4]\" method=\"post\">";
      echo 
    "<select name=\"brate\">";
      echo 
    "<option value=\"1\">1</option>";
      echo 
    "<option value=\"2\">2</option>";
      echo 
    "<option value=\"3\">3</option>";
      echo 
    "<option value=\"4\">4</option>";
      echo 
    "<option value=\"5\">5</option>";
      echo 
    "</select><br/>";
      echo 
    "<input type=\"Submit\" Name=\"Rate\" Value=\"Rate\"></form>";
      }else{
        
    $rinfo mysql_fetch_array(mysql_query("SELECT COUNT(*) as nofr, SUM(brate) as nofp FROM ibwf_brate WHERE blogid='".$bid."'"));
        
    $ther $rinfo[1]/$rinfo[0];
        echo 
    "Rate: $ther - Points: $rinfo[1]";
      }
      echo 
    "</p>";
      echo 
    "<p align=\"center\">";
      echo 
    "<a href=\"lists.php?action=allbl&amp;sid=$sid\">Back to Blogs</a><br/>";
      
    $bnick getnick_uid($pminfo[3]);
      echo 
    "<a href=\"lists.php?action=blogs&amp;sid=$sid&amp;who=$pminfo[3]\">Back to $bnick's Blogs</a><br/>";
      echo 
    "<b>0 </b><a accesskey=\"0\" href=\"index.php?action=main&amp;sid=$sid\"><img src=\"../images/home.gif\" alt=\"\"/>Home</a>";
      echo 
    "</p>";
        echo 
    "</body>";

    }
    /////////////////////////////////Terms of use

    else if($action=="terms")
    {
      
    $uid =getuid_sid($sid);
      if(
    $uid>0)
      {
      
    addonline(getuid_sid($sid),"Terms of use","");
      }
        echo 
    "<head>";
        echo 
    "<title>Terms Of Use</title>";
      
    $thmname=$theme["theme"];
      
    $them=explode("_",$thmname);
      
    $them2=$them[0];
      if(
    $them2=="Custom")
          {
        include(
    "custom_theme.inc.php");
        }else{
      echo 
    "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
        }    echo 
    "</head>";
        echo 
    "<body>";
      echo 
    "<p align=\"center\">";
         echo 
    "<img src=\"../images/point.gif\" alt=\"!\"/>This Site Is made for OVER 18's ONLY, and users found to be lying about their age in order to access the site will be deleted without warning!<br/>";
        echo 
    "<img src=\"../images/point.gif\" alt=\"!\"/>Posts containing racism, spamming, flooding Or hacking Information will be deleted immediately, and the posters will be warned or banned<br/>";
        echo 
    "<img src=\"../images/point.gif\" alt=\"!\"/>Registering more than one nickname, could result in  all your accounts being deleted<br/>";
      echo 
    "<img src=\"../images/point.gif\" alt=\"!\"/>Never give your username and password to anyone<br/>";
      echo 
    "<img src=\"../images/point.gif\" alt=\"!\"/>Faking your personal information (like age, sex, location etc..) just to gain access to hidden forums and other content in here, could result in you being banned, or getting a warning at least<br/>";
      echo 
    "<img src=\"../images/point.gif\" alt=\"!\"/>Harassment and racism will result in a ban, and an permanent IP-Ban if this behavior continues<br/>";
      
    //echo "<img src=\"../images/point.gif\" alt=\"!\"/>Bumping topics (keep posting in them by the author of the topic just to keep it in first page) will cause these topics to be deleted and the penalty could vary between warning, or even a ban<br/>";
      
    echo "<img src=\"../images/point.gif\" alt=\"!\"/>You MUST speak in english on the Public parts of this site (shoutbox, and all chat rooms except user created and international rooms), but you are free to create your own chatroom and club in any language<br/>";
      
    //echo "<img src=\"../images/point.gif\" alt=\"!\"/>No smoking in public, next to the pregnant ladies, or next to babies hehe<br/>";
      
    echo "<img src=\"../images/point.gif\" alt=\"!\"/>ALL Bans are logged as are ALL pms with any form of website links in them, any pms sent containing weblinks will be moderated and may result in a ban for the sending user for an appropriate length of time.<br/>";
      echo 
    "<img src=\"../images/point.gif\" alt=\"!\"/>Watch out for the host hes a cunt lmao ;)<br/>";
      echo 
    "<br/>Remember, these rules were made for protecting you before protecting us, if you think they are a little restrictive then ask any online staff member(only if you logged in), Thank you<br/>";
        echo 
    "</p>";
      echo 
    "<p align=\"center\">";
      if(
    $uid>0)
      {
      echo 
    "<b>0 </b><a accesskey=\"0\" href=\"index.php?action=main&amp;sid=$sid\"><img src=\"../images/home.gif\" alt=\"\"/>Home</a>";
    }else{
      echo 
    "<b>0 </b><a accesskey=\"0\" href=\"index.php\"><img src=\"../images/home.gif\" alt=\"\"/>Home</a>";
    }
      echo 
    "</p>";
      echo 
    "</body>";
    }
    else{
      
    /////////////////////////Main Page Here
      
    echo "<head>";
      echo 
    "<title>$sitename</title>";
      echo 
    "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/black_medium.css\">";
      echo 
    "</head>";
      echo 
    "<body>";
      echo 
    "<div><img src=\"../images/logo.gif\" alt=\"------\"/><br/>";
      echo 
    "".date("H:i")." - ".date("D jS M y")."</div>";
      echo 
    "<p align=\"center\">";
      echo 
    "Welcome to $sitename the newest and best site around so what ya waitin for get yaself inside ;o)</p>";
      echo 
    "<p align=\"center\">wap2.0/xhtml<br/>works with any pc browser n most mobiles</p>";
      
    //echo "<p align=\"center\"><br/><span style=\"color:red\"></span><span style=\"color:red\">*New*</span><br/><a href=\"http://deelishwap.co.uk/top/in.php?sid=1\"><i>Click Here!!</i></a><br/>";
      //echo "<p align=\"center\"><img src=\"../images/banner.gif\" alt=\"\"/></p>";
      
    echo "<form action=\"login.php\" method=\"get\"><p align=\"center\">";
      echo 
    "<b>Username:</b><br/><input align=\"center\" name=\"loguid\" size=\"12\" maxlength=\"12\"/><br/>";
      echo 
    "<b>Password:</b><br/><input align=\"center\" type=\"password\" name=\"logpwd\" size=\"10\" maxlength=\"10\"/><br/>";
      echo 
    "<input type=\"submit\" value=\"Login!\"></p></form>";
      echo 
    "<p align=\"center\"><img src=\"../images/banner.gif\" alt=\"banner\"/></p>";
     
      echo 
    "<p align=\"center\"><br/>Contact Our Host's<a href=\"http://the-madhouse.uk.to\"><br/><i> Click Here !!</i></a>";
      echo 
    "<p align=\"center\"><br/>Not registered yet? <br/><a href=\"register.php\">Join us!!</a><br/>";
      echo 
    "<a href=\"index.php?action=terms&amp;sid=$sid\">Site Rules</a><br/>";
      echo 
    "</p>";
      echo 
    "<p align=\"center\">";
      
    $onu getnumonline();
      echo 
    "Members Inside: $onu<br/><br/>";
    //  echo "<a href=\"../wap/index.php\">Wap 1.0(wml) Version</a>"; 
    //echo "<br/>Original Script by: ";
      //echo "<a href=\"http://lavalair.net\">IrisBlaze</a><br/></p>";

      //echo mobads();
      
    echo "<div><b>©2011<br/>$sitename</b></div>";
      echo 
    "</body>";
    }
    ?>
    </html>
    pLEASE hELP
    Last edited by reebok; 27.06.11, 22:14.

    #2
    Try This way

    Here is a way to make This Code !
    I Think It will be Helpfull >>>
    Code:
    /////////////////////////////////viewuser profile
    
    
    
    else if($action=="viewuser")
    
    {
    
    $who = $_GET["who"];
    
    $whnick = getnick_uid($who);
    
      addonline(getuid_sid($sid),"Viewing <b>$whnick</b> Profile","index.php?action=viewuser&amp;who=$who");
    
        echo "<card id=\"main\" title=\"$sitename\">";
    
       echo "<p align=\"center\"><small>";
    
      $lastloc=$_GET["lstloc"];
    
    if($lastloc=="cht"){
    
    	$rid= $_GET["rid"];
    
        $rooms = mysql_fetch_array(mysql_query("SELECT id, name FROM ibwf_rooms WHERE id='".$rid."'"));
    
        $rname = $rooms[1];
    
    }
    
      if($who==""||$who==0)
    
      {
    
        $mnick = $_POST["mnick"];
    
        $who = getuid_nick($mnick);
    
      }
    
      $whonick = getnick_uid($who);
    
      if($whonick!="")
    
      {
    
    echo "<a href=\"more.php?action=cpanel&amp;sid=$sid\">Control Panel</a><br/>";
    echo "Basic l <a href=\"uinfo.php?who=$who&amp;sid=$sid\">Advanced</a> | ";
    echo "<a href=\"index.php?action=prostats&amp;sid=$sid&amp;who=$who\">Activity</a> | ";
    echo "<a href=\"uinfo.php?action=look&amp;sid=$sid&amp;who=$who\">Info</a><br/><br/>";
    
    if($uid=="1792"||ismod(getuid_sid($sid))||$judg[0]>0)
    {
    echo "<small><a href=\"index.php?action=batp&amp;who=$who&amp;sid=$sid\">&#187;</a>Premium User Cp</small><br/>";
    }
    
    if(isonline($who))
    {
    echo "User is: 0nline!<br/>";
    }
    else
    {
    echo "User is: offline!<br/>";
    }
    
    $plc = mysql_fetch_array(mysql_query("SELECT place FROM ibwf_online WHERE userid='".$who."'"));
    $ln5 = "Where:";
    $go = mysql_fetch_array(mysql_query("SELECT placedet FROM ibwf_online WHERE userid='".$who."'"));
    $lnk2 = "<br/><a href=\"$go[0]&amp;sid=$sid\">Go There!</a>";
    $uact .= $plc[0];
    
    echo "<small>$ln5 <b>$uact</b> $lnk2</small><br/>";
    echo "<small>";
    
    $noi = mysql_fetch_array(mysql_query("SELECT lastact FROM ibwf_users WHERE id='".$who."'"));
    
    $var1 = date("his",$noi[0]);
    
    $var2 = time();
    
    $var21 = date("his",$var2);
    
    $var3 = $var21 - $var1;
    
    $var4 = date("s",$var3);
    
    echo "Idle For: ";
    
    $remain = time() - $noi[0];
    
    $idle = gettimemsg($remain);
    
    echo "$idle<br/><br/>";
    
    echo "</small>";
    
    
    $sql = mysql_fetch_array(mysql_query("SELECT COUNT(id) FROM lastview WHERE whonick='".$whonick."'"));
    
    if ($sql[0]>10)
    
    {
    
    $sql = mysql_fetch_array(mysql_query("SELECT MAX(id) FROM lastview WHERE whonick='".$whonick."'"));
    
    $sql = $sql[0]-9;
    
    mysql_query("DELETE FROM lastview WHERE whonick='".$whonick."' AND id <'".$sql."'");
    
    }
    
    $lv=getnick_sid($sid);
    
    $a = getuid_nick($whonick);
    
    if($a!=$uid)
    
    {
    
    mysql_query("INSERT INTO lastview SET lastview='".$lv."', whonick='".$whonick."', ltime='".time()."'");
    
    }
    
    $sql= mysql_fetch_array(mysql_query("SELECT lastview,ltime FROM lastview WHERE whonick='".$whonick."'ORDER BY ltime DESC LIMIT 1"));
    
    $a = getuid_nick($sql[0]);
    
    $link = "<a href=\"index.php?action=viewuser&amp;sid=$sid&amp;who=$a\"></a>$sql[0]";
    
    echo "Last Viewed By: <b>$link</b>";
    
    $newtime =$sql[1]+(0 *60 *60);
    
    echo "<a href=\"index.php?action=10pv&amp;who=$who&amp;sid=$sid\">[+]</a><br/><br/>";
    
    $couple = mysql_fetch_array(mysql_query("SELECT accept, who, partner FROM couple WHERE who='".$who."'"));
    
    if($couple[0]=='1')
    
    {
    
    echo "<br/>Married With:";
    
    $unick = getnick_uid($couple[2]);
    
    echo "<b>$unick</b><br/><br/>
    
    ";
    
    }
    
    $couples = mysql_fetch_array(mysql_query("SELECT accept, who, partner FROM couple WHERE partner='".$who."'"));
    
    if($couples[0]=='1')
    
    {
    echo "<br/>Married With:";
    
    $nick = getnick_uid($couples[1]);
    
    echo "<b>$nick's</b><br/><br/>
    
    ";
    }
    
    $whonick = getnick_uid($who);
    
    if($who==45)
    {
       echo "<u>Quick PM</u><br/>";
     echo "<input name=\"pmtext\" maxlength=\"500\"/><br/>";
     echo "<anchor>Send<go href=\"chatgirl.php?action=sendpm&amp;who=$who&amp;sid=$sid\" method=\"post\">";
      echo "<postfield name=\"pmtext\" value=\"$(pmtext)\"/>";
      echo "</go></anchor>";
    echo " I <anchor><refresh><setvar name=\"pmtext\" value=\"\"/></refresh>Clear text</anchor><br/><br/>";
    
    }else{
    
    
    
    $inf1 = mysql_fetch_array(mysql_query("SELECT security3 FROM ibwf_users WHERE id='".$who."'"));
    
    
        if($inf1[0]=='1')
        {
        if((arebuds($uid, $who))||(ismod(getuid_sid($sid)))||(isowner(getuid_sid($sid))))
        {
        if($who!==$uid)
    
      {
    
       echo "<u>Quick PM</u><br/>";
     echo "<input name=\"pmtext\" maxlength=\"500\"/><br/>";
     echo "<anchor>Send<go href=\"inbxproc.php?action=sendpm&amp;who=$who&amp;sid=$sid\" method=\"post\">";
      echo "<postfield name=\"pmtext\" value=\"$(pmtext)\"/>";
      echo "</go></anchor>";
    echo " I <anchor><refresh><setvar name=\"pmtext\" value=\"\"/></refresh>Clear text</anchor><br/><br/>";
    
      }
    
    }else{
    
     echo "<b>Only Friends Can Send PM to $whonick!</b><br/><br/>";
    
    }
    }else{
    
    if($who!==$uid)
    
    
      {
       echo "<u>Quick PM</u><br/>";
     echo "<input name=\"pmtext\" maxlength=\"500\"/><br/>";
     echo "<anchor>Send<go href=\"inbxproc.php?action=sendpm&amp;who=$who&amp;sid=$sid\" method=\"post\">";
      echo "<postfield name=\"pmtext\" value=\"$(pmtext)\"/>";
      echo "</go></anchor>";
    echo " I <anchor><refresh><setvar name=\"pmtext\" value=\"\"/></refresh>Clear text</anchor><br/><br/>";
    
      }
    
    }
    
    }
    
    $judg = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_judges WHERE uid='".getuid_sid($sid)."'"));
    
    ////////////////////////////// OWNER TOOLS
    if($uid=="1792"||isowner(getuid_sid($sid)))
    
      {
    
    
      $vp = mysql_fetch_array(mysql_query("SELECT vip FROM ibwf_users WHERE id='".$who."'"));
    
      if($vp[0]=="0")
    
      {
    
      echo "<small><a href=\"oproc.php?action=vip&amp;sid=$sid&amp;who=$who\">&#187;</a>Make VIP</small><br/>";
    
      }else{
    
      echo "<small><a href=\"oproc.php?action=unvip&amp;sid=$sid&amp;who=$who\">&#187;</a>Make Normal</small><br/>";
    
      }
    
    
    
      }
    
    if(isheadadmin(getuid_sid($sid)))
    
      {
    
    
    
      }
    
      if(ismod($uid))
    
      {
    
      if(!isowner(getuid_sid($sid)))
    
      {
    
      if(!isheadadmin(getuid_sid($sid)))
    
      {
    
    
    
      }
    
      }
    
      }
      $avlink = getavatar($who);
    
      if($avlink=="")
    
      {
    echo "<img src=\"../images/nopic.jpg\" alt=\"Nopic\"/>";
      }else{
      echo "<img src=\"$avlink\" alt=\"avatar\" width=\"250\" height=\"250\"/>";
      }
     echo "<br/>";
    
    echo "<a href=\"upavatar.php?action=main&amp;sid=$sid&amp;who=$who\">Upload Picture</a><br/>";
    echo "<a href=\"statusupdates.php?action=user&amp;sid=$sid&amp;who=$who\">Whats On Your Mind?</a><br/><br/>";
    echo "<b>Status Updates:</b><br/>";
    $lpt = mysql_fetch_array(mysql_query("SELECT uid, status FROM w3bjocky_status WHERE uid='".$who."' ORDER BY
    lastupdate DESC LIMIT 0 , 1"));
    
    echo "$lpt[1]<br/>";
    
    $lpt = mysql_fetch_array(mysql_query("SELECT uid, status FROM w3bjocky_status WHERE uid='".$who."' ORDER BY
    lastupdate DESC LIMIT 1 , 2"));
    
    $shawn = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM w3bjocky_status WHERE uid='".$who."'"));
    //echo "<small>";
    echo "<a href=\"statusupdates.php?action=user&amp;sid=$sid&amp;who=$who\">More...[$shawn[0]]</a><br/>";
        echo "</small>";
        echo "</p>";
      echo "<p align=\"left\"><small>";
      $nopl = mysql_fetch_array(mysql_query("SELECT regdate FROM ibwf_users WHERE id='".$who."'"));
    
    $inf1 = mysql_fetch_array(mysql_query("SELECT security FROM ibwf_users WHERE id='".$who."'"));
    
    if($inf1[0]=='1')
    {
     if(($who==$uid)||(arebuds($uid, $who))||(ismod(getuid_sid($sid)))||(isowner(getuid_sid($sid))))
        {
    echo "Member's ID:<b>$who</b><br/>";
    echo "Status: <b>".getstatus($who)."</b><br/>";
    echo "Chat Status: <b>".getchatstatus($who)."</b><br/>";
      $nopl = mysql_fetch_array(mysql_query("SELECT sex, birthday, location FROM ibwf_users WHERE id='".$who."'"));
    
      $uage = getage($nopl[1]);
    
      if($nopl[0]=='M')
    
      {
    
        $usex = "Male";
    
      }else if($nopl[0]=='F'){
    
        $usex = "Female";
    
      }else{
    
        $usex = "SheMale!";
    
      }
    
      $nopl[2] = htmlspecialchars($nopl[2]);
    
      echo "Age: <b>$uage</b><br/>";
    
      echo "Gender: <b>$usex</b><br/>";
    
      echo "Location: <b>$nopl[2]</b><br/>";
      echo "Star sign: <b>".getstarsign($nopl[1])."</b><br/>";
    $cmid = mysql_fetch_array(mysql_query("SELECT  chmood FROM ibwf_users WHERE id='".$who."'"));
    
      $mlnk = mysql_fetch_array(mysql_query("SELECT img, text FROM ibwf_moods WHERE id='".$cmid[0]."'"));
    
                      $iml = "$mlnk[1]";
    
    echo "Online Mood: <b>$iml</b><br/>";
    $lovepoints = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_givelove WHERE who='".$who."'"));
    echo "Love Point: <b>".$lovepoints[0]."</b><br/>";
     $brt = mysql_fetch_array(mysql_query("SELECT birthday FROM ibwf_users WHERE id='".$who."'"));
    
       $unol = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_topics WHERE authorid='".$who."'"));
    
      $tlink = "<a href=\"lists.php?action=tbuid&amp;sid=$sid&amp;who=$who\">$unol[0]</a>";
    
      //echo "Topics: <b>$tlink</b><br/>";
    
      $unop = mysql_fetch_array(mysql_query("SELECT posts FROM ibwf_users WHERE id='".$who."'"));
    
      $unol = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_posts WHERE uid='".$who."'"));
    
      $plink = "<a href=\"lists.php?action=uposts&amp;sid=$sid&amp;who=$who\">$unol[0]</a>";
    
      //echo "Posts: <b>$plink/$unop[0]</b><br/>";
    
    $tmsg = getpmcount(getuid_sid($sid));
    
      $umsg = getunreadpm(getuid_sid($sid));
    
      //$new_gm = getnewgml(getuid_sid($sid));
    
      //echo "<a   href=\"inbox.php?action=main&amp;sid=$sid\"> </a>Unread Pms: <b>$umsg</b><br/>";
    
       $noin = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_private WHERE touid='".$who."'"));
    
      $nout = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_private WHERE byuid='".$who."'"));
    
      echo "PMs IN: <b>$noin[0]</b> - OUT: <b>$nout[0]</b><br/>";
    
    
     $unpm = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_private WHERE touid='".$who."' AND unread>0"));
    
     $unread = mysql_fetch_array(mysql_query("SELECT COUNT(DISTINCT unread) FROM ibwf_private WHERE byuid='".$uid."' AND
    
    touid='".$who."'"));
    
     if($unpm[0]==0)
    
    {
    
     echo "Unread PM's:<b>0,0</b>from U!<br/>";
    
     }else{
    
     echo "Unread PM's:<b> $unpm[0], $unread[0] </b>from U!<br/>";
    
      }
    
    $nop = mysql_fetch_array(mysql_query("SELECT bank FROM ibwf_users WHERE id='".$who."'"));
    
    $nopl = mysql_fetch_array(mysql_query("SELECT plusses FROM ibwf_users WHERE id='".$who."'"));
    
      echo "Plusses &amp; Bank: <b>$nopl[0] &amp; $nop[0]</b><br/>";
    $prof = mysql_fetch_array(mysql_query("SELECT views FROM ibwf_users WHERE id='".$who."'"));
    
    $vws = $prof[0]+1; mysql_query("UPDATE ibwf_users SET views='".$vws."'WHERE  id='".$who."'");
    
    
    
     echo "profile viewed:<b> $prof[0] times</b><br/>";
    
      $nob = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_buddies WHERE (uid='".$who."' OR tid='".$who."') AND agreed='1'"));
    
      echo "Buddies: <b>$nob[0]</b><br/>";
    
    
    
      $nopl = mysql_fetch_array(mysql_query("SELECT signature FROM ibwf_users WHERE id='".$who."'"));
    
      $sign = parsepm($nopl[0], $sid);
    
    
      $nopl = mysql_fetch_array(mysql_query("SELECT browserm FROM ibwf_users WHERE id='".$who."'"));
    
       echo "Browser: <b>$nopl[0]</b><br/>";
    
      $ip = mysql_fetch_array(mysql_query("SELECT ipadd FROM ibwf_users WHERE id='".$who."'"));
    
       echo "Network: ".network($ip[0]);
    echo"<br/>";
      $nopl = mysql_fetch_array(mysql_query("SELECT email FROM ibwf_users WHERE id='".$who."'"));
    
      echo "E-mail: <b>$nopl[0]</b><br/>";
    
    }else{
    
     echo "</small></p><p align=\"center\"><b>Only Friends Can View $whonick's Profile!</b></p><p align=\"left\"><small>";
    
    }
    }else{
    
    echo "Member's ID:<b>$who</b><br/>";
    echo "Status: <b>".getstatus($who)."</b><br/>";
    echo "Chat Status: <b>".getchatstatus($who)."</b><br/>";
      $nopl = mysql_fetch_array(mysql_query("SELECT sex, birthday, location FROM ibwf_users WHERE id='".$who."'"));
    
      $uage = getage($nopl[1]);
    
      if($nopl[0]=='M')
    
      {
    
        $usex = "Male";
    
      }else if($nopl[0]=='F'){
    
        $usex = "Female";
    
      }else{
    
        $usex = "SheMale!";
    
      }
    
      $nopl[2] = htmlspecialchars($nopl[2]);
    
      echo "Age: <b>$uage</b><br/>";
    
      echo "Gender: <b>$usex</b><br/>";
    
      echo "Location: <b>$nopl[2]</b><br/>";
      echo "Star sign: <b>".getstarsign($nopl[1])."</b><br/>";
    $cmid = mysql_fetch_array(mysql_query("SELECT  chmood FROM ibwf_users WHERE id='".$who."'"));
    
      $mlnk = mysql_fetch_array(mysql_query("SELECT img, text FROM ibwf_moods WHERE id='".$cmid[0]."'"));
    
                      $iml = "$mlnk[1]";
    
    echo "Online Mood: <b>$iml</b><br/>";
    $lovepoints = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_givelove WHERE who='".$who."'"));
    echo "Love Point: <b>".$lovepoints[0]."</b><br/>";
     $brt = mysql_fetch_array(mysql_query("SELECT birthday FROM ibwf_users WHERE id='".$who."'"));
    
       $unol = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_topics WHERE authorid='".$who."'"));
    
      $tlink = "<a href=\"lists.php?action=tbuid&amp;sid=$sid&amp;who=$who\">$unol[0]</a>";
    
      //echo "Topics: <b>$tlink</b><br/>";
    
      $unop = mysql_fetch_array(mysql_query("SELECT posts FROM ibwf_users WHERE id='".$who."'"));
    
      $unol = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_posts WHERE uid='".$who."'"));
    
      $plink = "<a href=\"lists.php?action=uposts&amp;sid=$sid&amp;who=$who\">$unol[0]</a>";
    
      //echo "Posts: <b>$plink/$unop[0]</b><br/>";
    
    $tmsg = getpmcount(getuid_sid($sid));
    
      $umsg = getunreadpm(getuid_sid($sid));
    
      //$new_gm = getnewgml(getuid_sid($sid));
    
      //echo "<a   href=\"inbox.php?action=main&amp;sid=$sid\"> </a>Unread Pms: <b>$umsg</b><br/>";
    
       $noin = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_private WHERE touid='".$who."'"));
    
      $nout = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_private WHERE byuid='".$who."'"));
    
      echo "PMs IN: <b>$noin[0]</b> - OUT: <b>$nout[0]</b><br/>";
    
    
     $unpm = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_private WHERE touid='".$who."' AND unread>0"));
    
     $unread = mysql_fetch_array(mysql_query("SELECT COUNT(DISTINCT unread) FROM ibwf_private WHERE byuid='".$uid."' AND
    
    touid='".$who."'"));
    
     if($unpm[0]==0)
    
    {
    
     echo "Unread PM's:<b>0,0</b>from U!<br/>";
    
     }else{
    
     echo "Unread PM's:<b> $unpm[0], $unread[0] </b>from U!<br/>";
    
      }
    
    $nop = mysql_fetch_array(mysql_query("SELECT bank FROM ibwf_users WHERE id='".$who."'"));
    
    $nopl = mysql_fetch_array(mysql_query("SELECT plusses FROM ibwf_users WHERE id='".$who."'"));
    
      echo "Plusses &amp; Bank: <b>$nopl[0] &amp; $nop[0]</b><br/>";
    $prof = mysql_fetch_array(mysql_query("SELECT views FROM ibwf_users WHERE id='".$who."'"));
    
    $vws = $prof[0]+1; mysql_query("UPDATE ibwf_users SET views='".$vws."'WHERE  id='".$who."'");
    
    
    
     echo "profile viewed:<b> $prof[0] times</b><br/>";
    
      $nob = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_buddies WHERE (uid='".$who."' OR tid='".$who."') AND agreed='1'"));
    
      echo "Buddies: <b>$nob[0]</b><br/>";
    
    
    
      $nopl = mysql_fetch_array(mysql_query("SELECT signature FROM ibwf_users WHERE id='".$who."'"));
    
      $sign = parsepm($nopl[0], $sid);
    
    
      $nopl = mysql_fetch_array(mysql_query("SELECT browserm FROM ibwf_users WHERE id='".$who."'"));
    
       echo "Browser: <b>$nopl[0]</b><br/>";
    
      $ip = mysql_fetch_array(mysql_query("SELECT ipadd FROM ibwf_users WHERE id='".$who."'"));
    
       echo "Network: ".network($ip[0]);
    echo"<br/>";
      $nopl = mysql_fetch_array(mysql_query("SELECT email FROM ibwf_users WHERE id='".$who."'"));
    
      echo "E-mail: <b>$nopl[0]</b><br/>";
    
    }
    
    $uipadd = mysql_fetch_array(mysql_query("SELECT ipadd FROM ibwf_users WHERE id='".$who."'"));
    echo "<a href=\"http://wen.ru/whois/?ip=$uipadd[0]\">Check IP</a><br/>";
    echo "<br/>";
    if(ismod(getuid_sid($sid)))
    
    
    
      {
    
    
    
     $uipadd = mysql_fetch_array(mysql_query("SELECT ipadd FROM ibwf_users WHERE id='".$who."'"));
    
    
    
      echo "<b>IP:</b> <a href=\"lists.php?action=byip&amp;sid=$sid&amp;who=$who\">$uipadd[0]</a><br/>";
    
    
    
      //echo "<b>IP:</b> <a href=\"http://wen.ru/whois/?ip=$uipadd[0]\">Check IP</a><br/>";
    
       }
    if($who==$uid)
    
        {
    
    //echo "&#187; <a href=\"more.php?action=cpanel&amp;sid=$sid\">Edit Profile</a><br/>";
    
    }
    
    
    
    //echo "<br/>&#187; [<a href=\"index.php?action=prostats&amp;sid=$sid&amp;who=$who\">More</a>]<br/>";
    
    
    
    //echo "&#187; [<a href=\"uinfo.php?who=$who&amp;sid=$sid\">More info</a>]<br/>";
    
    
    
    //echo "&#187; [<a href=\"index.php?action=more extra&amp;sid=$sid&amp;who=$who\">$whnick Extra</a>]<br/>";
    
    
    
    
    
    
    echo "&#187;<a href=\"love.php?action=givelove&amp;sid=$sid&amp;who=$who\">Give Love To $whnick</a><br/>";
    echo "&#187;<a href=\"userfun.php?action=profile&amp;who=$who&amp;sid=$sid\">Make Fun With $whnick</a><br/>";
    echo "&#187;<a href=\"inbox.php?action=sendpopup&amp;who=$who&amp;sid=$sid\">Send Popup To $whnick</a><br/>";
    if(budres($uid, $who)==0)
    
      {
    
       echo "&#187;<a href=\"genproc.php?action=bud&amp;who=$who&amp;sid=$sid&amp;todo=add\">Add as Friend</a><br/>";
    
      }else if(budres($uid, $who)==1)
    
      {
    
    echo "(Queued Buddy Request)<br/>";
    
      }else if(budres($uid, $who)==2)
    
      {
    
    echo "&#187;<a href=\"genproc.php?action=bud&amp;who=$who&amp;sid=$sid&amp;todo=del\">Remove from Friend</a><br/>";
    
    
      }
    $ires = ignoreres($uid, $who);
    
    if($ires==1)
    
      {
    
    
    
    echo "&#187;<a href=\"genproc.php?action=ign&amp;who=$who&amp;sid=$sid&amp;todo=add\">Ignore User</a><br/>";
    
      }
    
      if(isignored($who, $uid))
    
      {
    
    
    
    echo "&#187;<a href=\"genproc.php?action=ign&amp;who=$who&amp;sid=$sid&amp;todo=del\">Unignore User</a><br/>";
    
      }
     $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_gallery WHERE uid='".$who."'"));
    
     echo "&#187;<a href=\"gallery.php?action=viewuser&amp;who=$who&amp;sid=$sid\">Photos</a> [$noi[0]]<br/>";
     $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_clubmembers WHERE uid='".$who."'"));
    
       echo "&#187;<a href=\"lists.php?action=clm&amp;who=$who&amp;sid=$sid\">Member In  Clubs</a> [$noi[0]]<br/>";
    
    
    $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_shop_Inventory WHERE uid='".$who."'"));
    
    echo "&#187;<a href=\"lists.php?action=gifts&amp;who=$who&amp;sid=$sid\">Gifts</a> [$noi[0]]<br/>";
    
    $noi = mysql_fetch_array(mysql_query("SELECT pollid FROM ibwf_users WHERE id='".$who."'"));
    
    echo "&#187;<a href=\"index.php?action=viewpl&amp;who=$who&amp;sid=$sid\">Poll</a><br/>";
    
    
     $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_clubs WHERE owner='".$who."'"));
    
    
       echo "&#187;<a href=\"lists.php?action=ucl&amp;who=$who&amp;sid=$sid\">$whnick Clubs</a>[$noi[0]]<br/>";
    $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_gbook WHERE gbowner='".$who."'"));
     echo "&#187;<a href=\"lists.php?action=gbook&amp;who=$who&amp;sid=$sid\">Guestbook</a>[$noi[0]]<br/>";
    $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_gbook WHERE gbowner='".$who."'"));
    $items = mysql_query("SELECT gbowner, gbsigner, gbmsg, dtime, id FROM ibwf_gbook WHERE gbowner='".$who."' ORDER BY dtime DESC LIMIT 0, 3");
    if(mysql_num_rows($items)>0)
        {
        while ($item = mysql_fetch_array($items))
        {
          $snick = getnick_uid($item[1]);
          $lnk = "<b>$snick</b>";
          $text = parsepm($item[2], $sid);
    
          echo "$lnk: $text<br/>";
        }
        echo "<a href=\"lists.php?action=gbook&amp;who=$who&amp;sid=$sid\">More..[$noi[0]]</a><br/>";
    }
        echo "</small>";
        echo "</p><p align=\"center\">";
        echo "<a href=\"index.php?action=main&amp;sid=$sid\"><img src=\"../images/home.gif\" alt=\"*\"/>";
    echo "Home</a>";
    
    
       } else
    
      {
       echo "<small><img src=\"../images/notok.gif\" alt=\"X\"/> Member dos not exist</small><br/>";
    
       }
    
         if($lastloc=="cht"){
    
    
    
        echo "<a href=\"chat.php?sid=$sid&amp;rid=$rid\">Back to $rname</a><br/>";
       echo "<a href=\"index.php?action=main&amp;sid=$sid\"><img src=\"../images/home.gif\" alt=\"*\"/>";
    echo "Home</a>";
    
      echo "</p>";
    
      echo "</card>";
    
      }else{
    
    
      echo "</p>";
    
      echo "</card>";
    
      }
    
    }

    Comment


      #3
      sorz mate dont work can u add my bit to my view user profile plz

      Comment


        #4
        you can code it by your self..

        you may set 1 field in the table of users then 0 = public and 1 = private...

        then create a query the correspond to this.. :D

        Comment


          #5
          Originally posted by phzone
          instead of giving your opinion .. why dont show and share your code here.... in this matter you act like a boastfull man..

          Some people need the code nor openions!
          instead of posting bollox first try it your self,
          then ask for help...
          else you will never learn
          and btw in case you are blind,
          code is already given,
          just need to be midified a bit...
          you cant always get ready made code...
          It's better to keep your mouth shut and give the impression that you're stupid, than to open it and remove all doubt.
          ⓣⓗⓔ ⓠⓤⓘⓔⓣⓔⓡ ⓨⓞⓤ ⓑⓔ©ⓞⓜⓔ, ⓣⓗⓔ ⓜⓞⓡⓔ ⓨⓞⓤ ⓐⓡⓔ ⓐⓑⓛⓔ ⓣⓞ ⓗⓔⓐⓡ !
          ιη тнєσяу, тнє ρяα¢тι¢є ιѕ α яєѕυℓт σƒ тнє тнєσяу, вυт ιη ρяα¢тι¢є ιѕ тнє σρρσѕιтє.
          キノgんイノ刀g 4 ア乇ムc乇 ノ丂 レノズ乇 キucズノ刀g 4 √ノ尺gノ刀ノイリ!

          Comment

          Working...
          X