-download category-

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

    -download category-

    This is my download.php script

    PHP Code:
    <?php
    include("config.php");
    include("core.php");
    
    
    header("Content-type: text/html; charset=ISO-8859-1");
    echo "<?xml version=\"1.0\" encoding=\"ISO-8859-1\" ?>";
    echo "<!DOCTYPE html PUBLIC \"-//WAPFORUM//DTD XHTML Mobile 1.0//EN\"\"http://www.wapforum.org/DTD/xhtml-mobile10.dtd\">";
    echo "<html xmlns=\"http://www.w3.org/1999/xhtml\">";
    
        echo "<head>";
    
        echo "<title>pinoyaztig.net</title>";
        echo "<link rel=\"StyleSheet\" type=\"text/css\" href=\"style/style.css\" />";
        echo "</head>";
    
        echo "<body>";
    connectdb();
    
    
    $action = $_GET["action"];
    $sid = $_GET["sid"];
    $page = $_GET["page"];
    $did = $_GET["did"];
    if($action != "")
    {
        if(islogged($sid)==false)
        {
          echo "<card id=\"main\" title=\"KozmozWAP\">";
          echo "<p align=\"center\">";
          echo "You are not logged in<br/>";
          echo "Or<br/>Your session has been expired<br/><br/>";
          echo "<a href=\"index.php\">Login</a>";
          echo "</p>";
          echo "</card>";
          echo "</wml>";
          exit();
        }
    }
    if(isbanned($uid))
        {
            echo "<card id=\"main\" title=\"KozmozWAP\">";
          echo "<p align=\"center\">";
          echo "<img src=\"images/notok.gif\" alt=\"x\"/><br/>";
          echo "You are <b>Banned</b><br/>";
          $banto = mysql_fetch_array(mysql_query("SELECT timeto FROM ibwf_penalties WHERE uid='".$uid."' AND penalty='1'"));
          $remain = $banto[0]- time();
          $rmsg = gettimemsg($remain);
          echo "Time to finish your penalty: $rmsg<br/><br/>";
          //echo "<a href=\"index.php\">Login</a>";
          echo "</p>";
          echo "</card>";
          echo "</wml>";
          exit();
        }
    
    //////////////////////////////////Buddies
    
    else if($action=="symbian")
    {
        $who = $_GET["who"];
        addonline(getuid_sid($sid),"Symbian Application","");
        echo "<card id=\"main\" title=\"Symbian Application\">";
        $uid = getuid_sid($sid);
    
    
    
        //////ALL LISTS SCRIPT <<
    
        if($page=="" || $page<=0)$page=1;
        if($did="1")
        {
        $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_vault WHERE did='1'"));
        }else{
        $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_vault WHERE uid='".$who."'"));
        }
        $num_items = $noi[0]; //changable
        $items_per_page= 10;
        $num_pages = ceil($num_items/$items_per_page);
        if(($page>$num_pages)&&$page!=1)$page= $num_pages;
        $limit_start = ($page-1)*$items_per_page;
    
    
        if($who!="")
        {
            $sql = "SELECT id, title, itemurl, did FROM ibwf_vault WHERE uid='".$who."' ORDER BY pudt DESC LIMIT $limit_start, $items_per_page";
            }else{
          $sql = "SELECT id, title, itemurl, uid, did FROM ibwf_vault WHERE did='".$did."' ORDER BY pudt DESC LIMIT $limit_start, $items_per_page";
            }
    
    
    
        echo "<p>";
        $items = mysql_query($sql);
        echo mysql_error();
        if(mysql_num_rows($items)>0)
        {
        while ($item = mysql_fetch_array($items))
        {
          $ext = getext($item[2]);
            $ime = getextimg($ext);
            $lnk = "<a href=\"downloads.php?action=download&amp;sid=$sid&amp;did=$item[0]\">$ime".htmlspecialchars($item[2])."</a>";
    
          if(candelvl($uid, $item[0]))
          {
            $delnk = "<a href=\"genproc.php?action=delvlt&amp;sid=$sid&amp;did=$item[0]\">[x]</a>";
          }else{
            $delnk = "";
          }
          if($who!="")
          {
            $byusr="";
          }else{
            $unick = getnick_uid($item[3]);
            $ulnk = "<a href=\"index.php?action=viewuser&amp;sid=$sid&amp;who=$item[3]\">$unick</a>";
            $byusr = "<br/>By: $ulnk";
          }
          echo "$lnk $byusr $delnk<br/>";
    
    
        }
        }
        echo "</p>";
        echo "<p align=\"center\">";
        if($page>1)
        {
          $ppage = $page-1;
          echo "<a href=\"downloads.php?action=$action&amp;page=$ppage&amp;sid=$sid&amp;who=$who\">«PREV</a> ";
        }
        if($page<$num_pages)
        {
          $npage = $page+1;
          echo "<a href=\"downloads.php?action=$action&amp;page=$npage&amp;sid=$sid&amp;who=$who\">Next»</a>";
        }
        echo "<br/>$page/$num_pages<br/>";
        if($num_pages>2)
        {
          $rets = "Jump to page: <input name=\"pg\" format=\"*N\" size=\"3\"/>";
            $rets .= "<anchor>[GO]";
            $rets .= "<go href=\"downloads.php?type=send\" method=\"get\">";
            $rets .= "<postfield name=\"action\" value=\"$action\"/>";
            $rets .= "<postfield name=\"who\" value=\"$who\"/>";
            $rets .= "<postfield name=\"sid\" value=\"$sid\"/>";
            $rets .= "<postfield name=\"page\" value=\"$(pg)\"/>";
            $rets .= "</go></anchor>";
    
            echo $rets;
        }
        echo "</p>";
      ////// UNTILL HERE >>
        echo "<p align=\"center\">";
        if($uid==$who && getplusses($uid)>25)
        {
        echo "<a href=\"up.php?action=themes&amp;sid=$sid\">";
    echo "Add Item</a><br/>";
    }
    if($who!="")
    {
    echo "<a href=\"index.php?action=viewuser&amp;sid=$sid&amp;who=$who\">";
    $whonick = getnick_uid($who);
    echo "$whonick's Profile</a><br/>";
    }else{
    echo "<a href=\"index.php?action=vault&amp;sid=$sid\">";
    echo "Downloads</a><br/>";
    }
        echo "<a href=\"index.php?action=main&amp;sid=$sid\">";
    echo "Main menu</a>";
      echo "</p>";
        echo "</card>";
    }
    
    
    //////////////////////////////////Buddies
    
    else if($action=="java")
    {
        $who = $_GET["who"];
        addonline(getuid_sid($sid),"Java Application","");
        echo "<card id=\"main\" title=\"Java Application\">";
        $uid = getuid_sid($sid);
    
    
    
        //////ALL LISTS SCRIPT <<
    
        if($page=="" || $page<=0)$page=1;
        if($did="2")
        {
        $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_vault WHERE did='2'"));
        }else{
        $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_vault WHERE uid='".$who."'"));
        }
        $num_items = $noi[0]; //changable
        $items_per_page= 10;
        $num_pages = ceil($num_items/$items_per_page);
        if(($page>$num_pages)&&$page!=1)$page= $num_pages;
        $limit_start = ($page-1)*$items_per_page;
    
    
        if($who!="")
        {
            $sql = "SELECT id, title, itemurl, did FROM ibwf_vault WHERE uid='".$who."' ORDER BY pudt DESC LIMIT $limit_start, $items_per_page";
            }else{
          $sql = "SELECT id, title, itemurl, uid, did FROM ibwf_vault WHERE did='".$did."' ORDER BY pudt DESC LIMIT $limit_start, $items_per_page";
            }
    
    
    
        echo "<p>";
        $items = mysql_query($sql);
        echo mysql_error();
        if(mysql_num_rows($items)>0)
        {
        while ($item = mysql_fetch_array($items))
        {
          $ext = getext($item[2]);
            $ime = getextimg($ext);
            $lnk = "<a href=\"downloads.php?action=download&amp;sid=$sid&amp;did=$item[0]\">$ime".htmlspecialchars($item[2])."</a>";
    
          if(candelvl($uid, $item[0]))
          {
            $delnk = "<a href=\"genproc.php?action=delvlt&amp;sid=$sid&amp;did=$item[0]\">[x]</a>";
          }else{
            $delnk = "";
          }
          if($who!="")
          {
            $byusr="";
          }else{
            $unick = getnick_uid($item[3]);
            $ulnk = "<a href=\"index.php?action=viewuser&amp;sid=$sid&amp;who=$item[3]\">$unick</a>";
            $byusr = "<br/>By: $ulnk";
          }
          echo "$lnk $byusr $delnk<br/>";
    
    
        }
        }
        echo "</p>";
        echo "<p align=\"center\">";
        if($page>1)
        {
          $ppage = $page-1;
          echo "<a href=\"downloads.php?action=$action&amp;page=$ppage&amp;sid=$sid&amp;who=$who\">«PREV</a> ";
        }
        if($page<$num_pages)
        {
          $npage = $page+1;
          echo "<a href=\"downloads.php?action=$action&amp;page=$npage&amp;sid=$sid&amp;who=$who\">Next»</a>";
        }
        echo "<br/>$page/$num_pages<br/>";
        if($num_pages>2)
        {
          $rets = "Jump to page: <input name=\"pg\" format=\"*N\" size=\"3\"/>";
            $rets .= "<anchor>[GO]";
            $rets .= "<go href=\"downloads.php?type=send\" method=\"get\">";
            $rets .= "<postfield name=\"action\" value=\"$action\"/>";
            $rets .= "<postfield name=\"who\" value=\"$who\"/>";
            $rets .= "<postfield name=\"sid\" value=\"$sid\"/>";
            $rets .= "<postfield name=\"page\" value=\"$(pg)\"/>";
            $rets .= "</go></anchor>";
    
            echo $rets;
        }
        echo "</p>";
      ////// UNTILL HERE >>
        echo "<p align=\"center\">";
        if($uid==$who && getplusses($uid)>25)
        {
        echo "<a href=\"up.php?action=themes&amp;sid=$sid\">";
    echo "Add Item</a><br/>";
    }
    if($who!="")
    {
    echo "<a href=\"index.php?action=viewuser&amp;sid=$sid&amp;who=$who\">";
    $whonick = getnick_uid($who);
    echo "$whonick's Profile</a><br/>";
    }else{
    echo "<a href=\"index.php?action=vault&amp;sid=$sid\">";
    echo "Downloads</a><br/>";
    }
        echo "<a href=\"index.php?action=main&amp;sid=$sid\">";
    echo "Main menu</a>";
      echo "</p>";
        echo "</card>";
    }
    
    
    //////////////////////////////////Buddies
    
    else if($action=="antivirus")
    {
        $who = $_GET["who"];
        addonline(getuid_sid($sid),"Anti Vitus","");
        echo "<card id=\"main\" title=\"Anti Virus\">";
        $uid = getuid_sid($sid);
    
    
    
        //////ALL LISTS SCRIPT <<
    
        if($page=="" || $page<=0)$page=1;
        if($did="3")
        {
        $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_vault WHERE did='3'"));
        }else{
        $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_vault WHERE uid='".$who."'"));
        }
        $num_items = $noi[0]; //changable
        $items_per_page= 10;
        $num_pages = ceil($num_items/$items_per_page);
        if(($page>$num_pages)&&$page!=1)$page= $num_pages;
        $limit_start = ($page-1)*$items_per_page;
    
    
        if($who!="")
        {
            $sql = "SELECT id, title, itemurl, did FROM ibwf_vault WHERE uid='".$who."' ORDER BY pudt DESC LIMIT $limit_start, $items_per_page";
            }else{
          $sql = "SELECT id, title, itemurl, uid, did FROM ibwf_vault WHERE did='".$did."' ORDER BY pudt DESC LIMIT $limit_start, $items_per_page";
            }
    
    
    
        echo "<p>";
        $items = mysql_query($sql);
        echo mysql_error();
        if(mysql_num_rows($items)>0)
        {
        while ($item = mysql_fetch_array($items))
        {
          $ext = getext($item[2]);
            $ime = getextimg($ext);
            $lnk = "<a href=\"downloads.php?action=download&amp;sid=$sid&amp;did=$item[0]\">$ime".htmlspecialchars($item[2])."</a>";
    
          if(candelvl($uid, $item[0]))
          {
            $delnk = "<a href=\"genproc.php?action=delvlt&amp;sid=$sid&amp;did=$item[0]\">[x]</a>";
          }else{
            $delnk = "";
          }
          if($who!="")
          {
            $byusr="";
          }else{
            $unick = getnick_uid($item[3]);
            $ulnk = "<a href=\"index.php?action=viewuser&amp;sid=$sid&amp;who=$item[3]\">$unick</a>";
            $byusr = "<br/>By: $ulnk";
          }
          echo "$lnk $byusr $delnk<br/>";
    
    
        }
        }
        echo "</p>";
        echo "<p align=\"center\">";
        if($page>1)
        {
          $ppage = $page-1;
          echo "<a href=\"downloads.php?action=$action&amp;page=$ppage&amp;sid=$sid&amp;who=$who\">«PREV</a> ";
        }
        if($page<$num_pages)
        {
          $npage = $page+1;
          echo "<a href=\"downloads.php?action=$action&amp;page=$npage&amp;sid=$sid&amp;who=$who\">Next»</a>";
        }
        echo "<br/>$page/$num_pages<br/>";
        if($num_pages>2)
        {
          $rets = "Jump to page: <input name=\"pg\" format=\"*N\" size=\"3\"/>";
            $rets .= "<anchor>[GO]";
            $rets .= "<go href=\"downloads.php?type=send\" method=\"get\">";
            $rets .= "<postfield name=\"action\" value=\"$action\"/>";
            $rets .= "<postfield name=\"who\" value=\"$who\"/>";
            $rets .= "<postfield name=\"sid\" value=\"$sid\"/>";
            $rets .= "<postfield name=\"page\" value=\"$(pg)\"/>";
            $rets .= "</go></anchor>";
    
            echo $rets;
        }
        echo "</p>";
      ////// UNTILL HERE >>
        echo "<p align=\"center\">";
        if($uid==$who && getplusses($uid)>25)
        {
        echo "<a href=\"up.php?action=themes&amp;sid=$sid\">";
    echo "Add Item</a><br/>";
    }
    if($who!="")
    {
    echo "<a href=\"index.php?action=viewuser&amp;sid=$sid&amp;who=$who\">";
    $whonick = getnick_uid($who);
    echo "$whonick's Profile</a><br/>";
    }else{
    echo "<a href=\"index.php?action=vault&amp;sid=$sid\">";
    echo "Downloads</a><br/>";
    }
        echo "<a href=\"index.php?action=main&amp;sid=$sid\">";
    echo "Main menu</a>";
      echo "</p>";
        echo "</card>";
    }
    
    
    //////////////////////////////////Buddies
    
    else if($action=="themes")
    {
        $who = $_GET["who"];
        addonline(getuid_sid($sid),"s40v2/s40v3 Themes","");
        echo "<card id=\"main\" title=\"s40v2/s40v3 Themes\">";
        $uid = getuid_sid($sid);
    
    
    
        //////ALL LISTS SCRIPT <<
    
        if($page=="" || $page<=0)$page=1;
        if($did="4")
        {
        $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_vault WHERE did='4'"));
        }else{
        $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_vault WHERE uid='".$who."'"));
        }
        $num_items = $noi[0]; //changable
        $items_per_page= 10;
        $num_pages = ceil($num_items/$items_per_page);
        if(($page>$num_pages)&&$page!=1)$page= $num_pages;
        $limit_start = ($page-1)*$items_per_page;
    
    
        if($who!="")
        {
            $sql = "SELECT id, title, itemurl, did FROM ibwf_vault WHERE uid='".$who."' ORDER BY pudt DESC LIMIT $limit_start, $items_per_page";
            }else{
          $sql = "SELECT id, title, itemurl, uid, did FROM ibwf_vault WHERE did='".$did."' ORDER BY pudt DESC LIMIT $limit_start, $items_per_page";
            }
    
    
    
        echo "<p>";
        $items = mysql_query($sql);
        echo mysql_error();
        if(mysql_num_rows($items)>0)
        {
        while ($item = mysql_fetch_array($items))
        {
          $ext = getext($item[2]);
            $ime = getextimg($ext);
            $lnk = "<a href=\"downloads.php?action=download&amp;sid=$sid&amp;did=$item[0]\">$ime".htmlspecialchars($item[2])."</a>";
    
          if(candelvl($uid, $item[0]))
          {
            $delnk = "<a href=\"genproc.php?action=delvlt&amp;sid=$sid&amp;did=$item[0]\">[x]</a>";
          }else{
            $delnk = "";
          }
          if($who!="")
          {
            $byusr="";
          }else{
            $unick = getnick_uid($item[3]);
            $ulnk = "<a href=\"index.php?action=viewuser&amp;sid=$sid&amp;who=$item[3]\">$unick</a>";
            $byusr = "<br/>By: $ulnk";
          }
          echo "$lnk $byusr $delnk<br/>";
    
    
        }
        }
        echo "</p>";
        echo "<p align=\"center\">";
        if($page>1)
        {
          $ppage = $page-1;
          echo "<a href=\"downloads.php?action=$action&amp;page=$ppage&amp;sid=$sid&amp;who=$who\">«PREV</a> ";
        }
        if($page<$num_pages)
        {
          $npage = $page+1;
          echo "<a href=\"downloads.php?action=$action&amp;page=$npage&amp;sid=$sid&amp;who=$who\">Next»</a>";
        }
        echo "<br/>$page/$num_pages<br/>";
        if($num_pages>2)
        {
          $rets = "Jump to page: <input name=\"pg\" format=\"*N\" size=\"3\"/>";
            $rets .= "<anchor>[GO]";
            $rets .= "<go href=\"downloads.php?type=send\" method=\"get\">";
            $rets .= "<postfield name=\"action\" value=\"$action\"/>";
            $rets .= "<postfield name=\"who\" value=\"$who\"/>";
            $rets .= "<postfield name=\"sid\" value=\"$sid\"/>";
            $rets .= "<postfield name=\"page\" value=\"$(pg)\"/>";
            $rets .= "</go></anchor>";
    
            echo $rets;
        }
        echo "</p>";
      ////// UNTILL HERE >>
        echo "<p align=\"center\">";
        if($uid==$who && getplusses($uid)>25)
        {
        echo "<a href=\"up.php?action=themes&amp;sid=$sid\">";
    echo "Add Item</a><br/>";
    }
    if($who!="")
    {
    echo "<a href=\"index.php?action=viewuser&amp;sid=$sid&amp;who=$who\">";
    $whonick = getnick_uid($who);
    echo "$whonick's Profile</a><br/>";
    }else{
    echo "<a href=\"index.php?action=vault&amp;sid=$sid\">";
    echo "Downloads</a><br/>";
    }
        echo "<a href=\"index.php?action=main&amp;sid=$sid\">";
    echo "Main menu</a>";
      echo "</p>";
        echo "</card>";
    }
    
    
    //////////////////////////////////Buddies
    
    else if($action=="themes1")
    {
        $who = $_GET["who"];
        addonline(getuid_sid($sid),"s60/s60v3/Nseries-Themes","");
        echo "<card id=\"main\" title=\"s60/s60v3/Nseries-Themes\">";
        $uid = getuid_sid($sid);
    
    
    
        //////ALL LISTS SCRIPT <<
    
        if($page=="" || $page<=0)$page=1;
        if($did="5")
        {
        $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_vault WHERE did='5'"));
        }else{
        $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_vault WHERE uid='".$who."'"));
        }
        $num_items = $noi[0]; //changable
        $items_per_page= 10;
        $num_pages = ceil($num_items/$items_per_page);
        if(($page>$num_pages)&&$page!=1)$page= $num_pages;
        $limit_start = ($page-1)*$items_per_page;
    
    
        if($who!="")
        {
            $sql = "SELECT id, title, itemurl, did FROM ibwf_vault WHERE uid='".$who."' ORDER BY pudt DESC LIMIT $limit_start, $items_per_page";
            }else{
          $sql = "SELECT id, title, itemurl, uid, did FROM ibwf_vault WHERE did='".$did."' ORDER BY pudt DESC LIMIT $limit_start, $items_per_page";
            }
    
    
    
        echo "<p>";
        $items = mysql_query($sql);
        echo mysql_error();
        if(mysql_num_rows($items)>0)
        {
        while ($item = mysql_fetch_array($items))
        {
          $ext = getext($item[2]);
            $ime = getextimg($ext);
            $lnk = "<a href=\"downloads.php?action=download&amp;sid=$sid&amp;did=$item[0]\">$ime".htmlspecialchars($item[2])."</a>";
    
          if(candelvl($uid, $item[0]))
          {
            $delnk = "<a href=\"genproc.php?action=delvlt&amp;sid=$sid&amp;did=$item[0]\">[x]</a>";
          }else{
            $delnk = "";
          }
          if($who!="")
          {
            $byusr="";
          }else{
            $unick = getnick_uid($item[3]);
            $ulnk = "<a href=\"index.php?action=viewuser&amp;sid=$sid&amp;who=$item[3]\">$unick</a>";
            $byusr = "<br/>By: $ulnk";
          }
          echo "$lnk $byusr $delnk<br/>";
    
    
        }
        }
        echo "</p>";
        echo "<p align=\"center\">";
        if($page>1)
        {
          $ppage = $page-1;
          echo "<a href=\"downloads.php?action=$action&amp;page=$ppage&amp;sid=$sid&amp;who=$who\">«PREV</a> ";
        }
        if($page<$num_pages)
        {
          $npage = $page+1;
          echo "<a href=\"downloads.php?action=$action&amp;page=$npage&amp;sid=$sid&amp;who=$who\">Next»</a>";
        }
        echo "<br/>$page/$num_pages<br/>";
        if($num_pages>2)
        {
          $rets = "Jump to page: <input name=\"pg\" format=\"*N\" size=\"3\"/>";
            $rets .= "<anchor>[GO]";
            $rets .= "<go href=\"downloads.php?type=send\" method=\"get\">";
            $rets .= "<postfield name=\"action\" value=\"$action\"/>";
            $rets .= "<postfield name=\"who\" value=\"$who\"/>";
            $rets .= "<postfield name=\"sid\" value=\"$sid\"/>";
            $rets .= "<postfield name=\"page\" value=\"$(pg)\"/>";
            $rets .= "</go></anchor>";
    
            echo $rets;
        }
        echo "</p>";
      ////// UNTILL HERE >>
        echo "<p align=\"center\">";
        if($uid==$who && getplusses($uid)>25)
        {
        echo "<a href=\"up.php?action=themes&amp;sid=$sid\">";
    echo "Add Item</a><br/>";
    }
    if($who!="")
    {
    echo "<a href=\"index.php?action=viewuser&amp;sid=$sid&amp;who=$who\">";
    $whonick = getnick_uid($who);
    echo "$whonick's Profile</a><br/>";
    }else{
    echo "<a href=\"index.php?action=vault&amp;sid=$sid\">";
    echo "Downloads</a><br/>";
    }
        echo "<a href=\"index.php?action=main&amp;sid=$sid\">";
    echo "Main menu</a>";
      echo "</p>";
        echo "</card>";
    }
    
    
    //////////////////////////////////Buddies
    
    else if($action=="sethemes")
    {
        $who = $_GET["who"];
        addonline(getuid_sid($sid),"SE Themes","");
        echo "<card id=\"main\" title=\"SE Themes\">";
        $uid = getuid_sid($sid);
    
    
    
        //////ALL LISTS SCRIPT <<
    
        if($page=="" || $page<=0)$page=1;
        if($did="6")
        {
        $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_vault WHERE did='6'"));
        }else{
        $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_vault WHERE uid='".$who."'"));
        }
        $num_items = $noi[0]; //changable
        $items_per_page= 10;
        $num_pages = ceil($num_items/$items_per_page);
        if(($page>$num_pages)&&$page!=1)$page= $num_pages;
        $limit_start = ($page-1)*$items_per_page;
    
        if($who="")
        {
            $sql = "SELECT id, title, itemurl, did FROM ibwf_vault WHERE uid='".$who."' ORDER BY pudt DESC LIMIT $limit_start, $items_per_page";
            }else{
    $sql = "SELECT id, title, itemurl, uid, did FROM ibwf_vault WHERE did='".$did."' ORDER BY did DESC LIMIT $limit_start, $items_per_page";
            }
    
    
        echo "<p>";
        $items = mysql_query($sql);
        echo mysql_error();
        if(mysql_num_rows($items)>0)
        {
        while ($item = mysql_fetch_array($items))
        {
          $ext = getext($item[2]);
            $ime = getextimg($ext);
            $lnk = "<a href=\"downloads.php?action=download&amp;sid=$sid&amp;did=$item[0]\">$ime".htmlspecialchars($item[2])."</a>";
    
          if(candelvl($uid, $item[0]))
          {
            $delnk = "<a href=\"genproc.php?action=delvlt&amp;sid=$sid&amp;did=$item[0]\">[x]</a>";
          }else{
            $delnk = "";
          }
          if($who!="")
          {
            $byusr="";
          }else{
            $unick = getnick_uid($item[3]);
            $ulnk = "<a href=\"index.php?action=viewuser&amp;sid=$sid&amp;who=$item[3]\">$unick</a>";
            $byusr = "<br/>By: $ulnk";
          }
          echo "$lnk $byusr $delnk<br/>";
    
    
        }
        }
        echo "</p>";
        echo "<p align=\"center\">";
        if($page>1)
        {
          $ppage = $page-1;
          echo "<a href=\"downloads.php?action=$action&amp;page=$ppage&amp;sid=$sid&amp;who=$who\">«PREV</a> ";
        }
        if($page<$num_pages)
        {
          $npage = $page+1;
          echo "<a href=\"downloads.php?action=$action&amp;page=$npage&amp;sid=$sid&amp;who=$who\">Next»</a>";
        }
        echo "<br/>$page/$num_pages<br/>";
        if($num_pages>2)
        {
          $rets = "Jump to page: <input name=\"pg\" format=\"*N\" size=\"3\"/>";
            $rets .= "<anchor>[GO]";
            $rets .= "<go href=\"downloads.php?type=send\" method=\"get\">";
            $rets .= "<postfield name=\"action\" value=\"$action\"/>";
            $rets .= "<postfield name=\"who\" value=\"$who\"/>";
            $rets .= "<postfield name=\"sid\" value=\"$sid\"/>";
            $rets .= "<postfield name=\"page\" value=\"$(pg)\"/>";
            $rets .= "</go></anchor>";
    
            echo $rets;
        }
        echo "</p>";
      ////// UNTILL HERE >>
        echo "<p align=\"center\">";
        if($uid==$who && getplusses($uid)>25)
        {
        echo "<a href=\"up.php?action=apps&amp;sid=$sid\">";
    echo "Add Item</a><br/>";
    }
    if($who!="")
    {
    echo "<a href=\"index.php?action=viewuser&amp;sid=$sid&amp;who=$who\">";
    $whonick = getnick_uid($who);
    echo "$whonick's Profile</a><br/>";
    }else{
    echo "<a href=\"index.php?action=vault&amp;sid=$sid\">";
    echo "Downloads</a><br/>";
    }
        echo "<a href=\"index.php?action=main&amp;sid=$sid\">";
    echo "Main menu</a>";
      echo "</p>";
        echo "</card>";
    }
    
    
    //////////////////////////////////Buddies
    
    else if($action=="games1")
    {
        $who = $_GET["who"];
        addonline(getuid_sid($sid),"s30/s40/s40v2 Games","");
        echo "<card id=\"main\" title=\"s30/s40/s40v2 Games\">";
        $uid = getuid_sid($sid);
    
    
    
        //////ALL LISTS SCRIPT <<
    
        if($page=="" || $page<=0)$page=1;
        if($did="7")
        {
        $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_vault WHERE did='7'"));
        }else{
        $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_vault WHERE uid='".$who."'"));
        }
        $num_items = $noi[0]; //changable
        $items_per_page= 10;
        $num_pages = ceil($num_items/$items_per_page);
        if(($page>$num_pages)&&$page!=1)$page= $num_pages;
        $limit_start = ($page-1)*$items_per_page;
    
        if($who!="")
        {
            $sql = "SELECT id, title, itemurl, did FROM ibwf_vault WHERE uid='".$who."' ORDER BY pudt DESC LIMIT $limit_start, $items_per_page";
            }else{
    $sql = "SELECT id, title, itemurl, uid, did FROM ibwf_vault WHERE did='".$did."' ORDER BY did DESC LIMIT $limit_start, $items_per_page";
            }
    
    
        echo "<p>";
        $items = mysql_query($sql);
        echo mysql_error();
        if(mysql_num_rows($items)>0)
        {
        while ($item = mysql_fetch_array($items))
        {
          $ext = getext($item[2]);
            $ime = getextimg($ext);
            $lnk = "<a href=\"downloads.php?action=download&amp;sid=$sid&amp;did=$item[0]\">$ime".htmlspecialchars($item[2])."</a>";
    
          if(candelvl($uid, $item[0]))
          {
            $delnk = "<a href=\"genproc.php?action=delvlt&amp;sid=$sid&amp;did=$item[0]\">[x]</a>";
          }else{
            $delnk = "";
          }
          if($who!="")
          {
            $byusr="";
          }else{
            $unick = getnick_uid($item[3]);
            $ulnk = "<a href=\"index.php?action=viewuser&amp;sid=$sid&amp;who=$item[3]\">$unick</a>";
            $byusr = "<br/>By: $ulnk";
          }
          echo "$lnk $byusr $delnk<br/>";
    
    
        }
        }
        echo "</p>";
        echo "<p align=\"center\">";
        if($page>1)
        {
          $ppage = $page-1;
          echo "<a href=\"downloads.php?action=$action&amp;page=$ppage&amp;sid=$sid&amp;who=$who\">«PREV</a> ";
        }
        if($page<$num_pages)
        {
          $npage = $page+1;
          echo "<a href=\"downloads.php?action=$action&amp;page=$npage&amp;sid=$sid&amp;who=$who\">Next»</a>";
        }
        echo "<br/>$page/$num_pages<br/>";
        if($num_pages>2)
        {
          $rets = "Jump to page: <input name=\"pg\" format=\"*N\" size=\"3\"/>";
            $rets .= "<anchor>[GO]";
            $rets .= "<go href=\"downloads.php?type=send\" method=\"get\">";
            $rets .= "<postfield name=\"action\" value=\"$action\"/>";
            $rets .= "<postfield name=\"who\" value=\"$who\"/>";
            $rets .= "<postfield name=\"sid\" value=\"$sid\"/>";
            $rets .= "<postfield name=\"page\" value=\"$(pg)\"/>";
            $rets .= "</go></anchor>";
    
            echo $rets;
        }
        echo "</p>";
      ////// UNTILL HERE >>
        echo "<p align=\"center\">";
        if($uid==$who && getplusses($uid)>25)
        {
        echo "<a href=\"up.php?action=games1&amp;sid=$sid\">";
    echo "Add Item</a><br/>";
    }
    if($who!="")
    {
    echo "<a href=\"index.php?action=viewuser&amp;sid=$sid&amp;who=$who\">";
    $whonick = getnick_uid($who);
    echo "$whonick's Profile</a><br/>";
    }else{
    echo "<a href=\"index.php?action=vault&amp;sid=$sid\">";
    echo "Downloads</a><br/>";
    }
        echo "<a href=\"index.php?action=main&amp;sid=$sid\">";
    echo "Main menu</a>";
      echo "</p>";
        echo "</card>";
    }
    
    
    //////////////////////////////////Buddies
    
    else if($action=="games2")
    {
        $who = $_GET["who"];
        addonline(getuid_sid($sid),"s60/s60v3 Games","");
        echo "<card id=\"main\" title=\"s60/s60v3 Games\">";
        $uid = getuid_sid($sid);
    
    
    
        //////ALL LISTS SCRIPT <<
    
        if($page=="" || $page<=0)$page=1;
        if($did="8")
        {
        $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_vault WHERE did='8'"));
        }else{
        $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_vault WHERE uid='".$who."'"));
        }
        $num_items = $noi[0]; //changable
        $items_per_page= 10;
        $num_pages = ceil($num_items/$items_per_page);
        if(($page>$num_pages)&&$page!=1)$page= $num_pages;
        $limit_start = ($page-1)*$items_per_page;
    
        if($who!="")
        {
            $sql = "SELECT id, title, itemurl, did FROM ibwf_vault WHERE uid='".$who."' ORDER BY pudt DESC LIMIT $limit_start, $items_per_page";
            }else{
    $sql = "SELECT id, title, itemurl, uid, did FROM ibwf_vault WHERE did='".$did."' ORDER BY did DESC LIMIT $limit_start, $items_per_page";
            }
    
    
        echo "<p>";
        $items = mysql_query($sql);
        echo mysql_error();
        if(mysql_num_rows($items)>0)
        {
        while ($item = mysql_fetch_array($items))
        {
          $ext = getext($item[2]);
            $ime = getextimg($ext);
            $lnk = "<a href=\"downloads.php?action=download&amp;sid=$sid&amp;did=$item[0]\">$ime".htmlspecialchars($item[2])."</a>";
    
          if(candelvl($uid, $item[0]))
          {
            $delnk = "<a href=\"genproc.php?action=delvlt&amp;sid=$sid&amp;did=$item[0]\">[x]</a>";
          }else{
            $delnk = "";
          }
          if($who!="")
          {
            $byusr="";
          }else{
            $unick = getnick_uid($item[3]);
            $ulnk = "<a href=\"index.php?action=viewuser&amp;sid=$sid&amp;who=$item[3]\">$unick</a>";
            $byusr = "<br/>By: $ulnk";
          }
          echo "$lnk $byusr $delnk<br/>";
    
    
        }
        }
        echo "</p>";
        echo "<p align=\"center\">";
        if($page>1)
        {
          $ppage = $page-1;
          echo "<a href=\"downloads.php?action=$action&amp;page=$ppage&amp;sid=$sid&amp;who=$who\">«PREV</a> ";
        }
        if($page<$num_pages)
        {
          $npage = $page+1;
          echo "<a href=\"downloads.php?action=$action&amp;page=$npage&amp;sid=$sid&amp;who=$who\">Next»</a>";
        }
        echo "<br/>$page/$num_pages<br/>";
        if($num_pages>2)
        {
          $rets = "Jump to page: <input name=\"pg\" format=\"*N\" size=\"3\"/>";
            $rets .= "<anchor>[GO]";
            $rets .= "<go href=\"downloads.php?type=send\" method=\"get\">";
            $rets .= "<postfield name=\"action\" value=\"$action\"/>";
            $rets .= "<postfield name=\"who\" value=\"$who\"/>";
            $rets .= "<postfield name=\"sid\" value=\"$sid\"/>";
            $rets .= "<postfield name=\"page\" value=\"$(pg)\"/>";
            $rets .= "</go></anchor>";
    
            echo $rets;
        }
        echo "</p>";
      ////// UNTILL HERE >>
        echo "<p align=\"center\">";
        if($uid==$who && getplusses($uid)>25)
        {
        echo "<a href=\"up.php?action=games2&amp;sid=$sid\">";
    echo "Add Item</a><br/>";
    }
    if($who!="")
    {
    echo "<a href=\"index.php?action=viewuser&amp;sid=$sid&amp;who=$who\">";
    $whonick = getnick_uid($who);
    echo "$whonick's Profile</a><br/>";
    }else{
    echo "<a href=\"index.php?action=vault&amp;sid=$sid\">";
    echo "Downloads</a><br/>";
    }
        echo "<a href=\"index.php?action=main&amp;sid=$sid\">";
    echo "Main menu</a>";
      echo "</p>";
        echo "</card>";
    }
    
    
    //////////////////////////////////Buddies
    
    else if($action=="games3")
    {
        $who = $_GET["who"];
        addonline(getuid_sid($sid),"Eseries/Ngage/Nseries Games","");
        echo "<card id=\"main\" title=\"s60/Ngage/Nseries Games\">";
        $uid = getuid_sid($sid);
    
    
    
        //////ALL LISTS SCRIPT <<
    
        if($page=="" || $page<=0)$page=1;
        if($did="9")
        {
        $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_vault WHERE did='9'"));
        }else{
        $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_vault WHERE uid='".$who."'"));
        }
        $num_items = $noi[0]; //changable
        $items_per_page= 10;
        $num_pages = ceil($num_items/$items_per_page);
        if(($page>$num_pages)&&$page!=1)$page= $num_pages;
        $limit_start = ($page-1)*$items_per_page;
    
        if($who!="")
        {
            $sql = "SELECT id, title, itemurl, did FROM ibwf_vault WHERE uid='".$who."' ORDER BY pudt DESC LIMIT $limit_start, $items_per_page";
            }else{
    $sql = "SELECT id, title, itemurl, uid, did FROM ibwf_vault WHERE did='".$did."' ORDER BY did DESC LIMIT $limit_start, $items_per_page";
            }
    
    
        echo "<p>";
        $items = mysql_query($sql);
        echo mysql_error();
        if(mysql_num_rows($items)>0)
        {
        while ($item = mysql_fetch_array($items))
        {
          $ext = getext($item[2]);
            $ime = getextimg($ext);
            $lnk = "<a href=\"downloads.php?action=download&amp;sid=$sid&amp;did=$item[0]\">$ime".htmlspecialchars($item[2])."</a>";
    
          if(candelvl($uid, $item[0]))
          {
            $delnk = "<a href=\"genproc.php?action=delvlt&amp;sid=$sid&amp;did=$item[0]\">[x]</a>";
          }else{
            $delnk = "";
          }
          if($who!="")
          {
            $byusr="";
          }else{
            $unick = getnick_uid($item[3]);
            $ulnk = "<a href=\"index.php?action=viewuser&amp;sid=$sid&amp;who=$item[3]\">$unick</a>";
            $byusr = "<br/>By: $ulnk";
          }
          echo "$lnk $byusr $delnk<br/>";
    
    
        }
        }
        echo "</p>";
        echo "<p align=\"center\">";
        if($page>1)
        {
          $ppage = $page-1;
          echo "<a href=\"downloads.php?action=$action&amp;page=$ppage&amp;sid=$sid&amp;who=$who\">«PREV</a> ";
        }
        if($page<$num_pages)
        {
          $npage = $page+1;
          echo "<a href=\"downloads.php?action=$action&amp;page=$npage&amp;sid=$sid&amp;who=$who\">Next»</a>";
        }
        echo "<br/>$page/$num_pages<br/>";
        if($num_pages>2)
        {
          $rets = "Jump to page: <input name=\"pg\" format=\"*N\" size=\"3\"/>";
            $rets .= "<anchor>[GO]";
            $rets .= "<go href=\"downloads.php?type=send\" method=\"get\">";
            $rets .= "<postfield name=\"action\" value=\"$action\"/>";
            $rets .= "<postfield name=\"who\" value=\"$who\"/>";
            $rets .= "<postfield name=\"sid\" value=\"$sid\"/>";
            $rets .= "<postfield name=\"page\" value=\"$(pg)\"/>";
            $rets .= "</go></anchor>";
    
            echo $rets;
        }
        echo "</p>";
      ////// UNTILL HERE >>
        echo "<p align=\"center\">";
        if($uid==$who && getplusses($uid)>25)
        {
        echo "<a href=\"up.php?action=videos&amp;sid=$sid\">";
    echo "Add Item</a><br/>";
    }
    if($who!="")
    {
    echo "<a href=\"index.php?action=viewuser&amp;sid=$sid&amp;who=$who\">";
    $whonick = getnick_uid($who);
    echo "$whonick's Profile</a><br/>";
    }else{
    echo "<a href=\"index.php?action=vault&amp;sid=$sid\">";
    echo "Downloads</a><br/>";
    }
        echo "<a href=\"index.php?action=main&amp;sid=$sid\">";
    echo "Main menu</a>";
      echo "</p>";
        echo "</card>";
    }
    
    
    //////////////////////////////////Buddies
    
    else if($action=="segames")
    {
        $who = $_GET["who"];
        addonline(getuid_sid($sid),"SE Games","");
        echo "<card id=\"main\" title=\"SE Games\">";
        $uid = getuid_sid($sid);
    
    
    
        //////ALL LISTS SCRIPT <<
    
        if($page=="" || $page<=0)$page=1;
        if($did="10")
        {
        $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_vault WHERE did='10'"));
        }else{
        $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_vault WHERE uid='".$who."'"));
        }
        $num_items = $noi[0]; //changable
        $items_per_page= 10;
        $num_pages = ceil($num_items/$items_per_page);
        if(($page>$num_pages)&&$page!=1)$page= $num_pages;
        $limit_start = ($page-1)*$items_per_page;
    
        if($who!="")
        {
            $sql = "SELECT id, title, itemurl, did FROM ibwf_vault WHERE uid='".$who."' ORDER BY pudt DESC LIMIT $limit_start, $items_per_page";
            }else{
    $sql = "SELECT id, title, itemurl, uid, did FROM ibwf_vault WHERE did='".$did."' ORDER BY did DESC LIMIT $limit_start, $items_per_page";
            }
    
    
        echo "<p>";
        $items = mysql_query($sql);
        echo mysql_error();
        if(mysql_num_rows($items)>0)
        {
        while ($item = mysql_fetch_array($items))
        {
          $ext = getext($item[2]);
            $ime = getextimg($ext);
            $lnk = "<a href=\"downloads.php?action=download&amp;sid=$sid&amp;did=$item[0]\">$ime".htmlspecialchars($item[2])."</a>";
    
          if(candelvl($uid, $item[0]))
          {
            $delnk = "<a href=\"genproc.php?action=delvlt&amp;sid=$sid&amp;did=$item[0]\">[x]</a>";
          }else{
            $delnk = "";
          }
          if($who!="")
          {
            $byusr="";
          }else{
            $unick = getnick_uid($item[3]);
            $ulnk = "<a href=\"index.php?action=viewuser&amp;sid=$sid&amp;who=$item[3]\">$unick</a>";
            $byusr = "<br/>By: $ulnk";
          }
          echo "$lnk $byusr $delnk<br/>";
    
    
        }
        }
        echo "</p>";
        echo "<p align=\"center\">";
        if($page>1)
        {
          $ppage = $page-1;
          echo "<a href=\"downloads.php?action=$action&amp;page=$ppage&amp;sid=$sid&amp;who=$who\">«PREV</a> ";
        }
        if($page<$num_pages)
        {
          $npage = $page+1;
          echo "<a href=\"downloads.php?action=$action&amp;page=$npage&amp;sid=$sid&amp;who=$who\">Next»</a>";
        }
        echo "<br/>$page/$num_pages<br/>";
        if($num_pages>2)
        {
          $rets = "Jump to page: <input name=\"pg\" format=\"*N\" size=\"3\"/>";
            $rets .= "<anchor>[GO]";
            $rets .= "<go href=\"downloads.php?type=send\" method=\"get\">";
            $rets .= "<postfield name=\"action\" value=\"$action\"/>";
            $rets .= "<postfield name=\"who\" value=\"$who\"/>";
            $rets .= "<postfield name=\"sid\" value=\"$sid\"/>";
            $rets .= "<postfield name=\"page\" value=\"$(pg)\"/>";
            $rets .= "</go></anchor>";
    
            echo $rets;
        }
        echo "</p>";
      ////// UNTILL HERE >>
        echo "<p align=\"center\">";
        if($uid==$who && getplusses($uid)>25)
        {
        echo "<a href=\"up.php?action=audio&amp;sid=$sid\">";
    echo "Add Item</a><br/>";
    }
    if($who!="")
    {
    echo "<a href=\"index.php?action=viewuser&amp;sid=$sid&amp;who=$who\">";
    $whonick = getnick_uid($who);
    echo "$whonick's Profile</a><br/>";
    }else{
    echo "<a href=\"index.php?action=vault&amp;sid=$sid\">";
    echo "Downloads</a><br/>";
    }
        echo "<a href=\"index.php?action=main&amp;sid=$sid\">";
    echo "Main menu</a>";
      echo "</p>";
        echo "</card>";
    }
    
    
    //////////////////////////////////Buddies
    
    else if($action=="mp3")
    {
        $who = $_GET["who"];
        addonline(getuid_sid($sid),"Full MP3","");
        echo "<card id=\"main\" title=\"Full MP3\">";
        $uid = getuid_sid($sid);
    
    
    
        //////ALL LISTS SCRIPT <<
    
        if($page=="" || $page<=0)$page=1;
        if($did="11")
        {
        $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_vault WHERE did='11'"));
        }else{
        $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_vault WHERE uid='".$who."'"));
        }
        $num_items = $noi[0]; //changable
        $items_per_page= 10;
        $num_pages = ceil($num_items/$items_per_page);
        if(($page>$num_pages)&&$page!=1)$page= $num_pages;
        $limit_start = ($page-1)*$items_per_page;
    
        if($who!="")
        {
            $sql = "SELECT id, title, itemurl, did FROM ibwf_vault WHERE uid='".$who."' ORDER BY pudt DESC LIMIT $limit_start, $items_per_page";
            }else{
    $sql = "SELECT id, title, itemurl, uid, did FROM ibwf_vault WHERE did='".$did."' ORDER BY did DESC LIMIT $limit_start, $items_per_page";
            }
    
    
        echo "<p>";
        $items = mysql_query($sql);
        echo mysql_error();
        if(mysql_num_rows($items)>0)
        {
        while ($item = mysql_fetch_array($items))
        {
          $ext = getext($item[2]);
            $ime = getextimg($ext);
            $lnk = "<a href=\"downloads.php?action=download&amp;sid=$sid&amp;did=$item[0]\">$ime".htmlspecialchars($item[2])."</a>";
    
          if(candelvl($uid, $item[0]))
          {
            $delnk = "<a href=\"genproc.php?action=delvlt&amp;sid=$sid&amp;did=$item[0]\">[x]</a>";
          }else{
            $delnk = "";
          }
          if($who!="")
          {
            $byusr="";
          }else{
            $unick = getnick_uid($item[3]);
            $ulnk = "<a href=\"index.php?action=viewuser&amp;sid=$sid&amp;who=$item[3]\">$unick</a>";
            $byusr = "<br/>By: $ulnk";
          }
          echo "$lnk $byusr $delnk<br/>";
    
    
        }
        }
        echo "</p>";
        echo "<p align=\"center\">";
        if($page>1)
        {
          $ppage = $page-1;
          echo "<a href=\"downloads.php?action=$action&amp;page=$ppage&amp;sid=$sid&amp;who=$who\">«PREV</a> ";
        }
        if($page<$num_pages)
        {
          $npage = $page+1;
          echo "<a href=\"downloads.php?action=$action&amp;page=$npage&amp;sid=$sid&amp;who=$who\">Next»</a>";
        }
        echo "<br/>$page/$num_pages<br/>";
        if($num_pages>2)
        {
          $rets = "Jump to page: <input name=\"pg\" format=\"*N\" size=\"3\"/>";
            $rets .= "<anchor>[GO]";
            $rets .= "<go href=\"downloads.php?type=send\" method=\"get\">";
            $rets .= "<postfield name=\"action\" value=\"$action\"/>";
            $rets .= "<postfield name=\"who\" value=\"$who\"/>";
            $rets .= "<postfield name=\"sid\" value=\"$sid\"/>";
            $rets .= "<postfield name=\"page\" value=\"$(pg)\"/>";
            $rets .= "</go></anchor>";
    
            echo $rets;
        }
        echo "</p>";
      ////// UNTILL HERE >>
        echo "<p align=\"center\">";
        if($uid==$who && getplusses($uid)>25)
        {
        echo "<a href=\"up.php?action=wall&amp;sid=$sid\">";
    echo "Add Item</a><br/>";
    }
    if($who!="")
    {
    echo "<a href=\"index.php?action=viewuser&amp;sid=$sid&amp;who=$who\">";
    $whonick = getnick_uid($who);
    echo "$whonick's Profile</a><br/>";
    }else{
    echo "<a href=\"index.php?action=vault&amp;sid=$sid\">";
    echo "Downloads</a><br/>";
    }
        echo "<a href=\"index.php?action=main&amp;sid=$sid\">";
    echo "Main menu</a>";
      echo "</p>";
        echo "</card>";
    }
    
    
    //////////////////////////////////Buddies
    
    else if($action=="3gp")
    {
        $who = $_GET["who"];
        addonline(getuid_sid($sid),"3GP Videos","");
        echo "<card id=\"main\" title=\"3GP Videos\">";
        $uid = getuid_sid($sid);
    
    
    
        //////ALL LISTS SCRIPT <<
    
        if($page=="" || $page<=0)$page=1;
        if($did="12")
        {
        $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_vault WHERE did='12'"));
        }else{
        $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_vault WHERE uid='".$who."'"));
        }
        $num_items = $noi[0]; //changable
        $items_per_page= 10;
        $num_pages = ceil($num_items/$items_per_page);
        if(($page>$num_pages)&&$page!=1)$page= $num_pages;
        $limit_start = ($page-1)*$items_per_page;
    
        if($who!="")
        {
            $sql = "SELECT id, title, itemurl, did FROM ibwf_vault WHERE uid='".$who."' ORDER BY pudt DESC LIMIT $limit_start, $items_per_page";
            }else{
    $sql = "SELECT id, title, itemurl, uid, did FROM ibwf_vault WHERE did='".$did."' ORDER BY pudt DESC LIMIT $limit_start, $items_per_page";
            }
    
    
        echo "<p>";
        $items = mysql_query($sql);
        echo mysql_error();
        if(mysql_num_rows($items)>0)
        {
        while ($item = mysql_fetch_array($items))
        {
          $ext = getext($item[2]);
            $ime = getextimg($ext);
            $lnk = "<a href=\"downloads.php?action=download&amp;sid=$sid&amp;did=$item[0]\">$ime".htmlspecialchars($item[2])."</a>";
    
          if(candelvl($uid, $item[0]))
          {
            $delnk = "<a href=\"genproc.php?action=delvlt&amp;sid=$sid&amp;did=$item[0]\">[x]</a>";
          }else{
            $delnk = "";
          }
          if($who!="")
          {
            $byusr="";
          }else{
            $unick = getnick_uid($item[3]);
            $ulnk = "<a href=\"index.php?action=viewuser&amp;sid=$sid&amp;who=$item[3]\">$unick</a>";
            $byusr = "<br/>By: $ulnk";
          }
          echo "$lnk $byusr $delnk<br/>";
    
    
        }
        }
        echo "</p>";
        echo "<p align=\"center\">";
        if($page>1)
        {
          $ppage = $page-1;
          echo "<a href=\"downloads.php?action=$action&amp;page=$ppage&amp;sid=$sid&amp;who=$who\">«PREV</a> ";
        }
        if($page<$num_pages)
        {
          $npage = $page+1;
          echo "<a href=\"downloads.php?action=$action&amp;page=$npage&amp;sid=$sid&amp;who=$who\">Next»</a>";
        }
        echo "<br/>$page/$num_pages<br/>";
        if($num_pages>2)
        {
          $rets = "Jump to page: <input name=\"pg\" format=\"*N\" size=\"3\"/>";
            $rets .= "<anchor>[GO]";
            $rets .= "<go href=\"downloads.php?type=send\" method=\"get\">";
            $rets .= "<postfield name=\"action\" value=\"$action\"/>";
            $rets .= "<postfield name=\"who\" value=\"$who\"/>";
            $rets .= "<postfield name=\"sid\" value=\"$sid\"/>";
            $rets .= "<postfield name=\"page\" value=\"$(pg)\"/>";
            $rets .= "</go></anchor>";
    
            echo $rets;
        }
        echo "</p>";
      ////// UNTILL HERE >>
        echo "<p align=\"center\">";
        if($uid==$who && getplusses($uid)>25)
        {
        echo "<a href=\"up.php?action=others&amp;sid=$sid\">";
    echo "Add Item</a><br/>";
    }
    if($who!="")
    {
    echo "<a href=\"index.php?action=viewuser&amp;sid=$sid&amp;who=$who\">";
    $whonick = getnick_uid($who);
    echo "$whonick's Profile</a><br/>";
    }else{
    echo "<a href=\"index.php?action=vault&amp;sid=$sid\">";
    echo "Downloads</a><br/>";
    }
        echo "<a href=\"index.php?action=main&amp;sid=$sid\">";
    echo "Main menu</a>";
      echo "</p>";
        echo "</card>";
    }
    
    
    //////////////////////////////////Buddies
    
    else if($action=="scandal")
    {
        $who = $_GET["who"];
        addonline(getuid_sid($sid),"Scandal","");
        echo "<card id=\"main\" title=\"Scandal\">";
        $uid = getuid_sid($sid);
    
    
    
        //////ALL LISTS SCRIPT <<
    
        if($page=="" || $page<=0)$page=1;
        if($did="13")
        {
        $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_vault WHERE did='13'"));
        }else{
        $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_vault WHERE uid='".$who."'"));
        }
        $num_items = $noi[0]; //changable
        $items_per_page= 10;
        $num_pages = ceil($num_items/$items_per_page);
        if(($page>$num_pages)&&$page!=1)$page= $num_pages;
        $limit_start = ($page-1)*$items_per_page;
    
        if($who!="")
        {
            $sql = "SELECT id, title, itemurl, did FROM ibwf_vault WHERE uid='".$who."' ORDER BY pudt DESC LIMIT $limit_start, $items_per_page";
            }else{
    $sql = "SELECT id, title, itemurl, uid, did FROM ibwf_vault WHERE did='".$did."' ORDER BY did DESC LIMIT $limit_start, $items_per_page";
            }
    
    
        echo "<p>";
        $items = mysql_query($sql);
        echo mysql_error();
        if(mysql_num_rows($items)>0)
        {
        while ($item = mysql_fetch_array($items))
        {
          $ext = getext($item[2]);
            $ime = getextimg($ext);
            $lnk = "<a href=\"downloads.php?action=download&amp;sid=$sid&amp;did=$item[0]\">$ime".htmlspecialchars($item[2])."</a>";
    
          if(candelvl($uid, $item[0]))
          {
            $delnk = "<a href=\"genproc.php?action=delvlt&amp;sid=$sid&amp;did=$item[0]\">[x]</a>";
          }else{
            $delnk = "";
          }
          if($who!="")
          {
            $byusr="";
          }else{
            $unick = getnick_uid($item[3]);
            $ulnk = "<a href=\"index.php?action=viewuser&amp;sid=$sid&amp;who=$item[3]\">$unick</a>";
            $byusr = "<br/>By: $ulnk";
          }
          echo "$lnk $byusr $delnk<br/>";
    
    
        }
        }
        echo "</p>";
        echo "<p align=\"center\">";
        if($page>1)
        {
          $ppage = $page-1;
          echo "<a href=\"downloads.php?action=$action&amp;page=$ppage&amp;sid=$sid&amp;who=$who\">«PREV</a> ";
        }
        if($page<$num_pages)
        {
          $npage = $page+1;
          echo "<a href=\"downloads.php?action=$action&amp;page=$npage&amp;sid=$sid&amp;who=$who\">Next»</a>";
        }
        echo "<br/>$page/$num_pages<br/>";
        if($num_pages>2)
        {
          $rets = "Jump to page: <input name=\"pg\" format=\"*N\" size=\"3\"/>";
            $rets .= "<anchor>[GO]";
            $rets .= "<go href=\"downloads.php?type=send\" method=\"get\">";
            $rets .= "<postfield name=\"action\" value=\"$action\"/>";
            $rets .= "<postfield name=\"who\" value=\"$who\"/>";
            $rets .= "<postfield name=\"sid\" value=\"$sid\"/>";
            $rets .= "<postfield name=\"page\" value=\"$(pg)\"/>";
            $rets .= "</go></anchor>";
    
            echo $rets;
        }
        echo "</p>";
      ////// UNTILL HERE >>
        echo "<p align=\"center\">";
        if($uid==$who && getplusses($uid)>25)
        {
        echo "<a href=\"up.php?action=wall&amp;sid=$sid\">";
    echo "Add Item</a><br/>";
    }
    if($who!="")
    {
    echo "<a href=\"index.php?action=viewuser&amp;sid=$sid&amp;who=$who\">";
    $whonick = getnick_uid($who);
    echo "$whonick's Profile</a><br/>";
    }else{
    echo "<a href=\"index.php?action=vault&amp;sid=$sid\">";
    echo "Downloads</a><br/>";
    }
        echo "<a href=\"index.php?action=main&amp;sid=$sid\">";
    echo "Main menu</a>";
      echo "</p>";
        echo "</card>";
    }
    
    
    //////////////////////////////////Buddies
    
    else if($action=="gameboy")
    {
        $who = $_GET["who"];
        addonline(getuid_sid($sid),"Gameboy Games","");
        echo "<card id=\"main\" title=\"Gameboy Games\">";
        $uid = getuid_sid($sid);
    
    
    
        //////ALL LISTS SCRIPT <<
    
        if($page=="" || $page<=0)$page=1;
        if($did="14")
        {
        $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_vault WHERE did='14'"));
        }else{
        $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_vault WHERE uid='".$who."'"));
        }
        $num_items = $noi[0]; //changable
        $items_per_page= 10;
        $num_pages = ceil($num_items/$items_per_page);
        if(($page>$num_pages)&&$page!=1)$page= $num_pages;
        $limit_start = ($page-1)*$items_per_page;
    
        if($who!="")
        {
            $sql = "SELECT id, title, itemurl, did FROM ibwf_vault WHERE uid='".$who."' ORDER BY pudt DESC LIMIT $limit_start, $items_per_page";
            }else{
    $sql = "SELECT id, title, itemurl, uid, did FROM ibwf_vault WHERE did='".$did."' ORDER BY did DESC LIMIT $limit_start, $items_per_page";
            }
    
    
        echo "<p>";
        $items = mysql_query($sql);
        echo mysql_error();
        if(mysql_num_rows($items)>0)
        {
        while ($item = mysql_fetch_array($items))
        {
          $ext = getext($item[2]);
            $ime = getextimg($ext);
            $lnk = "<a href=\"downloads.php?action=download&amp;sid=$sid&amp;did=$item[0]\">$ime".htmlspecialchars($item[2])."</a>";
    
          if(candelvl($uid, $item[0]))
          {
            $delnk = "<a href=\"genproc.php?action=delvlt&amp;sid=$sid&amp;did=$item[0]\">[x]</a>";
          }else{
            $delnk = "";
          }
          if($who!="")
          {
            $byusr="";
          }else{
            $unick = getnick_uid($item[3]);
            $ulnk = "<a href=\"index.php?action=viewuser&amp;sid=$sid&amp;who=$item[3]\">$unick</a>";
            $byusr = "<br/>By: $ulnk";
          }
          echo "$lnk $byusr $delnk<br/>";
    
    
        }
        }
        echo "</p>";
        echo "<p align=\"center\">";
        if($page>1)
        {
          $ppage = $page-1;
          echo "<a href=\"downloads.php?action=$action&amp;page=$ppage&amp;sid=$sid&amp;who=$who\">«PREV</a> ";
        }
        if($page<$num_pages)
        {
          $npage = $page+1;
          echo "<a href=\"downloads.php?action=$action&amp;page=$npage&amp;sid=$sid&amp;who=$who\">Next»</a>";
        }
        echo "<br/>$page/$num_pages<br/>";
        if($num_pages>2)
        {
          $rets = "Jump to page: <input name=\"pg\" format=\"*N\" size=\"3\"/>";
            $rets .= "<anchor>[GO]";
            $rets .= "<go href=\"downloads.php?type=send\" method=\"get\">";
            $rets .= "<postfield name=\"action\" value=\"$action\"/>";
            $rets .= "<postfield name=\"who\" value=\"$who\"/>";
            $rets .= "<postfield name=\"sid\" value=\"$sid\"/>";
            $rets .= "<postfield name=\"page\" value=\"$(pg)\"/>";
            $rets .= "</go></anchor>";
    
            echo $rets;
        }
        echo "</p>";
      ////// UNTILL HERE >>
        echo "<p align=\"center\">";
        if($uid==$who && getplusses($uid)>25)
        {
        echo "<a href=\"up.php?action=wall&amp;sid=$sid\">";
    echo "Add Item</a><br/>";
    }
    if($who!="")
    {
    echo "<a href=\"index.php?action=viewuser&amp;sid=$sid&amp;who=$who\">";
    $whonick = getnick_uid($who);
    echo "$whonick's Profile</a><br/>";
    }else{
    echo "<a href=\"index.php?action=vault&amp;sid=$sid\">";
    echo "Downloads</a><br/>";
    }
        echo "<a href=\"index.php?action=main&amp;sid=$sid\">";
    echo "Main menu</a>";
      echo "</p>";
        echo "</card>";
    }
    
    
    //////////////////////////////////Buddies
    
    else if($action=="naruto")
    {
        $who = $_GET["who"];
        addonline(getuid_sid($sid),"Naruto-Themes/Poly/MP3 ","");
        echo "<card id=\"main\" title=\"Naruto-Themes/Poly/MP3 \">";
        $uid = getuid_sid($sid);
    
    
    
        //////ALL LISTS SCRIPT <<
    
        if($page=="" || $page<=0)$page=1;
        if($did="15")
        {
        $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_vault WHERE did='15'"));
        }else{
        $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_vault WHERE uid='".$who."'"));
        }
        $num_items = $noi[0]; //changable
        $items_per_page= 10;
        $num_pages = ceil($num_items/$items_per_page);
        if(($page>$num_pages)&&$page!=1)$page= $num_pages;
        $limit_start = ($page-1)*$items_per_page;
    
        if($who!="")
        {
            $sql = "SELECT id, title, itemurl, did FROM ibwf_vault WHERE uid='".$who."' ORDER BY pudt DESC LIMIT $limit_start, $items_per_page";
            }else{
    $sql = "SELECT id, title, itemurl, uid, did FROM ibwf_vault WHERE did='".$did."' ORDER BY did DESC LIMIT $limit_start, $items_per_page";
            }
    
    
        echo "<p>";
        $items = mysql_query($sql);
        echo mysql_error();
        if(mysql_num_rows($items)>0)
        {
        while ($item = mysql_fetch_array($items))
        {
          $ext = getext($item[2]);
            $ime = getextimg($ext);
            $lnk = "<a href=\"downloads.php?action=download&amp;sid=$sid&amp;did=$item[0]\">$ime".htmlspecialchars($item[2])."</a>";
    
          if(candelvl($uid, $item[0]))
          {
            $delnk = "<a href=\"genproc.php?action=delvlt&amp;sid=$sid&amp;did=$item[0]\">[x]</a>";
          }else{
            $delnk = "";
          }
          if($who!="")
          {
            $byusr="";
          }else{
            $unick = getnick_uid($item[3]);
            $ulnk = "<a href=\"index.php?action=viewuser&amp;sid=$sid&amp;who=$item[3]\">$unick</a>";
            $byusr = "<br/>By: $ulnk";
          }
          echo "$lnk $byusr $delnk<br/>";
    
    
        }
        }
        echo "</p>";
        echo "<p align=\"center\">";
        if($page>1)
        {
          $ppage = $page-1;
          echo "<a href=\"downloads.php?action=$action&amp;page=$ppage&amp;sid=$sid&amp;who=$who\">«PREV</a> ";
        }
        if($page<$num_pages)
        {
          $npage = $page+1;
          echo "<a href=\"downloads.php?action=$action&amp;page=$npage&amp;sid=$sid&amp;who=$who\">Next»</a>";
        }
        echo "<br/>$page/$num_pages<br/>";
        if($num_pages>2)
        {
          $rets = "Jump to page: <input name=\"pg\" format=\"*N\" size=\"3\"/>";
            $rets .= "<anchor>[GO]";
            $rets .= "<go href=\"downloads.php?type=send\" method=\"get\">";
            $rets .= "<postfield name=\"action\" value=\"$action\"/>";
            $rets .= "<postfield name=\"who\" value=\"$who\"/>";
            $rets .= "<postfield name=\"sid\" value=\"$sid\"/>";
            $rets .= "<postfield name=\"page\" value=\"$(pg)\"/>";
            $rets .= "</go></anchor>";
    
            echo $rets;
        }
        echo "</p>";
      ////// UNTILL HERE >>
        echo "<p align=\"center\">";
        if($uid==$who && getplusses($uid)>25)
        {
        echo "<a href=\"up.php?action=wall&amp;sid=$sid\">";
    echo "Add Item</a><br/>";
    }
    if($who!="")
    {
    echo "<a href=\"index.php?action=viewuser&amp;sid=$sid&amp;who=$who\">";
    $whonick = getnick_uid($who);
    echo "$whonick's Profile</a><br/>";
    }else{
    echo "<a href=\"index.php?action=vault&amp;sid=$sid\">";
    echo "Downloads</a><br/>";
    }
        echo "<a href=\"index.php?action=main&amp;sid=$sid\">";
    echo "Main menu</a>";
      echo "</p>";
        echo "</card>";
    }
    
    
    //////////////////////////////////Buddies
    
    else if($action=="poly")
    {
        $who = $_GET["who"];
        addonline(getuid_sid($sid),"MP3/MIDI/WAV/POLY/AMR/RAR ($noi[0])","");
        echo "<card id=\"main\" title=\"MP3/MIDI/WAV/POLY/AMR/RAR ($noi[0])\">";
        $uid = getuid_sid($sid);
    
    
    
        //////ALL LISTS SCRIPT <<
    
        if($page=="" || $page<=0)$page=1;
        if($did="16")
        {
        $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_vault WHERE did='16'"));
        }else{
        $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_vault WHERE uid='".$who."'"));
        }
        $num_items = $noi[0]; //changable
        $items_per_page= 10;
        $num_pages = ceil($num_items/$items_per_page);
        if(($page>$num_pages)&&$page!=1)$page= $num_pages;
        $limit_start = ($page-1)*$items_per_page;
    
        if($who!="")
        {
            $sql = "SELECT id, title, itemurl, did FROM ibwf_vault WHERE uid='".$who."' ORDER BY pudt DESC LIMIT $limit_start, $items_per_page";
            }else{
    $sql = "SELECT id, title, itemurl, uid, did FROM ibwf_vault WHERE did='".$did."' ORDER BY did DESC LIMIT $limit_start, $items_per_page";
            }
    
    
        echo "<p>";
        $items = mysql_query($sql);
        echo mysql_error();
        if(mysql_num_rows($items)>0)
        {
        while ($item = mysql_fetch_array($items))
        {
          $ext = getext($item[2]);
            $ime = getextimg($ext);
            $lnk = "<a href=\"downloads.php?action=download&amp;sid=$sid&amp;did=$item[0]\">$ime".htmlspecialchars($item[2])."</a>";
    
          if(candelvl($uid, $item[0]))
          {
            $delnk = "<a href=\"genproc.php?action=delvlt&amp;sid=$sid&amp;did=$item[0]\">[x]</a>";
          }else{
            $delnk = "";
          }
          if($who!="")
          {
            $byusr="";
          }else{
            $unick = getnick_uid($item[3]);
            $ulnk = "<a href=\"index.php?action=viewuser&amp;sid=$sid&amp;who=$item[3]\">$unick</a>";
            $byusr = "<br/>By: $ulnk";
          }
          echo "$lnk $byusr $delnk<br/>";
    
    
        }
        }
        echo "</p>";
        echo "<p align=\"center\">";
        if($page>1)
        {
          $ppage = $page-1;
          echo "<a href=\"downloads.php?action=$action&amp;page=$ppage&amp;sid=$sid&amp;who=$who\">«PREV</a> ";
        }
        if($page<$num_pages)
        {
          $npage = $page+1;
          echo "<a href=\"downloads.php?action=$action&amp;page=$npage&amp;sid=$sid&amp;who=$who\">Next»</a>";
        }
        echo "<br/>$page/$num_pages<br/>";
        if($num_pages>2)
        {
          $rets = "Jump to page: <input name=\"pg\" format=\"*N\" size=\"3\"/>";
            $rets .= "<anchor>[GO]";
            $rets .= "<go href=\"downloads.php?type=send\" method=\"get\">";
            $rets .= "<postfield name=\"action\" value=\"$action\"/>";
            $rets .= "<postfield name=\"who\" value=\"$who\"/>";
            $rets .= "<postfield name=\"sid\" value=\"$sid\"/>";
            $rets .= "<postfield name=\"page\" value=\"$(pg)\"/>";
            $rets .= "</go></anchor>";
    
            echo $rets;
        }
        echo "</p>";
      ////// UNTILL HERE >>
        echo "<p align=\"center\">";
        if($uid==$who && getplusses($uid)>25)
        {
        echo "<a href=\"up.php?action=wall&amp;sid=$sid\">";
    echo "Add Item</a><br/>";
    }
    if($who!="")
    {
    echo "<a href=\"index.php?action=viewuser&amp;sid=$sid&amp;who=$who\">";
    $whonick = getnick_uid($who);
    echo "$whonick's Profile</a><br/>";
    }else{
    echo "<a href=\"index.php?action=vault&amp;sid=$sid\">";
    echo "Downloads</a><br/>";
    }
        echo "<a href=\"index.php?action=main&amp;sid=$sid\">";
    echo "Main menu</a>";
      echo "</p>";
        echo "</card>";
    }
    
    
    
    //////////////////////////////////Buddies
    
    else if($action=="logo")
    {
        $who = $_GET["who"];
        addonline(getuid_sid($sid),"Opera Software","");
        echo "<card id=\"main\" title=\"Opera Software\">";
        $uid = getuid_sid($sid);
    
    
    
        //////ALL LISTS SCRIPT <<
    
        if($page=="" || $page<=0)$page=1;
        if($did="17")
        {
        $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_vault WHERE did='17'"));
        }else{
        $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_vault WHERE uid='".$who."'"));
        }
        $num_items = $noi[0]; //changable
        $items_per_page= 10;
        $num_pages = ceil($num_items/$items_per_page);
        if(($page>$num_pages)&&$page!=1)$page= $num_pages;
        $limit_start = ($page-1)*$items_per_page;
    
        if($who!="")
        {
            $sql = "SELECT id, title, itemurl, did FROM ibwf_vault WHERE uid='".$who."' ORDER BY pudt DESC LIMIT $limit_start, $items_per_page";
            }else{
    $sql = "SELECT id, title, itemurl, uid, did FROM ibwf_vault WHERE did='".$did."' ORDER BY did DESC LIMIT $limit_start, $items_per_page";
            }
    
    
        echo "<p>";
        $items = mysql_query($sql);
        echo mysql_error();
        if(mysql_num_rows($items)>0)
        {
        while ($item = mysql_fetch_array($items))
        {
          $ext = getext($item[2]);
            $ime = getextimg($ext);
            $lnk = "<a href=\"downloads.php?action=download&amp;sid=$sid&amp;did=$item[0]\">$ime".htmlspecialchars($item[2])."</a>";
    
          if(candelvl($uid, $item[0]))
          {
            $delnk = "<a href=\"genproc.php?action=delvlt&amp;sid=$sid&amp;did=$item[0]\">[x]</a>";
          }else{
            $delnk = "";
          }
          if($who!="")
          {
            $byusr="";
          }else{
            $unick = getnick_uid($item[3]);
            $ulnk = "<a href=\"index.php?action=viewuser&amp;sid=$sid&amp;who=$item[3]\">$unick</a>";
            $byusr = "<br/>By: $ulnk";
          }
          echo "$lnk $byusr $delnk<br/>";
    
    
        }
        }
        echo "</p>";
        echo "<p align=\"center\">";
        if($page>1)
        {
          $ppage = $page-1;
          echo "<a href=\"downloads.php?action=$action&amp;page=$ppage&amp;sid=$sid&amp;who=$who\">«PREV</a> ";
        }
        if($page<$num_pages)
        {
          $npage = $page+1;
          echo "<a href=\"downloads.php?action=$action&amp;page=$npage&amp;sid=$sid&amp;who=$who\">Next»</a>";
        }
        echo "<br/>$page/$num_pages<br/>";
        if($num_pages>2)
        {
          $rets = "Jump to page: <input name=\"pg\" format=\"*N\" size=\"3\"/>";
            $rets .= "<anchor>[GO]";
            $rets .= "<go href=\"downloads.php?type=send\" method=\"get\">";
            $rets .= "<postfield name=\"action\" value=\"$action\"/>";
            $rets .= "<postfield name=\"who\" value=\"$who\"/>";
            $rets .= "<postfield name=\"sid\" value=\"$sid\"/>";
            $rets .= "<postfield name=\"page\" value=\"$(pg)\"/>";
            $rets .= "</go></anchor>";
    
            echo $rets;
        }
        echo "</p>";
      ////// UNTILL HERE >>
        echo "<p align=\"center\">";
        if($uid==$who && getplusses($uid)>25)
        {
        echo "<a href=\"up.php?action=wall&amp;sid=$sid\">";
    echo "Add Item</a><br/>";
    }
    if($who!="")
    {
    echo "<a href=\"index.php?action=viewuser&amp;sid=$sid&amp;who=$who\">";
    $whonick = getnick_uid($who);
    echo "$whonick's Profile</a><br/>";
    }else{
    echo "<a href=\"index.php?action=vault&amp;sid=$sid\">";
    echo "Downloads</a><br/>";
    }
        echo "<a href=\"index.php?action=main&amp;sid=$sid\">";
    echo "Main menu</a>";
      echo "</p>";
        echo "</card>";
    }
    
    
    
    
    
    
    
    
    
    
    //////////////////////////////////Buddies
    
    else if($action=="download")
    {
        $did = $_GET["did"];
     $uid = getuid_sid($sid);
        addonline(getuid_sid($sid),"Downloading..","");
        echo "<card id=\"main\" title=\"Downloading...\">";
    echo "<p align=\"left\">";
        $uid = getuid_sid($sid);
    $item = mysql_fetch_array(mysql_query("SELECT id, title, itemurl, uid, did, downloads, pudt, filesize, mime, info FROM ibwf_vault WHERE id='".$did."'"));
    
           $name = "Name: $item[1]";
    $desc= "Description: $item[9]";
     $downloads = "Download Times: $item[5]";
            $filesize = "File Size: $item[7]";
     $mime = "File Type: $item[8]";
    $tmstamp = $item[6];
      $tmdt = date("d m Y - H:i:s", $tmstamp);
    $earns2 = "Download Cost: 5 plusses";
    
    
            $dateadded1 = "Date Added: $dateadded";
    
        if($who!="")
          {
            $byusr="";
          }else{
            $unick = getnick_uid($item[3]);
            $ulnk = "<a href=\"index.php?action=viewuser&amp;sid=$sid&amp;who=$item[3]\">$unick</a>";
    
          }
           echo "$name<br/>$desc<br/>$filesize<br/>$mime<br/>Date Uploaded: $tmdt<br/>$earns2<br/>$downloads<br/>Uploaded by by: $ulnk<br/>";
          echo "----<br/><a href=\"getnow.php?sid=$sid&amp;did=$item[0]\">Download now!</a><br/>";
    
      if(candelvl($uid, $item[0]))
          {
            $delnk = "<a href=\"genproc.php?action=delvlt&amp;sid=$sid&amp;did=$item[0]\">Delete</a><br/>";
          }else{
            $delnk = "";
          }
    echo "$delnk";
    echo "<a href=\"index.php?action=vault&amp;sid=$sid\">";
    echo "Downloads</a><br/>";
        echo "<a href=\"index.php?action=main&amp;sid=$sid\">";
    echo "Main menu</a>";
    
      echo "</p>";
        echo "</card>";
    }
    ?>
    
    </HTML>

    and this is the adding vault item @ genproc.php

    PHP Code:
    else if($action=="addvlt")
    {
    
    if(!getplusses(getuid_sid($sid))>25)
        {
          echo "<title>pinoykindat.net</title>";
          echo "<p align=\"center\">";
          echo "Only the user of 25+ plusses can add a vault item<br/><br/>";
          echo "<a href=\"index.php?action=main&amp;sid=$sid\">Home</a>";
          echo "</p>";
          echo "</body>";
          echo "</html>";
          exit();
        }
      $viname = $_POST["viname"];
      $vilink = $_POST["vilink"];
    $videsc = $_POST["videsc"];
      $did = $_POST["did"];
     //$qut = $_POST["qut"];
    
     $fname= array_reverse(explode("/",$vilink));
      addonline(getuid_sid($sid),"Adding A Vault Item","index.php?action=main");
    
    error_reporting(0);
     if(strlen($viname)<5)
    {
          echo "<title>pinoykindat.net</title>";
          echo "<p align=\"center\">";
            echo "5 minimum letters for the title!";
      echo "<br/><a href=\"index.php?action=main&amp;sid=$sid\">";
      echo "Main menu</a>";
          echo "</p>";
          echo "</body>";
          echo "</html>";
          exit();
        }
     if(strlen($vilink)<5)
    {
          echo "<title>pinoykindat.net</title>";
          echo "<p align=\"center\">";
            echo "5 minimum letters for the link!";
      echo "<br/><a href=\"index.php?action=main&amp;sid=$sid\">";
      echo "Main menu</a>";
          echo "</p>";
          echo "</body>";
          echo "</html>";
          exit();
        }
     if(strlen($videsc)<5)
    {
          echo "<title>pinoykindat.net</title>";
          echo "<p align=\"center\">";
            echo "5 minimum letters for the description!";
      echo "<br/><a href=\"index.php?action=main&amp;sid=$sid\">";
      echo "Main menu</a>";
          echo "</p>";
          echo "</body>";
          echo "</html>";
          exit();
        }
    if(spacesin($vilink))
    {
          echo "<card id=\"main\" title=\"Error adding\">";
          echo "<p align=\"center\">";
          echo "No space input!<br/>";
          echo "<a href=\"index.php?action=main&amp;sid=$sid\">Main menu</a>";
          echo "</p>";
          echo "</body>";
          echo "</html>";
          exit();
        }
    $fname= array_reverse(explode("/",$vilink));
    
    if (!eregi("\.(mid|gif|bmp|mid|midi|3gp|mp3|mp4|wav|mpn|nth|mpc|jar|jad|jpeg|jpg|sis|mmf|amr|thm|png|wbmp|rar|zip)$",$fname[0]))
    {
    echo "<card id=\"main\" title=\"Error adding\">";
          echo "<p align=\"center\">";
    echo "<b>Unsuported File extention!</b><br/>";
    echo "<a href=\"index.php?action=main&amp;sid=$sid\">Main menu</a>";
                      echo "</p></card></wml>";
                exit();
                }
    echo "<title>pinoykindat.net</title>";
          echo "<p align=\"center\">";
          $crdate = time();
          //$uid = getuid_sid($sid);
    
       $res = false;
    
    $defaultDest = "$dir";
    $slash       = "/";
    
    $dest        = "./pkfiles/";
     $fname= array_reverse(explode("/",$vilink));
    $ds = array($dest, $slash, $fname[0]);
            $ds = implode("", $ds);
      if (!copy($vilink, $ds))
    {
     echo "Dead link is not allowed!(<br/>"; 
    }else{       
      $fname= array_reverse(explode("/",$vilink));
    $ext = getext($fname[0]);
            $mime = getextfile($ext);
    $fname= array_reverse(explode("/",$vilink));
       $filesize = filesize($ds);
    $filesize = $filesize / 1048576;
    $fsize = 0;
    $fsizetxt = "";
      if ($filesize < 1)
      {
         $fsize = round($filesize*1024,0);
         $fsizetxt = "".$fsize."KB";
        $check1 = "KB";
      }else{
         $fsize = round($filesize,2);
         $fsizetxt = "".$fsize." MB";
    $check1 = "MB";
      }
      $res = mysql_query("INSERT INTO ibwf_vault SET uid='".$uid."', title='".mysql_escape_string($viname)."', pudt='".$crdate."', did='".$did."', info='".$videsc."',filesize='".$fsizetxt."', mime='".$mime."', itemurl='".$fname[0]."'");
     if($res)
          {
    mysql_query("UPDATE ibwf_users SET plusses=plusses-'5' WHERE id='".$uid."'");
     echo "File added successfully!";
          }else{
            
          }
    }
          echo "<br/><br/>";
          echo "<a href=\"index.php?action=main&amp;sid=$sid\">";
    echo "Main menu</a>";
          echo "</p>";
          echo "</body>";
    
    } 
    
    ----------------------------------------------------

    MY PROBLEM IS-- EVERYTIME I ADD A DOWNLOAD URL..
    DEADLINK IS NOT ALLOWED! APPEAR!
    BUT THE LINK THAT I USE IS NOT BROKEN..

    THANKS FOR THE ONE WOH FIXED THIS..
    LESS TALK. LESS MISTAKE.

    HTTP://APPSROB.COM - LIST OF MY FACEBOOK APPS!

    #2
    hmm.. i think Via URL is the best than Via Device.. hmm..
    LESS TALK. LESS MISTAKE.

    HTTP://APPSROB.COM - LIST OF MY FACEBOOK APPS!

    Comment


      #3
      Not all phones support uploading via device so i would say device and url are the best

      Comment


        #4
        that's right riders.. can you fixed this?
        LESS TALK. LESS MISTAKE.

        HTTP://APPSROB.COM - LIST OF MY FACEBOOK APPS!

        Comment


          #5
          Originally posted by robzky View Post
          This is my download.php script

          PHP Code:
          <?php
          include("config.php");
          include("core.php");
          
          
          header("Content-type: text/html; charset=ISO-8859-1");
          echo "<?xml version=\"1.0\" encoding=\"ISO-8859-1\" ?>";
          echo "<!DOCTYPE html PUBLIC \"-//WAPFORUM//DTD XHTML Mobile 1.0//EN\"\"http://www.wapforum.org/DTD/xhtml-mobile10.dtd\">";
          echo "<html xmlns=\"http://www.w3.org/1999/xhtml\">";
          
              echo "<head>";
          
              echo "<title>pinoyaztig.net</title>";
              echo "<link rel=\"StyleSheet\" type=\"text/css\" href=\"style/style.css\" />";
              echo "</head>";
          
              echo "<body>";
          connectdb();
          
          
          $action = $_GET["action"];
          $sid = $_GET["sid"];
          $page = $_GET["page"];
          $did = $_GET["did"];
          if($action != "")
          {
              if(islogged($sid)==false)
              {
                echo "<card id=\"main\" title=\"KozmozWAP\">";
                echo "<p align=\"center\">";
                echo "You are not logged in<br/>";
                echo "Or<br/>Your session has been expired<br/><br/>";
                echo "<a href=\"index.php\">Login</a>";
                echo "</p>";
                echo "</card>";
                echo "</wml>";
                exit();
              }
          }
          if(isbanned($uid))
              {
                  echo "<card id=\"main\" title=\"KozmozWAP\">";
                echo "<p align=\"center\">";
                echo "<img src=\"images/notok.gif\" alt=\"x\"/><br/>";
                echo "You are <b>Banned</b><br/>";
                $banto = mysql_fetch_array(mysql_query("SELECT timeto FROM ibwf_penalties WHERE uid='".$uid."' AND penalty='1'"));
                $remain = $banto[0]- time();
                $rmsg = gettimemsg($remain);
                echo "Time to finish your penalty: $rmsg<br/><br/>";
                //echo "<a href=\"index.php\">Login</a>";
                echo "</p>";
                echo "</card>";
                echo "</wml>";
                exit();
              }
          
          //////////////////////////////////Buddies
          
          else if($action=="symbian")
          {
              $who = $_GET["who"];
              addonline(getuid_sid($sid),"Symbian Application","");
              echo "<card id=\"main\" title=\"Symbian Application\">";
              $uid = getuid_sid($sid);
          
          
          
              //////ALL LISTS SCRIPT <<
          
              if($page=="" || $page<=0)$page=1;
              if($did="1")
              {
              $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_vault WHERE did='1'"));
              }else{
              $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_vault WHERE uid='".$who."'"));
              }
              $num_items = $noi[0]; //changable
              $items_per_page= 10;
              $num_pages = ceil($num_items/$items_per_page);
              if(($page>$num_pages)&&$page!=1)$page= $num_pages;
              $limit_start = ($page-1)*$items_per_page;
          
          
              if($who!="")
              {
                  $sql = "SELECT id, title, itemurl, did FROM ibwf_vault WHERE uid='".$who."' ORDER BY pudt DESC LIMIT $limit_start, $items_per_page";
                  }else{
                $sql = "SELECT id, title, itemurl, uid, did FROM ibwf_vault WHERE did='".$did."' ORDER BY pudt DESC LIMIT $limit_start, $items_per_page";
                  }
          
          
          
              echo "<p>";
              $items = mysql_query($sql);
              echo mysql_error();
              if(mysql_num_rows($items)>0)
              {
              while ($item = mysql_fetch_array($items))
              {
                $ext = getext($item[2]);
                  $ime = getextimg($ext);
                  $lnk = "<a href=\"downloads.php?action=download&amp;sid=$sid&amp;did=$item[0]\">$ime".htmlspecialchars($item[2])."</a>";
          
                if(candelvl($uid, $item[0]))
                {
                  $delnk = "<a href=\"genproc.php?action=delvlt&amp;sid=$sid&amp;did=$item[0]\">[x]</a>";
                }else{
                  $delnk = "";
                }
                if($who!="")
                {
                  $byusr="";
                }else{
                  $unick = getnick_uid($item[3]);
                  $ulnk = "<a href=\"index.php?action=viewuser&amp;sid=$sid&amp;who=$item[3]\">$unick</a>";
                  $byusr = "<br/>By: $ulnk";
                }
                echo "$lnk $byusr $delnk<br/>";
          
          
              }
              }
              echo "</p>";
              echo "<p align=\"center\">";
              if($page>1)
              {
                $ppage = $page-1;
                echo "<a href=\"downloads.php?action=$action&amp;page=$ppage&amp;sid=$sid&amp;who=$who\">«PREV</a> ";
              }
              if($page<$num_pages)
              {
                $npage = $page+1;
                echo "<a href=\"downloads.php?action=$action&amp;page=$npage&amp;sid=$sid&amp;who=$who\">Next»</a>";
              }
              echo "<br/>$page/$num_pages<br/>";
              if($num_pages>2)
              {
                $rets = "Jump to page: <input name=\"pg\" format=\"*N\" size=\"3\"/>";
                  $rets .= "<anchor>[GO]";
                  $rets .= "<go href=\"downloads.php?type=send\" method=\"get\">";
                  $rets .= "<postfield name=\"action\" value=\"$action\"/>";
                  $rets .= "<postfield name=\"who\" value=\"$who\"/>";
                  $rets .= "<postfield name=\"sid\" value=\"$sid\"/>";
                  $rets .= "<postfield name=\"page\" value=\"$(pg)\"/>";
                  $rets .= "</go></anchor>";
          
                  echo $rets;
              }
              echo "</p>";
            ////// UNTILL HERE >>
              echo "<p align=\"center\">";
              if($uid==$who && getplusses($uid)>25)
              {
              echo "<a href=\"up.php?action=themes&amp;sid=$sid\">";
          echo "Add Item</a><br/>";
          }
          if($who!="")
          {
          echo "<a href=\"index.php?action=viewuser&amp;sid=$sid&amp;who=$who\">";
          $whonick = getnick_uid($who);
          echo "$whonick's Profile</a><br/>";
          }else{
          echo "<a href=\"index.php?action=vault&amp;sid=$sid\">";
          echo "Downloads</a><br/>";
          }
              echo "<a href=\"index.php?action=main&amp;sid=$sid\">";
          echo "Main menu</a>";
            echo "</p>";
              echo "</card>";
          }
          
          
          //////////////////////////////////Buddies
          
          else if($action=="java")
          {
              $who = $_GET["who"];
              addonline(getuid_sid($sid),"Java Application","");
              echo "<card id=\"main\" title=\"Java Application\">";
              $uid = getuid_sid($sid);
          
          
          
              //////ALL LISTS SCRIPT <<
          
              if($page=="" || $page<=0)$page=1;
              if($did="2")
              {
              $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_vault WHERE did='2'"));
              }else{
              $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_vault WHERE uid='".$who."'"));
              }
              $num_items = $noi[0]; //changable
              $items_per_page= 10;
              $num_pages = ceil($num_items/$items_per_page);
              if(($page>$num_pages)&&$page!=1)$page= $num_pages;
              $limit_start = ($page-1)*$items_per_page;
          
          
              if($who!="")
              {
                  $sql = "SELECT id, title, itemurl, did FROM ibwf_vault WHERE uid='".$who."' ORDER BY pudt DESC LIMIT $limit_start, $items_per_page";
                  }else{
                $sql = "SELECT id, title, itemurl, uid, did FROM ibwf_vault WHERE did='".$did."' ORDER BY pudt DESC LIMIT $limit_start, $items_per_page";
                  }
          
          
          
              echo "<p>";
              $items = mysql_query($sql);
              echo mysql_error();
              if(mysql_num_rows($items)>0)
              {
              while ($item = mysql_fetch_array($items))
              {
                $ext = getext($item[2]);
                  $ime = getextimg($ext);
                  $lnk = "<a href=\"downloads.php?action=download&amp;sid=$sid&amp;did=$item[0]\">$ime".htmlspecialchars($item[2])."</a>";
          
                if(candelvl($uid, $item[0]))
                {
                  $delnk = "<a href=\"genproc.php?action=delvlt&amp;sid=$sid&amp;did=$item[0]\">[x]</a>";
                }else{
                  $delnk = "";
                }
                if($who!="")
                {
                  $byusr="";
                }else{
                  $unick = getnick_uid($item[3]);
                  $ulnk = "<a href=\"index.php?action=viewuser&amp;sid=$sid&amp;who=$item[3]\">$unick</a>";
                  $byusr = "<br/>By: $ulnk";
                }
                echo "$lnk $byusr $delnk<br/>";
          
          
              }
              }
              echo "</p>";
              echo "<p align=\"center\">";
              if($page>1)
              {
                $ppage = $page-1;
                echo "<a href=\"downloads.php?action=$action&amp;page=$ppage&amp;sid=$sid&amp;who=$who\">«PREV</a> ";
              }
              if($page<$num_pages)
              {
                $npage = $page+1;
                echo "<a href=\"downloads.php?action=$action&amp;page=$npage&amp;sid=$sid&amp;who=$who\">Next»</a>";
              }
              echo "<br/>$page/$num_pages<br/>";
              if($num_pages>2)
              {
                $rets = "Jump to page: <input name=\"pg\" format=\"*N\" size=\"3\"/>";
                  $rets .= "<anchor>[GO]";
                  $rets .= "<go href=\"downloads.php?type=send\" method=\"get\">";
                  $rets .= "<postfield name=\"action\" value=\"$action\"/>";
                  $rets .= "<postfield name=\"who\" value=\"$who\"/>";
                  $rets .= "<postfield name=\"sid\" value=\"$sid\"/>";
                  $rets .= "<postfield name=\"page\" value=\"$(pg)\"/>";
                  $rets .= "</go></anchor>";
          
                  echo $rets;
              }
              echo "</p>";
            ////// UNTILL HERE >>
              echo "<p align=\"center\">";
              if($uid==$who && getplusses($uid)>25)
              {
              echo "<a href=\"up.php?action=themes&amp;sid=$sid\">";
          echo "Add Item</a><br/>";
          }
          if($who!="")
          {
          echo "<a href=\"index.php?action=viewuser&amp;sid=$sid&amp;who=$who\">";
          $whonick = getnick_uid($who);
          echo "$whonick's Profile</a><br/>";
          }else{
          echo "<a href=\"index.php?action=vault&amp;sid=$sid\">";
          echo "Downloads</a><br/>";
          }
              echo "<a href=\"index.php?action=main&amp;sid=$sid\">";
          echo "Main menu</a>";
            echo "</p>";
              echo "</card>";
          }
          
          
          //////////////////////////////////Buddies
          
          else if($action=="antivirus")
          {
              $who = $_GET["who"];
              addonline(getuid_sid($sid),"Anti Vitus","");
              echo "<card id=\"main\" title=\"Anti Virus\">";
              $uid = getuid_sid($sid);
          
          
          
              //////ALL LISTS SCRIPT <<
          
              if($page=="" || $page<=0)$page=1;
              if($did="3")
              {
              $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_vault WHERE did='3'"));
              }else{
              $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_vault WHERE uid='".$who."'"));
              }
              $num_items = $noi[0]; //changable
              $items_per_page= 10;
              $num_pages = ceil($num_items/$items_per_page);
              if(($page>$num_pages)&&$page!=1)$page= $num_pages;
              $limit_start = ($page-1)*$items_per_page;
          
          
              if($who!="")
              {
                  $sql = "SELECT id, title, itemurl, did FROM ibwf_vault WHERE uid='".$who."' ORDER BY pudt DESC LIMIT $limit_start, $items_per_page";
                  }else{
                $sql = "SELECT id, title, itemurl, uid, did FROM ibwf_vault WHERE did='".$did."' ORDER BY pudt DESC LIMIT $limit_start, $items_per_page";
                  }
          
          
          
              echo "<p>";
              $items = mysql_query($sql);
              echo mysql_error();
              if(mysql_num_rows($items)>0)
              {
              while ($item = mysql_fetch_array($items))
              {
                $ext = getext($item[2]);
                  $ime = getextimg($ext);
                  $lnk = "<a href=\"downloads.php?action=download&amp;sid=$sid&amp;did=$item[0]\">$ime".htmlspecialchars($item[2])."</a>";
          
                if(candelvl($uid, $item[0]))
                {
                  $delnk = "<a href=\"genproc.php?action=delvlt&amp;sid=$sid&amp;did=$item[0]\">[x]</a>";
                }else{
                  $delnk = "";
                }
                if($who!="")
                {
                  $byusr="";
                }else{
                  $unick = getnick_uid($item[3]);
                  $ulnk = "<a href=\"index.php?action=viewuser&amp;sid=$sid&amp;who=$item[3]\">$unick</a>";
                  $byusr = "<br/>By: $ulnk";
                }
                echo "$lnk $byusr $delnk<br/>";
          
          
              }
              }
              echo "</p>";
              echo "<p align=\"center\">";
              if($page>1)
              {
                $ppage = $page-1;
                echo "<a href=\"downloads.php?action=$action&amp;page=$ppage&amp;sid=$sid&amp;who=$who\">«PREV</a> ";
              }
              if($page<$num_pages)
              {
                $npage = $page+1;
                echo "<a href=\"downloads.php?action=$action&amp;page=$npage&amp;sid=$sid&amp;who=$who\">Next»</a>";
              }
              echo "<br/>$page/$num_pages<br/>";
              if($num_pages>2)
              {
                $rets = "Jump to page: <input name=\"pg\" format=\"*N\" size=\"3\"/>";
                  $rets .= "<anchor>[GO]";
                  $rets .= "<go href=\"downloads.php?type=send\" method=\"get\">";
                  $rets .= "<postfield name=\"action\" value=\"$action\"/>";
                  $rets .= "<postfield name=\"who\" value=\"$who\"/>";
                  $rets .= "<postfield name=\"sid\" value=\"$sid\"/>";
                  $rets .= "<postfield name=\"page\" value=\"$(pg)\"/>";
                  $rets .= "</go></anchor>";
          
                  echo $rets;
              }
              echo "</p>";
            ////// UNTILL HERE >>
              echo "<p align=\"center\">";
              if($uid==$who && getplusses($uid)>25)
              {
              echo "<a href=\"up.php?action=themes&amp;sid=$sid\">";
          echo "Add Item</a><br/>";
          }
          if($who!="")
          {
          echo "<a href=\"index.php?action=viewuser&amp;sid=$sid&amp;who=$who\">";
          $whonick = getnick_uid($who);
          echo "$whonick's Profile</a><br/>";
          }else{
          echo "<a href=\"index.php?action=vault&amp;sid=$sid\">";
          echo "Downloads</a><br/>";
          }
              echo "<a href=\"index.php?action=main&amp;sid=$sid\">";
          echo "Main menu</a>";
            echo "</p>";
              echo "</card>";
          }
          
          
          //////////////////////////////////Buddies
          
          else if($action=="themes")
          {
              $who = $_GET["who"];
              addonline(getuid_sid($sid),"s40v2/s40v3 Themes","");
              echo "<card id=\"main\" title=\"s40v2/s40v3 Themes\">";
              $uid = getuid_sid($sid);
          
          
          
              //////ALL LISTS SCRIPT <<
          
              if($page=="" || $page<=0)$page=1;
              if($did="4")
              {
              $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_vault WHERE did='4'"));
              }else{
              $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_vault WHERE uid='".$who."'"));
              }
              $num_items = $noi[0]; //changable
              $items_per_page= 10;
              $num_pages = ceil($num_items/$items_per_page);
              if(($page>$num_pages)&&$page!=1)$page= $num_pages;
              $limit_start = ($page-1)*$items_per_page;
          
          
              if($who!="")
              {
                  $sql = "SELECT id, title, itemurl, did FROM ibwf_vault WHERE uid='".$who."' ORDER BY pudt DESC LIMIT $limit_start, $items_per_page";
                  }else{
                $sql = "SELECT id, title, itemurl, uid, did FROM ibwf_vault WHERE did='".$did."' ORDER BY pudt DESC LIMIT $limit_start, $items_per_page";
                  }
          
          
          
              echo "<p>";
              $items = mysql_query($sql);
              echo mysql_error();
              if(mysql_num_rows($items)>0)
              {
              while ($item = mysql_fetch_array($items))
              {
                $ext = getext($item[2]);
                  $ime = getextimg($ext);
                  $lnk = "<a href=\"downloads.php?action=download&amp;sid=$sid&amp;did=$item[0]\">$ime".htmlspecialchars($item[2])."</a>";
          
                if(candelvl($uid, $item[0]))
                {
                  $delnk = "<a href=\"genproc.php?action=delvlt&amp;sid=$sid&amp;did=$item[0]\">[x]</a>";
                }else{
                  $delnk = "";
                }
                if($who!="")
                {
                  $byusr="";
                }else{
                  $unick = getnick_uid($item[3]);
                  $ulnk = "<a href=\"index.php?action=viewuser&amp;sid=$sid&amp;who=$item[3]\">$unick</a>";
                  $byusr = "<br/>By: $ulnk";
                }
                echo "$lnk $byusr $delnk<br/>";
          
          
              }
              }
              echo "</p>";
              echo "<p align=\"center\">";
              if($page>1)
              {
                $ppage = $page-1;
                echo "<a href=\"downloads.php?action=$action&amp;page=$ppage&amp;sid=$sid&amp;who=$who\">«PREV</a> ";
              }
              if($page<$num_pages)
              {
                $npage = $page+1;
                echo "<a href=\"downloads.php?action=$action&amp;page=$npage&amp;sid=$sid&amp;who=$who\">Next»</a>";
              }
              echo "<br/>$page/$num_pages<br/>";
              if($num_pages>2)
              {
                $rets = "Jump to page: <input name=\"pg\" format=\"*N\" size=\"3\"/>";
                  $rets .= "<anchor>[GO]";
                  $rets .= "<go href=\"downloads.php?type=send\" method=\"get\">";
                  $rets .= "<postfield name=\"action\" value=\"$action\"/>";
                  $rets .= "<postfield name=\"who\" value=\"$who\"/>";
                  $rets .= "<postfield name=\"sid\" value=\"$sid\"/>";
                  $rets .= "<postfield name=\"page\" value=\"$(pg)\"/>";
                  $rets .= "</go></anchor>";
          
                  echo $rets;
              }
              echo "</p>";
            ////// UNTILL HERE >>
              echo "<p align=\"center\">";
              if($uid==$who && getplusses($uid)>25)
              {
              echo "<a href=\"up.php?action=themes&amp;sid=$sid\">";
          echo "Add Item</a><br/>";
          }
          if($who!="")
          {
          echo "<a href=\"index.php?action=viewuser&amp;sid=$sid&amp;who=$who\">";
          $whonick = getnick_uid($who);
          echo "$whonick's Profile</a><br/>";
          }else{
          echo "<a href=\"index.php?action=vault&amp;sid=$sid\">";
          echo "Downloads</a><br/>";
          }
              echo "<a href=\"index.php?action=main&amp;sid=$sid\">";
          echo "Main menu</a>";
            echo "</p>";
              echo "</card>";
          }
          
          
          //////////////////////////////////Buddies
          
          else if($action=="themes1")
          {
              $who = $_GET["who"];
              addonline(getuid_sid($sid),"s60/s60v3/Nseries-Themes","");
              echo "<card id=\"main\" title=\"s60/s60v3/Nseries-Themes\">";
              $uid = getuid_sid($sid);
          
          
          
              //////ALL LISTS SCRIPT <<
          
              if($page=="" || $page<=0)$page=1;
              if($did="5")
              {
              $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_vault WHERE did='5'"));
              }else{
              $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_vault WHERE uid='".$who."'"));
              }
              $num_items = $noi[0]; //changable
              $items_per_page= 10;
              $num_pages = ceil($num_items/$items_per_page);
              if(($page>$num_pages)&&$page!=1)$page= $num_pages;
              $limit_start = ($page-1)*$items_per_page;
          
          
              if($who!="")
              {
                  $sql = "SELECT id, title, itemurl, did FROM ibwf_vault WHERE uid='".$who."' ORDER BY pudt DESC LIMIT $limit_start, $items_per_page";
                  }else{
                $sql = "SELECT id, title, itemurl, uid, did FROM ibwf_vault WHERE did='".$did."' ORDER BY pudt DESC LIMIT $limit_start, $items_per_page";
                  }
          
          
          
              echo "<p>";
              $items = mysql_query($sql);
              echo mysql_error();
              if(mysql_num_rows($items)>0)
              {
              while ($item = mysql_fetch_array($items))
              {
                $ext = getext($item[2]);
                  $ime = getextimg($ext);
                  $lnk = "<a href=\"downloads.php?action=download&amp;sid=$sid&amp;did=$item[0]\">$ime".htmlspecialchars($item[2])."</a>";
          
                if(candelvl($uid, $item[0]))
                {
                  $delnk = "<a href=\"genproc.php?action=delvlt&amp;sid=$sid&amp;did=$item[0]\">[x]</a>";
                }else{
                  $delnk = "";
                }
                if($who!="")
                {
                  $byusr="";
                }else{
                  $unick = getnick_uid($item[3]);
                  $ulnk = "<a href=\"index.php?action=viewuser&amp;sid=$sid&amp;who=$item[3]\">$unick</a>";
                  $byusr = "<br/>By: $ulnk";
                }
                echo "$lnk $byusr $delnk<br/>";
          
          
              }
              }
              echo "</p>";
              echo "<p align=\"center\">";
              if($page>1)
              {
                $ppage = $page-1;
                echo "<a href=\"downloads.php?action=$action&amp;page=$ppage&amp;sid=$sid&amp;who=$who\">«PREV</a> ";
              }
              if($page<$num_pages)
              {
                $npage = $page+1;
                echo "<a href=\"downloads.php?action=$action&amp;page=$npage&amp;sid=$sid&amp;who=$who\">Next»</a>";
              }
              echo "<br/>$page/$num_pages<br/>";
              if($num_pages>2)
              {
                $rets = "Jump to page: <input name=\"pg\" format=\"*N\" size=\"3\"/>";
                  $rets .= "<anchor>[GO]";
                  $rets .= "<go href=\"downloads.php?type=send\" method=\"get\">";
                  $rets .= "<postfield name=\"action\" value=\"$action\"/>";
                  $rets .= "<postfield name=\"who\" value=\"$who\"/>";
                  $rets .= "<postfield name=\"sid\" value=\"$sid\"/>";
                  $rets .= "<postfield name=\"page\" value=\"$(pg)\"/>";
                  $rets .= "</go></anchor>";
          
                  echo $rets;
              }
              echo "</p>";
            ////// UNTILL HERE >>
              echo "<p align=\"center\">";
              if($uid==$who && getplusses($uid)>25)
              {
              echo "<a href=\"up.php?action=themes&amp;sid=$sid\">";
          echo "Add Item</a><br/>";
          }
          if($who!="")
          {
          echo "<a href=\"index.php?action=viewuser&amp;sid=$sid&amp;who=$who\">";
          $whonick = getnick_uid($who);
          echo "$whonick's Profile</a><br/>";
          }else{
          echo "<a href=\"index.php?action=vault&amp;sid=$sid\">";
          echo "Downloads</a><br/>";
          }
              echo "<a href=\"index.php?action=main&amp;sid=$sid\">";
          echo "Main menu</a>";
            echo "</p>";
              echo "</card>";
          }
          
          
          //////////////////////////////////Buddies
          
          else if($action=="sethemes")
          {
              $who = $_GET["who"];
              addonline(getuid_sid($sid),"SE Themes","");
              echo "<card id=\"main\" title=\"SE Themes\">";
              $uid = getuid_sid($sid);
          
          
          
              //////ALL LISTS SCRIPT <<
          
              if($page=="" || $page<=0)$page=1;
              if($did="6")
              {
              $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_vault WHERE did='6'"));
              }else{
              $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_vault WHERE uid='".$who."'"));
              }
              $num_items = $noi[0]; //changable
              $items_per_page= 10;
              $num_pages = ceil($num_items/$items_per_page);
              if(($page>$num_pages)&&$page!=1)$page= $num_pages;
              $limit_start = ($page-1)*$items_per_page;
          
              if($who="")
              {
                  $sql = "SELECT id, title, itemurl, did FROM ibwf_vault WHERE uid='".$who."' ORDER BY pudt DESC LIMIT $limit_start, $items_per_page";
                  }else{
          $sql = "SELECT id, title, itemurl, uid, did FROM ibwf_vault WHERE did='".$did."' ORDER BY did DESC LIMIT $limit_start, $items_per_page";
                  }
          
          
              echo "<p>";
              $items = mysql_query($sql);
              echo mysql_error();
              if(mysql_num_rows($items)>0)
              {
              while ($item = mysql_fetch_array($items))
              {
                $ext = getext($item[2]);
                  $ime = getextimg($ext);
                  $lnk = "<a href=\"downloads.php?action=download&amp;sid=$sid&amp;did=$item[0]\">$ime".htmlspecialchars($item[2])."</a>";
          
                if(candelvl($uid, $item[0]))
                {
                  $delnk = "<a href=\"genproc.php?action=delvlt&amp;sid=$sid&amp;did=$item[0]\">[x]</a>";
                }else{
                  $delnk = "";
                }
                if($who!="")
                {
                  $byusr="";
                }else{
                  $unick = getnick_uid($item[3]);
                  $ulnk = "<a href=\"index.php?action=viewuser&amp;sid=$sid&amp;who=$item[3]\">$unick</a>";
                  $byusr = "<br/>By: $ulnk";
                }
                echo "$lnk $byusr $delnk<br/>";
          
          
              }
              }
              echo "</p>";
              echo "<p align=\"center\">";
              if($page>1)
              {
                $ppage = $page-1;
                echo "<a href=\"downloads.php?action=$action&amp;page=$ppage&amp;sid=$sid&amp;who=$who\">«PREV</a> ";
              }
              if($page<$num_pages)
              {
                $npage = $page+1;
                echo "<a href=\"downloads.php?action=$action&amp;page=$npage&amp;sid=$sid&amp;who=$who\">Next»</a>";
              }
              echo "<br/>$page/$num_pages<br/>";
              if($num_pages>2)
              {
                $rets = "Jump to page: <input name=\"pg\" format=\"*N\" size=\"3\"/>";
                  $rets .= "<anchor>[GO]";
                  $rets .= "<go href=\"downloads.php?type=send\" method=\"get\">";
                  $rets .= "<postfield name=\"action\" value=\"$action\"/>";
                  $rets .= "<postfield name=\"who\" value=\"$who\"/>";
                  $rets .= "<postfield name=\"sid\" value=\"$sid\"/>";
                  $rets .= "<postfield name=\"page\" value=\"$(pg)\"/>";
                  $rets .= "</go></anchor>";
          
                  echo $rets;
              }
              echo "</p>";
            ////// UNTILL HERE >>
              echo "<p align=\"center\">";
              if($uid==$who && getplusses($uid)>25)
              {
              echo "<a href=\"up.php?action=apps&amp;sid=$sid\">";
          echo "Add Item</a><br/>";
          }
          if($who!="")
          {
          echo "<a href=\"index.php?action=viewuser&amp;sid=$sid&amp;who=$who\">";
          $whonick = getnick_uid($who);
          echo "$whonick's Profile</a><br/>";
          }else{
          echo "<a href=\"index.php?action=vault&amp;sid=$sid\">";
          echo "Downloads</a><br/>";
          }
              echo "<a href=\"index.php?action=main&amp;sid=$sid\">";
          echo "Main menu</a>";
            echo "</p>";
              echo "</card>";
          }
          
          
          //////////////////////////////////Buddies
          
          else if($action=="games1")
          {
              $who = $_GET["who"];
              addonline(getuid_sid($sid),"s30/s40/s40v2 Games","");
              echo "<card id=\"main\" title=\"s30/s40/s40v2 Games\">";
              $uid = getuid_sid($sid);
          
          
          
              //////ALL LISTS SCRIPT <<
          
              if($page=="" || $page<=0)$page=1;
              if($did="7")
              {
              $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_vault WHERE did='7'"));
              }else{
              $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_vault WHERE uid='".$who."'"));
              }
              $num_items = $noi[0]; //changable
              $items_per_page= 10;
              $num_pages = ceil($num_items/$items_per_page);
              if(($page>$num_pages)&&$page!=1)$page= $num_pages;
              $limit_start = ($page-1)*$items_per_page;
          
              if($who!="")
              {
                  $sql = "SELECT id, title, itemurl, did FROM ibwf_vault WHERE uid='".$who."' ORDER BY pudt DESC LIMIT $limit_start, $items_per_page";
                  }else{
          $sql = "SELECT id, title, itemurl, uid, did FROM ibwf_vault WHERE did='".$did."' ORDER BY did DESC LIMIT $limit_start, $items_per_page";
                  }
          
          
              echo "<p>";
              $items = mysql_query($sql);
              echo mysql_error();
              if(mysql_num_rows($items)>0)
              {
              while ($item = mysql_fetch_array($items))
              {
                $ext = getext($item[2]);
                  $ime = getextimg($ext);
                  $lnk = "<a href=\"downloads.php?action=download&amp;sid=$sid&amp;did=$item[0]\">$ime".htmlspecialchars($item[2])."</a>";
          
                if(candelvl($uid, $item[0]))
                {
                  $delnk = "<a href=\"genproc.php?action=delvlt&amp;sid=$sid&amp;did=$item[0]\">[x]</a>";
                }else{
                  $delnk = "";
                }
                if($who!="")
                {
                  $byusr="";
                }else{
                  $unick = getnick_uid($item[3]);
                  $ulnk = "<a href=\"index.php?action=viewuser&amp;sid=$sid&amp;who=$item[3]\">$unick</a>";
                  $byusr = "<br/>By: $ulnk";
                }
                echo "$lnk $byusr $delnk<br/>";
          
          
              }
              }
              echo "</p>";
              echo "<p align=\"center\">";
              if($page>1)
              {
                $ppage = $page-1;
                echo "<a href=\"downloads.php?action=$action&amp;page=$ppage&amp;sid=$sid&amp;who=$who\">«PREV</a> ";
              }
              if($page<$num_pages)
              {
                $npage = $page+1;
                echo "<a href=\"downloads.php?action=$action&amp;page=$npage&amp;sid=$sid&amp;who=$who\">Next»</a>";
              }
              echo "<br/>$page/$num_pages<br/>";
              if($num_pages>2)
              {
                $rets = "Jump to page: <input name=\"pg\" format=\"*N\" size=\"3\"/>";
                  $rets .= "<anchor>[GO]";
                  $rets .= "<go href=\"downloads.php?type=send\" method=\"get\">";
                  $rets .= "<postfield name=\"action\" value=\"$action\"/>";
                  $rets .= "<postfield name=\"who\" value=\"$who\"/>";
                  $rets .= "<postfield name=\"sid\" value=\"$sid\"/>";
                  $rets .= "<postfield name=\"page\" value=\"$(pg)\"/>";
                  $rets .= "</go></anchor>";
          
                  echo $rets;
              }
              echo "</p>";
            ////// UNTILL HERE >>
              echo "<p align=\"center\">";
              if($uid==$who && getplusses($uid)>25)
              {
              echo "<a href=\"up.php?action=games1&amp;sid=$sid\">";
          echo "Add Item</a><br/>";
          }
          if($who!="")
          {
          echo "<a href=\"index.php?action=viewuser&amp;sid=$sid&amp;who=$who\">";
          $whonick = getnick_uid($who);
          echo "$whonick's Profile</a><br/>";
          }else{
          echo "<a href=\"index.php?action=vault&amp;sid=$sid\">";
          echo "Downloads</a><br/>";
          }
              echo "<a href=\"index.php?action=main&amp;sid=$sid\">";
          echo "Main menu</a>";
            echo "</p>";
              echo "</card>";
          }
          
          
          //////////////////////////////////Buddies
          
          else if($action=="games2")
          {
              $who = $_GET["who"];
              addonline(getuid_sid($sid),"s60/s60v3 Games","");
              echo "<card id=\"main\" title=\"s60/s60v3 Games\">";
              $uid = getuid_sid($sid);
          
          
          
              //////ALL LISTS SCRIPT <<
          
              if($page=="" || $page<=0)$page=1;
              if($did="8")
              {
              $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_vault WHERE did='8'"));
              }else{
              $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_vault WHERE uid='".$who."'"));
              }
              $num_items = $noi[0]; //changable
              $items_per_page= 10;
              $num_pages = ceil($num_items/$items_per_page);
              if(($page>$num_pages)&&$page!=1)$page= $num_pages;
              $limit_start = ($page-1)*$items_per_page;
          
              if($who!="")
              {
                  $sql = "SELECT id, title, itemurl, did FROM ibwf_vault WHERE uid='".$who."' ORDER BY pudt DESC LIMIT $limit_start, $items_per_page";
                  }else{
          $sql = "SELECT id, title, itemurl, uid, did FROM ibwf_vault WHERE did='".$did."' ORDER BY did DESC LIMIT $limit_start, $items_per_page";
                  }
          
          
              echo "<p>";
              $items = mysql_query($sql);
              echo mysql_error();
              if(mysql_num_rows($items)>0)
              {
              while ($item = mysql_fetch_array($items))
              {
                $ext = getext($item[2]);
                  $ime = getextimg($ext);
                  $lnk = "<a href=\"downloads.php?action=download&amp;sid=$sid&amp;did=$item[0]\">$ime".htmlspecialchars($item[2])."</a>";
          
                if(candelvl($uid, $item[0]))
                {
                  $delnk = "<a href=\"genproc.php?action=delvlt&amp;sid=$sid&amp;did=$item[0]\">[x]</a>";
                }else{
                  $delnk = "";
                }
                if($who!="")
                {
                  $byusr="";
                }else{
                  $unick = getnick_uid($item[3]);
                  $ulnk = "<a href=\"index.php?action=viewuser&amp;sid=$sid&amp;who=$item[3]\">$unick</a>";
                  $byusr = "<br/>By: $ulnk";
                }
                echo "$lnk $byusr $delnk<br/>";
          
          
              }
              }
              echo "</p>";
              echo "<p align=\"center\">";
              if($page>1)
              {
                $ppage = $page-1;
                echo "<a href=\"downloads.php?action=$action&amp;page=$ppage&amp;sid=$sid&amp;who=$who\">«PREV</a> ";
              }
              if($page<$num_pages)
              {
                $npage = $page+1;
                echo "<a href=\"downloads.php?action=$action&amp;page=$npage&amp;sid=$sid&amp;who=$who\">Next»</a>";
              }
              echo "<br/>$page/$num_pages<br/>";
              if($num_pages>2)
              {
                $rets = "Jump to page: <input name=\"pg\" format=\"*N\" size=\"3\"/>";
                  $rets .= "<anchor>[GO]";
                  $rets .= "<go href=\"downloads.php?type=send\" method=\"get\">";
                  $rets .= "<postfield name=\"action\" value=\"$action\"/>";
                  $rets .= "<postfield name=\"who\" value=\"$who\"/>";
                  $rets .= "<postfield name=\"sid\" value=\"$sid\"/>";
                  $rets .= "<postfield name=\"page\" value=\"$(pg)\"/>";
                  $rets .= "</go></anchor>";
          
                  echo $rets;
              }
              echo "</p>";
            ////// UNTILL HERE >>
              echo "<p align=\"center\">";
              if($uid==$who && getplusses($uid)>25)
              {
              echo "<a href=\"up.php?action=games2&amp;sid=$sid\">";
          echo "Add Item</a><br/>";
          }
          if($who!="")
          {
          echo "<a href=\"index.php?action=viewuser&amp;sid=$sid&amp;who=$who\">";
          $whonick = getnick_uid($who);
          echo "$whonick's Profile</a><br/>";
          }else{
          echo "<a href=\"index.php?action=vault&amp;sid=$sid\">";
          echo "Downloads</a><br/>";
          }
              echo "<a href=\"index.php?action=main&amp;sid=$sid\">";
          echo "Main menu</a>";
            echo "</p>";
              echo "</card>";
          }
          
          
          //////////////////////////////////Buddies
          
          else if($action=="games3")
          {
              $who = $_GET["who"];
              addonline(getuid_sid($sid),"Eseries/Ngage/Nseries Games","");
              echo "<card id=\"main\" title=\"s60/Ngage/Nseries Games\">";
              $uid = getuid_sid($sid);
          
          
          
              //////ALL LISTS SCRIPT <<
          
              if($page=="" || $page<=0)$page=1;
              if($did="9")
              {
              $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_vault WHERE did='9'"));
              }else{
              $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_vault WHERE uid='".$who."'"));
              }
              $num_items = $noi[0]; //changable
              $items_per_page= 10;
              $num_pages = ceil($num_items/$items_per_page);
              if(($page>$num_pages)&&$page!=1)$page= $num_pages;
              $limit_start = ($page-1)*$items_per_page;
          
              if($who!="")
              {
                  $sql = "SELECT id, title, itemurl, did FROM ibwf_vault WHERE uid='".$who."' ORDER BY pudt DESC LIMIT $limit_start, $items_per_page";
                  }else{
          $sql = "SELECT id, title, itemurl, uid, did FROM ibwf_vault WHERE did='".$did."' ORDER BY did DESC LIMIT $limit_start, $items_per_page";
                  }
          
          
              echo "<p>";
              $items = mysql_query($sql);
              echo mysql_error();
              if(mysql_num_rows($items)>0)
              {
              while ($item = mysql_fetch_array($items))
              {
                $ext = getext($item[2]);
                  $ime = getextimg($ext);
                  $lnk = "<a href=\"downloads.php?action=download&amp;sid=$sid&amp;did=$item[0]\">$ime".htmlspecialchars($item[2])."</a>";
          
                if(candelvl($uid, $item[0]))
                {
                  $delnk = "<a href=\"genproc.php?action=delvlt&amp;sid=$sid&amp;did=$item[0]\">[x]</a>";
                }else{
                  $delnk = "";
                }
                if($who!="")
                {
                  $byusr="";
                }else{
                  $unick = getnick_uid($item[3]);
                  $ulnk = "<a href=\"index.php?action=viewuser&amp;sid=$sid&amp;who=$item[3]\">$unick</a>";
                  $byusr = "<br/>By: $ulnk";
                }
                echo "$lnk $byusr $delnk<br/>";
          
          
              }
              }
              echo "</p>";
              echo "<p align=\"center\">";
              if($page>1)
              {
                $ppage = $page-1;
                echo "<a href=\"downloads.php?action=$action&amp;page=$ppage&amp;sid=$sid&amp;who=$who\">«PREV</a> ";
              }
              if($page<$num_pages)
              {
                $npage = $page+1;
                echo "<a href=\"downloads.php?action=$action&amp;page=$npage&amp;sid=$sid&amp;who=$who\">Next»</a>";
              }
              echo "<br/>$page/$num_pages<br/>";
              if($num_pages>2)
              {
                $rets = "Jump to page: <input name=\"pg\" format=\"*N\" size=\"3\"/>";
                  $rets .= "<anchor>[GO]";
                  $rets .= "<go href=\"downloads.php?type=send\" method=\"get\">";
                  $rets .= "<postfield name=\"action\" value=\"$action\"/>";
                  $rets .= "<postfield name=\"who\" value=\"$who\"/>";
                  $rets .= "<postfield name=\"sid\" value=\"$sid\"/>";
                  $rets .= "<postfield name=\"page\" value=\"$(pg)\"/>";
                  $rets .= "</go></anchor>";
          
                  echo $rets;
              }
              echo "</p>";
            ////// UNTILL HERE >>
              echo "<p align=\"center\">";
              if($uid==$who && getplusses($uid)>25)
              {
              echo "<a href=\"up.php?action=videos&amp;sid=$sid\">";
          echo "Add Item</a><br/>";
          }
          if($who!="")
          {
          echo "<a href=\"index.php?action=viewuser&amp;sid=$sid&amp;who=$who\">";
          $whonick = getnick_uid($who);
          echo "$whonick's Profile</a><br/>";
          }else{
          echo "<a href=\"index.php?action=vault&amp;sid=$sid\">";
          echo "Downloads</a><br/>";
          }
              echo "<a href=\"index.php?action=main&amp;sid=$sid\">";
          echo "Main menu</a>";
            echo "</p>";
              echo "</card>";
          }
          
          
          //////////////////////////////////Buddies
          
          else if($action=="segames")
          {
              $who = $_GET["who"];
              addonline(getuid_sid($sid),"SE Games","");
              echo "<card id=\"main\" title=\"SE Games\">";
              $uid = getuid_sid($sid);
          
          
          
              //////ALL LISTS SCRIPT <<
          
              if($page=="" || $page<=0)$page=1;
              if($did="10")
              {
              $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_vault WHERE did='10'"));
              }else{
              $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_vault WHERE uid='".$who."'"));
              }
              $num_items = $noi[0]; //changable
              $items_per_page= 10;
              $num_pages = ceil($num_items/$items_per_page);
              if(($page>$num_pages)&&$page!=1)$page= $num_pages;
              $limit_start = ($page-1)*$items_per_page;
          
              if($who!="")
              {
                  $sql = "SELECT id, title, itemurl, did FROM ibwf_vault WHERE uid='".$who."' ORDER BY pudt DESC LIMIT $limit_start, $items_per_page";
                  }else{
          $sql = "SELECT id, title, itemurl, uid, did FROM ibwf_vault WHERE did='".$did."' ORDER BY did DESC LIMIT $limit_start, $items_per_page";
                  }
          
          
              echo "<p>";
              $items = mysql_query($sql);
              echo mysql_error();
              if(mysql_num_rows($items)>0)
              {
              while ($item = mysql_fetch_array($items))
              {
                $ext = getext($item[2]);
                  $ime = getextimg($ext);
                  $lnk = "<a href=\"downloads.php?action=download&amp;sid=$sid&amp;did=$item[0]\">$ime".htmlspecialchars($item[2])."</a>";
          
                if(candelvl($uid, $item[0]))
                {
                  $delnk = "<a href=\"genproc.php?action=delvlt&amp;sid=$sid&amp;did=$item[0]\">[x]</a>";
                }else{
                  $delnk = "";
                }
                if($who!="")
                {
                  $byusr="";
                }else{
                  $unick = getnick_uid($item[3]);
                  $ulnk = "<a href=\"index.php?action=viewuser&amp;sid=$sid&amp;who=$item[3]\">$unick</a>";
                  $byusr = "<br/>By: $ulnk";
                }
                echo "$lnk $byusr $delnk<br/>";
          
          
              }
              }
              echo "</p>";
              echo "<p align=\"center\">";
              if($page>1)
              {
                $ppage = $page-1;
                echo "<a href=\"downloads.php?action=$action&amp;page=$ppage&amp;sid=$sid&amp;who=$who\">«PREV</a> ";
              }
              if($page<$num_pages)
              {
                $npage = $page+1;
                echo "<a href=\"downloads.php?action=$action&amp;page=$npage&amp;sid=$sid&amp;who=$who\">Next»</a>";
              }
              echo "<br/>$page/$num_pages<br/>";
              if($num_pages>2)
              {
                $rets = "Jump to page: <input name=\"pg\" format=\"*N\" size=\"3\"/>";
                  $rets .= "<anchor>[GO]";
                  $rets .= "<go href=\"downloads.php?type=send\" method=\"get\">";
                  $rets .= "<postfield name=\"action\" value=\"$action\"/>";
                  $rets .= "<postfield name=\"who\" value=\"$who\"/>";
                  $rets .= "<postfield name=\"sid\" value=\"$sid\"/>";
                  $rets .= "<postfield name=\"page\" value=\"$(pg)\"/>";
                  $rets .= "</go></anchor>";
          
                  echo $rets;
              }
              echo "</p>";
            ////// UNTILL HERE >>
              echo "<p align=\"center\">";
              if($uid==$who && getplusses($uid)>25)
              {
              echo "<a href=\"up.php?action=audio&amp;sid=$sid\">";
          echo "Add Item</a><br/>";
          }
          if($who!="")
          {
          echo "<a href=\"index.php?action=viewuser&amp;sid=$sid&amp;who=$who\">";
          $whonick = getnick_uid($who);
          echo "$whonick's Profile</a><br/>";
          }else{
          echo "<a href=\"index.php?action=vault&amp;sid=$sid\">";
          echo "Downloads</a><br/>";
          }
              echo "<a href=\"index.php?action=main&amp;sid=$sid\">";
          echo "Main menu</a>";
            echo "</p>";
              echo "</card>";
          }
          
          
          //////////////////////////////////Buddies
          
          else if($action=="mp3")
          {
              $who = $_GET["who"];
              addonline(getuid_sid($sid),"Full MP3","");
              echo "<card id=\"main\" title=\"Full MP3\">";
              $uid = getuid_sid($sid);
          
          
          
              //////ALL LISTS SCRIPT <<
          
              if($page=="" || $page<=0)$page=1;
              if($did="11")
              {
              $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_vault WHERE did='11'"));
              }else{
              $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_vault WHERE uid='".$who."'"));
              }
              $num_items = $noi[0]; //changable
              $items_per_page= 10;
              $num_pages = ceil($num_items/$items_per_page);
              if(($page>$num_pages)&&$page!=1)$page= $num_pages;
              $limit_start = ($page-1)*$items_per_page;
          
              if($who!="")
              {
                  $sql = "SELECT id, title, itemurl, did FROM ibwf_vault WHERE uid='".$who."' ORDER BY pudt DESC LIMIT $limit_start, $items_per_page";
                  }else{
          $sql = "SELECT id, title, itemurl, uid, did FROM ibwf_vault WHERE did='".$did."' ORDER BY did DESC LIMIT $limit_start, $items_per_page";
                  }
          
          
              echo "<p>";
              $items = mysql_query($sql);
              echo mysql_error();
              if(mysql_num_rows($items)>0)
              {
              while ($item = mysql_fetch_array($items))
              {
                $ext = getext($item[2]);
                  $ime = getextimg($ext);
                  $lnk = "<a href=\"downloads.php?action=download&amp;sid=$sid&amp;did=$item[0]\">$ime".htmlspecialchars($item[2])."</a>";
          
                if(candelvl($uid, $item[0]))
                {
                  $delnk = "<a href=\"genproc.php?action=delvlt&amp;sid=$sid&amp;did=$item[0]\">[x]</a>";
                }else{
                  $delnk = "";
                }
                if($who!="")
                {
                  $byusr="";
                }else{
                  $unick = getnick_uid($item[3]);
                  $ulnk = "<a href=\"index.php?action=viewuser&amp;sid=$sid&amp;who=$item[3]\">$unick</a>";
                  $byusr = "<br/>By: $ulnk";
                }
                echo "$lnk $byusr $delnk<br/>";
          
          
              }
              }
              echo "</p>";
              echo "<p align=\"center\">";
              if($page>1)
              {
                $ppage = $page-1;
                echo "<a href=\"downloads.php?action=$action&amp;page=$ppage&amp;sid=$sid&amp;who=$who\">«PREV</a> ";
              }
              if($page<$num_pages)
              {
                $npage = $page+1;
                echo "<a href=\"downloads.php?action=$action&amp;page=$npage&amp;sid=$sid&amp;who=$who\">Next»</a>";
              }
              echo "<br/>$page/$num_pages<br/>";
              if($num_pages>2)
              {
                $rets = "Jump to page: <input name=\"pg\" format=\"*N\" size=\"3\"/>";
                  $rets .= "<anchor>[GO]";
                  $rets .= "<go href=\"downloads.php?type=send\" method=\"get\">";
                  $rets .= "<postfield name=\"action\" value=\"$action\"/>";
                  $rets .= "<postfield name=\"who\" value=\"$who\"/>";
                  $rets .= "<postfield name=\"sid\" value=\"$sid\"/>";
                  $rets .= "<postfield name=\"page\" value=\"$(pg)\"/>";
                  $rets .= "</go></anchor>";
          
                  echo $rets;
              }
              echo "</p>";
            ////// UNTILL HERE >>
              echo "<p align=\"center\">";
              if($uid==$who && getplusses($uid)>25)
              {
              echo "<a href=\"up.php?action=wall&amp;sid=$sid\">";
          echo "Add Item</a><br/>";
          }
          if($who!="")
          {
          echo "<a href=\"index.php?action=viewuser&amp;sid=$sid&amp;who=$who\">";
          $whonick = getnick_uid($who);
          echo "$whonick's Profile</a><br/>";
          }else{
          echo "<a href=\"index.php?action=vault&amp;sid=$sid\">";
          echo "Downloads</a><br/>";
          }
              echo "<a href=\"index.php?action=main&amp;sid=$sid\">";
          echo "Main menu</a>";
            echo "</p>";
              echo "</card>";
          }
          
          
          //////////////////////////////////Buddies
          
          else if($action=="3gp")
          {
              $who = $_GET["who"];
              addonline(getuid_sid($sid),"3GP Videos","");
              echo "<card id=\"main\" title=\"3GP Videos\">";
              $uid = getuid_sid($sid);
          
          
          
              //////ALL LISTS SCRIPT <<
          
              if($page=="" || $page<=0)$page=1;
              if($did="12")
              {
              $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_vault WHERE did='12'"));
              }else{
              $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_vault WHERE uid='".$who."'"));
              }
              $num_items = $noi[0]; //changable
              $items_per_page= 10;
              $num_pages = ceil($num_items/$items_per_page);
              if(($page>$num_pages)&&$page!=1)$page= $num_pages;
              $limit_start = ($page-1)*$items_per_page;
          
              if($who!="")
              {
                  $sql = "SELECT id, title, itemurl, did FROM ibwf_vault WHERE uid='".$who."' ORDER BY pudt DESC LIMIT $limit_start, $items_per_page";
                  }else{
          $sql = "SELECT id, title, itemurl, uid, did FROM ibwf_vault WHERE did='".$did."' ORDER BY pudt DESC LIMIT $limit_start, $items_per_page";
                  }
          
          
              echo "<p>";
              $items = mysql_query($sql);
              echo mysql_error();
              if(mysql_num_rows($items)>0)
              {
              while ($item = mysql_fetch_array($items))
              {
                $ext = getext($item[2]);
                  $ime = getextimg($ext);
                  $lnk = "<a href=\"downloads.php?action=download&amp;sid=$sid&amp;did=$item[0]\">$ime".htmlspecialchars($item[2])."</a>";
          
                if(candelvl($uid, $item[0]))
                {
                  $delnk = "<a href=\"genproc.php?action=delvlt&amp;sid=$sid&amp;did=$item[0]\">[x]</a>";
                }else{
                  $delnk = "";
                }
                if($who!="")
                {
                  $byusr="";
                }else{
                  $unick = getnick_uid($item[3]);
                  $ulnk = "<a href=\"index.php?action=viewuser&amp;sid=$sid&amp;who=$item[3]\">$unick</a>";
                  $byusr = "<br/>By: $ulnk";
                }
                echo "$lnk $byusr $delnk<br/>";
          
          
              }
              }
              echo "</p>";
              echo "<p align=\"center\">";
              if($page>1)
              {
                $ppage = $page-1;
                echo "<a href=\"downloads.php?action=$action&amp;page=$ppage&amp;sid=$sid&amp;who=$who\">«PREV</a> ";
              }
              if($page<$num_pages)
              {
                $npage = $page+1;
                echo "<a href=\"downloads.php?action=$action&amp;page=$npage&amp;sid=$sid&amp;who=$who\">Next»</a>";
              }
              echo "<br/>$page/$num_pages<br/>";
              if($num_pages>2)
              {
                $rets = "Jump to page: <input name=\"pg\" format=\"*N\" size=\"3\"/>";
                  $rets .= "<anchor>[GO]";
                  $rets .= "<go href=\"downloads.php?type=send\" method=\"get\">";
                  $rets .= "<postfield name=\"action\" value=\"$action\"/>";
                  $rets .= "<postfield name=\"who\" value=\"$who\"/>";
                  $rets .= "<postfield name=\"sid\" value=\"$sid\"/>";
                  $rets .= "<postfield name=\"page\" value=\"$(pg)\"/>";
                  $rets .= "</go></anchor>";
          
                  echo $rets;
              }
              echo "</p>";
            ////// UNTILL HERE >>
              echo "<p align=\"center\">";
              if($uid==$who && getplusses($uid)>25)
              {
              echo "<a href=\"up.php?action=others&amp;sid=$sid\">";
          echo "Add Item</a><br/>";
          }
          if($who!="")
          {
          echo "<a href=\"index.php?action=viewuser&amp;sid=$sid&amp;who=$who\">";
          $whonick = getnick_uid($who);
          echo "$whonick's Profile</a><br/>";
          }else{
          echo "<a href=\"index.php?action=vault&amp;sid=$sid\">";
          echo "Downloads</a><br/>";
          }
              echo "<a href=\"index.php?action=main&amp;sid=$sid\">";
          echo "Main menu</a>";
            echo "</p>";
              echo "</card>";
          }
          
          
          //////////////////////////////////Buddies
          
          else if($action=="scandal")
          {
              $who = $_GET["who"];
              addonline(getuid_sid($sid),"Scandal","");
              echo "<card id=\"main\" title=\"Scandal\">";
              $uid = getuid_sid($sid);
          
          
          
              //////ALL LISTS SCRIPT <<
          
              if($page=="" || $page<=0)$page=1;
              if($did="13")
              {
              $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_vault WHERE did='13'"));
              }else{
              $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_vault WHERE uid='".$who."'"));
              }
              $num_items = $noi[0]; //changable
              $items_per_page= 10;
              $num_pages = ceil($num_items/$items_per_page);
              if(($page>$num_pages)&&$page!=1)$page= $num_pages;
              $limit_start = ($page-1)*$items_per_page;
          
              if($who!="")
              {
                  $sql = "SELECT id, title, itemurl, did FROM ibwf_vault WHERE uid='".$who."' ORDER BY pudt DESC LIMIT $limit_start, $items_per_page";
                  }else{
          $sql = "SELECT id, title, itemurl, uid, did FROM ibwf_vault WHERE did='".$did."' ORDER BY did DESC LIMIT $limit_start, $items_per_page";
                  }
          
          
              echo "<p>";
              $items = mysql_query($sql);
              echo mysql_error();
              if(mysql_num_rows($items)>0)
              {
              while ($item = mysql_fetch_array($items))
              {
                $ext = getext($item[2]);
                  $ime = getextimg($ext);
                  $lnk = "<a href=\"downloads.php?action=download&amp;sid=$sid&amp;did=$item[0]\">$ime".htmlspecialchars($item[2])."</a>";
          
                if(candelvl($uid, $item[0]))
                {
                  $delnk = "<a href=\"genproc.php?action=delvlt&amp;sid=$sid&amp;did=$item[0]\">[x]</a>";
                }else{
                  $delnk = "";
                }
                if($who!="")
                {
                  $byusr="";
                }else{
                  $unick = getnick_uid($item[3]);
                  $ulnk = "<a href=\"index.php?action=viewuser&amp;sid=$sid&amp;who=$item[3]\">$unick</a>";
                  $byusr = "<br/>By: $ulnk";
                }
                echo "$lnk $byusr $delnk<br/>";
          
          
              }
              }
              echo "</p>";
              echo "<p align=\"center\">";
              if($page>1)
              {
                $ppage = $page-1;
                echo "<a href=\"downloads.php?action=$action&amp;page=$ppage&amp;sid=$sid&amp;who=$who\">«PREV</a> ";
              }
              if($page<$num_pages)
              {
                $npage = $page+1;
                echo "<a href=\"downloads.php?action=$action&amp;page=$npage&amp;sid=$sid&amp;who=$who\">Next»</a>";
              }
              echo "<br/>$page/$num_pages<br/>";
              if($num_pages>2)
              {
                $rets = "Jump to page: <input name=\"pg\" format=\"*N\" size=\"3\"/>";
                  $rets .= "<anchor>[GO]";
                  $rets .= "<go href=\"downloads.php?type=send\" method=\"get\">";
                  $rets .= "<postfield name=\"action\" value=\"$action\"/>";
                  $rets .= "<postfield name=\"who\" value=\"$who\"/>";
                  $rets .= "<postfield name=\"sid\" value=\"$sid\"/>";
                  $rets .= "<postfield name=\"page\" value=\"$(pg)\"/>";
                  $rets .= "</go></anchor>";
          
                  echo $rets;
              }
              echo "</p>";
            ////// UNTILL HERE >>
              echo "<p align=\"center\">";
              if($uid==$who && getplusses($uid)>25)
              {
              echo "<a href=\"up.php?action=wall&amp;sid=$sid\">";
          echo "Add Item</a><br/>";
          }
          if($who!="")
          {
          echo "<a href=\"index.php?action=viewuser&amp;sid=$sid&amp;who=$who\">";
          $whonick = getnick_uid($who);
          echo "$whonick's Profile</a><br/>";
          }else{
          echo "<a href=\"index.php?action=vault&amp;sid=$sid\">";
          echo "Downloads</a><br/>";
          }
              echo "<a href=\"index.php?action=main&amp;sid=$sid\">";
          echo "Main menu</a>";
            echo "</p>";
              echo "</card>";
          }
          
          
          //////////////////////////////////Buddies
          
          else if($action=="gameboy")
          {
              $who = $_GET["who"];
              addonline(getuid_sid($sid),"Gameboy Games","");
              echo "<card id=\"main\" title=\"Gameboy Games\">";
              $uid = getuid_sid($sid);
          
          
          
              //////ALL LISTS SCRIPT <<
          
              if($page=="" || $page<=0)$page=1;
              if($did="14")
              {
              $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_vault WHERE did='14'"));
              }else{
              $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_vault WHERE uid='".$who."'"));
              }
              $num_items = $noi[0]; //changable
              $items_per_page= 10;
              $num_pages = ceil($num_items/$items_per_page);
              if(($page>$num_pages)&&$page!=1)$page= $num_pages;
              $limit_start = ($page-1)*$items_per_page;
          
              if($who!="")
              {
                  $sql = "SELECT id, title, itemurl, did FROM ibwf_vault WHERE uid='".$who."' ORDER BY pudt DESC LIMIT $limit_start, $items_per_page";
                  }else{
          $sql = "SELECT id, title, itemurl, uid, did FROM ibwf_vault WHERE did='".$did."' ORDER BY did DESC LIMIT $limit_start, $items_per_page";
                  }
          
          
              echo "<p>";
              $items = mysql_query($sql);
              echo mysql_error();
              if(mysql_num_rows($items)>0)
              {
              while ($item = mysql_fetch_array($items))
              {
                $ext = getext($item[2]);
                  $ime = getextimg($ext);
                  $lnk = "<a href=\"downloads.php?action=download&amp;sid=$sid&amp;did=$item[0]\">$ime".htmlspecialchars($item[2])."</a>";
          
                if(candelvl($uid, $item[0]))
                {
                  $delnk = "<a href=\"genproc.php?action=delvlt&amp;sid=$sid&amp;did=$item[0]\">[x]</a>";
                }else{
                  $delnk = "";
                }
                if($who!="")
                {
                  $byusr="";
                }else{
                  $unick = getnick_uid($item[3]);
                  $ulnk = "<a href=\"index.php?action=viewuser&amp;sid=$sid&amp;who=$item[3]\">$unick</a>";
                  $byusr = "<br/>By: $ulnk";
                }
                echo "$lnk $byusr $delnk<br/>";
          
          
              }
              }
              echo "</p>";
              echo "<p align=\"center\">";
              if($page>1)
              {
                $ppage = $page-1;
                echo "<a href=\"downloads.php?action=$action&amp;page=$ppage&amp;sid=$sid&amp;who=$who\">«PREV</a> ";
              }
              if($page<$num_pages)
              {
                $npage = $page+1;
                echo "<a href=\"downloads.php?action=$action&amp;page=$npage&amp;sid=$sid&amp;who=$who\">Next»</a>";
              }
              echo "<br/>$page/$num_pages<br/>";
              if($num_pages>2)
              {
                $rets = "Jump to page: <input name=\"pg\" format=\"*N\" size=\"3\"/>";
                  $rets .= "<anchor>[GO]";
                  $rets .= "<go href=\"downloads.php?type=send\" method=\"get\">";
                  $rets .= "<postfield name=\"action\" value=\"$action\"/>";
                  $rets .= "<postfield name=\"who\" value=\"$who\"/>";
                  $rets .= "<postfield name=\"sid\" value=\"$sid\"/>";
                  $rets .= "<postfield name=\"page\" value=\"$(pg)\"/>";
                  $rets .= "</go></anchor>";
          
                  echo $rets;
              }
              echo "</p>";
            ////// UNTILL HERE >>
              echo "<p align=\"center\">";
              if($uid==$who && getplusses($uid)>25)
              {
              echo "<a href=\"up.php?action=wall&amp;sid=$sid\">";
          echo "Add Item</a><br/>";
          }
          if($who!="")
          {
          echo "<a href=\"index.php?action=viewuser&amp;sid=$sid&amp;who=$who\">";
          $whonick = getnick_uid($who);
          echo "$whonick's Profile</a><br/>";
          }else{
          echo "<a href=\"index.php?action=vault&amp;sid=$sid\">";
          echo "Downloads</a><br/>";
          }
              echo "<a href=\"index.php?action=main&amp;sid=$sid\">";
          echo "Main menu</a>";
            echo "</p>";
              echo "</card>";
          }
          
          
          //////////////////////////////////Buddies
          
          else if($action=="naruto")
          {
              $who = $_GET["who"];
              addonline(getuid_sid($sid),"Naruto-Themes/Poly/MP3 ","");
              echo "<card id=\"main\" title=\"Naruto-Themes/Poly/MP3 \">";
              $uid = getuid_sid($sid);
          
          
          
              //////ALL LISTS SCRIPT <<
          
              if($page=="" || $page<=0)$page=1;
              if($did="15")
              {
              $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_vault WHERE did='15'"));
              }else{
              $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_vault WHERE uid='".$who."'"));
              }
              $num_items = $noi[0]; //changable
              $items_per_page= 10;
              $num_pages = ceil($num_items/$items_per_page);
              if(($page>$num_pages)&&$page!=1)$page= $num_pages;
              $limit_start = ($page-1)*$items_per_page;
          
              if($who!="")
              {
                  $sql = "SELECT id, title, itemurl, did FROM ibwf_vault WHERE uid='".$who."' ORDER BY pudt DESC LIMIT $limit_start, $items_per_page";
                  }else{
          $sql = "SELECT id, title, itemurl, uid, did FROM ibwf_vault WHERE did='".$did."' ORDER BY did DESC LIMIT $limit_start, $items_per_page";
                  }
          
          
              echo "<p>";
              $items = mysql_query($sql);
              echo mysql_error();
              if(mysql_num_rows($items)>0)
              {
              while ($item = mysql_fetch_array($items))
              {
                $ext = getext($item[2]);
                  $ime = getextimg($ext);
                  $lnk = "<a href=\"downloads.php?action=download&amp;sid=$sid&amp;did=$item[0]\">$ime".htmlspecialchars($item[2])."</a>";
          
                if(candelvl($uid, $item[0]))
                {
                  $delnk = "<a href=\"genproc.php?action=delvlt&amp;sid=$sid&amp;did=$item[0]\">[x]</a>";
                }else{
                  $delnk = "";
                }
                if($who!="")
                {
                  $byusr="";
                }else{
                  $unick = getnick_uid($item[3]);
                  $ulnk = "<a href=\"index.php?action=viewuser&amp;sid=$sid&amp;who=$item[3]\">$unick</a>";
                  $byusr = "<br/>By: $ulnk";
                }
                echo "$lnk $byusr $delnk<br/>";
          
          
              }
              }
              echo "</p>";
              echo "<p align=\"center\">";
              if($page>1)
              {
                $ppage = $page-1;
                echo "<a href=\"downloads.php?action=$action&amp;page=$ppage&amp;sid=$sid&amp;who=$who\">«PREV</a> ";
              }
              if($page<$num_pages)
              {
                $npage = $page+1;
                echo "<a href=\"downloads.php?action=$action&amp;page=$npage&amp;sid=$sid&amp;who=$who\">Next»</a>";
              }
              echo "<br/>$page/$num_pages<br/>";
              if($num_pages>2)
              {
                $rets = "Jump to page: <input name=\"pg\" format=\"*N\" size=\"3\"/>";
                  $rets .= "<anchor>[GO]";
                  $rets .= "<go href=\"downloads.php?type=send\" method=\"get\">";
                  $rets .= "<postfield name=\"action\" value=\"$action\"/>";
                  $rets .= "<postfield name=\"who\" value=\"$who\"/>";
                  $rets .= "<postfield name=\"sid\" value=\"$sid\"/>";
                  $rets .= "<postfield name=\"page\" value=\"$(pg)\"/>";
                  $rets .= "</go></anchor>";
          
                  echo $rets;
              }
              echo "</p>";
            ////// UNTILL HERE >>
              echo "<p align=\"center\">";
              if($uid==$who && getplusses($uid)>25)
              {
              echo "<a href=\"up.php?action=wall&amp;sid=$sid\">";
          echo "Add Item</a><br/>";
          }
          if($who!="")
          {
          echo "<a href=\"index.php?action=viewuser&amp;sid=$sid&amp;who=$who\">";
          $whonick = getnick_uid($who);
          echo "$whonick's Profile</a><br/>";
          }else{
          echo "<a href=\"index.php?action=vault&amp;sid=$sid\">";
          echo "Downloads</a><br/>";
          }
              echo "<a href=\"index.php?action=main&amp;sid=$sid\">";
          echo "Main menu</a>";
            echo "</p>";
              echo "</card>";
          }
          
          
          //////////////////////////////////Buddies
          
          else if($action=="poly")
          {
              $who = $_GET["who"];
              addonline(getuid_sid($sid),"MP3/MIDI/WAV/POLY/AMR/RAR ($noi[0])","");
              echo "<card id=\"main\" title=\"MP3/MIDI/WAV/POLY/AMR/RAR ($noi[0])\">";
              $uid = getuid_sid($sid);
          
          
          
              //////ALL LISTS SCRIPT <<
          
              if($page=="" || $page<=0)$page=1;
              if($did="16")
              {
              $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_vault WHERE did='16'"));
              }else{
              $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_vault WHERE uid='".$who."'"));
              }
              $num_items = $noi[0]; //changable
              $items_per_page= 10;
              $num_pages = ceil($num_items/$items_per_page);
              if(($page>$num_pages)&&$page!=1)$page= $num_pages;
              $limit_start = ($page-1)*$items_per_page;
          
              if($who!="")
              {
                  $sql = "SELECT id, title, itemurl, did FROM ibwf_vault WHERE uid='".$who."' ORDER BY pudt DESC LIMIT $limit_start, $items_per_page";
                  }else{
          $sql = "SELECT id, title, itemurl, uid, did FROM ibwf_vault WHERE did='".$did."' ORDER BY did DESC LIMIT $limit_start, $items_per_page";
                  }
          
          
              echo "<p>";
              $items = mysql_query($sql);
              echo mysql_error();
              if(mysql_num_rows($items)>0)
              {
              while ($item = mysql_fetch_array($items))
              {
                $ext = getext($item[2]);
                  $ime = getextimg($ext);
                  $lnk = "<a href=\"downloads.php?action=download&amp;sid=$sid&amp;did=$item[0]\">$ime".htmlspecialchars($item[2])."</a>";
          
                if(candelvl($uid, $item[0]))
                {
                  $delnk = "<a href=\"genproc.php?action=delvlt&amp;sid=$sid&amp;did=$item[0]\">[x]</a>";
                }else{
                  $delnk = "";
                }
                if($who!="")
                {
                  $byusr="";
                }else{
                  $unick = getnick_uid($item[3]);
                  $ulnk = "<a href=\"index.php?action=viewuser&amp;sid=$sid&amp;who=$item[3]\">$unick</a>";
                  $byusr = "<br/>By: $ulnk";
                }
                echo "$lnk $byusr $delnk<br/>";
          
          
              }
              }
              echo "</p>";
              echo "<p align=\"center\">";
              if($page>1)
              {
                $ppage = $page-1;
                echo "<a href=\"downloads.php?action=$action&amp;page=$ppage&amp;sid=$sid&amp;who=$who\">«PREV</a> ";
              }
              if($page<$num_pages)
              {
                $npage = $page+1;
                echo "<a href=\"downloads.php?action=$action&amp;page=$npage&amp;sid=$sid&amp;who=$who\">Next»</a>";
              }
              echo "<br/>$page/$num_pages<br/>";
              if($num_pages>2)
              {
                $rets = "Jump to page: <input name=\"pg\" format=\"*N\" size=\"3\"/>";
                  $rets .= "<anchor>[GO]";
                  $rets .= "<go href=\"downloads.php?type=send\" method=\"get\">";
                  $rets .= "<postfield name=\"action\" value=\"$action\"/>";
                  $rets .= "<postfield name=\"who\" value=\"$who\"/>";
                  $rets .= "<postfield name=\"sid\" value=\"$sid\"/>";
                  $rets .= "<postfield name=\"page\" value=\"$(pg)\"/>";
                  $rets .= "</go></anchor>";
          
                  echo $rets;
              }
              echo "</p>";
            ////// UNTILL HERE >>
              echo "<p align=\"center\">";
              if($uid==$who && getplusses($uid)>25)
              {
              echo "<a href=\"up.php?action=wall&amp;sid=$sid\">";
          echo "Add Item</a><br/>";
          }
          if($who!="")
          {
          echo "<a href=\"index.php?action=viewuser&amp;sid=$sid&amp;who=$who\">";
          $whonick = getnick_uid($who);
          echo "$whonick's Profile</a><br/>";
          }else{
          echo "<a href=\"index.php?action=vault&amp;sid=$sid\">";
          echo "Downloads</a><br/>";
          }
              echo "<a href=\"index.php?action=main&amp;sid=$sid\">";
          echo "Main menu</a>";
            echo "</p>";
              echo "</card>";
          }
          
          
          
          //////////////////////////////////Buddies
          
          else if($action=="logo")
          {
              $who = $_GET["who"];
              addonline(getuid_sid($sid),"Opera Software","");
              echo "<card id=\"main\" title=\"Opera Software\">";
              $uid = getuid_sid($sid);
          
          
          
              //////ALL LISTS SCRIPT <<
          
              if($page=="" || $page<=0)$page=1;
              if($did="17")
              {
              $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_vault WHERE did='17'"));
              }else{
              $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_vault WHERE uid='".$who."'"));
              }
              $num_items = $noi[0]; //changable
              $items_per_page= 10;
              $num_pages = ceil($num_items/$items_per_page);
              if(($page>$num_pages)&&$page!=1)$page= $num_pages;
              $limit_start = ($page-1)*$items_per_page;
          
              if($who!="")
              {
                  $sql = "SELECT id, title, itemurl, did FROM ibwf_vault WHERE uid='".$who."' ORDER BY pudt DESC LIMIT $limit_start, $items_per_page";
                  }else{
          $sql = "SELECT id, title, itemurl, uid, did FROM ibwf_vault WHERE did='".$did."' ORDER BY did DESC LIMIT $limit_start, $items_per_page";
                  }
          
          
              echo "<p>";
              $items = mysql_query($sql);
              echo mysql_error();
              if(mysql_num_rows($items)>0)
              {
              while ($item = mysql_fetch_array($items))
              {
                $ext = getext($item[2]);
                  $ime = getextimg($ext);
                  $lnk = "<a href=\"downloads.php?action=download&amp;sid=$sid&amp;did=$item[0]\">$ime".htmlspecialchars($item[2])."</a>";
          
                if(candelvl($uid, $item[0]))
                {
                  $delnk = "<a href=\"genproc.php?action=delvlt&amp;sid=$sid&amp;did=$item[0]\">[x]</a>";
                }else{
                  $delnk = "";
                }
                if($who!="")
                {
                  $byusr="";
                }else{
                  $unick = getnick_uid($item[3]);
                  $ulnk = "<a href=\"index.php?action=viewuser&amp;sid=$sid&amp;who=$item[3]\">$unick</a>";
                  $byusr = "<br/>By: $ulnk";
                }
                echo "$lnk $byusr $delnk<br/>";
          
          
              }
              }
              echo "</p>";
              echo "<p align=\"center\">";
              if($page>1)
              {
                $ppage = $page-1;
                echo "<a href=\"downloads.php?action=$action&amp;page=$ppage&amp;sid=$sid&amp;who=$who\">«PREV</a> ";
              }
              if($page<$num_pages)
              {
                $npage = $page+1;
                echo "<a href=\"downloads.php?action=$action&amp;page=$npage&amp;sid=$sid&amp;who=$who\">Next»</a>";
              }
              echo "<br/>$page/$num_pages<br/>";
              if($num_pages>2)
              {
                $rets = "Jump to page: <input name=\"pg\" format=\"*N\" size=\"3\"/>";
                  $rets .= "<anchor>[GO]";
                  $rets .= "<go href=\"downloads.php?type=send\" method=\"get\">";
                  $rets .= "<postfield name=\"action\" value=\"$action\"/>";
                  $rets .= "<postfield name=\"who\" value=\"$who\"/>";
                  $rets .= "<postfield name=\"sid\" value=\"$sid\"/>";
                  $rets .= "<postfield name=\"page\" value=\"$(pg)\"/>";
                  $rets .= "</go></anchor>";
          
                  echo $rets;
              }
              echo "</p>";
            ////// UNTILL HERE >>
              echo "<p align=\"center\">";
              if($uid==$who && getplusses($uid)>25)
              {
              echo "<a href=\"up.php?action=wall&amp;sid=$sid\">";
          echo "Add Item</a><br/>";
          }
          if($who!="")
          {
          echo "<a href=\"index.php?action=viewuser&amp;sid=$sid&amp;who=$who\">";
          $whonick = getnick_uid($who);
          echo "$whonick's Profile</a><br/>";
          }else{
          echo "<a href=\"index.php?action=vault&amp;sid=$sid\">";
          echo "Downloads</a><br/>";
          }
              echo "<a href=\"index.php?action=main&amp;sid=$sid\">";
          echo "Main menu</a>";
            echo "</p>";
              echo "</card>";
          }
          
          
          
          
          
          
          
          
          
          
          //////////////////////////////////Buddies
          
          else if($action=="download")
          {
              $did = $_GET["did"];
           $uid = getuid_sid($sid);
              addonline(getuid_sid($sid),"Downloading..","");
              echo "<card id=\"main\" title=\"Downloading...\">";
          echo "<p align=\"left\">";
              $uid = getuid_sid($sid);
          $item = mysql_fetch_array(mysql_query("SELECT id, title, itemurl, uid, did, downloads, pudt, filesize, mime, info FROM ibwf_vault WHERE id='".$did."'"));
          
                 $name = "Name: $item[1]";
          $desc= "Description: $item[9]";
           $downloads = "Download Times: $item[5]";
                  $filesize = "File Size: $item[7]";
           $mime = "File Type: $item[8]";
          $tmstamp = $item[6];
            $tmdt = date("d m Y - H:i:s", $tmstamp);
          $earns2 = "Download Cost: 5 plusses";
          
          
                  $dateadded1 = "Date Added: $dateadded";
          
              if($who!="")
                {
                  $byusr="";
                }else{
                  $unick = getnick_uid($item[3]);
                  $ulnk = "<a href=\"index.php?action=viewuser&amp;sid=$sid&amp;who=$item[3]\">$unick</a>";
          
                }
                 echo "$name<br/>$desc<br/>$filesize<br/>$mime<br/>Date Uploaded: $tmdt<br/>$earns2<br/>$downloads<br/>Uploaded by by: $ulnk<br/>";
                echo "----<br/><a href=\"getnow.php?sid=$sid&amp;did=$item[0]\">Download now!</a><br/>";
          
            if(candelvl($uid, $item[0]))
                {
                  $delnk = "<a href=\"genproc.php?action=delvlt&amp;sid=$sid&amp;did=$item[0]\">Delete</a><br/>";
                }else{
                  $delnk = "";
                }
          echo "$delnk";
          echo "<a href=\"index.php?action=vault&amp;sid=$sid\">";
          echo "Downloads</a><br/>";
              echo "<a href=\"index.php?action=main&amp;sid=$sid\">";
          echo "Main menu</a>";
          
            echo "</p>";
              echo "</card>";
          }
          ?>
          
          </HTML>

          and this is the adding vault item @ genproc.php

          PHP Code:
          else if($action=="addvlt")
          {
          
          if(!getplusses(getuid_sid($sid))>25)
              {
                echo "<title>pinoykindat.net</title>";
                echo "<p align=\"center\">";
                echo "Only the user of 25+ plusses can add a vault item<br/><br/>";
                echo "<a href=\"index.php?action=main&amp;sid=$sid\">Home</a>";
                echo "</p>";
                echo "</body>";
                echo "</html>";
                exit();
              }
            $viname = $_POST["viname"];
            $vilink = $_POST["vilink"];
          $videsc = $_POST["videsc"];
            $did = $_POST["did"];
           //$qut = $_POST["qut"];
          
           $fname= array_reverse(explode("/",$vilink));
            addonline(getuid_sid($sid),"Adding A Vault Item","index.php?action=main");
          
          error_reporting(0);
           if(strlen($viname)<5)
          {
                echo "<title>pinoykindat.net</title>";
                echo "<p align=\"center\">";
                  echo "5 minimum letters for the title!";
            echo "<br/><a href=\"index.php?action=main&amp;sid=$sid\">";
            echo "Main menu</a>";
                echo "</p>";
                echo "</body>";
                echo "</html>";
                exit();
              }
           if(strlen($vilink)<5)
          {
                echo "<title>pinoykindat.net</title>";
                echo "<p align=\"center\">";
                  echo "5 minimum letters for the link!";
            echo "<br/><a href=\"index.php?action=main&amp;sid=$sid\">";
            echo "Main menu</a>";
                echo "</p>";
                echo "</body>";
                echo "</html>";
                exit();
              }
           if(strlen($videsc)<5)
          {
                echo "<title>pinoykindat.net</title>";
                echo "<p align=\"center\">";
                  echo "5 minimum letters for the description!";
            echo "<br/><a href=\"index.php?action=main&amp;sid=$sid\">";
            echo "Main menu</a>";
                echo "</p>";
                echo "</body>";
                echo "</html>";
                exit();
              }
          if(spacesin($vilink))
          {
                echo "<card id=\"main\" title=\"Error adding\">";
                echo "<p align=\"center\">";
                echo "No space input!<br/>";
                echo "<a href=\"index.php?action=main&amp;sid=$sid\">Main menu</a>";
                echo "</p>";
                echo "</body>";
                echo "</html>";
                exit();
              }
          $fname= array_reverse(explode("/",$vilink));
          
          if (!eregi("\.(mid|gif|bmp|mid|midi|3gp|mp3|mp4|wav|mpn|nth|mpc|jar|jad|jpeg|jpg|sis|mmf|amr|thm|png|wbmp|rar|zip)$",$fname[0]))
          {
          echo "<card id=\"main\" title=\"Error adding\">";
                echo "<p align=\"center\">";
          echo "<b>Unsuported File extention!</b><br/>";
          echo "<a href=\"index.php?action=main&amp;sid=$sid\">Main menu</a>";
                            echo "</p></card></wml>";
                      exit();
                      }
          echo "<title>pinoykindat.net</title>";
                echo "<p align=\"center\">";
                $crdate = time();
                //$uid = getuid_sid($sid);
          
             $res = false;
          
          $defaultDest = "$dir";
          $slash       = "/";
          
          $dest        = "./pkfiles/";
           $fname= array_reverse(explode("/",$vilink));
          $ds = array($dest, $slash, $fname[0]);
                  $ds = implode("", $ds);
            if (!copy($vilink, $ds))
          {
           echo "Dead link is not allowed!(<br/>"; 
          }else{       
            $fname= array_reverse(explode("/",$vilink));
          $ext = getext($fname[0]);
                  $mime = getextfile($ext);
          $fname= array_reverse(explode("/",$vilink));
             $filesize = filesize($ds);
          $filesize = $filesize / 1048576;
          $fsize = 0;
          $fsizetxt = "";
            if ($filesize < 1)
            {
               $fsize = round($filesize*1024,0);
               $fsizetxt = "".$fsize."KB";
              $check1 = "KB";
            }else{
               $fsize = round($filesize,2);
               $fsizetxt = "".$fsize." MB";
          $check1 = "MB";
            }
            $res = mysql_query("INSERT INTO ibwf_vault SET uid='".$uid."', title='".mysql_escape_string($viname)."', pudt='".$crdate."', did='".$did."', info='".$videsc."',filesize='".$fsizetxt."', mime='".$mime."', itemurl='".$fname[0]."'");
           if($res)
                {
          mysql_query("UPDATE ibwf_users SET plusses=plusses-'5' WHERE id='".$uid."'");
           echo "File added successfully!";
                }else{
                  
                }
          }
                echo "<br/><br/>";
                echo "<a href=\"index.php?action=main&amp;sid=$sid\">";
          echo "Main menu</a>";
                echo "</p>";
                echo "</body>";
          
          } 
          
          ----------------------------------------------------

          MY PROBLEM IS-- EVERYTIME I ADD A DOWNLOAD URL..
          DEADLINK IS NOT ALLOWED! APPEAR!
          BUT THE LINK THAT I USE IS NOT BROKEN..

          THANKS FOR THE ONE WOH FIXED THIS..
          where is the sql

          Comment


            #6
            i can try to fix it if you post the FULL script for it , theres some stuff missing for the mod to work

            Comment


              #7
              genproc.php

              PHP Code:
              <?php
              include("core.php");
              include("config.php");
              
              
              header("Content-type: text/html; charset=ISO-8859-1");
              echo "<?xml version=\"1.0\" encoding=\"ISO-8859-1\" ?>";
              echo "<!DOCTYPE html PUBLIC \"-//WAPFORUM//DTD XHTML Mobile 1.0//EN\"\"http://www.wapforum.org/DTD/xhtml-mobile10.dtd\">";
              echo "<html xmlns=\"http://www.w3.org/1999/xhtml\">";
              
                  echo "<head>";
              
                  echo "<title>pinoykindat.net</title>";
                  echo "<link rel=\"StyleSheet\" type=\"text/css\" href=\"style/style.css\" />";
                  echo "</head>";
              
                  echo "<body>";
              
              connectdb();
              $action = $_GET["action"];
              $sid = $_GET["sid"];
              $uid = getuid_sid($sid);
              if((islogged($sid)==false)||($uid==0))
                  {
                      
                    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();
                  }
              $res = mysql_query("UPDATE ibwf_users SET pid='0' WHERE id='".getuid_sid($sid)."'");
              if($action=="newtopic")
              {
                $fid = $_POST["fid"];
                $ntitle = $_POST["ntitle"];
                $tpctxt = $_POST["tpctxt"];
                if(!canaccess(getuid_sid($sid), $fid))
                  {
                    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),"Created New Topic","");
                   echo "<p align=\"center\">";
                    $crdate = time();
                    //$uid = getuid_sid($sid);
                    $texst = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_topics WHERE name LIKE '".$ntitle."' AND fid='".$fid."'"));
                    if($texst[0]==0)
                    {
                      $res = false;
                    
                      $ltopic = mysql_fetch_array(mysql_query("SELECT crdate FROM ibwf_topics WHERE authorid='".$uid."' ORDER BY crdate DESC LIMIT 1"));
                      global $topic_af;
                      $antiflood = time()-$ltopic[0];
                      if($antiflood>$topic_af)
              {
                if((trim($ntitle)!="")||(trim($tpctxt)!=""))
                    {
                    $res = mysql_query("INSERT INTO ibwf_topics SET name='".$ntitle."', fid='".$fid."', authorid='".$uid."', text='".$tpctxt."', crdate='".$crdate."', lastpost='".$crdate."'");
                   }
                     if($res)
                    {
                      $usts = mysql_fetch_array(mysql_query("SELECT posts, plusses FROM ibwf_users WHERE id='".$uid."'"));
                      $ups = $usts[0]+1;
                      $upl = $usts[1]+1;
                      mysql_query("UPDATE ibwf_users SET posts='".$ups."', plusses='".$upl."' WHERE id='".$uid."'");
                      $tnm = htmlspecialchars($ntitle);
                      echo "<img src=\"../images/ok.gif\" alt=\"O\"/>Topic <b>$tnm</b> Created Successfully";
                      $tid = mysql_fetch_array(mysql_query("SELECT id FROM ibwf_topics WHERE name='".$ntitle."' AND fid='".$fid."'"));
                      echo "<br/><br/><a href=\"index.php?action=viewtpc&amp;sid=$sid&amp;tid=$tid[0]\">";
              echo "View Topic</a>";
                    }else{
                      echo "<img src=\"../images/notok.gif\" alt=\"X\"/>Error Creating New Thread";
                    }
                    }else{
                      $af = $topic_af -$antiflood;
                      echo "<img src=\"../images/notok.gif\" alt=\"X\"/>Antiflood Control: $af";
                    }
                    }else{
                      echo "<img src=\"../images/notok.gif\" alt=\"X\"/>Topic Name already Exist";
                    }
              
                    
              
              
              
                    $fname = getfname($fid);
                    echo "<br/><br/><a href=\"index.php?action=viewfrm&amp;sid=$sid&amp;fid=$fid\">";
              echo "$fname</a><br/>";
                    echo "<a href=\"index.php?action=main&amp;sid=$sid\"><img src=\"../images/home.gif\" alt=\"*\"/>";
              echo "Home</a>";
                    echo "</p>";
                    echo "</body>";
              }
              else if($action=="quizpanel")
              {
                 $question = $_POST["question"];
                 $answer = $_POST["answer"];
              
                   echo "<p align=\"center\">";
              
                 $res = mysql_query("INSERT INTO ibwf_quiz SET question='".$question."', answer='".$answer."'");
                    if($res)
                    {
                      echo "Question Added<br/>";
                    }else{
                      echo "Database Error<br/>";
                    }
                echo "<a href=\"index.php?action=quizpanel&amp;sid=$sid&amp;type=send&amp;browse?start\">";
              echo "Quiz Panel</a><br/>";
                 echo "<a href=\"index.php?action=main&amp;sid=$sid&amp;type=send&amp;browse?start\">";
              echo "Main menu</a>";
                echo "</p>";
                echo "</body>";
              }
              else if($action=="delquiz")
              {
                  $id = $_GET["id"];
               
                echo "<p align=\"center\">";
                
                  $res = mysql_query("DELETE FROM ibwf_quiz WHERE id='".$id."'");
              
                  if($res)
                      {
                          echo "Quiz Deleted<br/>";
                      }else{
                        echo "Database Error!<br/>";
                      }
                
                echo "<br/><br/>";
              echo "<a href=\"index.php?action=quizpanel&amp;sid=$sid&amp;type=send&amp;browse?start\">";
              echo "Quiz Panel</a><br/>";
                echo "<a href=\"index.php?action=main&amp;sid=$sid&amp;browse?start\">";
              echo "Main menu</a>";
                echo "</p>";
              echo "</body>";
              }
              else if($action=="delgal")
              {
              $gid = $_GET["gid"];
              echo "<title>Gallery</title>";
              echo "<p align=\"center\">";
              echo "<br/>";
              $res = mysql_query("DELETE FROM ibwf_gallery3 WHERE id='".$gid."'");
              if($res){
              echo "Deleted successfully";
              }else{
              echo ">Error! Please Try again!";
              }
              echo "<br/><a href=\"index.php?action=main&amp;sid=$sid\">";
              echo "Main menu</a>";
              echo "</p>";
              }
              else if($action=="addgal")
              {
                 $itemurl = $_POST["itemurl"];
              addonline(getuid_sid($sid),"Adding A Pic","index.php?action=main");
              
                   echo "<p align=\"center\">";
               $nopl = mysql_fetch_array(mysql_query("SELECT sex FROM ibwf_users WHERE id='".$who."'"));
                $uid = getuid_sid($sid);
                $nopl = mysql_fetch_array(mysql_query("SELECT sex FROM ibwf_users WHERE id='".$uid."'"));
                if($nopl[0]=='M')
                {
                  $usex = "M";
                }else if($nopl[0]=='F'){
                  $usex = "F";
                }else{
                  $usex = "M";
                }
                 $res = mysql_query("INSERT INTO ibwf_gallery3 SET uid='".$uid."', itemurl='".$itemurl."', sex='".$usex."'");
                    if($res)
                    {
                      echo "User Photo Added<br/>";
                    }else{
                      echo "Database Error<br/>";
                    }
                 
                    echo "<a href=\"index.php?action=usergal&amp;sid=$sid&amp;browse?start\">User Gallery</a><br/>";
                 echo "<a href=\"index.php?action=main&amp;sid=$sid&amp;type=send&amp;browse?start\">";
              echo "Main menu</a>";
                echo "</p>";
              
              }
              else if($action=="addcom2")
              {
                  $text = $_POST["text"];
                 $prate = $_POST["prate"];
              
                $gid = $_GET["gid"];
                addonline(getuid_sid($sid),"Adding Photo Comment","index.php?action=main");
                 echo "<card id=\"main\" title=\"Add Photo\">";
                    echo "<p align=\"center\">";
                    $crdate = time();
                    $uid = getuid_sid($sid);
                    $res = false;
              
                    if(trim($text)!="")
                    {
                      
                    $res = mysql_query("INSERT INTO ibwf_galcom SET text='".$text."', byuser='".$uid."', time='".$crdate."', pid='".$gid."'");
                    }
                    if($res)
                    {
                      echo "Comment Added Successfully<br/>";
                    }else{
                      echo "Error Adding Comment<br/>";
                    }
              if($prate!="") {
              $res2 = mysql_query("INSERT INTO ibwf_prate SET uid='".$uid."', pid='".$gid."', prate='".$prate."'");
                  if($res2)
                  {
                      echo "Photo rated successfully<br/>";
                  }else{
                      echo "Database Error!<br/>";
                  }
                }      
              
                    
              echo "<a href=\"index.php?action=pkgal&amp;sid=$sid\">Users Gallery</a><br/>";
                    echo "<a href=\"index.php?action=main&amp;sid=$sid\">";
              echo "Main</a>";
                    echo "</p>";
                    echo "</body>";
              
              }
              //////////////////////////////////////////Give Plusses
              else if($action=="shares")
              {
                  $unick = getnick_uid($who);
                  addonline(getuid_sid($sid),"Sending plusses to $unick","");
                  $who = $_GET["who"];
                  $ptg = trim($_POST["ptg"]);
                  $pres = trim($_POST["pres"]);
                if(isdigitf3($ptg))
              {
              
                    echo "<p align=\"center\">";
                      echo "Opps! No no its not the right amount!<br/>";
                echo "<a href=\"index.php?action=main&amp;sid=$sid&amp;type=send&amp;browse?start\">";
                echo "Main menu</a>";
                    echo "</p>";
                    echo "</body>";
                    echo "</html>";
                    exit();
                  }
              echo "<title>pinoykindat.net</title>";
                echo "<p align=\"center\">";
                //$uid = getuid_sid($sid);
                if($uid==$who)
                          {
                   echo "Sending to your own account is not permitted!<br/>";
               }else{
              if($ptg<=0)
              {
                 echo "0 amount is not allowed!<br/>";
               }else{
              if($ptg>=10001)
              {
                 echo "10,000 maximum plusses!<br/>";
               }else{
              if(($ptg=="")||($pres==""))
                      {
                        echo "Its empty";
                      }else{
               $unick = getnick_uid($who); 
              $actime = mysql_fetch_array(mysql_query("SELECT actime FROM ibwf_killed2 WHERE uid='".$uid."' AND who='".$who."' ORDER BY actime DESC LIMIT 1"));
                      $timeout = $actime[0] + (1*24*60*60);
                      if(time()<$timeout)
                      {
                          echo "Can't send plusses to the same user at this time wait after 1 day!.<br/><br/>";
                      }else{
              $unick = getnick_uid($who);
                $psf = mysql_fetch_array(mysql_query("SELECT plusses FROM ibwf_users WHERE id='".$uid."'"));
                $npl = mysql_fetch_array(mysql_query("SELECT plusses FROM ibwf_users WHERE id='".$who."'"));
                if($psf[0]>=$ptg){
                  $psf = $psf[0]-$ptg;
                  $npl = $npl[0]+$ptg;
                  $res = mysql_query("UPDATE ibwf_users SET plusses='".$npl."', lastplreas='".mysql_escape_string($pres)."' WHERE id='".$who."'");
                  if($res)
                          {
                          if($tdo==1)
                          {
                            $msg = "share";
                          }else{
                              $msg = "share";
                          }
                        
                      $res = mysql_query("INSERT INTO ibwf_killed2 SET uid='".$uid."', who='".$who."', actime='".time()."'");
              $res = mysql_query("UPDATE ibwf_users SET plusses='".$psf."' WHERE id='".$uid."'");
                        mysql_query("INSERT INTO ibwf_mlog SET action='shareplusses', details='<b>".getnick_uid(getuid_sid($sid))."</b> send plusses to<b> ".$unick."</b> the amount of: ".$ptg."', actdt='".time()."'");
                         mysql_query("UPDATE ibwf_users SET plussess=plusses-3 WHERE id='".$uid."'");
                         echo "Plusses Shared Successfully to $unick<br/>";
                        $msg = "".getnick_uid(getuid_sid($sid))." had $msg $ptg plusses to you. LIVE MSG: $pres"."[br/][small]Note: This is an automatic PM[/small]";
                          autopm($msg, $who);
                      }else{
                        echo "Database Error!<br/>";
                      }
                    }else{
                       $nopl = mysql_fetch_array(mysql_query("SELECT plusses FROM ibwf_users WHERE id='".getuid_sid($sid)."'"));
                      echo "Yebba! not enough plusses!<br/>";
                      }
                    }
              }
              }
              }
              }
              echo "<br/>";
                echo "<a href=\"index.php?action=main&amp;sid=$sid&amp;type=send&amp;browse?start\">";
              echo "Main menu</a>";
              echo "</p>";
              
              }
              else if($action=="post")
              {
                  $tid = $_POST["tid"];
                  $tfid = mysql_fetch_array(mysql_query("SELECT fid FROM ibwf_topics WHERE id='".$tid."'"));
              if(!canaccess(getuid_sid($sid), $tfid[0]))
                  {
                    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();
                  }
                $reptxt = $_POST["reptxt"];
                $qut = $_POST["qut"];
                addonline(getuid_sid($sid),"Posted A reply","");
                  echo "<p align=\"center\">";
                    $crdate = time();
                    $fid = getfid($tid);
                    //$uid = getuid_sid($sid);
                    $res = false;
                    $closed = mysql_fetch_array(mysql_query("SELECT closed FROM ibwf_topics WHERE id='".$tid."'"));
                    
                    if(($closed[0]!='1')||(ismod($uid)))
                    {
                    
                      $lpost = mysql_fetch_array(mysql_query("SELECT dtpost FROM ibwf_posts WHERE uid='".$uid."' ORDER BY dtpost DESC LIMIT 1"));
                      global $post_af;
                      $antiflood = time()-$lpost[0];
                      if($antiflood>$post_af)
              {
                if(trim($reptxt)!="")
                    {
                    $res = mysql_query("INSERT INTO ibwf_posts SET text='".$reptxt."', tid='".$tid."', uid='".$uid."', dtpost='".$crdate."', quote='".$qut."'");
              }
                    if($res)
                    {
                      $usts = mysql_fetch_array(mysql_query("SELECT posts, plusses FROM ibwf_users WHERE id='".$uid."'"));
                      $ups = $usts[0]+1;
                      $upl = $usts[1]+1;
                      mysql_query("UPDATE ibwf_users SET posts='".$ups."', plusses='".$upl."' WHERE id='".$uid."'");
                      mysql_query("UPDATE ibwf_topics SET lastpost='".$crdate."' WHERE id='".$tid."'");
                      echo "<img src=\"../images/ok.gif\" alt=\"O\"/>Message Posted Successfully";
                      echo "<br/><br/><a href=\"index.php?action=viewtpc&amp;sid=$sid&amp;tid=$tid&amp;go=last\">";
              echo "View Topic</a>";
                    }else{
                      echo "<img src=\"../images/notok.gif\" alt=\"X\"/>Error Posting Message";
                    }
                    }else{
              $af = $post_af -$antiflood;
                      echo "<img src=\"../images/notok.gif\" alt=\"X\"/>Antiflood Control: $af";
                    }
                    }else{
                      echo "<img src=\"../images/notok.gif\" alt=\"X\"/>Topic is closed for posting";
                    }
                    
                    $fname = getfname($fid);
                    echo "<br/><br/><a href=\"index.php?action=viewfrm&amp;sid=$sid&amp;fid=$fid\">";
              echo "$fname</a><br/>";
                    echo "<a href=\"index.php?action=main&amp;sid=$sid\"><img src=\"../images/home.gif\" alt=\"*\"/>";
              echo "Home</a>";
                    echo "</p>";
                    echo "</body>";
                
              }
              
              else if ($action=="uadd")
              {
                  $ucon = $_POST["ucon"];
                  $ucit = $_POST["ucit"];
                  $ustr = $_POST["ustr"];
                  $utzn = $_POST["utzn"];
                  $uphn = $_POST["uphn"];
                  addonline(getuid_sid($sid),"My Address","");
                  echo "<p align=\"center\">";
                  $uid = getuid_sid($sid);
                  $exs = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_xinfo WHERE uid='".$uid."'"));
                  if($exs[0]>0)
                  {
                      $res = mysql_query("UPDATE ibwf_xinfo SET country='".$ucon."', city='".$ucit."', street='".$ustr."', timezone='".$utzn."', phoneno='".$uphn."' WHERE uid='".$uid."'");
                      if($res)
                      {
                        echo "<img src=\"../images/ok.gif\" alt=\"O\"/>Address Updated Successfully<br/><br/>";
                      }else{
                          echo "<img src=\"../images/notok.gif\" alt=\"O\"/>Database Error!<br/><br/>";
                      }
                  }else{
                      $res = mysql_query("INSERT INTO ibwf_xinfo SET uid='".$uid."', country='".$ucon."', city='".$ucit."', street='".$ustr."', timezone='".$utzn."', phoneno='".$uphn."'");
                      if($res)
                      {
                        echo "<img src=\"../images/ok.gif\" alt=\"O\"/>Address Updated Successfully<br/><br/>";
                      }else{
                          echo "<img src=\"../images/notok.gif\" alt=\"O\"/>Database Error!<br/><br/>";
                      }
                  }
                  echo "<a href=\"index.php?action=uxset&amp;sid=$sid\">";
              echo "Extended Settings</a><br/>";
                  echo "<a href=\"index.php?action=main&amp;sid=$sid\"><img src=\"../images/home.gif\" alt=\"*\"/>";
              echo "Home</a>";
                echo "</p>";
                  echo "</body>";
              }
              
              else if($action=="gcp")
              {
                  $clid = $_GET["clid"];
                  $who = $_GET["who"];
                  $giv = $_POST["giv"];
                  $pnt = $_POST["pnt"];
                  addonline(getuid_sid($sid),"Moderating Club Member","");
                  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]>0 && $cow[0]>0)
              {
                  $mpt = mysql_fetch_array(mysql_query("SELECT plusses FROM ibwf_clubmembers WHERE uid='".$who."' AND clid='".$clid."'"));
                  if($giv=="1")
                  {
                    $pnt = $mpt[0]+$pnt;
                  }else{
                      $pnt = $mpt[0]-$pnt;
                      if($pnt<0)$pnt=0;
                  }
                  $res = mysql_query("UPDATE ibwf_clubmembers SET plusses='".$pnt."' WHERE uid='".$who."' AND clid='".$clid."'");
                  if($res)
                  {
                      echo "<img src=\"../images/ok.gif\" alt=\"O\"/>Club plusses updated successfully!";
                  }else{
                    echo "<img src=\"../images/notok.gif\" alt=\"X\"/>Database Error!";
                  }
                  }else{
                    echo "<img src=\"../images/notok.gif\" alt=\"X\"/>Missing Info!";
                  }
                  echo "</p>";
              
                  echo "<p align=\"center\">";
              
                  echo "<a href=\"index.php?action=main&amp;sid=$sid\"><img src=\"../images/home.gif\" alt=\"*\"/>";
              echo "Home</a>";
                echo "</p>";
                  echo "</body>";
              }
              
              else if($action=="gpl")
              {
                  $clid = $_GET["clid"];
                  $who = $_GET["who"];
                  $pnt = $_POST["pnt"];
                  addonline(getuid_sid($sid),"Moderating Club Member","");
                  echo "<p align=\"center\">";
                  $whnick = getnick_uid($who);
                  echo "<b>$whnick</b>";
                  echo "</p>";
                  echo "<p>";
                    echo "<img src=\"../images/notok.gif\" alt=\"X\"/>Because people misused the plusses thing, clubs owners cant give plusses anymore";
                  
                  echo "</p>";
              
                  echo "<p align=\"center\">";
              
                  echo "<a href=\"index.php?action=main&amp;sid=$sid\"><img src=\"../images/home.gif\" alt=\"*\"/>";
              echo "Home</a>";
                echo "</p>";
                  echo "</body>";
              }
              
              else if ($action=="upre")
              {
                  $usds = $_POST["usds"];
                  $usds = str_replace('"', "", $usds);
                  $usds = str_replace("'", "", $usds);
                  $ubon = $_POST["ubon"];
                  $usxp = $_POST["usxp"];
                  addonline(getuid_sid($sid),"Preferences","");
                  echo "<p align=\"center\">";
                  $uid = getuid_sid($sid);
                  $exs = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_xinfo WHERE uid='".$uid."'"));
                  if($exs[0]>0)
                  {
                      $res = mysql_query("UPDATE ibwf_xinfo SET sitedscr='".$usds."', budsonly='".$ubon."', sexpre='".$usxp."' WHERE uid='".$uid."'");
                      if($res)
                      {
                        echo "<img src=\"../images/ok.gif\" alt=\"O\"/>Preferences Updated Successfully<br/><br/>";
                      }else{
                          echo "<img src=\"../images/notok.gif\" alt=\"O\"/>Database Error!<br/><br/>";
                      }
                  }else{
                      $res = mysql_query("INSERT INTO ibwf_xinfo SET uid='".$uid."', sitedscr='".$usds."', budsonly='".$ubon."', sexpre='".$usxp."'");
                      if($res)
                      {
                        echo "<img src=\"../images/ok.gif\" alt=\"O\"/>Preferences Updated Successfully<br/><br/>";
                      }else{
                          echo "<img src=\"../images/notok.gif\" alt=\"O\"/>Database Error!<br/><br/>";
                      }
                  }
                  echo "<a href=\"index.php?action=uxset&amp;sid=$sid\">";
              echo "Extended Settings</a><br/>";
                  echo "<a href=\"index.php?action=main&amp;sid=$sid\"><img src=\"../images/home.gif\" alt=\"*\"/>";
              echo "Home</a>";
                echo "</p>";
                  echo "</body>";
              }
              
              else if ($action=="gmset")
              {
                  $ugun = $_POST["ugun"];
                  $ugpw = $_POST["ugpw"];
                  $ugch = $_POST["ugch"];
                  addonline(getuid_sid($sid),"G-Mail Settings","");
                  echo "<p align=\"center\">";
                  $uid = getuid_sid($sid);
                  $exs = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_xinfo WHERE uid='".$uid."'"));
                  if($exs[0]>0)
                  {
                      $res = mysql_query("UPDATE ibwf_xinfo SET gmailun='".$ugun."', gmailpw='".$ugpw."', gmailchk='".$ugch."', gmaillch='".time()."' WHERE uid='".$uid."'");
                      if($res)
                      {
                        echo "<img src=\"../images/ok.gif\" alt=\"O\"/>Gmail Settings Updated Successfully<br/><br/>";
                      }else{
                          echo "<img src=\"../images/notok.gif\" alt=\"O\"/>Database Error!<br/><br/>";
                      }
                  }else{
                      $res = mysql_query("INSERT INTO ibwf_xinfo SET uid='".$uid."', gmailun='".$ugun."', gmailpw='".$ugpw."', gmailchk='".$ugch."', gmaillch='".time()."'");
                      if($res)
                      {
                        echo "<img src=\"../images/ok.gif\" alt=\"O\"/>G-Mail Settings Updated Successfully<br/><br/>";
                      }else{
                          echo "<img src=\"../images/notok.gif\" alt=\"O\"/>Database Error!<br/><br/>";
                      }
                  }
                  echo "<a href=\"index.php?action=uxset&amp;sid=$sid\">";
              echo "Extended Settings</a><br/>";
                  echo "<a href=\"index.php?action=main&amp;sid=$sid\"><img src=\"../images/home.gif\" alt=\"*\"/>";
              echo "Home</a>";
                echo "</p>";
                  echo "</body>";
              }
              
              else if ($action=="uper")
              {
                  $uhig = addslashes($_POST["uhig"]);
                  $uwgt = $_POST["uwgt"];
                  $urln = $_POST["urln"];
                  $ueor = $_POST["ueor"];
                  $ueys = $_POST["ueys"];
                  $uher = $_POST["uher"];
                  $upro = $_POST["upro"];
                  
                  addonline(getuid_sid($sid),"Personality","");
                  echo "<p align=\"center\">";
                  $uid = getuid_sid($sid);
                  $exs = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_xinfo WHERE uid='".$uid."'"));
                  if($exs[0]>0)
                  {
                      $res = mysql_query("UPDATE ibwf_xinfo SET height='".$uhig."', weight='".$uwgt."', realname='".$urln."', eyescolor='".$ueys."', profession='".$upro."', racerel='".$ueor."',hairtype='".$uher."'  WHERE uid='".$uid."'");
                      if($res)
                      {
                        echo "<img src=\"../images/ok.gif\" alt=\"O\"/>Personal Info Updated Successfully<br/><br/>";
                      }else{
                          echo "<img src=\"../images/notok.gif\" alt=\"O\"/>Database Error!<br/><br/>";
                      }
                  }else{
                      $res = mysql_query("INSERT INTO ibwf_xinfo SET uid='".$uid."', height='".$uhig."', weight='".$uwgt."', realname='".$urln."', eyescolor='".$ueys."', profession='".$upro."', racerel='".$ueor."',hairtype='".$uher."'");
                      if($res)
                      {
                        echo "<img src=\"../images/ok.gif\" alt=\"O\"/>Personal Info Updated Successfully<br/><br/>";
                      }else{
                          echo "<img src=\"../images/notok.gif\" alt=\"O\"/>Database Error!<br/><br/>";
                      }
                  }
                  echo "<a href=\"index.php?action=uxset&amp;sid=$sid\">";
              echo "Extended Settings</a><br/>";
                  echo "<a href=\"index.php?action=main&amp;sid=$sid\"><img src=\"../images/home.gif\" alt=\"*\"/>";
              echo "Home</a>";
                echo "</p>";
                  echo "</body>";
              }
              
              else if ($action=="umin")
              {
                  $ulik = $_POST["ulik"];
                  $ulik = str_replace('"', "", $ulik);
                  $ulik = str_replace("'", "", $ulik);
                  $udlk = $_POST["udlk"];
                  $udlk = str_replace('"', "", $udlk);
                  $udlk = str_replace("'", "", $udlk);
                  $ubht = $_POST["ubht"];
                  $ubht = str_replace('"', "", $ubht);
                  $ubht = str_replace("'", "", $ubht);
                  $ught = $_POST["ught"];
                  $ught = str_replace('"', "", $ught);
                  $ught = str_replace("'", "", $ught);
                  $ufsp = $_POST["ufsp"];
                  $ufsp = str_replace('"', "", $ufsp);
                  $ufsp = str_replace("'", "", $ufsp);
                  $ufmc = $_POST["ufmc"];
                  $ufmc = str_replace('"', "", $ufmc);
                  $ufmc = str_replace("'", "", $ufmc);
                  $umtx = $_POST["umtx"];
                  $umtx = str_replace('"', "", $umtx);
                  $umtx = str_replace("'", "", $umtx);
                  addonline(getuid_sid($sid),"More about me","");
                  echo "<card id=\"main\" title=\"More about me\">";
                  echo "<p align=\"center\">";
                  $uid = getuid_sid($sid);
                  $exs = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_xinfo WHERE uid='".$uid."'"));
                  if($exs[0]>0)
                  {
                      $res = mysql_query("UPDATE ibwf_xinfo SET likes='".$ulik."', deslikes='".$udlk."', habitsb='".$ubht."', habitsg='".$ught."', favsport='".$ufsp."', favmusic='".$ufmc."',moretext='".$umtx."'  WHERE uid='".$uid."'");
                      if($res)
                      {
                        echo "<img src=\"../images/ok.gif\" alt=\"O\"/>Info Updated Successfully<br/><br/>";
                      }else{
                          echo "<img src=\"../images/notok.gif\" alt=\"O\"/>Database Error!<br/><br/>";
                      }
                  }else{
                      $res = mysql_query("INSERT INTO ibwf_xinfo SET uid='".$uid."', likes='".$ulik."', deslikes='".$udlk."', habitsb='".$ubht."', habitsg='".$ught."', favsport='".$ufsp."', favmusic='".$ufmc."',moretext='".$umtx."'");
                      if($res)
                      {
                        echo "<img src=\"../images/ok.gif\" alt=\"O\"/>Info Updated Successfully<br/><br/>";
                      }else{
                          echo "<img src=\"../images/notok.gif\" alt=\"O\"/>Database Error!<br/><br/>";
                      }
                  }
                  echo "<a href=\"index.php?action=uxset&amp;sid=$sid\">";
              echo "Extended Settings</a><br/>";
                  echo "<a href=\"index.php?action=main&amp;sid=$sid\"><img src=\"../images/home.gif\" alt=\"*\"/>";
              echo "Home</a>";
                echo "</p>";
                  echo "</body>";
              }
              
              else if($action=="mkroom")
              {
                      $rname = mysql_escape_string($_POST["rname"]);
                      $rpass = trim($_POST["rpass"]);
                      addonline(getuid_sid($sid),"Creating Chatroom","");
                             echo "<p align=\"center\">";
                       //$uid = getuid_sid($sid);
              if ($rpass=="")
                      {
                        $cns = 1;
                      }else{
                          $cns = 0;
                      }
                      $prooms = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_rooms WHERE static='0'"));
                      if($prooms[0]<10)
                      {
                      $res = mysql_query("INSERT INTO ibwf_rooms SET name='".$rname."', owner='".$uid."', censord='".$cns."', static='0', lastmsg='".time()."'");
                      if($res)
                      {
                        echo "Room Created Successfully<br/><br/>";
                      }else{
                          echo "Database Error!<br/><br/>";
                      }
                      }else{
                          echo "There's already 10 users rooms<br/><br/>";
                      }
                      echo "<a href=\"index.php?action=chat&amp;sid=$sid&amp;type=send&amp;browse?start\">Chatrooms</a><br/>";
                      echo "<a href=\"index.php?action=main&amp;sid=$sid&amp;type=send&amp;browse?start\">Main menu</a>";
                      echo "</p>";
               
                      echo "</body>";
                      
              }
              ///////////////////////////////////////Unban user
              
              else if($action=="kick")
              {
                $who = $_GET["who"];
                $rid = $_GET["rid"];
              if(!iscowner(getuid_sid($sid), $rid))
                  {
                
                    echo "<p align=\"center\">";
                    echo "lolz! Wotz ur doing? chuchu<br/><br/>";
                    echo "<a href=\"index.php?action=main&amp;sid=$sid&amp;type=send&amp;browse?start\">Main</a>";
                    echo "</p>";
                    echo "</body>";
                    echo "</html>";
                    exit();
                  }
              echo "<card id=\"main\" title=\"User Options\">";
               echo "<p align=\"center\">";
                if($uid==$who)
                          {
                   echo "Lolz You cant kick your own profile!<br/>";
               }else{
              $res = mysql_query("INSERT INTO ibwf_kick SET kick='1', rid='".$rid."', uid='".$who."', actime='".time()."'");
                if($res)
                        {
                          $unick = getnick_uid($who);
                         
                          echo "$unick has been kicked!";
                        }else{
                          echo "NAME ALREADY INSERTED";
                        }
                }
              echo "<br/><br/>";
              
                echo "<a href=\"index.php?action=chat&amp;sid=$sid&amp;browse?start\">";
              echo "Chat index</a><br/>";
              
                echo "<a href=\"index.php?action=main&amp;sid=$sid&amp;browse?start\">";
              echo "Home</a>";
                echo "</p></body>";
              }
              ///////////////////////////////////////Unban user
              
              else if($action=="unkick")
              {
                $who = $_GET["who"];
               $rid = $_GET["rid"];
               if(!iscowner(getuid_sid($sid), $rid))
                  {
                    echo "<title>pinoykindat.net</title>";
                    echo "<p align=\"center\">";
                    echo "lolz! Wotz ur doing? chuchu<br/><br/>";
                    echo "<a href=\"index.php?action=main&amp;sid=$sid&amp;type=send&amp;browse?start\">Main</a>";
                    echo "</p>";
                    echo "</body>";
                    echo "</html>";
                    exit();
                  }
              echo "<card id=\"main\" title=\"User Options\">";
              echo "<p align=\"center\">";
                $res = mysql_query("DELETE FROM ibwf_kick WHERE uid='".$who."'");
                if($res)
                        {
                          $unick = getnick_uid($who);
                        
                          echo "$unick has been unkicked!";
                        }else{
                          echo "Database Error";
                        }
                echo "<br/><br/>";
              
               echo "<a href=\"index.php?action=chat&amp;sid=$sid&amp;browse?start\">";
              echo "Chat index</a><br/>";
              
                echo "<a href=\"index.php?action=main&amp;sid=$sid&amp;browse?start\">";
              echo "Home</a>";
                echo "</p></card>";
              }
              ///////////////////////////////////////Unban user
              
              else if($action=="lock")
              {
                $rid = $_GET["rid"];
              if(!iscowner(getuid_sid($sid), $rid))
                  {
                    echo "<title>pinoykindat.net</title>";
                    echo "<p align=\"center\">";
                    echo "lolz! Wotz ur doing? chuchu<br/><br/>";
                    echo "<a href=\"index.php?action=main&amp;sid=$sid&amp;type=send&amp;browse?start\">Main</a>";
                    echo "</p>";
                    echo "</body>";
                    echo "</html>";
                    exit();
                  }
              echo "<card id=\"main\" title=\"User Options\">";
               echo "<p align=\"center\">";
                $res = mysql_query("UPDATE ibwf_rooms SET locked='1' WHERE id='".$rid."'");
                if($res)
                        {
                          $unick = getnick_uid($who);
                         
                          echo "Room has been locked!";
                        }else{
                          echo "NAME ALREADY INSERTED";
                        }
                echo "<br/><br/>";
              
               echo "<a href=\"index.php?action=chat&amp;sid=$sid&amp;browse?start\">";
              echo "Chat index</a><br/>";
              
                echo "<a href=\"index.php?action=main&amp;sid=$sid&amp;browse?start\">";
              echo "Home</a>";
                echo "</p></card>";
              }
              ///////////////////////////////////////Unban user
              
              else if($action=="unlock")
              {
               
               $rid = $_GET["rid"];
               if(!iscowner(getuid_sid($sid), $rid))
                  {
                    echo "<title>pinoykindat.net</title>";
                    echo "<p align=\"center\">";
                    echo "lolz! Wotz ur doing? chuchu<br/><br/>";
                    echo "<a href=\"index.php?action=main&amp;sid=$sid&amp;type=send&amp;browse?start\">Main</a>";
                    echo "</p>";
                    echo "</body>";
                    echo "</html>";
                    exit();
                  }
              echo "<card id=\"main\" title=\"User Options\">";
                echo "<p align=\"center\">";
                $res = mysql_query("UPDATE ibwf_rooms SET locked='0' WHERE id='".$rid."'");
                if($res)
                        {
                          
                        
                          echo "Room has been unlocked!";
                        }else{
                          echo "Database Error";
                        }
                echo "<br/><br/>";
              
               echo "<a href=\"index.php?action=chat&amp;sid=$sid&amp;browse?start\">";
              echo "Chat index</a><br/>";
              
                echo "<a href=\"index.php?action=main&amp;sid=$sid&amp;browse?start\">";
              echo "Home</a>";
                echo "</p></card>";
              }
              else if($action=="signgb")
              {
                  $who = $_POST["who"];
                 
              if(!cansigngb(getuid_sid($sid), $who))
                  {
                      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();
                  }
                $msgtxt = $_POST["msgtxt"];
                //$qut = $_POST["qut"];
                addonline(getuid_sid($sid),"Signing a guestbook","");
                    echo "<p align=\"center\">";
                    $crdate = time();
                    //$uid = getuid_sid($sid);
                    $res = false;
              
                    if(trim($msgtxt)!="")
                    {
                      
                    $res = mysql_query("INSERT INTO ibwf_gbook SET gbowner='".$who."', gbsigner='".$uid."', dtime='".$crdate."', gbmsg='".$msgtxt."'");
                    }
                    if($res)
                    {
                      echo "<img src=\"../images/ok.gif\" alt=\"O\"/>Message Posted Successfully";
                    }else{
                      echo "<img src=\"../images/notok.gif\" alt=\"X\"/>Error Posting Message";
                    }
                    
                    echo "<br/><br/>";
                    echo "<a href=\"index.php?action=main&amp;sid=$sid\"><img src=\"../images/home.gif\" alt=\"*\"/>";
              echo "Home</a>";
                    echo "</p>";
                    echo "</body>";
              
              }
              else if($action=="votepl")
              {
                //$uid = getuid_sid($sid);
                $plid = $_GET["plid"];
                $ans = $_GET["ans"];
                addonline(getuid_sid($sid),"Poll Voting ;)","");
                 echo "<p align=\"center\">";
                  $voted = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_presults WHERE uid='".$uid."' AND pid='".$plid."'"));
                  if($voted[0]==0)
                  {
                      $res = mysql_query("INSERT INTO ibwf_presults SET uid='".$uid."', pid='".$plid."', ans='".$ans."'");
                      if($res)
                      {
                          echo "<img src=\"../images/ok.gif\" alt=\"o\"/>Thanx for your voting";
                      }else{
                          echo "<img src=\"../images/notok.gif\" alt=\"x\"/>Database Error!";
                      }
                  }else{
                      echo "<img src=\"../images/notok.gif\" alt=\"x\"/>You already voted for this poll";
                  }
                  echo "<br/><br/><a href=\"index.php?action=main&amp;sid=$sid\"><img src=\"../images/home.gif\" alt=\"*\"/>";
              echo "Home</a>";
                echo "</p>";
                echo "</body>";
              }
              else if($action=="dlpoll")
              {
                //$uid = getuid_sid($sid);
                addonline(getuid_sid($sid),"Deleting Poll","");
                  echo "<p align=\"center\">";
                  $pid = mysql_fetch_array(mysql_query("SELECT pollid FROM ibwf_users WHERE id='".$uid."'"));
                      $res = mysql_query("UPDATE ibwf_users SET pollid='0' WHERE id='".$uid."'");
                      if($res)
                      {
                        $res = mysql_query("DELETE FROM ibwf_presults WHERE pid='".$pid[0]."'");
                        $res = mysql_query("DELETE FROM ibwf_pp_pres WHERE pid='".$pid[0]."'");
                        $res = mysql_query("DELETE FROM ibwf_polls WHERE id='".$pid[0]."'");
                          echo "<img src=\"../images/ok.gif\" alt=\"o\"/>Poll Deleted";
                      }else{
                          echo "<img src=\"../images/notok.gif\" alt=\"x\"/>Database Error!";
                      }
                  echo "<br/><br/><a href=\"index.php?action=main&amp;sid=$sid\"><img src=\"../images/home.gif\" alt=\"*\"/>";
              echo "Home</a>";
                echo "</p>";
                echo "</body>";
              }
              else if($action=="delcmt")
              {
                $id = $_GET["id"];
                addonline(getuid_sid($sid),"Deleting Photo Comments","index.php?action=main");
                 echo "<title>Delete Comments</title>";
                echo "<p align=\"center\">";
              
                $res = mysql_query("DELETE FROM ibwf_galcom WHERE id ='".$id."'");
                if($res)
                        {
                       
                          echo "Comment deleted";
                        }else{
                          echo "Database Error";
                        }
                echo "<br/><br/>";
              
              
                echo "<a href=\"index.php?action=main&amp;sid=$sid\">";
              echo "Main menu</a>";
                echo "</p>";
               echo" </card>";
              }
              else if($action=="delan")
              {
                //$uid = getuid_sid($sid);
                addonline(getuid_sid($sid),"Deleting Announcement","");
                 $clid = $_GET["clid"];
                $anid = $_GET["anid"];
                $uid = getuid_sid($sid);
                  echo "<p align=\"center\">";
                  $pid = mysql_fetch_array(mysql_query("SELECT owner FROM ibwf_clubs WHERE id='".$clid."'"));
                  $exs = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_announcements WHERE id='".$anid."' AND clid='".$clid."'"));
                  if(($uid==$pid[0])&&($exs[0]>0))
                  {
                      $res = mysql_query("DELETE FROM ibwf_announcements WHERE id='".$anid."'");
                      if($res)
                      {
              
                          echo "<img src=\"../images/ok.gif\" alt=\"o\"/>Announcement Deleted";
                      }else{
                          echo "<img src=\"../images/notok.gif\" alt=\"x\"/>Database Error!";
                      }
                  }else{
                      echo "<img src=\"../images/notok.gif\" alt=\"x\"/>Yo can't delete this announcement!";
                  }
                  echo "<br/><br/><a href=\"index.php?action=main&amp;sid=$sid\"><img src=\"../images/home.gif\" alt=\"*\"/>";
              echo "Home</a>";
                echo "</p>";
                echo "</body>";
              }
              
              else if($action=="dlcl")
              {
                //$uid = getuid_sid($sid);
                addonline(getuid_sid($sid),"Deleting Club","");
                  $clid = $_GET["clid"];
                $uid = getuid_sid($sid);
                  echo "<p align=\"center\">";
                  $pid = mysql_fetch_array(mysql_query("SELECT owner FROM ibwf_clubs WHERE id='".$clid."'"));
                  if($uid==$pid[0])
                  {
                      $res = deleteClub($clid);
                      if($res)
                      {
                        
                          echo "<img src=\"../images/ok.gif\" alt=\"o\"/>Club Deleted";
                      }else{
                          echo "<img src=\"../images/notok.gif\" alt=\"x\"/>Database Error!";
                      }
                  }else{
                      echo "<img src=\"../images/notok.gif\" alt=\"x\"/>Yo can't delete this club!";
                  }
                  echo "<br/><br/><a href=\"index.php?action=main&amp;sid=$sid\"><img src=\"../images/home.gif\" alt=\"*\"/>";
              echo "Home</a>";
                echo "</p>";
                echo "</body>";
              }
              
              else if($action=="pws")
              {
                //$uid = getuid_sid($sid);
                addonline(getuid_sid($sid),"Updating PWS","");
                  $imgt = $_POST["imgt"];
                $imgo = $_POST["imgo"];
                $smsg = $_POST["smsg"];
                $thms = $_POST["thms"];
                
                $uid = getuid_sid($sid);
                  echo "<p align=\"center\">";
                  if($imgt=="idc")
                  {
                      $imgo = "http://chatheaven.4mak.net/rwidc.php?id=$uid";
                  }else if($imgt == "avt")
                  {
                      $av = mysql_fetch_array(mysql_query("SELECT avatar FROM ibwf_users WHERE id='".$uid."'"));
                      if(strpos($av[0], "http://")===false)
                      {
                          $av[0] = "../".$av[0];
                      }
                      $imgo = $av[0];
                  }else if($imgt=="sml")
                  {
                      $sml = mysql_fetch_array(mysql_query("SELECT imgsrc FROM ibwf_smilies WHERE scode='".strtolower(trim($imgo))."'"));
                      $imgo = "../".$sml[0];
                  }else
                  {
                      $imgo = strtolower(trim($imgo));
                  }
                  $smsg = trim($smsg);
                  $isu = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_mypage WHERE uid='".$uid."'"));
                  if ($isu[0]>0)
                  {
                      $res = mysql_query("UPDATE ibwf_mypage SET thid='".$thms."', mimg='".$imgo."', msg='".$smsg."' WHERE uid='".$uid."'");
                  }else{
                      $res = mysql_query("INSERT INTO ibwf_mypage SET uid='".$uid."', thid='".$thms."', mimg='".$imgo."', msg='".$smsg."'");
                  }
                  echo mysql_error();
                  if($res)
                  {
                  echo "<img src=\"../images/ok.gif\" alt=\"o\"/>Your Site updated successfully<br/><br/>";
                  echo "<a href=\"users?".getnick_uid($uid)."\">View Your Site</a>";
                  }else{
                      echo "<img src=\"../images/notok.gif\" alt=\"x\"/>Database Error!";
                  }
                  echo "<br/><br/><a href=\"index.php?action=main&amp;sid=$sid\"><img src=\"../images/home.gif\" alt=\"*\"/>";
              echo "Home</a>";
                echo "</p>";
                echo "</body>";
              }
              
              else if($action=="dltpl")
              {
                //$uid = getuid_sid($sid);
                $tid = $_GET["tid"];
                addonline(getuid_sid($sid),"Deleting Poll","");
                   echo "<p align=\"center\">";
                  $pid = mysql_fetch_array(mysql_query("SELECT pollid FROM ibwf_topics WHERE id='".$tid."'"));
                      $res = mysql_query("UPDATE ibwf_topics SET pollid='0' WHERE id='".$tid."'");
                      if($res)
                      {
                        $res = mysql_query("DELETE FROM ibwf_presults WHERE pid='".$pid[0]."'");
                        $res = mysql_query("DELETE FROM ibwf_polls WHERE id='".$pid[0]."'");
                          echo "<img src=\"../images/ok.gif\" alt=\"o\"/>Poll Deleted";
                      }else{
                          echo "<img src=\"../images/notok.gif\" alt=\"x\"/>Database Error!";
                      }
                  echo "<br/><br/><a href=\"index.php?action=main&amp;sid=$sid\"><img src=\"../images/home.gif\" alt=\"*\"/>";
              echo "Home</a>";
                echo "</p>";
                echo "</body>";
              }
              
              else if($action=="reqjc")
              {
                //$uid = getuid_sid($sid);
                $clid = $_GET["clid"];
                addonline(getuid_sid($sid),"Joining A Club","");
                    echo "<p align=\"center\">";
                  $uid = getuid_sid($sid);
                  $isin = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_clubmembers WHERE uid='".$uid."' AND clid='".$clid."'"));
                  if($isin[0]==0){
                      $res = mysql_query("INSERT INTO ibwf_clubmembers SET uid='".$uid."', clid='".$clid."', accepted='0', points='0', joined='".time()."'");
                      if($res)
                      {
                          echo "<img src=\"../images/ok.gif\" alt=\"o\"/>Request sent! the club owner should accept your request";
                      }else{
                          echo "<img src=\"../images/notok.gif\" alt=\"x\"/>Database Error!";
                      }
                      }else{
                          echo "<img src=\"../images/notok.gif\" alt=\"x\"/>You already in this club or request sent and waiting for acception";
                      }
                  echo "<br/><br/><a href=\"index.php?action=main&amp;sid=$sid\"><img src=\"../images/home.gif\" alt=\"*\"/>";
              echo "Home</a>";
                echo "</p>";
                echo "</body>";
              }
              
              else if($action=="unjc")
              {
                //$uid = getuid_sid($sid);
                $clid = $_GET["clid"];
                addonline(getuid_sid($sid),"Unjoining club","");
                   echo "<p align=\"center\">";
                  $uid = getuid_sid($sid);
                  $isin = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_clubmembers WHERE uid='".$uid."' AND clid='".$clid."'"));
                  if($isin[0]>0){
                      $res = mysql_query("DELETE FROM ibwf_clubmembers WHERE uid='".$uid."' AND clid='".$clid."'");
                      if($res)
                      {
                          echo "<img src=\"../images/ok.gif\" alt=\"o\"/>Unjoined club successfully";
                      }else{
                          echo "<img src=\"../images/notok.gif\" alt=\"x\"/>Database Error!";
                      }
                      }else{
                          echo "<img src=\"../images/notok.gif\" alt=\"x\"/>You're not a member of this club!";
                      }
                  echo "<br/><br/><a href=\"index.php?action=main&amp;sid=$sid\"><img src=\"../images/home.gif\" alt=\"*\"/>";
              echo "Home</a>";
                echo "</p>";
                echo "</body>";
              }
              
              else if($action=="acm")
              {
                //$uid = getuid_sid($sid);
                $clid = $_GET["clid"];
                $who = $_GET["who"];
                addonline(getuid_sid($sid),"Adding a member to club","");
                 echo "<p align=\"center\">";
                  $uid = getuid_sid($sid);
                  $cowner = mysql_fetch_array(mysql_query("SELECT owner FROM ibwf_clubs WHERE id='".$clid."'"));
                  if($cowner[0]==$uid){
                      $res = mysql_query("UPDATE ibwf_clubmembers SET accepted='1' WHERE clid='".$clid."' AND uid='".$who."'");
                      if($res)
                      {
                          echo "<img src=\"../images/ok.gif\" alt=\"o\"/>Member added to your club";
                      }else{
                          echo "<img src=\"../images/notok.gif\" alt=\"x\"/>Database Error!";
                      }
                      }else{
                          echo "<img src=\"../images/notok.gif\" alt=\"x\"/>This club ain't yours";
                      }
                  echo "<br/><br/><a href=\"index.php?action=main&amp;sid=$sid\"><img src=\"../images/home.gif\" alt=\"*\"/>";
              echo "Home</a>";
                echo "</p>";
                echo "</body>";
              }
              else if($action=="accall")
              {
                //$uid = getuid_sid($sid);
                $clid = $_GET["clid"];
                
                addonline(getuid_sid($sid),"Adding a member to club","");
                echo "<card id=\"main\" title=\"Add Member\">";
                  echo "<p align=\"center\">";
                  $uid = getuid_sid($sid);
                  $cowner = mysql_fetch_array(mysql_query("SELECT owner FROM ibwf_clubs WHERE id='".$clid."'"));
                  if($cowner[0]==$uid){
                      $res = mysql_query("UPDATE ibwf_clubmembers SET accepted='1' WHERE clid='".$clid."'");
                      if($res)
                      {
                          echo "<img src=\"../images/ok.gif\" alt=\"o\"/>All Members Accepted";
                      }else{
                          echo "<img src=\"../images/notok.gif\" alt=\"x\"/>Database Error!";
                      }
                      }else{
                          echo "<img src=\"../images/notok.gif\" alt=\"x\"/>This club ain't yours";
                      }
                  echo "<br/><br/><a href=\"index.php?action=main&amp;sid=$sid\"><img src=\"../images/home.gif\" alt=\"*\"/>";
              echo "Home</a>";
                echo "</p>";
                echo "</body>";
              }
              else if($action=="denall")
              {
                //$uid = getuid_sid($sid);
                $clid = $_GET["clid"];
                
                addonline(getuid_sid($sid),"Adding a member to club","");
                   echo "<p align=\"center\">";
                  $uid = getuid_sid($sid);
                  $cowner = mysql_fetch_array(mysql_query("SELECT owner FROM ibwf_clubs WHERE id='".$clid."'"));
                  if($cowner[0]==$uid){
                      $res = mysql_query("DELETE FROM ibwf_clubmembers WHERE accepted='0' AND clid='".$clid."'");
                      if($res)
                      {
                          echo "<img src=\"../images/ok.gif\" alt=\"o\"/>All Members Denied";
                      }else{
                          echo "<img src=\"../images/notok.gif\" alt=\"x\"/>Database Error!";
                      }
                      }else{
                          echo "<img src=\"../images/notok.gif\" alt=\"x\"/>This club ain't yours";
                      }
                  echo "<br/><br/><a href=\"index.php?action=main&amp;sid=$sid\"><img src=\"../images/home.gif\" alt=\"*\"/>";
              echo "Home</a>";
                echo "</p>";
                echo "</body>";
              }
              else if($action=="dcm")
              {
                //$uid = getuid_sid($sid);
                $clid = $_GET["clid"];
                $who = $_GET["who"];
                addonline(getuid_sid($sid),"Deleting a member from club","");
                echo "<card id=\"main\" title=\"Delete Member\">";
                  echo "<p align=\"center\">";
                  $uid = getuid_sid($sid);
                  $cowner = mysql_fetch_array(mysql_query("SELECT owner FROM ibwf_clubs WHERE id='".$clid."'"));
                  if($cowner[0]==$uid){
                      $res = mysql_query("DELETE FROM ibwf_clubmembers  WHERE clid='".$clid."' AND uid='".$who."'");
                      if($res)
                      {
                          echo "<img src=\"../images/ok.gif\" alt=\"o\"/>Member deleted from your club";
                      }else{
                          echo "<img src=\"../images/notok.gif\" alt=\"x\"/>Database Error!";
                      }
                      }else{
                          echo "<img src=\"../images/notok.gif\" alt=\"x\"/>This club ain't yours";
                      }
                  echo "<br/><br/><a href=\"index.php?action=main&amp;sid=$sid\"><img src=\"../images/home.gif\" alt=\"*\"/>";
              echo "Home</a>";
                echo "</p>";
                echo "</body>";
              }
              
              else if($action=="crpoll")
              {
                addonline(getuid_sid($sid),"Creating Poll","");
                  echo "<card id=\"main\" title=\"Create Poll\">";
                  echo "<p align=\"center\">";
                  //$uid = getuid_sid($sid);
                  if(getplusses(getuid_sid($sid))>=50)
                  {
                  $pid = mysql_fetch_array(mysql_query("SELECT pollid FROM ibwf_users WHERE id='".$uid."'"));
                      if($pid[0] == 0)
                      {
                        $pques = $_POST["pques"];
                        $opt1 = $_POST["opt1"];
                        $opt2 = $_POST["opt2"];
                        $opt3 = $_POST["opt3"];
                        $opt4 = $_POST["opt4"];
                        $opt5 = $_POST["opt5"];
                        if((trim($pques)!="")&&(trim($opt1)!="")&&(trim($opt2)!=""))
                        {
                          $pex = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_polls WHERE pqst LIKE '".$pques."'"));
                          if($pex[0]==0)
                          {
                            $res = mysql_query("INSERT INTO ibwf_polls SET pqst='".$pques."', opt1='".$opt1."', opt2='".$opt2."', opt3='".$opt3."', opt4='".$opt4."', opt5='".$opt5."', pdt='".time()."'");
                            if($res)
                            {
                              $pollid = mysql_fetch_array(mysql_query("SELECT id FROM ibwf_polls WHERE pqst='".$pques."' "));
                              mysql_query("UPDATE ibwf_users SET pollid='".$pollid[0]."' WHERE id='".$uid."'");
                              echo "<img src=\"../images/ok.gif\" alt=\"O\"/>Your poll created successfully";
                            }else{
                              echo "<img src=\"../images/notok.gif\" alt=\"x\"/>Database Eroor!";
                            }
                              }else{
                          echo "<img src=\"../images/notok.gif\" alt=\"x\"/>There's already a poll with the same question";
                        }
              
                        }else{
                           echo "<img src=\"../images/notok.gif\" alt=\"x\"/>The poll must have a question, and at least 2 options";
                        }
                        }else{
                          echo "<img src=\"../images/notok.gif\" alt=\"x\"/>You already have a poll";
                        }
                        }else{
                          echo "<img src=\"../images/notok.gif\" alt=\"x\"/>You should have at least 50 plusses to create a poll";
              
                        }
                        echo "<br/><br/><a href=\"index.php?action=main&amp;sid=$sid\"><img src=\"../images/home.gif\" alt=\"*\"/>";
              echo "Home</a>";
                echo "</p>";
                  echo "</body>";
              }
              else if($action=="pltpc")
              {
                $tid = $_GET["tid"];
                addonline(getuid_sid($sid),"Creating Poll","");
                  echo "<p align=\"center\">";
                  //$uid = getuid_sid($sid);
                  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)
                      {
                        $pques = $_POST["pques"];
                        $opt1 = $_POST["opt1"];
                        $opt2 = $_POST["opt2"];
                        $opt3 = $_POST["opt3"];
                        $opt4 = $_POST["opt4"];
                        $opt5 = $_POST["opt5"];
                        if((trim($pques)!="")&&(trim($opt1)!="")&&(trim($opt2)!=""))
                        {
                          $pex = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_polls WHERE pqst LIKE '".$pques."'"));
                          if($pex[0]==0)
                          {
                            $res = mysql_query("INSERT INTO ibwf_polls SET pqst='".$pques."', opt1='".$opt1."', opt2='".$opt2."', opt3='".$opt3."', opt4='".$opt4."', opt5='".$opt5."', pdt='".time()."'");
                            if($res)
                            {
                              $pollid = mysql_fetch_array(mysql_query("SELECT id FROM ibwf_polls WHERE pqst='".$pques."' "));
                              mysql_query("UPDATE ibwf_topics SET pollid='".$pollid[0]."' WHERE id='".$tid."'");
                              echo "<img src=\"../images/ok.gif\" alt=\"O\"/>Your poll created successfully";
                            }else{
                              echo "<img src=\"../images/notok.gif\" alt=\"x\"/>Database Eroor!";
                            }
                              }else{
                          echo "<img src=\"../images/notok.gif\" alt=\"x\"/>There's already a poll with the same question";
                        }
              
                        }else{
                           echo "<img src=\"../images/notok.gif\" alt=\"x\"/>The poll must have a question, and at least 2 options";
                        }
                        }else{
                          echo "<img src=\"../images/notok.gif\" alt=\"x\"/>This 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 "<br/><br/><a href=\"index.php?action=main&amp;sid=$sid\"><img src=\"../images/home.gif\" alt=\"*\"/>";
              echo "Home</a>";
                echo "</p>";
                  echo "</body>";
              }
              else if($action=="addblg")
              {
              
              if(!getplusses(getuid_sid($sid))>50)
                  {
                    echo "<p align=\"center\">";
                    echo "Only 50+ plusses can add blogs<br/><br/>";
                    echo "<a href=\"index.php?action=main&amp;sid=$sid\">Home</a>";
                    echo "</p>";
                    echo "</body>";
                    echo "</html>";
                    exit();
                  }
                $msgtxt = $_POST["btitle"];
                $msgtxt = $_POST["msgtxt"];
                //$qut = $_POST["qut"];
                addonline(getuid_sid($sid),"Adding a blog","");
                    echo "<p align=\"center\">";
                    $crdate = time();
                    //$uid = getuid_sid($sid);
                    $res = false;
              
                    if((trim($msgtxt)!="")&&(trim($btitle)!=""))
                    {
                    $res = mysql_query("INSERT INTO ibwf_blogs SET bowner='".$uid."', bname='".$btitle."', bgdate='".$crdate."', btext='".$msgtxt."'");
                    }
                    if($res)
                    {
                      echo "<img src=\"../images/ok.gif\" alt=\"O\"/>Message Posted Successfully";
                    }else{
                      echo "<img src=\"../images/notok.gif\" alt=\"X\"/>Error Posting Message";
                    }
              
                    echo "<br/><br/>";
                    echo "<a href=\"index.php?action=main&amp;sid=$sid\"><img src=\"../images/home.gif\" alt=\"*\"/>";
              echo "Home</a>";
                    echo "</p>";
                    echo "</body>";
              
              }
              
              else if($action=="addvlt")
              {
              
              if(!getplusses(getuid_sid($sid))>25)
                  {
                    echo "<title>pinoykindat.net</title>";
                    echo "<p align=\"center\">";
                    echo "Only the user of 25+ plusses can add a vault item<br/><br/>";
                    echo "<a href=\"index.php?action=main&amp;sid=$sid\">Home</a>";
                    echo "</p>";
                    echo "</body>";
                    echo "</html>";
                    exit();
                  }
                $viname = $_POST["viname"];
                $vilink = $_POST["vilink"];
              $videsc = $_POST["videsc"];
                $did = $_POST["did"];
               //$qut = $_POST["qut"];
              
               $fname= array_reverse(explode("/",$vilink));
                addonline(getuid_sid($sid),"Adding A Vault Item","index.php?action=main");
              
              error_reporting(0);
               if(strlen($viname)<5)
              {
                    echo "<title>pinoykindat.net</title>";
                    echo "<p align=\"center\">";
                      echo "5 minimum letters for the title!";
                echo "<br/><a href=\"index.php?action=main&amp;sid=$sid\">";
                echo "Main menu</a>";
                    echo "</p>";
                    echo "</body>";
                    echo "</html>";
                    exit();
                  }
               if(strlen($vilink)<5)
              {
                    echo "<title>pinoykindat.net</title>";
                    echo "<p align=\"center\">";
                      echo "5 minimum letters for the link!";
                echo "<br/><a href=\"index.php?action=main&amp;sid=$sid\">";
                echo "Main menu</a>";
                    echo "</p>";
                    echo "</body>";
                    echo "</html>";
                    exit();
                  }
               if(strlen($videsc)<5)
              {
                    echo "<title>pinoykindat.net</title>";
                    echo "<p align=\"center\">";
                      echo "5 minimum letters for the description!";
                echo "<br/><a href=\"index.php?action=main&amp;sid=$sid\">";
                echo "Main menu</a>";
                    echo "</p>";
                    echo "</body>";
                    echo "</html>";
                    exit();
                  }
              if(spacesin($vilink))
              {
                    echo "<card id=\"main\" title=\"Error adding\">";
                    echo "<p align=\"center\">";
                    echo "No space input!<br/>";
                    echo "<a href=\"index.php?action=main&amp;sid=$sid\">Main menu</a>";
                    echo "</p>";
                    echo "</body>";
                    echo "</html>";
                    exit();
                  }
              $fname= array_reverse(explode("/",$vilink));
              
              if (!eregi("\.(mid|gif|bmp|mid|midi|3gp|mp3|mp4|wav|mpn|nth|mpc|jar|jad|jpeg|jpg|sis|mmf|amr|thm|png|wbmp|rar|zip)$",$fname[0]))
              {
              echo "<card id=\"main\" title=\"Error adding\">";
                    echo "<p align=\"center\">";
              echo "<b>Unsuported File extention!</b><br/>";
              echo "<a href=\"index.php?action=main&amp;sid=$sid\">Main menu</a>";
                                echo "</p></card></wml>";
                          exit();
                          }
              echo "<title>pinoykindat.net</title>";
                    echo "<p align=\"center\">";
                    $crdate = time();
                    //$uid = getuid_sid($sid);
              
                 $res = false;
              
              $defaultDest = "$dir";
              $slash       = "/";
              
              $dest        = "./pkfiles/";
               $fname= array_reverse(explode("/",$vilink));
              $ds = array($dest, $slash, $fname[0]);
                      $ds = implode("", $ds);
                if (!copy($vilink, $ds))
              {
               echo "Dead link is not allowed!(<br/>"; 
              }else{       
                $fname= array_reverse(explode("/",$vilink));
              $ext = getext($fname[0]);
                      $mime = getextfile($ext);
              $fname= array_reverse(explode("/",$vilink));
                 $filesize = filesize($ds);
              $filesize = $filesize / 1048576;
              $fsize = 0;
              $fsizetxt = "";
                if ($filesize < 1)
                {
                   $fsize = round($filesize*1024,0);
                   $fsizetxt = "".$fsize."KB";
                  $check1 = "KB";
                }else{
                   $fsize = round($filesize,2);
                   $fsizetxt = "".$fsize." MB";
              $check1 = "MB";
                }
                $res = mysql_query("INSERT INTO ibwf_vault SET uid='".$uid."', title='".mysql_escape_string($viname)."', pudt='".$crdate."', did='".$did."', info='".$videsc."',filesize='".$fsizetxt."', mime='".$mime."', itemurl='".$fname[0]."'");
               if($res)
                    {
              mysql_query("UPDATE ibwf_users SET plusses=plusses-'5' WHERE id='".$uid."'");
               echo "File added successfully!";
                    }else{
                      
                    }
              }
                    echo "<br/><br/>";
                    echo "<a href=\"index.php?action=main&amp;sid=$sid\">";
              echo "Main menu</a>";
                    echo "</p>";
                    echo "</body>";
              
              }
              //////////////////////////////////////////shout
              
              else if($action=="shout")
              {
                $shtxt = $_POST["shtxt"];
                  addonline(getuid_sid($sid),"Shouting","");
              
                  echo "<p align=\"center\">";
                  if(getplusses(getuid_sid($sid))<75)
                  {
                      echo "<img src=\"../images/notok.gif\" alt=\"X\"/>You should have at least 75 plusses to shout!";
                  }else{
                    $shtxt = $shtxt;
                  //$uid = getuid_sid($sid);
                  $shtm = time();
                  $res = mysql_query("INSERT INTO ibwf_shouts SET shout='".$shtxt."', shouter='".$uid."', shtime='".$shtm."'");
                  if($res)
                  {
                  $shts = mysql_fetch_array(mysql_query("SELECT shouts from ibwf_users WHERE id='".$uid."'"));
                  $shts = $shts[0]+1;
                  mysql_query("UPDATE ibwf_users SET shouts='".$shts."' WHERE id='".$uid."'");
                  echo "<img src=\"../images/ok.gif\" alt=\"O\"/>Shout added successfully";
                  }else{
                      echo "<img src=\"../images/notok.gif\" alt=\"X\"/>Database Error";
                  }
                          }
                       echo "<br/><br/><a href=\"index.php?action=main&amp;sid=$sid\"><img src=\"../images/home.gif\" alt=\"*\"/>";
              echo "Home</a>";
                  echo "</p>";
                  echo "</body>";
              }
              
              //////////////////////////////////////////Announce
              
              else if($action=="annc")
              {
                $antx = $_POST["antx"];
                $clid = $_GET["clid"];
                  addonline(getuid_sid($sid),"Announcing","");
              $cow = mysql_fetch_array(mysql_query("SELECT owner FROM ibwf_clubs WHERE id='".$clid."'"));
                  $uid = getuid_sid($sid);
                  echo "<p align=\"center\">";
                  if($cow[0]!=$uid)
                  {
                      echo "<img src=\"../images/notok.gif\" alt=\"X\"/>This is not your club!";
                  }else{
                    $shtxt = $shtxt;
                  //$uid = getuid_sid($sid);
                  $shtm = time();
                  $res = mysql_query("INSERT INTO ibwf_announcements SET antext='".$antx."', clid='".$clid."', antime='".$shtm."'");
                  if($res)
                  {
                  echo "<img src=\"../images/ok.gif\" alt=\"O\"/>Announcement Added!";
                  }else{
                      echo "<img src=\"../images/notok.gif\" alt=\"X\"/>Database Error";
                  }
                          }
                       echo "<br/><br/><a href=\"index.php?action=main&amp;sid=$sid\"><img src=\"../images/home.gif\" alt=\"*\"/>";
              echo "Home</a>";
                  echo "</p>";
                  echo "</body>";
              }
              
              else if($action=="rateb")
              {
                $brate = $_POST["brate"];
                $bid = $_GET["bid"];
                addonline(getuid_sid($sid),"Rating a blog","");
                //$uid = getuid_sid($sid);
                
                echo "<p align=\"center\">";
                $vb = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_brate WHERE uid='".$uid."' AND blogid='".$bid."'"));
                if($vb[0]==0)
                {
                  $res = mysql_query("INSERT INTO ibwf_brate SET uid='".$uid."', blogid='".$bid."', brate='".$brate."'");
                  if($res)
                  {
                      echo "<img src=\"../images/ok.gif\" alt=\"o\"/>Blog rated successfully<br/>";
                  }else{
                      echo "<img src=\"../images/notok.gif\" alt=\"x\"/>Database Error!<br/>";
                  }
                }else{
                  echo "<img src=\"../images/notok.gif\" alt=\"x\"/>You have rated this blog before<br/>";
                }
                echo "<br/><br/>";
                echo "<a href=\"index.php?action=main&amp;sid=$sid\"><img src=\"../images/home.gif\" alt=\"*\"/>";
              echo "Home</a>";
                echo "</p></body>";
                
              }
              
              else if($action=="delfgb")
              {
                  $mid = $_GET["mid"];
                addonline(getuid_sid($sid),"Deleting GB Message","");
                echo "<p align=\"center\">";
                if(candelgb(getuid_sid($sid), $mid))
                {
                  $res = mysql_query("DELETE FROM ibwf_gbook WHERE id='".$mid."'");
                  if($res)
                      {
                          echo "<img src=\"../images/ok.gif\" alt=\"o\"/>Message Deleted From Guestbook<br/>";
                      }else{
                        echo "<img src=\"../images/notok.gif\" alt=\"x\"/>Database Error!<br/>";
                      }
                }else{
                  echo "<img src=\"../images/notok.gif\" alt=\"X\"/>You can't delete this message";
                }
                echo "<br/><br/>";
                echo "<a href=\"index.php?action=main&amp;sid=$sid\"><img src=\"../images/home.gif\" alt=\"*\"/>";
              echo "Home</a>";
                echo "</p></body>";
              }
              
              else if($action=="delvlt")
              {
                  $vid = $_GET["vid"];
                addonline(getuid_sid($sid),"Deleting Vault Item","");
                echo "<p align=\"center\">";
                $itemowner = mysql_fetch_array(mysql_query("SELECT uid FROM ibwf_vault WHERE id='".$vid."'"));
                if(ismod(getuid_sid($sid))||getuid_sid($sid)==$itemowner[0])
                {
                  $res = mysql_query("DELETE FROM ibwf_vault WHERE id='".$vid."'");
                  if($res)
                      {
                          echo "<img src=\"../images/ok.gif\" alt=\"o\"/>Item Deleted From Vault<br/>";
                      }else{
                        echo "<img src=\"../images/notok.gif\" alt=\"x\"/>Database Error!<br/>";
                      }
                }else{
                  echo "<img src=\"../images/notok.gif\" alt=\"X\"/>You can't delete this item";
                }
                echo "<br/><br/>";
                echo "<a href=\"index.php?action=main&amp;sid=$sid\"><img src=\"../images/home.gif\" alt=\"*\"/>";
              echo "Home</a>";
                echo "</p></body>";
              }
              
              else if($action=="delpic")
              {
                  $vid = $_GET["vid"];
                addonline(getuid_sid($sid),"Deleting Gallery Pic","");
                echo "<p align=\"center\">";
                $itemowner = mysql_fetch_array(mysql_query("SELECT uid,file FROM gallery WHERE id='".$vid."'"));
                if(ismod(getuid_sid($sid))||getuid_sid($sid)==$itemowner[0])
                {
                  $res = mysql_query("DELETE FROM gallery WHERE id='".$vid."'");
                  if($res)
                      {
                      $myFile = "../gallery/$itemowner[1]";
                      unlink($myFile);
              
              
                      echo "<img src=\"../images/ok.gif\" alt=\"o\"/>Pic Deleted From Gallery<br/>";
                      }else{
                        echo "<img src=\"../images/notok.gif\" alt=\"x\"/>Database Error!<br/>";
                      }
                }else{
                  echo "<img src=\"../images/notok.gif\" alt=\"X\"/>You can't delete this item";
                }
                echo "<br/><br/>";
                echo "<a href=\"index.php?action=main&amp;sid=$sid\"><img src=\"../images/home.gif\" alt=\"*\"/>";
              echo "Home</a>";
                echo "</p></body>";
              }
              else if($action=="delbl")
              {
                  $bid = $_GET["bid"];
                addonline(getuid_sid($sid),"Deleting A Blog","");
                echo "<p align=\"center\">";
                if(candelbl(getuid_sid($sid), $bid))
                {
                  $res = mysql_query("DELETE FROM ibwf_blogs WHERE id='".$bid."'");
                  if($res)
                      {
                          echo "<img src=\"../images/ok.gif\" alt=\"o\"/>Blog Deleted<br/>";
                      }else{
                        echo "<img src=\"../images/notok.gif\" alt=\"x\"/>Database Error!<br/>";
                      }
                }else{
                  echo "<img src=\"../images/notok.gif\" alt=\"X\"/>You can't delete this blog";
                }
                echo "<br/><br/>";
                echo "<a href=\"index.php?action=main&amp;sid=$sid\"><img src=\"../images/home.gif\" alt=\"*\"/>";
              echo "Home</a>";
                echo "</p></body>";
              }
              else if($action=="rpost")
              {
                $pid = $_GET["pid"];
                addonline(getuid_sid($sid),"Reporting Post","");
                echo "<p align=\"center\">";
                $pinfo = mysql_fetch_array(mysql_query("SELECT reported FROM ibwf_posts WHERE id='".$pid."'"));
                        if($pinfo[0]=="0")
                        {
                        $str = mysql_query("UPDATE ibwf_posts SET reported='1' WHERE id='".$pid."' ");
                        if($str)
                        {
                          echo "<img src=\"../images/ok.gif\" alt=\"O\"/>Post reported to mods successfully";
                        }else{
                          echo "<img src=\"../images/notok.gif\" alt=\"X\"/>Can't report post at the moment";
                        }
                        }else{
                          echo "<img src=\"../images/notok.gif\" alt=\"X\"/>This Post is already reported";
                        }
                        echo "<br/><br/>";
                echo "<a href=\"index.php?action=main&amp;sid=$sid\"><img src=\"../images/home.gif\" alt=\"*\"/>";
              echo "Home</a>";
                echo "</p></body>";
                      
                      
              }
              
              
              else if($action=="rtpc")
              {
                $tid = $_GET["tid"];
                addonline(getuid_sid($sid),"Reporting Topic","");
                echo "<p align=\"center\">";
                $pinfo = mysql_fetch_array(mysql_query("SELECT reported FROM ibwf_topics WHERE id='".$tid."'"));
                        if($pinfo[0]=="0")
                        {
                        $str = mysql_query("UPDATE ibwf_topics SET reported='1' WHERE id='".$tid."' ");
                        if($str)
                        {
                          echo "<img src=\"../images/ok.gif\" alt=\"O\"/>Topic reported to mods successfully";
                        }else{
                          echo "<img src=\"../images/notok.gif\" alt=\"X\"/>Can't report topic at the moment";
                        }
                        }else{
                          echo "<img src=\"../images/notok.gif\" alt=\"X\"/>This Topic is already reported";
                        }
                        echo "<br/><br/>";
                echo "<a href=\"index.php?action=main&amp;sid=$sid\"><img src=\"../images/home.gif\" alt=\"*\"/>";
              echo "Home</a>";
                echo "</p></body>";
              
              
              }
              
              else if($action=="bud")
              {
                $todo = $_GET["todo"];
                $who = $_GET["who"];
                addonline(getuid_sid($sid),"Adding/Removing Buddy","");
                echo "<p align=\"center\">";
                //$uid = getuid_sid($sid);
                  $unick = getnick_uid($uid);
                  $tnick = getnick_uid($who);
                if($todo=="add")
                {
                  if(budres($uid,$who)!=3){
                  if(arebuds($uid,$who))
                  {
                    echo "<img src=\"../images/notok.gif\" alt=\"x\"/>$tnick is already your buddy<br/>";
                  }else if(budres($uid, $who)==0)
                  {
                      $res = mysql_query("INSERT INTO ibwf_buddies SET uid='".$uid."', tid='".$who."', reqdt='".time()."'");
                      if($res)
                      {
                          echo "<img src=\"../images/ok.gif\" alt=\"o\"/>A request has been sent to $tnick<br/>";
                      }else{
                        echo "<img src=\"../images/notok.gif\" alt=\"x\"/>You can't add $tnick to your buddy list<br/>";
                      }
                  }
              else if(budres($uid, $who)==1)
                  {
                      $res = mysql_query("UPDATE ibwf_buddies SET agreed='1' WHERE uid='".$who."' AND tid='".$uid."'");
                      if($res)
                      {
                          echo "<img src=\"../images/ok.gif\" alt=\"o\"/>$tnick Added to your buddy list successfully<br/>";
                      }else{
                        echo "<img src=\"../images/notok.gif\" alt=\"x\"/>You can't add $tnick to your buddy list<br/>";
                      }
                  }
                  else{
                      echo "<img src=\"../images/notok.gif\" alt=\"x\"/>You can't add $tnick to your buddy list<br/>";
                  }
                  }else{
                      echo "<img src=\"../images/notok.gif\" alt=\"x\"/>You can't add $tnick to your buddy list<br/>";
                  }
                }else if($todo="del")
                {
                  
                      
                    
                    $res= mysql_query("DELETE FROM ibwf_buddies WHERE (uid='".$uid."' AND tid='".$who."') OR (uid='".$who."' AND tid='".$uid."')");
                    if($res)
                      {
                          echo "<img src=\"../images/ok.gif\" alt=\"o\"/>$tnick removed from your buddy list<br/>";
                      }else{
                        echo "<img src=\"../images/notok.gif\" alt=\"x\"/>can't remove $tnick from your buddy list<br/>";
                      }
              
                }
                echo "<a href=\"index.php?action=main&amp;sid=$sid\"><img src=\"../images/home.gif\" alt=\"*\"/>";
              echo "Home</a>";
                echo "</p></body>";
              }
              
              //////////////////////////////////////////Update buddy message
              else if($action=="upbmsg")
              {
                  addonline(getuid_sid($sid),"Updating Buddy message","");
                  $bmsg = $_POST["bmsg"];
                  echo "<p align=\"center\">";
                //$uid = getuid_sid($sid);
                $res = mysql_query("UPDATE ibwf_users SET budmsg='".$bmsg."' WHERE id='".$uid."'");
                if($res)
                      {
                          echo "<img src=\"../images/ok.gif\" alt=\"o\"/>Buddy message updated successfully<br/>";
                      }else{
                        echo "<img src=\"../images/notok.gif\" alt=\"x\"/>can't update your buddy message<br/>";
                      }
                      echo "<br/>";
                echo "<a href=\"lists.php?action=buds&amp;sid=$sid\">";
              echo "Buddies List</a><br/>";
                   echo "<a href=\"index.php?action=main&amp;sid=$sid\"><img src=\"../images/home.gif\" alt=\"*\"/>";
              echo "Home</a>";
              echo "</p>";
                echo "</body>";
              }
              
              //////////////////////////////////////////Select Avatar
              else if($action=="upav")
              {
                  addonline(getuid_sid($sid),"Updating Avatar","");
                  $avid = $_GET["avid"];
                  echo "<p align=\"center\">";
                //$uid = getuid_sid($sid);
                $avlnk = mysql_fetch_array(mysql_query("SELECT avlink FROM ibwf_avatars WHERE id='".$avid."'"));
              
                $res = mysql_query("UPDATE ibwf_users SET avatar='".$avlnk[0]."' WHERE id='".$uid."'");
                if($res)
                      {
                          echo "<img src=\"../images/ok.gif\" alt=\"o\"/>Avatar Selected<br/>";
                      }else{
                        echo "<img src=\"../images/notok.gif\" alt=\"x\"/>Database Error!<br/>";
                      }
                      echo "<br/>";
                
                   echo "<a href=\"index.php?action=main&amp;sid=$sid\"><img src=\"../images/home.gif\" alt=\"*\"/>";
              echo "Home</a>";
              echo "</p>";
                echo "</body>";
              }
              //////////////////////////////////////////Select Avatar
              else if($action=="upav2")
              {
                  addonline(getuid_sid($sid),"Updating Avatar","index.php?action=main");
                  $gid = $_GET["gid"];
                  echo "<title>Gallery</title>";
                echo "<p align=\"center\">";
                //$uid = getuid_sid($sid);
                $avlnk = mysql_fetch_array(mysql_query("SELECT itemurl FROM ibwf_gallery3 WHERE id='".$gid."'"));
                $res = mysql_query("UPDATE ibwf_users SET avatar='".$avlnk[0]."' WHERE id='".$uid."'");
                if($res)
                      {
                          echo "<img src=\"images/ok.gif\" alt=\"o\"/>Pic Selected<br/>";
                      }else{
                        echo "<img src=\"images/notok.gif\" alt=\"x\"/>Database Error!<br/>";
                      }
                      echo "<br/>";
                
                   echo "<a href=\"index.php?action=main&amp;sid=$sid&amp;type=send\"><img src=\"images/home.gif\" alt=\"*\"/>";
              echo "Main menu</a>";
              echo "</p>";
              }
              //////////////////////////////////////////Select Avatar
              else if($action=="uppic")
              {
                  addonline(getuid_sid($sid),"Updating Avatar","");
                  $avid = $_GET["avid"];
                  echo "<p align=\"center\">";
                //$uid = getuid_sid($sid);
                $avlnk = mysql_fetch_array(mysql_query("SELECT id FROM gallery WHERE id='".$avid."'"));
                $gallery="gallery.php?id=$avlnk[0]";
                $res = mysql_query("UPDATE ibwf_users SET avatar='".$gallery."' WHERE id='".$uid."'");
                if($res)
                      {
                          echo "<img src=\"../images/ok.gif\" alt=\"o\"/>Avatar Selected<br/>";
                      }else{
                        echo "<img src=\"../images/notok.gif\" alt=\"x\"/>Database Error!<br/>";
                      }
                      echo "<br/>";
                
                   echo "<a href=\"index.php?action=main&amp;sid=$sid\"><img src=\"../images/home.gif\" alt=\"*\"/>";
              echo "Home</a>";
              echo "</p>";
                echo "</body>";
              }
              //////////////////////////////////////////Select Avatar
              else if($action=="upcm")
              {
                  addonline(getuid_sid($sid),"Updating Chatmood","");
                  $cmid = $_GET["cmid"];
                  echo "<p align=\"center\">";
                //$uid = getuid_sid($sid);
                $res = mysql_query("UPDATE ibwf_users SET chmood='".$cmid."' WHERE id='".$uid."'");
                if($res)
                      {
                          echo "<img src=\"../images/ok.gif\" alt=\"o\"/>Mood Selected<br/>";
                      }else{
                        echo "<img src=\"../images/notok.gif\" alt=\"x\"/>Database Error!<br/>";
                      }
                      echo "<br/>";
              echo "<a href=\"index.php?action=chat&amp;sid=$sid\">";
              echo "Chatrooms</a><br/>";
                   echo "<a href=\"index.php?action=main&amp;sid=$sid\"><img src=\"../images/home.gif\" alt=\"*\"/>";
              echo "Home</a>";
              echo "</p>";
                echo "</body>";
              }
              
              //////////////////////////////////////////Give GPs
              else if($action=="givegp")
              {
                  addonline(getuid_sid($sid),"Giving Game Plusses","");
                  $who = $_GET["who"];
                  $ptg = $_POST["ptg"];
                  echo "<p align=\"center\">";
                //$uid = getuid_sid($sid);
                $gpsf = mysql_fetch_array(mysql_query("SELECT gplus FROM ibwf_users WHERE id='".$uid."'"));
                $gpst = mysql_fetch_array(mysql_query("SELECT gplus FROM ibwf_users WHERE id='".$who."'"));
                if($gpsf[0]>=$ptg){
                  $gpsf = $gpsf[0]-$ptg;
                  $gpst = $gpst[0]+$ptg;
                  $res = mysql_query("UPDATE ibwf_users SET gplus='".$gpst."' WHERE id='".$who."'");
                if($res)
                      {
                        $res = mysql_query("UPDATE ibwf_users SET gplus='".$gpsf."' WHERE id='".$uid."'");
                          echo "<img src=\"../images/ok.gif\" alt=\"o\"/>Game Plusses Updated Successfully<br/>";
                      }else{
                        echo "<img src=\"../images/notok.gif\" alt=\"x\"/>Database Error!<br/>";
                      }
                    }else{
                        echo "<img src=\"../images/notok.gif\" alt=\"x\"/>You don't have enough GPs to give<br/>";
                      }
              
                      echo "<br/>";
                
                   echo "<a href=\"index.php?action=main&amp;sid=$sid\"><img src=\"../images/home.gif\" alt=\"*\"/>";
              echo "Home</a>";
              echo "</p>";
                echo "</body>";
              }
              
              //////////////////// add club
              
              else if($action=="addcl")
              {
                  addonline(getuid_sid($sid),"Adding Club","");
                $clnm = trim($_POST["clnm"]);
                  $clnm = str_replace("$", "", $clnm);
                  $clds = trim($_POST["clds"]);
                  $clds = str_replace("$", "", $clds);
                  $clrl = trim($_POST["clrl"]);
                  $clrl = str_replace("$", "", $clrl);
                  $cllg = trim($_POST["cllg"]);
                  $cllg = str_replace("$", "", $cllg);
                  echo "<card id=\"main\" title=\"Add Club\">";
                  echo "<p align=\"center\">";
                  $uid = getuid_sid($sid);
                  if(getplusses($uid)>=500)
                  {
                  $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_clubs WHERE owner='".$uid."'"));
                    if($noi[0]<3)
                    {
                      if(($clnm=="")||($clds=="")||($clrl==""))
                      {
                        echo "Please be sure to fill, club name, description and rules";
                      }else{
                        $nmex = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_clubs WHERE name LIKE '".$clnm."'"));
                        if($nmex[0]>0)
                        {
                          echo "Club Name Already exist";
                        }else{
                          $res = mysql_query("INSERT INTO ibwf_clubs SET name='".$clnm."', owner='".$uid."', description='".$clds."', rules='".$clrl."', logo='".$cllg."', plusses='0', created='".time()."'");
                          if($res)
                          {
                            $clid = mysql_fetch_array(mysql_query("SELECT id FROM ibwf_clubs WHERE owner='".$uid."' AND name='".$clnm."'"));
                              echo "Congratulations! you have your own club, your own rules, message board, chatroom, announcements board, 50 club points also for you";
                              mysql_query("INSERT INTO ibwf_clubmembers SET uid='".$uid."', clid='".$clid[0]."', accepted='1', points='50', joined='".time()."'");
                              //$ups = getplusses($uid);
                              //$ups += 5;
                              //mysql_query("UPDATE ibwf_users SET plusses='".$ups."' WHERE id='".$uid."'");
                              $fnm = $clnm;
                              $cnm = $clnm;
                              mysql_query("INSERT INTO ibwf_forums SET name='".$fnm."', position='0', cid='0', clubid='".$clid[0]."'");
                              mysql_query("INSERT INTO ibwf_rooms SET name='".$cnm."', pass='', static='1', mage='0', chposts='0', perms='0', censord='0', freaky='0', lastmsg='".time()."', clubid='".$clid[0]."'");
                          }else{
                              echo "Database Error!";
                          }
                        }
                      }
                    }else{
                      echo "You already have 3 clubs";
                    }
                    }else{
              
                    echo "You cant add clubs";
                    }
              
                  
                  echo "<br/><br/><a href=\"index.php?action=main&amp;sid=$sid\">";
              echo "Home</a>";
                echo "</p>";
                  echo "</body>";
              }
              //////////////////////////////////////////Give GPs
              else if($action=="batp")
              {
                  addonline(getuid_sid($sid),"Giving Game Plusses","");
                  $who = $_GET["who"];
                  $ptg = $_POST["ptbp"];
                  $giv = $_POST["giv"];
                  echo "<p align=\"center\">";
                //$uid = getuid_sid($sid);
                $judg = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_judges WHERE uid='".getuid_sid($sid)."'"));
                $gpst = mysql_fetch_array(mysql_query("SELECT battlep FROM ibwf_users WHERE id='".$who."'"));
                if(ismod(getuid_sid($sid))||$judg[0]>0)
                {
                  if ($giv=="1")
                  {
                      $gpst = $gpst[0]+$ptg;
                  }else{
                      $gpst = $gpst[0]-$ptg;
                      if($gpst<0)$gpst=0;
                  }
                  $res = mysql_query("UPDATE ibwf_users SET battlep='".$gpst."' WHERE id='".$who."'");
                if($res)
                      {
                        $vnick = getnick_uid($who);
                        if ($giv=="1")
                        {
                          $ms1 = " Added $ptg plusses to ";
                        }else{
                          $ms1 = " removed $ptg plusses from ";
                        }
              
                        mysql_query("INSERT INTO ibwf_mlog SET action='bplusses', details='<b>".getnick_uid(getuid_sid($sid))."</b> $ms1  $vnick', actdt='".time()."'");
                          echo "<img src=\"../images/ok.gif\" alt=\"o\"/>Battle plusses Updated Successfully<br/>";
                      }else{
                        echo "<img src=\"../images/notok.gif\" alt=\"x\"/>Database Error!<br/>";
                      }
                    }else{
                        echo "<img src=\"../images/notok.gif\" alt=\"x\"/>You can't do this<br/>";
                      }
              
                      echo "<br/>";
              
                   echo "<a href=\"index.php?action=main&amp;sid=$sid\"><img src=\"../images/home.gif\" alt=\"*\"/>";
              echo "Home</a>";
              echo "</p>";
                echo "</body>";
              }
              
              /////////////////////////////Add remove from ignoire list
              
              else if($action=="ign")
              {
                  addonline(getuid_sid($sid),"Updating ignore list","");
                  $todo = $_GET["todo"];
                  $who = $_GET["who"];
                  echo "<p align=\"center\">";
                //$uid = getuid_sid($sid);
                $tnick = getnick_uid($who);
                if($todo=="add")
                {
                  if(ignoreres($uid, $who)==1)
                  {
                    $res= mysql_query("INSERT INTO ibwf_ignore SET name='".$uid."', target='".$who."'");
                  if($res)
                      {
                          echo "<img src=\"../images/ok.gif\" alt=\"o\"/>$tnick was added successfully to your ignore list<br/>";
                      }else{
                        echo "<img src=\"../images/notok.gif\" alt=\"x\"/>Error Updating Database<br/>";
                      }
                  }else{
                      echo "<img src=\"../images/notok.gif\" alt=\"x\"/>You can't Add $tnick to your ignore list<br/>";
                  }
                }else if($todo="del")
                {
                  if(ignoreres($uid, $who)==2)
                  {
                    $res= mysql_query("DELETE FROM ibwf_ignore WHERE name='".$uid."' AND target='".$who."'");
                    if($res)
                      {
                          echo "<img src=\"../images/ok.gif\" alt=\"o\"/>$tnick was deleted successfully from your ignore list<br/>";
                      }else{
                        echo "<img src=\"../images/notok.gif\" alt=\"x\"/>Error Updating Database<br/>";
                      }
                    }else{
                      echo "<img src=\"../images/notok.gif\" alt=\"x\"/>$tnick is not ignored by you<br/>";
                    }
                }
                echo "<br/><a href=\"lists.php?action=ignl&amp;sid=$sid\">";
              echo "Ignore List</a><br/>";
                   echo "<a href=\"index.php?action=main&amp;sid=$sid\"><img src=\"../images/home.gif\" alt=\"*\"/>";
              echo "Home</a>";
              echo "</p>";
                echo "</body>";
              }
              
              //////////////////////////////////////////Update profile
              else if($action=="uprof")
              {
                  addonline(getuid_sid($sid),"Updating Settings","");
                  $savat = $_POST["savat"];
                  $semail = $_POST["semail"];
                  $usite = $_POST["usite"];
                  $ubday = $_POST["ubday"];
                  $uloc = $_POST["uloc"];
                  $usig = $_POST["usig"];
                  $usex = $_POST["usex"];
                  echo "<p align=\"center\">";
                //$uid = getuid_sid($sid);
                $res = mysql_query("UPDATE ibwf_users SET avatar='".$savat."', email='".$semail."', site='".$usite."', birthday='".$ubday."', location='".$uloc."', signature='".$usig."', sex='".$usex."' WHERE id='".$uid."'");
                if($res)
                {
                  echo "<img src=\"../images/ok.gif\" alt=\"o\"/>Your profile was updated successfully<br/>";
                }else{
                  echo "<img src=\"../images/notok.gif\" alt=\"x\"/>Error updating your profile<br/>";
                }
                echo "<br/><a href=\"index.php?action=main&amp;sid=$sid\"><img src=\"../images/home.gif\" alt=\"*\"/>";
              echo "Home</a>";
                echo "</p></body>";
              }
              
              //////////////////////////////////////////Update profile
              else if($action=="shsml")
              {
                  addonline(getuid_sid($sid),"Updating Smilies","");
                  $act = $_GET["act"];
                  $acts = ($act=="dis" ? 0 : 1);
                  echo "<p align=\"center\">";
                //$uid = getuid_sid($sid);
                $res = mysql_query("UPDATE ibwf_users SET hvia='".$acts."' WHERE id='".$uid."'");
                if($res)
                {
                  echo "<img src=\"../images/ok.gif\" alt=\"o\"/>Smilies Visibility updated successfully<br/>";
                }else{
                  echo "<img src=\"../images/notok.gif\" alt=\"x\"/>Error updating your profile<br/>";
                }
                echo "<br/><a href=\"index.php?action=main&amp;sid=$sid\"><img src=\"../images/home.gif\" alt=\"*\"/>";
              echo "Home</a>";
                echo "</p></body>";
              }
              
              //////////////////////////////////////////Change Password
              
              else if($action=="upwd")
              {
                  addonline(getuid_sid($sid),"Updating Settings","");
                  $npwd = $_POST["npwd"];
                  $cpwd = $_POST["cpwd"];
                  echo "<p align=\"center\">";
                //$uid = getuid_sid($sid);
                if($npwd!=$cpwd)
                {
                  echo "<img src=\"../images/notok.gif\" alt=\"x\"/>Your Password and Confirm Password Doesn't match<br/>";
                  
                }else if((strlen($npwd)<4) || (strlen($npwd)>15)){
                  echo "<img src=\"../images/notok.gif\" alt=\"x\"/>Your password should be between 4 and 15 letters only<br/>";
              
                }else{
                  $pwd = md5($npwd);
                  $res = mysql_query("UPDATE ibwf_users SET pass='".$pwd."' WHERE id='".$uid."'");
                  if($res)
                {
                  echo "<img src=\"../images/ok.gif\" alt=\"o\"/>Your password was updated successfully<br/>";
                }else{
                  echo "<img src=\"../images/notok.gif\" alt=\"x\"/>Error updating your password<br/>";
                }
                }
                echo "<br/><a href=\"index.php?action=main&amp;sid=$sid\"><img src=\"../images/home.gif\" alt=\"*\"/>";
              echo "Home</a>";
                echo "</p></body>";
              }
              else{
                 echo "<card id=\"main\" title=\"Chatheaven\">";
                echo "<p align=\"center\">";
                echo "I don't know how did you get into here, but there's nothing to show<br/><br/>";
                echo "<a href=\"index.php?action=main&amp;sid=$sid\"><img src=\"../images/home.gif\" alt=\"*\"/>";
              echo "Home</a>";
                echo "</p></body>";
              }
              
              ?>
              </html>
              getnow.php

              PHP Code:
              <?php
              include("core.php");
              include("config.php");
              connectdb();
              $sid = $_GET["sid"];
              $did = $_GET["did"];
              $agent = $_SERVER['HTTP_USER_AGENT'];
              $uid = getuid_sid($sid);
              if (eregi("mozilla", $agent))
               {
              echo "<head>";
              
                  
                  echo "<link rel=\"StyleSheet\" type=\"text/css\" href=\"style.css\" />";
                  echo "</head>";
              
                  echo "<body>";
                    echo "<title>Error Browser</title>";
                    echo "<p align=\"center\">";
                    echo "Your browser is not a mobile phone<br/>";
                    echo "<a href=\"index.php\">Home</a>";
                    echo "</p>";
                    echo "</body>";
                    echo "</html>";
                    exit();
              }
              if (eregi("anonymouse.org", $agent))
               {
              echo "<head>";
              
                  
                  echo "<link rel=\"StyleSheet\" type=\"text/css\" href=\"style.css\" />";
                  echo "</head>";
              
              
                  echo "<body>";
                    echo "<title>Error Browser</title>";
                    echo "<p align=\"center\">";
                    echo "Your browser is not a mobile phone<br/>";
                    echo "<a href=\"index.php\">Home</a>";
                    echo "</p>";
                    echo "</body>";
                    echo "</html>";
                    exit();
              }
              if (eregi("winwap", $agent))
               {
              echo "<head>";
              
                  
                  echo "<link rel=\"StyleSheet\" type=\"text/css\" href=\"style.css\" />";
                  echo "</head>";
              
              
                  echo "<body>";
                    echo "<title>Error Browser</title>";
                    echo "<p align=\"center\">";
                    echo "Your browser is not a mobile phone<br/>";
                    echo "<a href=\"index.php\">Home</a>";
                    echo "</p>";
                    echo "</body>";
                    echo "</html>";
                    exit();
              }
              if (eregi("gecko", $agent))
               {
              echo "<head>";
              
                  
                  echo "<link rel=\"StyleSheet\" type=\"text/css\" href=\"style.css\" />";
                  echo "</head>";
              
              
                  echo "<body>";
                    echo "<title>Error Browser</title>";
                    echo "<p align=\"center\">";
                    echo "Your browser is not a mobile phone<br/>";
                    echo "<a href=\"index.php\">Home</a>";
                    echo "</p>";
                    echo "</body>";
                    echo "</html>";
                    exit();
              }
              if (eregi("omniweb", $agent))
               {
              echo "<head>";
              
                  
                  echo "<link rel=\"StyleSheet\" type=\"text/css\" href=\"style.css\" />";
                  echo "</head>";
              
              
                  echo "<body>";
                    echo "<title>Error Browser</title>";
                    echo "<p align=\"center\">";
                    echo "Your browser is not a mobile phone<br/>";
                    echo "<a href=\"index.php\">Home</a>";
                    echo "</p>";
                    echo "</body>";
                    echo "</html>";
                    exit();
              }
              if (eregi("msie", $agent))
               {
              echo "<head>";
              
                  
                  echo "<link rel=\"StyleSheet\" type=\"text/css\" href=\"style.css\" />";
                  echo "</head>";
              
              
                  echo "<body>";
                    echo "<title>Error Browser</title>";
                    echo "<p align=\"center\">";
                    echo "Your browser is not a mobile phone<br/>";
                    echo "<a href=\"index.php\">Home</a>";
                    echo "</p>";
                    echo "</body>";
                    echo "</html>";
                    exit();
              }
              if (eregi("konqueror", $agent))
               {
              echo "<head>";
              
                  
                  echo "<link rel=\"StyleSheet\" type=\"text/css\" href=\"style.css\" />";
                  echo "</head>";
              
              
                  echo "<body>";
                    echo "<title>Error Browser</title>";
                    echo "<p align=\"center\">";
                    echo "Your browser is not a mobile phone<br/>";
                    echo "<a href=\"index.php\">Home</a>";
                    echo "</p>";
                    echo "</body>";
                    echo "</html>";
                    exit();
              }
              if (eregi("safari", $agent))
               {
              echo "<head>";
              
                  
                  echo "<link rel=\"StyleSheet\" type=\"text/css\" href=\"style.css\" />";
                  echo "</head>";
              
              
                  echo "<body>";
                    echo "<title>Error Browser</title>";
                    echo "<p align=\"center\">";
                    echo "Your browser is not a mobile phone<br/>";
                    echo "<a href=\"index.php\">Home</a>";
                    echo "</p>";
                    echo "</body>";
                    echo "</html>";
                    exit();
              }
              if (eregi("netpositive", $agent))
               {
              echo "<head>";
              
                  
                  echo "<link rel=\"StyleSheet\" type=\"text/css\" href=\"style.css\" />";
                  echo "</head>";
              
              
                  echo "<body>";
                    echo "<title>Error Browser</title>";
                    echo "<p align=\"center\">";
                    echo "Your browser is not a mobile phone<br/>";
                    echo "<a href=\"index.php\">Home</a>";
                    echo "</p>";
                    echo "</body>";
                    echo "</html>";
                    exit();
              }
              if (eregi("lynx", $agent))
               {
              echo "<head>";
              
                  
                  echo "<link rel=\"StyleSheet\" type=\"text/css\" href=\"style.css\" />";
                  echo "</head>";
              
              
                  echo "<body>";
                    echo "<title>Error Browser</title>";
                    echo "<p align=\"center\">";
                    echo "Your browser is not a mobile phone<br/>";
                    echo "<a href=\"index.php\">Home</a>";
                    echo "</p>";
                    echo "</body>";
                    echo "</html>";
                    exit();
              }
              if (eregi("elinks", $agent))
               {
              echo "<head>";
              
                  
                  echo "<link rel=\"StyleSheet\" type=\"text/css\" href=\"style.css\" />";
                  echo "</head>";
              
              
                  echo "<body>";
                    echo "<title>Error Browser</title>";
                    echo "<p align=\"center\">";
                    echo "Your browser is not a mobile phone<br/>";
                    echo "<a href=\"index.php\">Home</a>";
                    echo "</p>";
                    echo "</body>";
                    echo "</html>";
                    exit();
              }
              if (eregi("links", $agent))
               {
              echo "<head>";
              
                  
                  echo "<link rel=\"StyleSheet\" type=\"text/css\" href=\"style.css\" />";
                  echo "</head>";
              
              
                  echo "<body>";
                    echo "<title>Error Browser</title>";
                    echo "<p align=\"center\">";
                    echo "Your browser is not a mobile phone<br/>";
                    echo "<a href=\"index.php\">Home</a>";
                    echo "</p>";
                    echo "</body>";
                    echo "</html>";
                    exit();
              }
              if (eregi("w3m", $agent))
               {
              echo "<head>";
              
                  
                  echo "<link rel=\"StyleSheet\" type=\"text/css\" href=\"style.css\" />";
                  echo "</head>";
              
              
                  echo "<body>";
                    echo "<title>Error Browser</title>";
                    echo "<p align=\"center\">";
                    echo "Your browser is not a mobile phone<br/>";
                    echo "<a href=\"index.php\">Home</a>";
                    echo "</p>";
                    echo "</body>";
                    echo "</html>";
                    exit();
              }
              if (eregi("webtv", $agent))
               {
              echo "<head>";
              
                  
                  echo "<link rel=\"StyleSheet\" type=\"text/css\" href=\"style.css\" />";
                  echo "</head>";
              
              
                  echo "<body>";
                    echo "<title>Error Browser</title>";
                    echo "<p align=\"center\">";
                    echo "Your browser is not a mobile phone<br/>";
                    echo "<a href=\"index.php\">Home</a>";
                    echo "</p>";
                    echo "</body>";
                    echo "</html>";
                    exit();
              }
              if (eregi("amaya", $agent))
               {
              echo "<head>";
              
                  
                  echo "<link rel=\"StyleSheet\" type=\"text/css\" href=\"style.css\" />";
                  echo "</head>";
              
              
                  echo "<body>";
                    echo "<title>Error Browser</title>";
                    echo "<p align=\"center\">";
                    echo "Your browser is not a mobile phone<br/>";
                    echo "<a href=\"index.php\">Home</a>";
                    echo "</p>";
                    echo "</body>";
                    echo "</html>";
                    exit();
              }
              if (eregi("ibrowse", $agent))
               {
              echo "<head>";
              
                  
                  echo "<link rel=\"StyleSheet\" type=\"text/css\" href=\"style.css\" />";
                  echo "</head>";
              
              
                  echo "<body>";
                    echo "<title>Error Browser</title>";
                    echo "<p align=\"center\">";
                    echo "Your browser is not a mobile phone<br/>";
                    echo "<a href=\"index.php\">Home</a>";
                    echo "</p>";
                    echo "</body>";
                    echo "</html>";
                    exit();
              }
              if (eregi("icab", $agent))
               {
              echo "<head>";
              
                  
                  echo "<link rel=\"StyleSheet\" type=\"text/css\" href=\"style.css\" />";
                  echo "</head>";
              
              
                  echo "<body>";
                    echo "<title>Error Browser</title>";
                    echo "<p align=\"center\">";
                    echo "Your browser is not a mobile phone<br/>";
                    echo "<a href=\"index.php\">Home</a>";
                    echo "</p>";
                    echo "</body>";
                    echo "</html>";
                    exit();
              }
              if (eregi("crazy browser", $agent))
               {
              echo "<head>";
              
                  
                  echo "<link rel=\"StyleSheet\" type=\"text/css\" href=\"style.css\" />";
                  echo "</head>";
              
              
                  echo "<body>";
                    echo "<title>Error Browser</title>";
                    echo "<p align=\"center\">";
                    echo "Your browser is not a mobile phone<br/>";
                    echo "<a href=\"index.php\">Home</a>";
                    echo "</p>";
                    echo "</body>";
                    echo "</html>";
                    exit();
              }
              if (eregi("internet browser", $agent))
               {
              echo "<head>";
              
                  
                  echo "<link rel=\"StyleSheet\" type=\"text/css\" href=\"style.css\" />";
                  echo "</head>";
              
              
                  echo "<body>";
                    echo "<title>Error Browser</title>";
                    echo "<p align=\"center\">";
                    echo "Your browser is not a mobile phone<br/>";
                    echo "<a href=\"index.php\">Home</a>";
                    echo "</p>";
                    echo "</body>";
                    echo "</html>";
                    exit();
              }
              $uid = getuid_sid($sid);
               if(islogged($sid)==false)
                  {
              echo "<head>";
              
                  
                  echo "<link rel=\"StyleSheet\" type=\"text/css\" href=\"style.css\" />";
                  echo "</head>";
              
                  echo "<body>";
                    echo "<title>Session error</title>";
                    echo "<p align=\"center\">";
                    echo "You are not logged in<br/>";
                    echo "Or<br/>Your session has been expired<br/><br/>";
                    echo "<a href=\"index.php\">Home</a>";
                    echo "</p>";
                    echo "</body>";
                    echo "</html>";
                    exit();
                  }
              $tid = getfile($did);
                if($tid==0)
                  {
              echo "<head>";
              
                  
                  echo "<link rel=\"StyleSheet\" type=\"text/css\" href=\"style.css\" />";
                  echo "</head>";
              
                  echo "<body>";
                    echo "<title>Error File</title>";
                    echo "<p align=\"center\">";
                    echo "File has been deleted or not in our database.<br/>";
                    echo "<a href=\"index.php\">Home</a>";
                    echo "</p>";
                    echo "</body>";
                    echo "</html>";
                    exit();
                  }
              $res = mysql_fetch_array(mysql_query("SELECT itemurl, title, id, mime FROM ibwf_vault WHERE id='".$did."'"));
              if (file_exists("./pkfiles/".$res[0])) {
                  $fh = fopen ("./pkfiles/".$res[0],r);
                  $thisline= explode('|', fgets($fh));
                      $validdownload=$thisline;
                  fclose($fh);
              }
              if($validdownload==0) 
              {
              echo "<head>";    
                  echo "<link rel=\"StyleSheet\" type=\"text/css\" href=\"style.css\" />";
                  echo "</head>";
              
              
                  echo "<body>";
                    echo "<title>Error file</title>";
                    echo "<p align=\"center\">";
                    echo "File has been deleted or not in our database.<br/>";
                    echo "<a href=\"index.php\">Home</a>";
                    echo "</p>";
                    echo "</body>";
                    echo "</html>";
                    exit();
                  }
              mysql_query("UPDATE ibwf_vault SET downloads=downloads+'1' WHERE id='".$did."'");
              $res = mysql_fetch_array(mysql_query("SELECT itemurl, title, id, mime, uid FROM ibwf_vault WHERE id='".$did."'"));
              $res2 = $res[0];
              mysql_query("UPDATE ibwf_users SET plusses=plusses+'5' WHERE id='".$res[4]."'");
              mysql_query("UPDATE ibwf_users SET plusses=plusses-'5' WHERE id='".$uid."'");
              header("Location: http://wap.net.ph/pkfiles/$res2");
              ?>

              download.php

              PHP Code:
              <?php
              include("config.php");
              include("core.php");
              
              
              header("Content-type: text/html; charset=ISO-8859-1");
              echo "<?xml version=\"1.0\" encoding=\"ISO-8859-1\" ?>";
              echo "<!DOCTYPE html PUBLIC \"-//WAPFORUM//DTD XHTML Mobile 1.0//EN\"\"http://www.wapforum.org/DTD/xhtml-mobile10.dtd\">";
              echo "<html xmlns=\"http://www.w3.org/1999/xhtml\">";
              
                  echo "<head>";
              
                  echo "<title>pinoyaztig.net</title>";
                  echo "<link rel=\"StyleSheet\" type=\"text/css\" href=\"style/style.css\" />";
                  echo "</head>";
              
                  echo "<body>";
              connectdb();
              
              
              $action = $_GET["action"];
              $sid = $_GET["sid"];
              $page = $_GET["page"];
              $did = $_GET["did"];
              if($action != "")
              {
                  if(islogged($sid)==false)
                  {
                    echo "<card id=\"main\" title=\"pinoyaztig.net\">";
                    echo "<p align=\"center\">";
                    echo "You are not logged in<br/>";
                    echo "Or<br/>Your session has been expired<br/><br/>";
                    echo "<a href=\"index.php\">Login</a>";
                    echo "</p>";
                    echo "</card>";
                    echo "</wml>";
                    exit();
                  }
              }
              if(isbanned($uid))
                  {
                      echo "<card id=\"main\" title=\"pinoyaztig.net\">";
                    echo "<p align=\"center\">";
                    echo "<img src=\"images/notok.gif\" alt=\"x\"/><br/>";
                    echo "You are <b>Banned</b><br/>";
                    $banto = mysql_fetch_array(mysql_query("SELECT timeto FROM ibwf_penalties WHERE uid='".$uid."' AND penalty='1'"));
                    $remain = $banto[0]- time();
                    $rmsg = gettimemsg($remain);
                    echo "Time to finish your penalty: $rmsg<br/><br/>";
                    //echo "<a href=\"index.php\">Login</a>";
                    echo "</p>";
                    echo "</card>";
                    echo "</wml>";
                    exit();
                  }
              
              //////////////////////////////////Buddies
              
              else if($action=="symbian")
              {
                  $who = $_GET["who"];
                  addonline(getuid_sid($sid),"Symbian Application","");
                  echo "<card id=\"main\" title=\"Symbian Application\">";
                  $uid = getuid_sid($sid);
              
              
              
                  //////ALL LISTS SCRIPT <<
              
                  if($page=="" || $page<=0)$page=1;
                  if($did="1")
                  {
                  $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_vault WHERE did='1'"));
                  }else{
                  $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_vault WHERE uid='".$who."'"));
                  }
                  $num_items = $noi[0]; //changable
                  $items_per_page= 10;
                  $num_pages = ceil($num_items/$items_per_page);
                  if(($page>$num_pages)&&$page!=1)$page= $num_pages;
                  $limit_start = ($page-1)*$items_per_page;
              
              
                  if($who!="")
                  {
                      $sql = "SELECT id, title, itemurl, did FROM ibwf_vault WHERE uid='".$who."' ORDER BY pudt DESC LIMIT $limit_start, $items_per_page";
                      }else{
                    $sql = "SELECT id, title, itemurl, uid, did FROM ibwf_vault WHERE did='".$did."' ORDER BY pudt DESC LIMIT $limit_start, $items_per_page";
                      }
              
              
              
                  echo "<p>";
                  $items = mysql_query($sql);
                  echo mysql_error();
                  if(mysql_num_rows($items)>0)
                  {
                  while ($item = mysql_fetch_array($items))
                  {
                    $ext = getext($item[2]);
                      $ime = getextimg($ext);
                      $lnk = "<a href=\"downloads.php?action=download&amp;sid=$sid&amp;did=$item[0]\">$ime".htmlspecialchars($item[2])."</a>";
              
                    if(candelvl($uid, $item[0]))
                    {
                      $delnk = "<a href=\"genproc.php?action=delvlt&amp;sid=$sid&amp;did=$item[0]\">[x]</a>";
                    }else{
                      $delnk = "";
                    }
                    if($who!="")
                    {
                      $byusr="";
                    }else{
                      $unick = getnick_uid($item[3]);
                      $ulnk = "<a href=\"index.php?action=viewuser&amp;sid=$sid&amp;who=$item[3]\">$unick</a>";
                      $byusr = "<br/>By: $ulnk";
                    }
                    echo "$lnk $byusr $delnk<br/>";
              
              
                  }
                  }
                  echo "</p>";
                  echo "<p align=\"center\">";
                  if($page>1)
                  {
                    $ppage = $page-1;
                    echo "<a href=\"downloads.php?action=$action&amp;page=$ppage&amp;sid=$sid&amp;who=$who\">«PREV</a> ";
                  }
                  if($page<$num_pages)
                  {
                    $npage = $page+1;
                    echo "<a href=\"downloads.php?action=$action&amp;page=$npage&amp;sid=$sid&amp;who=$who\">Next»</a>";
                  }
                  echo "<br/>$page/$num_pages<br/>";
                  if($num_pages>2)
                  {
                    $rets = "Jump to page: <input name=\"pg\" format=\"*N\" size=\"3\"/>";
                      $rets .= "<anchor>[GO]";
                      $rets .= "<go href=\"downloads.php?type=send\" method=\"get\">";
                      $rets .= "<postfield name=\"action\" value=\"$action\"/>";
                      $rets .= "<postfield name=\"who\" value=\"$who\"/>";
                      $rets .= "<postfield name=\"sid\" value=\"$sid\"/>";
                      $rets .= "<postfield name=\"page\" value=\"$(pg)\"/>";
                      $rets .= "</go></anchor>";
              
                      echo $rets;
                  }
                  echo "</p>";
                ////// UNTILL HERE >>
                  echo "<p align=\"center\">";
                  if($uid==$who && getplusses($uid)>25)
                  {
                  echo "<a href=\"up.php?action=themes&amp;sid=$sid\">";
              echo "Add Item</a><br/>";
              }
              if($who!="")
              {
              echo "<a href=\"index.php?action=viewuser&amp;sid=$sid&amp;who=$who\">";
              $whonick = getnick_uid($who);
              echo "$whonick's Profile</a><br/>";
              }else{
              echo "<a href=\"index.php?action=vault&amp;sid=$sid\">";
              echo "Downloads</a><br/>";
              }
                  echo "<a href=\"index.php?action=main&amp;sid=$sid\">";
              echo "Main menu</a>";
                echo "</p>";
                  echo "</card>";
              }
              
              
              //////////////////////////////////Buddies
              
              else if($action=="java")
              {
                  $who = $_GET["who"];
                  addonline(getuid_sid($sid),"Java Application","");
                  echo "<card id=\"main\" title=\"Java Application\">";
                  $uid = getuid_sid($sid);
              
              
              
                  //////ALL LISTS SCRIPT <<
              
                  if($page=="" || $page<=0)$page=1;
                  if($did="2")
                  {
                  $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_vault WHERE did='2'"));
                  }else{
                  $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_vault WHERE uid='".$who."'"));
                  }
                  $num_items = $noi[0]; //changable
                  $items_per_page= 10;
                  $num_pages = ceil($num_items/$items_per_page);
                  if(($page>$num_pages)&&$page!=1)$page= $num_pages;
                  $limit_start = ($page-1)*$items_per_page;
              
              
                  if($who!="")
                  {
                      $sql = "SELECT id, title, itemurl, did FROM ibwf_vault WHERE uid='".$who."' ORDER BY pudt DESC LIMIT $limit_start, $items_per_page";
                      }else{
                    $sql = "SELECT id, title, itemurl, uid, did FROM ibwf_vault WHERE did='".$did."' ORDER BY pudt DESC LIMIT $limit_start, $items_per_page";
                      }
              
              
              
                  echo "<p>";
                  $items = mysql_query($sql);
                  echo mysql_error();
                  if(mysql_num_rows($items)>0)
                  {
                  while ($item = mysql_fetch_array($items))
                  {
                    $ext = getext($item[2]);
                      $ime = getextimg($ext);
                      $lnk = "<a href=\"downloads.php?action=download&amp;sid=$sid&amp;did=$item[0]\">$ime".htmlspecialchars($item[2])."</a>";
              
                    if(candelvl($uid, $item[0]))
                    {
                      $delnk = "<a href=\"genproc.php?action=delvlt&amp;sid=$sid&amp;did=$item[0]\">[x]</a>";
                    }else{
                      $delnk = "";
                    }
                    if($who!="")
                    {
                      $byusr="";
                    }else{
                      $unick = getnick_uid($item[3]);
                      $ulnk = "<a href=\"index.php?action=viewuser&amp;sid=$sid&amp;who=$item[3]\">$unick</a>";
                      $byusr = "<br/>By: $ulnk";
                    }
                    echo "$lnk $byusr $delnk<br/>";
              
              
                  }
                  }
                  echo "</p>";
                  echo "<p align=\"center\">";
                  if($page>1)
                  {
                    $ppage = $page-1;
                    echo "<a href=\"downloads.php?action=$action&amp;page=$ppage&amp;sid=$sid&amp;who=$who\">«PREV</a> ";
                  }
                  if($page<$num_pages)
                  {
                    $npage = $page+1;
                    echo "<a href=\"downloads.php?action=$action&amp;page=$npage&amp;sid=$sid&amp;who=$who\">Next»</a>";
                  }
                  echo "<br/>$page/$num_pages<br/>";
                  if($num_pages>2)
                  {
                    $rets = "Jump to page: <input name=\"pg\" format=\"*N\" size=\"3\"/>";
                      $rets .= "<anchor>[GO]";
                      $rets .= "<go href=\"downloads.php?type=send\" method=\"get\">";
                      $rets .= "<postfield name=\"action\" value=\"$action\"/>";
                      $rets .= "<postfield name=\"who\" value=\"$who\"/>";
                      $rets .= "<postfield name=\"sid\" value=\"$sid\"/>";
                      $rets .= "<postfield name=\"page\" value=\"$(pg)\"/>";
                      $rets .= "</go></anchor>";
              
                      echo $rets;
                  }
                  echo "</p>";
                ////// UNTILL HERE >>
                  echo "<p align=\"center\">";
                  if($uid==$who && getplusses($uid)>25)
                  {
                  echo "<a href=\"up.php?action=themes&amp;sid=$sid\">";
              echo "Add Item</a><br/>";
              }
              if($who!="")
              {
              echo "<a href=\"index.php?action=viewuser&amp;sid=$sid&amp;who=$who\">";
              $whonick = getnick_uid($who);
              echo "$whonick's Profile</a><br/>";
              }else{
              echo "<a href=\"index.php?action=vault&amp;sid=$sid\">";
              echo "Downloads</a><br/>";
              }
                  echo "<a href=\"index.php?action=main&amp;sid=$sid\">";
              echo "Main menu</a>";
                echo "</p>";
                  echo "</card>";
              }
              
              
              //////////////////////////////////Buddies
              
              else if($action=="antivirus")
              {
                  $who = $_GET["who"];
                  addonline(getuid_sid($sid),"Anti Vitus","");
                  echo "<card id=\"main\" title=\"Anti Virus\">";
                  $uid = getuid_sid($sid);
              
              
              
                  //////ALL LISTS SCRIPT <<
              
                  if($page=="" || $page<=0)$page=1;
                  if($did="3")
                  {
                  $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_vault WHERE did='3'"));
                  }else{
                  $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_vault WHERE uid='".$who."'"));
                  }
                  $num_items = $noi[0]; //changable
                  $items_per_page= 10;
                  $num_pages = ceil($num_items/$items_per_page);
                  if(($page>$num_pages)&&$page!=1)$page= $num_pages;
                  $limit_start = ($page-1)*$items_per_page;
              
              
                  if($who!="")
                  {
                      $sql = "SELECT id, title, itemurl, did FROM ibwf_vault WHERE uid='".$who."' ORDER BY pudt DESC LIMIT $limit_start, $items_per_page";
                      }else{
                    $sql = "SELECT id, title, itemurl, uid, did FROM ibwf_vault WHERE did='".$did."' ORDER BY pudt DESC LIMIT $limit_start, $items_per_page";
                      }
              
              
              
                  echo "<p>";
                  $items = mysql_query($sql);
                  echo mysql_error();
                  if(mysql_num_rows($items)>0)
                  {
                  while ($item = mysql_fetch_array($items))
                  {
                    $ext = getext($item[2]);
                      $ime = getextimg($ext);
                      $lnk = "<a href=\"downloads.php?action=download&amp;sid=$sid&amp;did=$item[0]\">$ime".htmlspecialchars($item[2])."</a>";
              
                    if(candelvl($uid, $item[0]))
                    {
                      $delnk = "<a href=\"genproc.php?action=delvlt&amp;sid=$sid&amp;did=$item[0]\">[x]</a>";
                    }else{
                      $delnk = "";
                    }
                    if($who!="")
                    {
                      $byusr="";
                    }else{
                      $unick = getnick_uid($item[3]);
                      $ulnk = "<a href=\"index.php?action=viewuser&amp;sid=$sid&amp;who=$item[3]\">$unick</a>";
                      $byusr = "<br/>By: $ulnk";
                    }
                    echo "$lnk $byusr $delnk<br/>";
              
              
                  }
                  }
                  echo "</p>";
                  echo "<p align=\"center\">";
                  if($page>1)
                  {
                    $ppage = $page-1;
                    echo "<a href=\"downloads.php?action=$action&amp;page=$ppage&amp;sid=$sid&amp;who=$who\">«PREV</a> ";
                  }
                  if($page<$num_pages)
                  {
                    $npage = $page+1;
                    echo "<a href=\"downloads.php?action=$action&amp;page=$npage&amp;sid=$sid&amp;who=$who\">Next»</a>";
                  }
                  echo "<br/>$page/$num_pages<br/>";
                  if($num_pages>2)
                  {
                    $rets = "Jump to page: <input name=\"pg\" format=\"*N\" size=\"3\"/>";
                      $rets .= "<anchor>[GO]";
                      $rets .= "<go href=\"downloads.php?type=send\" method=\"get\">";
                      $rets .= "<postfield name=\"action\" value=\"$action\"/>";
                      $rets .= "<postfield name=\"who\" value=\"$who\"/>";
                      $rets .= "<postfield name=\"sid\" value=\"$sid\"/>";
                      $rets .= "<postfield name=\"page\" value=\"$(pg)\"/>";
                      $rets .= "</go></anchor>";
              
                      echo $rets;
                  }
                  echo "</p>";
                ////// UNTILL HERE >>
                  echo "<p align=\"center\">";
                  if($uid==$who && getplusses($uid)>25)
                  {
                  echo "<a href=\"up.php?action=themes&amp;sid=$sid\">";
              echo "Add Item</a><br/>";
              }
              if($who!="")
              {
              echo "<a href=\"index.php?action=viewuser&amp;sid=$sid&amp;who=$who\">";
              $whonick = getnick_uid($who);
              echo "$whonick's Profile</a><br/>";
              }else{
              echo "<a href=\"index.php?action=vault&amp;sid=$sid\">";
              echo "Downloads</a><br/>";
              }
                  echo "<a href=\"index.php?action=main&amp;sid=$sid\">";
              echo "Main menu</a>";
                echo "</p>";
                  echo "</card>";
              }
              
              
              //////////////////////////////////Buddies
              
              else if($action=="themes")
              {
                  $who = $_GET["who"];
                  addonline(getuid_sid($sid),"s40v2/s40v3 Themes","");
                  echo "<card id=\"main\" title=\"s40v2/s40v3 Themes\">";
                  $uid = getuid_sid($sid);
              
              
              
                  //////ALL LISTS SCRIPT <<
              
                  if($page=="" || $page<=0)$page=1;
                  if($did="4")
                  {
                  $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_vault WHERE did='4'"));
                  }else{
                  $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_vault WHERE uid='".$who."'"));
                  }
                  $num_items = $noi[0]; //changable
                  $items_per_page= 10;
                  $num_pages = ceil($num_items/$items_per_page);
                  if(($page>$num_pages)&&$page!=1)$page= $num_pages;
                  $limit_start = ($page-1)*$items_per_page;
              
              
                  if($who!="")
                  {
                      $sql = "SELECT id, title, itemurl, did FROM ibwf_vault WHERE uid='".$who."' ORDER BY pudt DESC LIMIT $limit_start, $items_per_page";
                      }else{
                    $sql = "SELECT id, title, itemurl, uid, did FROM ibwf_vault WHERE did='".$did."' ORDER BY pudt DESC LIMIT $limit_start, $items_per_page";
                      }
              
              
              
                  echo "<p>";
                  $items = mysql_query($sql);
                  echo mysql_error();
                  if(mysql_num_rows($items)>0)
                  {
                  while ($item = mysql_fetch_array($items))
                  {
                    $ext = getext($item[2]);
                      $ime = getextimg($ext);
                      $lnk = "<a href=\"downloads.php?action=download&amp;sid=$sid&amp;did=$item[0]\">$ime".htmlspecialchars($item[2])."</a>";
              
                    if(candelvl($uid, $item[0]))
                    {
                      $delnk = "<a href=\"genproc.php?action=delvlt&amp;sid=$sid&amp;did=$item[0]\">[x]</a>";
                    }else{
                      $delnk = "";
                    }
                    if($who!="")
                    {
                      $byusr="";
                    }else{
                      $unick = getnick_uid($item[3]);
                      $ulnk = "<a href=\"index.php?action=viewuser&amp;sid=$sid&amp;who=$item[3]\">$unick</a>";
                      $byusr = "<br/>By: $ulnk";
                    }
                    echo "$lnk $byusr $delnk<br/>";
              
              
                  }
                  }
                  echo "</p>";
                  echo "<p align=\"center\">";
                  if($page>1)
                  {
                    $ppage = $page-1;
                    echo "<a href=\"downloads.php?action=$action&amp;page=$ppage&amp;sid=$sid&amp;who=$who\">«PREV</a> ";
                  }
                  if($page<$num_pages)
                  {
                    $npage = $page+1;
                    echo "<a href=\"downloads.php?action=$action&amp;page=$npage&amp;sid=$sid&amp;who=$who\">Next»</a>";
                  }
                  echo "<br/>$page/$num_pages<br/>";
                  if($num_pages>2)
                  {
                    $rets = "Jump to page: <input name=\"pg\" format=\"*N\" size=\"3\"/>";
                      $rets .= "<anchor>[GO]";
                      $rets .= "<go href=\"downloads.php?type=send\" method=\"get\">";
                      $rets .= "<postfield name=\"action\" value=\"$action\"/>";
                      $rets .= "<postfield name=\"who\" value=\"$who\"/>";
                      $rets .= "<postfield name=\"sid\" value=\"$sid\"/>";
                      $rets .= "<postfield name=\"page\" value=\"$(pg)\"/>";
                      $rets .= "</go></anchor>";
              
                      echo $rets;
                  }
                  echo "</p>";
                ////// UNTILL HERE >>
                  echo "<p align=\"center\">";
                  if($uid==$who && getplusses($uid)>25)
                  {
                  echo "<a href=\"up.php?action=themes&amp;sid=$sid\">";
              echo "Add Item</a><br/>";
              }
              if($who!="")
              {
              echo "<a href=\"index.php?action=viewuser&amp;sid=$sid&amp;who=$who\">";
              $whonick = getnick_uid($who);
              echo "$whonick's Profile</a><br/>";
              }else{
              echo "<a href=\"index.php?action=vault&amp;sid=$sid\">";
              echo "Downloads</a><br/>";
              }
                  echo "<a href=\"index.php?action=main&amp;sid=$sid\">";
              echo "Main menu</a>";
                echo "</p>";
                  echo "</card>";
              }
              
              
              //////////////////////////////////Buddies
              
              else if($action=="themes1")
              {
                  $who = $_GET["who"];
                  addonline(getuid_sid($sid),"s60/s60v3/Nseries-Themes","");
                  echo "<card id=\"main\" title=\"s60/s60v3/Nseries-Themes\">";
                  $uid = getuid_sid($sid);
              
              
              
                  //////ALL LISTS SCRIPT <<
              
                  if($page=="" || $page<=0)$page=1;
                  if($did="5")
                  {
                  $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_vault WHERE did='5'"));
                  }else{
                  $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_vault WHERE uid='".$who."'"));
                  }
                  $num_items = $noi[0]; //changable
                  $items_per_page= 10;
                  $num_pages = ceil($num_items/$items_per_page);
                  if(($page>$num_pages)&&$page!=1)$page= $num_pages;
                  $limit_start = ($page-1)*$items_per_page;
              
              
                  if($who!="")
                  {
                      $sql = "SELECT id, title, itemurl, did FROM ibwf_vault WHERE uid='".$who."' ORDER BY pudt DESC LIMIT $limit_start, $items_per_page";
                      }else{
                    $sql = "SELECT id, title, itemurl, uid, did FROM ibwf_vault WHERE did='".$did."' ORDER BY pudt DESC LIMIT $limit_start, $items_per_page";
                      }
              
              
              
                  echo "<p>";
                  $items = mysql_query($sql);
                  echo mysql_error();
                  if(mysql_num_rows($items)>0)
                  {
                  while ($item = mysql_fetch_array($items))
                  {
                    $ext = getext($item[2]);
                      $ime = getextimg($ext);
                      $lnk = "<a href=\"downloads.php?action=download&amp;sid=$sid&amp;did=$item[0]\">$ime".htmlspecialchars($item[2])."</a>";
              
                    if(candelvl($uid, $item[0]))
                    {
                      $delnk = "<a href=\"genproc.php?action=delvlt&amp;sid=$sid&amp;did=$item[0]\">[x]</a>";
                    }else{
                      $delnk = "";
                    }
                    if($who!="")
                    {
                      $byusr="";
                    }else{
                      $unick = getnick_uid($item[3]);
                      $ulnk = "<a href=\"index.php?action=viewuser&amp;sid=$sid&amp;who=$item[3]\">$unick</a>";
                      $byusr = "<br/>By: $ulnk";
                    }
                    echo "$lnk $byusr $delnk<br/>";
              
              
                  }
                  }
                  echo "</p>";
                  echo "<p align=\"center\">";
                  if($page>1)
                  {
                    $ppage = $page-1;
                    echo "<a href=\"downloads.php?action=$action&amp;page=$ppage&amp;sid=$sid&amp;who=$who\">«PREV</a> ";
                  }
                  if($page<$num_pages)
                  {
                    $npage = $page+1;
                    echo "<a href=\"downloads.php?action=$action&amp;page=$npage&amp;sid=$sid&amp;who=$who\">Next»</a>";
                  }
                  echo "<br/>$page/$num_pages<br/>";
                  if($num_pages>2)
                  {
                    $rets = "Jump to page: <input name=\"pg\" format=\"*N\" size=\"3\"/>";
                      $rets .= "<anchor>[GO]";
                      $rets .= "<go href=\"downloads.php?type=send\" method=\"get\">";
                      $rets .= "<postfield name=\"action\" value=\"$action\"/>";
                      $rets .= "<postfield name=\"who\" value=\"$who\"/>";
                      $rets .= "<postfield name=\"sid\" value=\"$sid\"/>";
                      $rets .= "<postfield name=\"page\" value=\"$(pg)\"/>";
                      $rets .= "</go></anchor>";
              
                      echo $rets;
                  }
                  echo "</p>";
                ////// UNTILL HERE >>
                  echo "<p align=\"center\">";
                  if($uid==$who && getplusses($uid)>25)
                  {
                  echo "<a href=\"up.php?action=themes&amp;sid=$sid\">";
              echo "Add Item</a><br/>";
              }
              if($who!="")
              {
              echo "<a href=\"index.php?action=viewuser&amp;sid=$sid&amp;who=$who\">";
              $whonick = getnick_uid($who);
              echo "$whonick's Profile</a><br/>";
              }else{
              echo "<a href=\"index.php?action=vault&amp;sid=$sid\">";
              echo "Downloads</a><br/>";
              }
                  echo "<a href=\"index.php?action=main&amp;sid=$sid\">";
              echo "Main menu</a>";
                echo "</p>";
                  echo "</card>";
              }
              
              
              //////////////////////////////////Buddies
              
              else if($action=="sethemes")
              {
                  $who = $_GET["who"];
                  addonline(getuid_sid($sid),"SE Themes","");
                  echo "<card id=\"main\" title=\"SE Themes\">";
                  $uid = getuid_sid($sid);
              
              
              
                  //////ALL LISTS SCRIPT <<
              
                  if($page=="" || $page<=0)$page=1;
                  if($did="6")
                  {
                  $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_vault WHERE did='6'"));
                  }else{
                  $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_vault WHERE uid='".$who."'"));
                  }
                  $num_items = $noi[0]; //changable
                  $items_per_page= 10;
                  $num_pages = ceil($num_items/$items_per_page);
                  if(($page>$num_pages)&&$page!=1)$page= $num_pages;
                  $limit_start = ($page-1)*$items_per_page;
              
                  if($who="")
                  {
                      $sql = "SELECT id, title, itemurl, did FROM ibwf_vault WHERE uid='".$who."' ORDER BY pudt DESC LIMIT $limit_start, $items_per_page";
                      }else{
              $sql = "SELECT id, title, itemurl, uid, did FROM ibwf_vault WHERE did='".$did."' ORDER BY did DESC LIMIT $limit_start, $items_per_page";
                      }
              
              
                  echo "<p>";
                  $items = mysql_query($sql);
                  echo mysql_error();
                  if(mysql_num_rows($items)>0)
                  {
                  while ($item = mysql_fetch_array($items))
                  {
                    $ext = getext($item[2]);
                      $ime = getextimg($ext);
                      $lnk = "<a href=\"downloads.php?action=download&amp;sid=$sid&amp;did=$item[0]\">$ime".htmlspecialchars($item[2])."</a>";
              
                    if(candelvl($uid, $item[0]))
                    {
                      $delnk = "<a href=\"genproc.php?action=delvlt&amp;sid=$sid&amp;did=$item[0]\">[x]</a>";
                    }else{
                      $delnk = "";
                    }
                    if($who!="")
                    {
                      $byusr="";
                    }else{
                      $unick = getnick_uid($item[3]);
                      $ulnk = "<a href=\"index.php?action=viewuser&amp;sid=$sid&amp;who=$item[3]\">$unick</a>";
                      $byusr = "<br/>By: $ulnk";
                    }
                    echo "$lnk $byusr $delnk<br/>";
              
              
                  }
                  }
                  echo "</p>";
                  echo "<p align=\"center\">";
                  if($page>1)
                  {
                    $ppage = $page-1;
                    echo "<a href=\"downloads.php?action=$action&amp;page=$ppage&amp;sid=$sid&amp;who=$who\">«PREV</a> ";
                  }
                  if($page<$num_pages)
                  {
                    $npage = $page+1;
                    echo "<a href=\"downloads.php?action=$action&amp;page=$npage&amp;sid=$sid&amp;who=$who\">Next»</a>";
                  }
                  echo "<br/>$page/$num_pages<br/>";
                  if($num_pages>2)
                  {
                    $rets = "Jump to page: <input name=\"pg\" format=\"*N\" size=\"3\"/>";
                      $rets .= "<anchor>[GO]";
                      $rets .= "<go href=\"downloads.php?type=send\" method=\"get\">";
                      $rets .= "<postfield name=\"action\" value=\"$action\"/>";
                      $rets .= "<postfield name=\"who\" value=\"$who\"/>";
                      $rets .= "<postfield name=\"sid\" value=\"$sid\"/>";
                      $rets .= "<postfield name=\"page\" value=\"$(pg)\"/>";
                      $rets .= "</go></anchor>";
              
                      echo $rets;
                  }
                  echo "</p>";
                ////// UNTILL HERE >>
                  echo "<p align=\"center\">";
                  if($uid==$who && getplusses($uid)>25)
                  {
                  echo "<a href=\"up.php?action=apps&amp;sid=$sid\">";
              echo "Add Item</a><br/>";
              }
              if($who!="")
              {
              echo "<a href=\"index.php?action=viewuser&amp;sid=$sid&amp;who=$who\">";
              $whonick = getnick_uid($who);
              echo "$whonick's Profile</a><br/>";
              }else{
              echo "<a href=\"index.php?action=vault&amp;sid=$sid\">";
              echo "Downloads</a><br/>";
              }
                  echo "<a href=\"index.php?action=main&amp;sid=$sid\">";
              echo "Main menu</a>";
                echo "</p>";
                  echo "</card>";
              }
              
              
              //////////////////////////////////Buddies
              
              else if($action=="games1")
              {
                  $who = $_GET["who"];
                  addonline(getuid_sid($sid),"s30/s40/s40v2 Games","");
                  echo "<card id=\"main\" title=\"s30/s40/s40v2 Games\">";
                  $uid = getuid_sid($sid);
              
              
              
                  //////ALL LISTS SCRIPT <<
              
                  if($page=="" || $page<=0)$page=1;
                  if($did="7")
                  {
                  $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_vault WHERE did='7'"));
                  }else{
                  $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_vault WHERE uid='".$who."'"));
                  }
                  $num_items = $noi[0]; //changable
                  $items_per_page= 10;
                  $num_pages = ceil($num_items/$items_per_page);
                  if(($page>$num_pages)&&$page!=1)$page= $num_pages;
                  $limit_start = ($page-1)*$items_per_page;
              
                  if($who!="")
                  {
                      $sql = "SELECT id, title, itemurl, did FROM ibwf_vault WHERE uid='".$who."' ORDER BY pudt DESC LIMIT $limit_start, $items_per_page";
                      }else{
              $sql = "SELECT id, title, itemurl, uid, did FROM ibwf_vault WHERE did='".$did."' ORDER BY did DESC LIMIT $limit_start, $items_per_page";
                      }
              
              
                  echo "<p>";
                  $items = mysql_query($sql);
                  echo mysql_error();
                  if(mysql_num_rows($items)>0)
                  {
                  while ($item = mysql_fetch_array($items))
                  {
                    $ext = getext($item[2]);
                      $ime = getextimg($ext);
                      $lnk = "<a href=\"downloads.php?action=download&amp;sid=$sid&amp;did=$item[0]\">$ime".htmlspecialchars($item[2])."</a>";
              
                    if(candelvl($uid, $item[0]))
                    {
                      $delnk = "<a href=\"genproc.php?action=delvlt&amp;sid=$sid&amp;did=$item[0]\">[x]</a>";
                    }else{
                      $delnk = "";
                    }
                    if($who!="")
                    {
                      $byusr="";
                    }else{
                      $unick = getnick_uid($item[3]);
                      $ulnk = "<a href=\"index.php?action=viewuser&amp;sid=$sid&amp;who=$item[3]\">$unick</a>";
                      $byusr = "<br/>By: $ulnk";
                    }
                    echo "$lnk $byusr $delnk<br/>";
              
              
                  }
                  }
                  echo "</p>";
                  echo "<p align=\"center\">";
                  if($page>1)
                  {
                    $ppage = $page-1;
                    echo "<a href=\"downloads.php?action=$action&amp;page=$ppage&amp;sid=$sid&amp;who=$who\">«PREV</a> ";
                  }
                  if($page<$num_pages)
                  {
                    $npage = $page+1;
                    echo "<a href=\"downloads.php?action=$action&amp;page=$npage&amp;sid=$sid&amp;who=$who\">Next»</a>";
                  }
                  echo "<br/>$page/$num_pages<br/>";
                  if($num_pages>2)
                  {
                    $rets = "Jump to page: <input name=\"pg\" format=\"*N\" size=\"3\"/>";
                      $rets .= "<anchor>[GO]";
                      $rets .= "<go href=\"downloads.php?type=send\" method=\"get\">";
                      $rets .= "<postfield name=\"action\" value=\"$action\"/>";
                      $rets .= "<postfield name=\"who\" value=\"$who\"/>";
                      $rets .= "<postfield name=\"sid\" value=\"$sid\"/>";
                      $rets .= "<postfield name=\"page\" value=\"$(pg)\"/>";
                      $rets .= "</go></anchor>";
              
                      echo $rets;
                  }
                  echo "</p>";
                ////// UNTILL HERE >>
                  echo "<p align=\"center\">";
                  if($uid==$who && getplusses($uid)>25)
                  {
                  echo "<a href=\"up.php?action=games1&amp;sid=$sid\">";
              echo "Add Item</a><br/>";
              }
              if($who!="")
              {
              echo "<a href=\"index.php?action=viewuser&amp;sid=$sid&amp;who=$who\">";
              $whonick = getnick_uid($who);
              echo "$whonick's Profile</a><br/>";
              }else{
              echo "<a href=\"index.php?action=vault&amp;sid=$sid\">";
              echo "Downloads</a><br/>";
              }
                  echo "<a href=\"index.php?action=main&amp;sid=$sid\">";
              echo "Main menu</a>";
                echo "</p>";
                  echo "</card>";
              }
              
              
              //////////////////////////////////Buddies
              
              else if($action=="games2")
              {
                  $who = $_GET["who"];
                  addonline(getuid_sid($sid),"s60/s60v3 Games","");
                  echo "<card id=\"main\" title=\"s60/s60v3 Games\">";
                  $uid = getuid_sid($sid);
              
              
              
                  //////ALL LISTS SCRIPT <<
              
                  if($page=="" || $page<=0)$page=1;
                  if($did="8")
                  {
                  $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_vault WHERE did='8'"));
                  }else{
                  $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_vault WHERE uid='".$who."'"));
                  }
                  $num_items = $noi[0]; //changable
                  $items_per_page= 10;
                  $num_pages = ceil($num_items/$items_per_page);
                  if(($page>$num_pages)&&$page!=1)$page= $num_pages;
                  $limit_start = ($page-1)*$items_per_page;
              
                  if($who!="")
                  {
                      $sql = "SELECT id, title, itemurl, did FROM ibwf_vault WHERE uid='".$who."' ORDER BY pudt DESC LIMIT $limit_start, $items_per_page";
                      }else{
              $sql = "SELECT id, title, itemurl, uid, did FROM ibwf_vault WHERE did='".$did."' ORDER BY did DESC LIMIT $limit_start, $items_per_page";
                      }
              
              
                  echo "<p>";
                  $items = mysql_query($sql);
                  echo mysql_error();
                  if(mysql_num_rows($items)>0)
                  {
                  while ($item = mysql_fetch_array($items))
                  {
                    $ext = getext($item[2]);
                      $ime = getextimg($ext);
                      $lnk = "<a href=\"downloads.php?action=download&amp;sid=$sid&amp;did=$item[0]\">$ime".htmlspecialchars($item[2])."</a>";
              
                    if(candelvl($uid, $item[0]))
                    {
                      $delnk = "<a href=\"genproc.php?action=delvlt&amp;sid=$sid&amp;did=$item[0]\">[x]</a>";
                    }else{
                      $delnk = "";
                    }
                    if($who!="")
                    {
                      $byusr="";
                    }else{
                      $unick = getnick_uid($item[3]);
                      $ulnk = "<a href=\"index.php?action=viewuser&amp;sid=$sid&amp;who=$item[3]\">$unick</a>";
                      $byusr = "<br/>By: $ulnk";
                    }
                    echo "$lnk $byusr $delnk<br/>";
              
              
                  }
                  }
                  echo "</p>";
                  echo "<p align=\"center\">";
                  if($page>1)
                  {
                    $ppage = $page-1;
                    echo "<a href=\"downloads.php?action=$action&amp;page=$ppage&amp;sid=$sid&amp;who=$who\">«PREV</a> ";
                  }
                  if($page<$num_pages)
                  {
                    $npage = $page+1;
                    echo "<a href=\"downloads.php?action=$action&amp;page=$npage&amp;sid=$sid&amp;who=$who\">Next»</a>";
                  }
                  echo "<br/>$page/$num_pages<br/>";
                  if($num_pages>2)
                  {
                    $rets = "Jump to page: <input name=\"pg\" format=\"*N\" size=\"3\"/>";
                      $rets .= "<anchor>[GO]";
                      $rets .= "<go href=\"downloads.php?type=send\" method=\"get\">";
                      $rets .= "<postfield name=\"action\" value=\"$action\"/>";
                      $rets .= "<postfield name=\"who\" value=\"$who\"/>";
                      $rets .= "<postfield name=\"sid\" value=\"$sid\"/>";
                      $rets .= "<postfield name=\"page\" value=\"$(pg)\"/>";
                      $rets .= "</go></anchor>";
              
                      echo $rets;
                  }
                  echo "</p>";
                ////// UNTILL HERE >>
                  echo "<p align=\"center\">";
                  if($uid==$who && getplusses($uid)>25)
                  {
                  echo "<a href=\"up.php?action=games2&amp;sid=$sid\">";
              echo "Add Item</a><br/>";
              }
              if($who!="")
              {
              echo "<a href=\"index.php?action=viewuser&amp;sid=$sid&amp;who=$who\">";
              $whonick = getnick_uid($who);
              echo "$whonick's Profile</a><br/>";
              }else{
              echo "<a href=\"index.php?action=vault&amp;sid=$sid\">";
              echo "Downloads</a><br/>";
              }
                  echo "<a href=\"index.php?action=main&amp;sid=$sid\">";
              echo "Main menu</a>";
                echo "</p>";
                  echo "</card>";
              }
              
              
              //////////////////////////////////Buddies
              
              else if($action=="games3")
              {
                  $who = $_GET["who"];
                  addonline(getuid_sid($sid),"Eseries/Ngage/Nseries Games","");
                  echo "<card id=\"main\" title=\"s60/Ngage/Nseries Games\">";
                  $uid = getuid_sid($sid);
              
              
              
                  //////ALL LISTS SCRIPT <<
              
                  if($page=="" || $page<=0)$page=1;
                  if($did="9")
                  {
                  $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_vault WHERE did='9'"));
                  }else{
                  $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_vault WHERE uid='".$who."'"));
                  }
                  $num_items = $noi[0]; //changable
                  $items_per_page= 10;
                  $num_pages = ceil($num_items/$items_per_page);
                  if(($page>$num_pages)&&$page!=1)$page= $num_pages;
                  $limit_start = ($page-1)*$items_per_page;
              
                  if($who!="")
                  {
                      $sql = "SELECT id, title, itemurl, did FROM ibwf_vault WHERE uid='".$who."' ORDER BY pudt DESC LIMIT $limit_start, $items_per_page";
                      }else{
              $sql = "SELECT id, title, itemurl, uid, did FROM ibwf_vault WHERE did='".$did."' ORDER BY did DESC LIMIT $limit_start, $items_per_page";
                      }
              
              
                  echo "<p>";
                  $items = mysql_query($sql);
                  echo mysql_error();
                  if(mysql_num_rows($items)>0)
                  {
                  while ($item = mysql_fetch_array($items))
                  {
                    $ext = getext($item[2]);
                      $ime = getextimg($ext);
                      $lnk = "<a href=\"downloads.php?action=download&amp;sid=$sid&amp;did=$item[0]\">$ime".htmlspecialchars($item[2])."</a>";
              
                    if(candelvl($uid, $item[0]))
                    {
                      $delnk = "<a href=\"genproc.php?action=delvlt&amp;sid=$sid&amp;did=$item[0]\">[x]</a>";
                    }else{
                      $delnk = "";
                    }
                    if($who!="")
                    {
                      $byusr="";
                    }else{
                      $unick = getnick_uid($item[3]);
                      $ulnk = "<a href=\"index.php?action=viewuser&amp;sid=$sid&amp;who=$item[3]\">$unick</a>";
                      $byusr = "<br/>By: $ulnk";
                    }
                    echo "$lnk $byusr $delnk<br/>";
              
              
                  }
                  }
                  echo "</p>";
                  echo "<p align=\"center\">";
                  if($page>1)
                  {
                    $ppage = $page-1;
                    echo "<a href=\"downloads.php?action=$action&amp;page=$ppage&amp;sid=$sid&amp;who=$who\">«PREV</a> ";
                  }
                  if($page<$num_pages)
                  {
                    $npage = $page+1;
                    echo "<a href=\"downloads.php?action=$action&amp;page=$npage&amp;sid=$sid&amp;who=$who\">Next»</a>";
                  }
                  echo "<br/>$page/$num_pages<br/>";
                  if($num_pages>2)
                  {
                    $rets = "Jump to page: <input name=\"pg\" format=\"*N\" size=\"3\"/>";
                      $rets .= "<anchor>[GO]";
                      $rets .= "<go href=\"downloads.php?type=send\" method=\"get\">";
                      $rets .= "<postfield name=\"action\" value=\"$action\"/>";
                      $rets .= "<postfield name=\"who\" value=\"$who\"/>";
                      $rets .= "<postfield name=\"sid\" value=\"$sid\"/>";
                      $rets .= "<postfield name=\"page\" value=\"$(pg)\"/>";
                      $rets .= "</go></anchor>";
              
                      echo $rets;
                  }
                  echo "</p>";
                ////// UNTILL HERE >>
                  echo "<p align=\"center\">";
                  if($uid==$who && getplusses($uid)>25)
                  {
                  echo "<a href=\"up.php?action=videos&amp;sid=$sid\">";
              echo "Add Item</a><br/>";
              }
              if($who!="")
              {
              echo "<a href=\"index.php?action=viewuser&amp;sid=$sid&amp;who=$who\">";
              $whonick = getnick_uid($who);
              echo "$whonick's Profile</a><br/>";
              }else{
              echo "<a href=\"index.php?action=vault&amp;sid=$sid\">";
              echo "Downloads</a><br/>";
              }
                  echo "<a href=\"index.php?action=main&amp;sid=$sid\">";
              echo "Main menu</a>";
                echo "</p>";
                  echo "</card>";
              }
              
              
              //////////////////////////////////Buddies
              
              else if($action=="segames")
              {
                  $who = $_GET["who"];
                  addonline(getuid_sid($sid),"SE Games","");
                  echo "<card id=\"main\" title=\"SE Games\">";
                  $uid = getuid_sid($sid);
              
              
              
                  //////ALL LISTS SCRIPT <<
              
                  if($page=="" || $page<=0)$page=1;
                  if($did="10")
                  {
                  $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_vault WHERE did='10'"));
                  }else{
                  $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_vault WHERE uid='".$who."'"));
                  }
                  $num_items = $noi[0]; //changable
                  $items_per_page= 10;
                  $num_pages = ceil($num_items/$items_per_page);
                  if(($page>$num_pages)&&$page!=1)$page= $num_pages;
                  $limit_start = ($page-1)*$items_per_page;
              
                  if($who!="")
                  {
                      $sql = "SELECT id, title, itemurl, did FROM ibwf_vault WHERE uid='".$who."' ORDER BY pudt DESC LIMIT $limit_start, $items_per_page";
                      }else{
              $sql = "SELECT id, title, itemurl, uid, did FROM ibwf_vault WHERE did='".$did."' ORDER BY did DESC LIMIT $limit_start, $items_per_page";
                      }
              
              
                  echo "<p>";
                  $items = mysql_query($sql);
                  echo mysql_error();
                  if(mysql_num_rows($items)>0)
                  {
                  while ($item = mysql_fetch_array($items))
                  {
                    $ext = getext($item[2]);
                      $ime = getextimg($ext);
                      $lnk = "<a href=\"downloads.php?action=download&amp;sid=$sid&amp;did=$item[0]\">$ime".htmlspecialchars($item[2])."</a>";
              
                    if(candelvl($uid, $item[0]))
                    {
                      $delnk = "<a href=\"genproc.php?action=delvlt&amp;sid=$sid&amp;did=$item[0]\">[x]</a>";
                    }else{
                      $delnk = "";
                    }
                    if($who!="")
                    {
                      $byusr="";
                    }else{
                      $unick = getnick_uid($item[3]);
                      $ulnk = "<a href=\"index.php?action=viewuser&amp;sid=$sid&amp;who=$item[3]\">$unick</a>";
                      $byusr = "<br/>By: $ulnk";
                    }
                    echo "$lnk $byusr $delnk<br/>";
              
              
                  }
                  }
                  echo "</p>";
                  echo "<p align=\"center\">";
                  if($page>1)
                  {
                    $ppage = $page-1;
                    echo "<a href=\"downloads.php?action=$action&amp;page=$ppage&amp;sid=$sid&amp;who=$who\">«PREV</a> ";
                  }
                  if($page<$num_pages)
                  {
                    $npage = $page+1;
                    echo "<a href=\"downloads.php?action=$action&amp;page=$npage&amp;sid=$sid&amp;who=$who\">Next»</a>";
                  }
                  echo "<br/>$page/$num_pages<br/>";
                  if($num_pages>2)
                  {
                    $rets = "Jump to page: <input name=\"pg\" format=\"*N\" size=\"3\"/>";
                      $rets .= "<anchor>[GO]";
                      $rets .= "<go href=\"downloads.php?type=send\" method=\"get\">";
                      $rets .= "<postfield name=\"action\" value=\"$action\"/>";
                      $rets .= "<postfield name=\"who\" value=\"$who\"/>";
                      $rets .= "<postfield name=\"sid\" value=\"$sid\"/>";
                      $rets .= "<postfield name=\"page\" value=\"$(pg)\"/>";
                      $rets .= "</go></anchor>";
              
                      echo $rets;
                  }
                  echo "</p>";
                ////// UNTILL HERE >>
                  echo "<p align=\"center\">";
                  if($uid==$who && getplusses($uid)>25)
                  {
                  echo "<a href=\"up.php?action=audio&amp;sid=$sid\">";
              echo "Add Item</a><br/>";
              }
              if($who!="")
              {
              echo "<a href=\"index.php?action=viewuser&amp;sid=$sid&amp;who=$who\">";
              $whonick = getnick_uid($who);
              echo "$whonick's Profile</a><br/>";
              }else{
              echo "<a href=\"index.php?action=vault&amp;sid=$sid\">";
              echo "Downloads</a><br/>";
              }
                  echo "<a href=\"index.php?action=main&amp;sid=$sid\">";
              echo "Main menu</a>";
                echo "</p>";
                  echo "</card>";
              }
              
              
              //////////////////////////////////Buddies
              
              else if($action=="mp3")
              {
                  $who = $_GET["who"];
                  addonline(getuid_sid($sid),"Full MP3","");
                  echo "<card id=\"main\" title=\"Full MP3\">";
                  $uid = getuid_sid($sid);
              
              
              
                  //////ALL LISTS SCRIPT <<
              
                  if($page=="" || $page<=0)$page=1;
                  if($did="11")
                  {
                  $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_vault WHERE did='11'"));
                  }else{
                  $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_vault WHERE uid='".$who."'"));
                  }
                  $num_items = $noi[0]; //changable
                  $items_per_page= 10;
                  $num_pages = ceil($num_items/$items_per_page);
                  if(($page>$num_pages)&&$page!=1)$page= $num_pages;
                  $limit_start = ($page-1)*$items_per_page;
              
                  if($who!="")
                  {
                      $sql = "SELECT id, title, itemurl, did FROM ibwf_vault WHERE uid='".$who."' ORDER BY pudt DESC LIMIT $limit_start, $items_per_page";
                      }else{
              $sql = "SELECT id, title, itemurl, uid, did FROM ibwf_vault WHERE did='".$did."' ORDER BY did DESC LIMIT $limit_start, $items_per_page";
                      }
              
              
                  echo "<p>";
                  $items = mysql_query($sql);
                  echo mysql_error();
                  if(mysql_num_rows($items)>0)
                  {
                  while ($item = mysql_fetch_array($items))
                  {
                    $ext = getext($item[2]);
                      $ime = getextimg($ext);
                      $lnk = "<a href=\"downloads.php?action=download&amp;sid=$sid&amp;did=$item[0]\">$ime".htmlspecialchars($item[2])."</a>";
              
                    if(candelvl($uid, $item[0]))
                    {
                      $delnk = "<a href=\"genproc.php?action=delvlt&amp;sid=$sid&amp;did=$item[0]\">[x]</a>";
                    }else{
                      $delnk = "";
                    }
                    if($who!="")
                    {
                      $byusr="";
                    }else{
                      $unick = getnick_uid($item[3]);
                      $ulnk = "<a href=\"index.php?action=viewuser&amp;sid=$sid&amp;who=$item[3]\">$unick</a>";
                      $byusr = "<br/>By: $ulnk";
                    }
                    echo "$lnk $byusr $delnk<br/>";
              
              
                  }
                  }
                  echo "</p>";
                  echo "<p align=\"center\">";
                  if($page>1)
                  {
                    $ppage = $page-1;
                    echo "<a href=\"downloads.php?action=$action&amp;page=$ppage&amp;sid=$sid&amp;who=$who\">«PREV</a> ";
                  }
                  if($page<$num_pages)
                  {
                    $npage = $page+1;
                    echo "<a href=\"downloads.php?action=$action&amp;page=$npage&amp;sid=$sid&amp;who=$who\">Next»</a>";
                  }
                  echo "<br/>$page/$num_pages<br/>";
                  if($num_pages>2)
                  {
                    $rets = "Jump to page: <input name=\"pg\" format=\"*N\" size=\"3\"/>";
                      $rets .= "<anchor>[GO]";
                      $rets .= "<go href=\"downloads.php?type=send\" method=\"get\">";
                      $rets .= "<postfield name=\"action\" value=\"$action\"/>";
                      $rets .= "<postfield name=\"who\" value=\"$who\"/>";
                      $rets .= "<postfield name=\"sid\" value=\"$sid\"/>";
                      $rets .= "<postfield name=\"page\" value=\"$(pg)\"/>";
                      $rets .= "</go></anchor>";
              
                      echo $rets;
                  }
                  echo "</p>";
                ////// UNTILL HERE >>
                  echo "<p align=\"center\">";
                  if($uid==$who && getplusses($uid)>25)
                  {
                  echo "<a href=\"up.php?action=wall&amp;sid=$sid\">";
              echo "Add Item</a><br/>";
              }
              if($who!="")
              {
              echo "<a href=\"index.php?action=viewuser&amp;sid=$sid&amp;who=$who\">";
              $whonick = getnick_uid($who);
              echo "$whonick's Profile</a><br/>";
              }else{
              echo "<a href=\"index.php?action=vault&amp;sid=$sid\">";
              echo "Downloads</a><br/>";
              }
                  echo "<a href=\"index.php?action=main&amp;sid=$sid\">";
              echo "Main menu</a>";
                echo "</p>";
                  echo "</card>";
              }
              
              
              //////////////////////////////////Buddies
              
              else if($action=="3gp")
              {
                  $who = $_GET["who"];
                  addonline(getuid_sid($sid),"3GP Videos","");
                  echo "<card id=\"main\" title=\"3GP Videos\">";
                  $uid = getuid_sid($sid);
              
              
              
                  //////ALL LISTS SCRIPT <<
              
                  if($page=="" || $page<=0)$page=1;
                  if($did="12")
                  {
                  $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_vault WHERE did='12'"));
                  }else{
                  $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_vault WHERE uid='".$who."'"));
                  }
                  $num_items = $noi[0]; //changable
                  $items_per_page= 10;
                  $num_pages = ceil($num_items/$items_per_page);
                  if(($page>$num_pages)&&$page!=1)$page= $num_pages;
                  $limit_start = ($page-1)*$items_per_page;
              
                  if($who!="")
                  {
                      $sql = "SELECT id, title, itemurl, did FROM ibwf_vault WHERE uid='".$who."' ORDER BY pudt DESC LIMIT $limit_start, $items_per_page";
                      }else{
              $sql = "SELECT id, title, itemurl, uid, did FROM ibwf_vault WHERE did='".$did."' ORDER BY pudt DESC LIMIT $limit_start, $items_per_page";
                      }
              
              
                  echo "<p>";
                  $items = mysql_query($sql);
                  echo mysql_error();
                  if(mysql_num_rows($items)>0)
                  {
                  while ($item = mysql_fetch_array($items))
                  {
                    $ext = getext($item[2]);
                      $ime = getextimg($ext);
                      $lnk = "<a href=\"downloads.php?action=download&amp;sid=$sid&amp;did=$item[0]\">$ime".htmlspecialchars($item[2])."</a>";
              
                    if(candelvl($uid, $item[0]))
                    {
                      $delnk = "<a href=\"genproc.php?action=delvlt&amp;sid=$sid&amp;did=$item[0]\">[x]</a>";
                    }else{
                      $delnk = "";
                    }
                    if($who!="")
                    {
                      $byusr="";
                    }else{
                      $unick = getnick_uid($item[3]);
                      $ulnk = "<a href=\"index.php?action=viewuser&amp;sid=$sid&amp;who=$item[3]\">$unick</a>";
                      $byusr = "<br/>By: $ulnk";
                    }
                    echo "$lnk $byusr $delnk<br/>";
              
              
                  }
                  }
                  echo "</p>";
                  echo "<p align=\"center\">";
                  if($page>1)
                  {
                    $ppage = $page-1;
                    echo "<a href=\"downloads.php?action=$action&amp;page=$ppage&amp;sid=$sid&amp;who=$who\">«PREV</a> ";
                  }
                  if($page<$num_pages)
                  {
                    $npage = $page+1;
                    echo "<a href=\"downloads.php?action=$action&amp;page=$npage&amp;sid=$sid&amp;who=$who\">Next»</a>";
                  }
                  echo "<br/>$page/$num_pages<br/>";
                  if($num_pages>2)
                  {
                    $rets = "Jump to page: <input name=\"pg\" format=\"*N\" size=\"3\"/>";
                      $rets .= "<anchor>[GO]";
                      $rets .= "<go href=\"downloads.php?type=send\" method=\"get\">";
                      $rets .= "<postfield name=\"action\" value=\"$action\"/>";
                      $rets .= "<postfield name=\"who\" value=\"$who\"/>";
                      $rets .= "<postfield name=\"sid\" value=\"$sid\"/>";
                      $rets .= "<postfield name=\"page\" value=\"$(pg)\"/>";
                      $rets .= "</go></anchor>";
              
                      echo $rets;
                  }
                  echo "</p>";
                ////// UNTILL HERE >>
                  echo "<p align=\"center\">";
                  if($uid==$who && getplusses($uid)>25)
                  {
                  echo "<a href=\"up.php?action=others&amp;sid=$sid\">";
              echo "Add Item</a><br/>";
              }
              if($who!="")
              {
              echo "<a href=\"index.php?action=viewuser&amp;sid=$sid&amp;who=$who\">";
              $whonick = getnick_uid($who);
              echo "$whonick's Profile</a><br/>";
              }else{
              echo "<a href=\"index.php?action=vault&amp;sid=$sid\">";
              echo "Downloads</a><br/>";
              }
                  echo "<a href=\"index.php?action=main&amp;sid=$sid\">";
              echo "Main menu</a>";
                echo "</p>";
                  echo "</card>";
              }
              
              
              //////////////////////////////////Buddies
              
              else if($action=="scandal")
              {
                  $who = $_GET["who"];
                  addonline(getuid_sid($sid),"Scandal","");
                  echo "<card id=\"main\" title=\"Scandal\">";
                  $uid = getuid_sid($sid);
              
              
              
                  //////ALL LISTS SCRIPT <<
              
                  if($page=="" || $page<=0)$page=1;
                  if($did="13")
                  {
                  $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_vault WHERE did='13'"));
                  }else{
                  $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_vault WHERE uid='".$who."'"));
                  }
                  $num_items = $noi[0]; //changable
                  $items_per_page= 10;
                  $num_pages = ceil($num_items/$items_per_page);
                  if(($page>$num_pages)&&$page!=1)$page= $num_pages;
                  $limit_start = ($page-1)*$items_per_page;
              
                  if($who!="")
                  {
                      $sql = "SELECT id, title, itemurl, did FROM ibwf_vault WHERE uid='".$who."' ORDER BY pudt DESC LIMIT $limit_start, $items_per_page";
                      }else{
              $sql = "SELECT id, title, itemurl, uid, did FROM ibwf_vault WHERE did='".$did."' ORDER BY did DESC LIMIT $limit_start, $items_per_page";
                      }
              
              
                  echo "<p>";
                  $items = mysql_query($sql);
                  echo mysql_error();
                  if(mysql_num_rows($items)>0)
                  {
                  while ($item = mysql_fetch_array($items))
                  {
                    $ext = getext($item[2]);
                      $ime = getextimg($ext);
                      $lnk = "<a href=\"downloads.php?action=download&amp;sid=$sid&amp;did=$item[0]\">$ime".htmlspecialchars($item[2])."</a>";
              
                    if(candelvl($uid, $item[0]))
                    {
                      $delnk = "<a href=\"genproc.php?action=delvlt&amp;sid=$sid&amp;did=$item[0]\">[x]</a>";
                    }else{
                      $delnk = "";
                    }
                    if($who!="")
                    {
                      $byusr="";
                    }else{
                      $unick = getnick_uid($item[3]);
                      $ulnk = "<a href=\"index.php?action=viewuser&amp;sid=$sid&amp;who=$item[3]\">$unick</a>";
                      $byusr = "<br/>By: $ulnk";
                    }
                    echo "$lnk $byusr $delnk<br/>";
              
              
                  }
                  }
                  echo "</p>";
                  echo "<p align=\"center\">";
                  if($page>1)
                  {
                    $ppage = $page-1;
                    echo "<a href=\"downloads.php?action=$action&amp;page=$ppage&amp;sid=$sid&amp;who=$who\">«PREV</a> ";
                  }
                  if($page<$num_pages)
                  {
                    $npage = $page+1;
                    echo "<a href=\"downloads.php?action=$action&amp;page=$npage&amp;sid=$sid&amp;who=$who\">Next»</a>";
                  }
                  echo "<br/>$page/$num_pages<br/>";
                  if($num_pages>2)
                  {
                    $rets = "Jump to page: <input name=\"pg\" format=\"*N\" size=\"3\"/>";
                      $rets .= "<anchor>[GO]";
                      $rets .= "<go href=\"downloads.php?type=send\" method=\"get\">";
                      $rets .= "<postfield name=\"action\" value=\"$action\"/>";
                      $rets .= "<postfield name=\"who\" value=\"$who\"/>";
                      $rets .= "<postfield name=\"sid\" value=\"$sid\"/>";
                      $rets .= "<postfield name=\"page\" value=\"$(pg)\"/>";
                      $rets .= "</go></anchor>";
              
                      echo $rets;
                  }
                  echo "</p>";
                ////// UNTILL HERE >>
                  echo "<p align=\"center\">";
                  if($uid==$who && getplusses($uid)>25)
                  {
                  echo "<a href=\"up.php?action=wall&amp;sid=$sid\">";
              echo "Add Item</a><br/>";
              }
              if($who!="")
              {
              echo "<a href=\"index.php?action=viewuser&amp;sid=$sid&amp;who=$who\">";
              $whonick = getnick_uid($who);
              echo "$whonick's Profile</a><br/>";
              }else{
              echo "<a href=\"index.php?action=vault&amp;sid=$sid\">";
              echo "Downloads</a><br/>";
              }
                  echo "<a href=\"index.php?action=main&amp;sid=$sid\">";
              echo "Main menu</a>";
                echo "</p>";
                  echo "</card>";
              }
              
              
              //////////////////////////////////Buddies
              
              else if($action=="gameboy")
              {
                  $who = $_GET["who"];
                  addonline(getuid_sid($sid),"Gameboy Games","");
                  echo "<card id=\"main\" title=\"Gameboy Games\">";
                  $uid = getuid_sid($sid);
              
              
              
                  //////ALL LISTS SCRIPT <<
              
                  if($page=="" || $page<=0)$page=1;
                  if($did="14")
                  {
                  $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_vault WHERE did='14'"));
                  }else{
                  $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_vault WHERE uid='".$who."'"));
                  }
                  $num_items = $noi[0]; //changable
                  $items_per_page= 10;
                  $num_pages = ceil($num_items/$items_per_page);
                  if(($page>$num_pages)&&$page!=1)$page= $num_pages;
                  $limit_start = ($page-1)*$items_per_page;
              
                  if($who!="")
                  {
                      $sql = "SELECT id, title, itemurl, did FROM ibwf_vault WHERE uid='".$who."' ORDER BY pudt DESC LIMIT $limit_start, $items_per_page";
                      }else{
              $sql = "SELECT id, title, itemurl, uid, did FROM ibwf_vault WHERE did='".$did."' ORDER BY did DESC LIMIT $limit_start, $items_per_page";
                      }
              
              
                  echo "<p>";
                  $items = mysql_query($sql);
                  echo mysql_error();
                  if(mysql_num_rows($items)>0)
                  {
                  while ($item = mysql_fetch_array($items))
                  {
                    $ext = getext($item[2]);
                      $ime = getextimg($ext);
                      $lnk = "<a href=\"downloads.php?action=download&amp;sid=$sid&amp;did=$item[0]\">$ime".htmlspecialchars($item[2])."</a>";
              
                    if(candelvl($uid, $item[0]))
                    {
                      $delnk = "<a href=\"genproc.php?action=delvlt&amp;sid=$sid&amp;did=$item[0]\">[x]</a>";
                    }else{
                      $delnk = "";
                    }
                    if($who!="")
                    {
                      $byusr="";
                    }else{
                      $unick = getnick_uid($item[3]);
                      $ulnk = "<a href=\"index.php?action=viewuser&amp;sid=$sid&amp;who=$item[3]\">$unick</a>";
                      $byusr = "<br/>By: $ulnk";
                    }
                    echo "$lnk $byusr $delnk<br/>";
              
              
                  }
                  }
                  echo "</p>";
                  echo "<p align=\"center\">";
                  if($page>1)
                  {
                    $ppage = $page-1;
                    echo "<a href=\"downloads.php?action=$action&amp;page=$ppage&amp;sid=$sid&amp;who=$who\">«PREV</a> ";
                  }
                  if($page<$num_pages)
                  {
                    $npage = $page+1;
                    echo "<a href=\"downloads.php?action=$action&amp;page=$npage&amp;sid=$sid&amp;who=$who\">Next»</a>";
                  }
                  echo "<br/>$page/$num_pages<br/>";
                  if($num_pages>2)
                  {
                    $rets = "Jump to page: <input name=\"pg\" format=\"*N\" size=\"3\"/>";
                      $rets .= "<anchor>[GO]";
                      $rets .= "<go href=\"downloads.php?type=send\" method=\"get\">";
                      $rets .= "<postfield name=\"action\" value=\"$action\"/>";
                      $rets .= "<postfield name=\"who\" value=\"$who\"/>";
                      $rets .= "<postfield name=\"sid\" value=\"$sid\"/>";
                      $rets .= "<postfield name=\"page\" value=\"$(pg)\"/>";
                      $rets .= "</go></anchor>";
              
                      echo $rets;
                  }
                  echo "</p>";
                ////// UNTILL HERE >>
                  echo "<p align=\"center\">";
                  if($uid==$who && getplusses($uid)>25)
                  {
                  echo "<a href=\"up.php?action=wall&amp;sid=$sid\">";
              echo "Add Item</a><br/>";
              }
              if($who!="")
              {
              echo "<a href=\"index.php?action=viewuser&amp;sid=$sid&amp;who=$who\">";
              $whonick = getnick_uid($who);
              echo "$whonick's Profile</a><br/>";
              }else{
              echo "<a href=\"index.php?action=vault&amp;sid=$sid\">";
              echo "Downloads</a><br/>";
              }
                  echo "<a href=\"index.php?action=main&amp;sid=$sid\">";
              echo "Main menu</a>";
                echo "</p>";
                  echo "</card>";
              }
              
              
              //////////////////////////////////Buddies
              
              else if($action=="naruto")
              {
                  $who = $_GET["who"];
                  addonline(getuid_sid($sid),"Naruto-Themes/Poly/MP3 ","");
                  echo "<card id=\"main\" title=\"Naruto-Themes/Poly/MP3 \">";
                  $uid = getuid_sid($sid);
              
              
              
                  //////ALL LISTS SCRIPT <<
              
                  if($page=="" || $page<=0)$page=1;
                  if($did="15")
                  {
                  $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_vault WHERE did='15'"));
                  }else{
                  $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_vault WHERE uid='".$who."'"));
                  }
                  $num_items = $noi[0]; //changable
                  $items_per_page= 10;
                  $num_pages = ceil($num_items/$items_per_page);
                  if(($page>$num_pages)&&$page!=1)$page= $num_pages;
                  $limit_start = ($page-1)*$items_per_page;
              
                  if($who!="")
                  {
                      $sql = "SELECT id, title, itemurl, did FROM ibwf_vault WHERE uid='".$who."' ORDER BY pudt DESC LIMIT $limit_start, $items_per_page";
                      }else{
              $sql = "SELECT id, title, itemurl, uid, did FROM ibwf_vault WHERE did='".$did."' ORDER BY did DESC LIMIT $limit_start, $items_per_page";
                      }
              
              
                  echo "<p>";
                  $items = mysql_query($sql);
                  echo mysql_error();
                  if(mysql_num_rows($items)>0)
                  {
                  while ($item = mysql_fetch_array($items))
                  {
                    $ext = getext($item[2]);
                      $ime = getextimg($ext);
                      $lnk = "<a href=\"downloads.php?action=download&amp;sid=$sid&amp;did=$item[0]\">$ime".htmlspecialchars($item[2])."</a>";
              
                    if(candelvl($uid, $item[0]))
                    {
                      $delnk = "<a href=\"genproc.php?action=delvlt&amp;sid=$sid&amp;did=$item[0]\">[x]</a>";
                    }else{
                      $delnk = "";
                    }
                    if($who!="")
                    {
                      $byusr="";
                    }else{
                      $unick = getnick_uid($item[3]);
                      $ulnk = "<a href=\"index.php?action=viewuser&amp;sid=$sid&amp;who=$item[3]\">$unick</a>";
                      $byusr = "<br/>By: $ulnk";
                    }
                    echo "$lnk $byusr $delnk<br/>";
              
              
                  }
                  }
                  echo "</p>";
                  echo "<p align=\"center\">";
                  if($page>1)
                  {
                    $ppage = $page-1;
                    echo "<a href=\"downloads.php?action=$action&amp;page=$ppage&amp;sid=$sid&amp;who=$who\">«PREV</a> ";
                  }
                  if($page<$num_pages)
                  {
                    $npage = $page+1;
                    echo "<a href=\"downloads.php?action=$action&amp;page=$npage&amp;sid=$sid&amp;who=$who\">Next»</a>";
                  }
                  echo "<br/>$page/$num_pages<br/>";
                  if($num_pages>2)
                  {
                    $rets = "Jump to page: <input name=\"pg\" format=\"*N\" size=\"3\"/>";
                      $rets .= "<anchor>[GO]";
                      $rets .= "<go href=\"downloads.php?type=send\" method=\"get\">";
                      $rets .= "<postfield name=\"action\" value=\"$action\"/>";
                      $rets .= "<postfield name=\"who\" value=\"$who\"/>";
                      $rets .= "<postfield name=\"sid\" value=\"$sid\"/>";
                      $rets .= "<postfield name=\"page\" value=\"$(pg)\"/>";
                      $rets .= "</go></anchor>";
              
                      echo $rets;
                  }
                  echo "</p>";
                ////// UNTILL HERE >>
                  echo "<p align=\"center\">";
                  if($uid==$who && getplusses($uid)>25)
                  {
                  echo "<a href=\"up.php?action=wall&amp;sid=$sid\">";
              echo "Add Item</a><br/>";
              }
              if($who!="")
              {
              echo "<a href=\"index.php?action=viewuser&amp;sid=$sid&amp;who=$who\">";
              $whonick = getnick_uid($who);
              echo "$whonick's Profile</a><br/>";
              }else{
              echo "<a href=\"index.php?action=vault&amp;sid=$sid\">";
              echo "Downloads</a><br/>";
              }
                  echo "<a href=\"index.php?action=main&amp;sid=$sid\">";
              echo "Main menu</a>";
                echo "</p>";
                  echo "</card>";
              }
              
              
              //////////////////////////////////Buddies
              
              else if($action=="poly")
              {
                  $who = $_GET["who"];
                  addonline(getuid_sid($sid),"MP3/MIDI/WAV/POLY/AMR/RAR ($noi[0])","");
                  echo "<card id=\"main\" title=\"MP3/MIDI/WAV/POLY/AMR/RAR ($noi[0])\">";
                  $uid = getuid_sid($sid);
              
              
              
                  //////ALL LISTS SCRIPT <<
              
                  if($page=="" || $page<=0)$page=1;
                  if($did="16")
                  {
                  $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_vault WHERE did='16'"));
                  }else{
                  $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_vault WHERE uid='".$who."'"));
                  }
                  $num_items = $noi[0]; //changable
                  $items_per_page= 10;
                  $num_pages = ceil($num_items/$items_per_page);
                  if(($page>$num_pages)&&$page!=1)$page= $num_pages;
                  $limit_start = ($page-1)*$items_per_page;
              
                  if($who!="")
                  {
                      $sql = "SELECT id, title, itemurl, did FROM ibwf_vault WHERE uid='".$who."' ORDER BY pudt DESC LIMIT $limit_start, $items_per_page";
                      }else{
              $sql = "SELECT id, title, itemurl, uid, did FROM ibwf_vault WHERE did='".$did."' ORDER BY did DESC LIMIT $limit_start, $items_per_page";
                      }
              
              
                  echo "<p>";
                  $items = mysql_query($sql);
                  echo mysql_error();
                  if(mysql_num_rows($items)>0)
                  {
                  while ($item = mysql_fetch_array($items))
                  {
                    $ext = getext($item[2]);
                      $ime = getextimg($ext);
                      $lnk = "<a href=\"downloads.php?action=download&amp;sid=$sid&amp;did=$item[0]\">$ime".htmlspecialchars($item[2])."</a>";
              
                    if(candelvl($uid, $item[0]))
                    {
                      $delnk = "<a href=\"genproc.php?action=delvlt&amp;sid=$sid&amp;did=$item[0]\">[x]</a>";
                    }else{
                      $delnk = "";
                    }
                    if($who!="")
                    {
                      $byusr="";
                    }else{
                      $unick = getnick_uid($item[3]);
                      $ulnk = "<a href=\"index.php?action=viewuser&amp;sid=$sid&amp;who=$item[3]\">$unick</a>";
                      $byusr = "<br/>By: $ulnk";
                    }
                    echo "$lnk $byusr $delnk<br/>";
              
              
                  }
                  }
                  echo "</p>";
                  echo "<p align=\"center\">";
                  if($page>1)
                  {
                    $ppage = $page-1;
                    echo "<a href=\"downloads.php?action=$action&amp;page=$ppage&amp;sid=$sid&amp;who=$who\">«PREV</a> ";
                  }
                  if($page<$num_pages)
                  {
                    $npage = $page+1;
                    echo "<a href=\"downloads.php?action=$action&amp;page=$npage&amp;sid=$sid&amp;who=$who\">Next»</a>";
                  }
                  echo "<br/>$page/$num_pages<br/>";
                  if($num_pages>2)
                  {
                    $rets = "Jump to page: <input name=\"pg\" format=\"*N\" size=\"3\"/>";
                      $rets .= "<anchor>[GO]";
                      $rets .= "<go href=\"downloads.php?type=send\" method=\"get\">";
                      $rets .= "<postfield name=\"action\" value=\"$action\"/>";
                      $rets .= "<postfield name=\"who\" value=\"$who\"/>";
                      $rets .= "<postfield name=\"sid\" value=\"$sid\"/>";
                      $rets .= "<postfield name=\"page\" value=\"$(pg)\"/>";
                      $rets .= "</go></anchor>";
              
                      echo $rets;
                  }
                  echo "</p>";
                ////// UNTILL HERE >>
                  echo "<p align=\"center\">";
                  if($uid==$who && getplusses($uid)>25)
                  {
                  echo "<a href=\"up.php?action=wall&amp;sid=$sid\">";
              echo "Add Item</a><br/>";
              }
              if($who!="")
              {
              echo "<a href=\"index.php?action=viewuser&amp;sid=$sid&amp;who=$who\">";
              $whonick = getnick_uid($who);
              echo "$whonick's Profile</a><br/>";
              }else{
              echo "<a href=\"index.php?action=vault&amp;sid=$sid\">";
              echo "Downloads</a><br/>";
              }
                  echo "<a href=\"index.php?action=main&amp;sid=$sid\">";
              echo "Main menu</a>";
                echo "</p>";
                  echo "</card>";
              }
              
              
              
              //////////////////////////////////Buddies
              
              else if($action=="logo")
              {
                  $who = $_GET["who"];
                  addonline(getuid_sid($sid),"Opera Software","");
                  echo "<card id=\"main\" title=\"Opera Software\">";
                  $uid = getuid_sid($sid);
              
              
              
                  //////ALL LISTS SCRIPT <<
              
                  if($page=="" || $page<=0)$page=1;
                  if($did="17")
                  {
                  $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_vault WHERE did='17'"));
                  }else{
                  $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_vault WHERE uid='".$who."'"));
                  }
                  $num_items = $noi[0]; //changable
                  $items_per_page= 10;
                  $num_pages = ceil($num_items/$items_per_page);
                  if(($page>$num_pages)&&$page!=1)$page= $num_pages;
                  $limit_start = ($page-1)*$items_per_page;
              
                  if($who!="")
                  {
                      $sql = "SELECT id, title, itemurl, did FROM ibwf_vault WHERE uid='".$who."' ORDER BY pudt DESC LIMIT $limit_start, $items_per_page";
                      }else{
              $sql = "SELECT id, title, itemurl, uid, did FROM ibwf_vault WHERE did='".$did."' ORDER BY did DESC LIMIT $limit_start, $items_per_page";
                      }
              
              
                  echo "<p>";
                  $items = mysql_query($sql);
                  echo mysql_error();
                  if(mysql_num_rows($items)>0)
                  {
                  while ($item = mysql_fetch_array($items))
                  {
                    $ext = getext($item[2]);
                      $ime = getextimg($ext);
                      $lnk = "<a href=\"downloads.php?action=download&amp;sid=$sid&amp;did=$item[0]\">$ime".htmlspecialchars($item[2])."</a>";
              
                    if(candelvl($uid, $item[0]))
                    {
                      $delnk = "<a href=\"genproc.php?action=delvlt&amp;sid=$sid&amp;did=$item[0]\">[x]</a>";
                    }else{
                      $delnk = "";
                    }
                    if($who!="")
                    {
                      $byusr="";
                    }else{
                      $unick = getnick_uid($item[3]);
                      $ulnk = "<a href=\"index.php?action=viewuser&amp;sid=$sid&amp;who=$item[3]\">$unick</a>";
                      $byusr = "<br/>By: $ulnk";
                    }
                    echo "$lnk $byusr $delnk<br/>";
              
              
                  }
                  }
                  echo "</p>";
                  echo "<p align=\"center\">";
                  if($page>1)
                  {
                    $ppage = $page-1;
                    echo "<a href=\"downloads.php?action=$action&amp;page=$ppage&amp;sid=$sid&amp;who=$who\">«PREV</a> ";
                  }
                  if($page<$num_pages)
                  {
                    $npage = $page+1;
                    echo "<a href=\"downloads.php?action=$action&amp;page=$npage&amp;sid=$sid&amp;who=$who\">Next»</a>";
                  }
                  echo "<br/>$page/$num_pages<br/>";
                  if($num_pages>2)
                  {
                    $rets = "Jump to page: <input name=\"pg\" format=\"*N\" size=\"3\"/>";
                      $rets .= "<anchor>[GO]";
                      $rets .= "<go href=\"downloads.php?type=send\" method=\"get\">";
                      $rets .= "<postfield name=\"action\" value=\"$action\"/>";
                      $rets .= "<postfield name=\"who\" value=\"$who\"/>";
                      $rets .= "<postfield name=\"sid\" value=\"$sid\"/>";
                      $rets .= "<postfield name=\"page\" value=\"$(pg)\"/>";
                      $rets .= "</go></anchor>";
              
                      echo $rets;
                  }
                  echo "</p>";
                ////// UNTILL HERE >>
                  echo "<p align=\"center\">";
                  if($uid==$who && getplusses($uid)>25)
                  {
                  echo "<a href=\"up.php?action=wall&amp;sid=$sid\">";
              echo "Add Item</a><br/>";
              }
              if($who!="")
              {
              echo "<a href=\"index.php?action=viewuser&amp;sid=$sid&amp;who=$who\">";
              $whonick = getnick_uid($who);
              echo "$whonick's Profile</a><br/>";
              }else{
              echo "<a href=\"index.php?action=vault&amp;sid=$sid\">";
              echo "Downloads</a><br/>";
              }
                  echo "<a href=\"index.php?action=main&amp;sid=$sid\">";
              echo "Main menu</a>";
                echo "</p>";
                  echo "</card>";
              }
              
              
              
              
              
              
              
              
              
              
              //////////////////////////////////Buddies
              
              else if($action=="download")
              {
                  $did = $_GET["did"];
               $uid = getuid_sid($sid);
                  addonline(getuid_sid($sid),"Downloading..","");
                  echo "<card id=\"main\" title=\"Downloading...\">";
              echo "<p align=\"left\">";
                  $uid = getuid_sid($sid);
              $item = mysql_fetch_array(mysql_query("SELECT id, title, itemurl, uid, did, downloads, pudt, filesize, mime, info FROM ibwf_vault WHERE id='".$did."'"));
              
                     $name = "Name: $item[1]";
              $desc= "Description: $item[9]";
               $downloads = "Download Times: $item[5]";
                      $filesize = "File Size: $item[7]";
               $mime = "File Type: $item[8]";
              $tmstamp = $item[6];
                $tmdt = date("d m Y - H:i:s", $tmstamp);
              $earns2 = "Download Cost: 5 plusses";
              
              
                      $dateadded1 = "Date Added: $dateadded";
              
                  if($who!="")
                    {
                      $byusr="";
                    }else{
                      $unick = getnick_uid($item[3]);
                      $ulnk = "<a href=\"index.php?action=viewuser&amp;sid=$sid&amp;who=$item[3]\">$unick</a>";
              
                    }
                     echo "$name<br/>$desc<br/>$filesize<br/>$mime<br/>Date Uploaded: $tmdt<br/>$earns2<br/>$downloads<br/>Uploaded by by: $ulnk<br/>";
                    echo "----<br/><a href=\"getnow.php?sid=$sid&amp;did=$item[0]\">Download now!</a><br/>";
              
                if(candelvl($uid, $item[0]))
                    {
                      $delnk = "<a href=\"genproc.php?action=delvlt&amp;sid=$sid&amp;did=$item[0]\">Delete</a><br/>";
                    }else{
                      $delnk = "";
                    }
              echo "$delnk";
              echo "<a href=\"index.php?action=vault&amp;sid=$sid\">";
              echo "Downloads</a><br/>";
                  echo "<a href=\"index.php?action=main&amp;sid=$sid\">";
              echo "Main menu</a>";
              
                echo "</p>";
                  echo "</card>";
              }
              ?>
              
              </HTML>
              LESS TALK. LESS MISTAKE.

              HTTP://APPSROB.COM - LIST OF MY FACEBOOK APPS!

              Comment


                #8
                Killer eyed pls..
                LESS TALK. LESS MISTAKE.

                HTTP://APPSROB.COM - LIST OF MY FACEBOOK APPS!

                Comment


                  #9
                  u didnt post the sql

                  Comment


                    #10
                    Originally posted by robzky View Post
                    hmm.. i think Via URL is the best than Via Device.. hmm..
                    Originally posted by riderz View Post
                    Not all phones support uploading via device so i would say device and url are the best
                    I agree, uploading via url also prevents your site from bein hacked..
                    Last edited by huwad; 30.08.09, 04:17.

                    Comment


                      #11
                      Originally posted by riderz View Post
                      u didnt post the sql
                      no, he's not sharing the script.,he need help..
                      My Blog: http://jhommark.blogspot.com
                      My Facebook: http://www.facebook.com/jhommark
                      My Official Site: http://www.undergroundweb.tk
                      My Community Site: http://undergroundwap.xtreemhost.com

                      Comment


                        #12
                        Originally posted by huwad View Post
                        I agree, uploading via url also prevents your site from bein hacked..
                        you can't say that..sites can also be hacked even on external urls or links..It depends on the security of the script..
                        My Blog: http://jhommark.blogspot.com
                        My Facebook: http://www.facebook.com/jhommark
                        My Official Site: http://www.undergroundweb.tk
                        My Community Site: http://undergroundwap.xtreemhost.com

                        Comment


                          #13
                          Originally posted by kiLLeR-eyEd_14 View Post
                          you can't say that..sites can also be hacked even on external urls or links..It depends on the security of the script..
                          yup.. sql injections use localhost.. upload via url prevent your site from backdoors.. ayt??

                          Comment


                            #14
                            Originally posted by huwad View Post
                            yup.. sql injections use localhost.. upload via url prevent your site from backdoors.. ayt??
                            there are also some dummy things done linking with a url..
                            My Blog: http://jhommark.blogspot.com
                            My Facebook: http://www.facebook.com/jhommark
                            My Official Site: http://www.undergroundweb.tk
                            My Community Site: http://undergroundwap.xtreemhost.com

                            Comment


                              #15
                              Originally posted by kiLLeR-eyEd_14 View Post
                              there are also some dummy things done linking with a url..
                              oh? whats that dummy things? can u name it? ahaha.. so remove your downloads if you are not confident with your download/upload script

                              Comment

                              Working...
                              X