read pm/ read pop ups

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

    read pm/ read pop ups

    hi my friends i got error in read pms and pop ups can some one tell me whats wrong with the code please

    Code:
    READ PMS
    
    <?php
    define('WCS',true);
    include('../core/main.inc');
    header_type();
    cleardata();
    if(ipbanned(ip(),browser())){
    if(!shield(getuid_sid($sid))){
    echo head_tag("Ip Blocked!!!",0,0);
    echo ipbanned_msg();
    echo foot_tag();
    exit();
    }
    }
    if(!islogged($sid)){
    echo head_tag("Error!!!",0,0);
    echo session_expired();
    echo foot_tag();
    exit();
    }
    if(banned(getuid_sid($sid))){
    echo head_tag("Error!!!",1,getnick_sid($sid));
    echo banned_msg($sid);
    echo foot_tag();
    exit();
    }
    if(inboxbanned(getuid_sid($sid))){
    echo head_tag("Error!!!",1,getnick_sid($sid));
    echo inboxbanned_msg($sid);
    echo foot_tag();
    exit();
    }
    if($pass!=""){$pw="&amp;pass=$pass";}
    if($rid!=""){
    $rooms=mysql_fetch_array(mysql_query("SELECT id, name FROM chatrooms WHERE id='".$rid."'"));
    $rname=$rooms[1];
    $chatlink="&amp;rid=$rid$pw";
    }
    mysql_query("UPDATE users SET browser='".browser()."', ipaddress='".ip()."', host='".subno()."' WHERE id='".getuid_sid($sid)."'");
    /////////////////////////////////////////////////////////////////////////////////////
    
    addonline(getuid_sid($sid),"Admin Tools","");
    echo head_tag(getnick_sid($sid)."@Admin Tools",1,getnick_sid($sid));
    $title="<b>Admin Tools</b>";
    $main="<p align=".align().">\n";
    $level=mysql_fetch_array(mysql_query("SELECT level FROM users WHERE id='".getuid_sid($sid)."'"));
    if($level[0]>4){
    
        
        $uid = getuid_sid($sid);
        if($page=="" || $page<=0)$page=1;
        $myid = getuid_sid($sid);
        $pms = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM inbox WHERE byid=$who AND toid=$uid) ORDER BY timesent"));
        echo mysql_error();
        $num_items = $pms[0]; //changable
        $items_per_page= 10;
        $num_pages = ceil($num_items/$items_per_page);
        if($page>$num_pages)$page= $num_pages;
        $limit_start = ($page-1)*$items_per_page;
        if($num_items>0)
        {
          
          $pms = mysql_query("SELECT byid, toid, text, timesent FROM inbox WHERE byid=$who ORDER BY timesent LIMIT $limit_start, $items_per_page");
          while($pm=mysql_fetch_array($pms))
          {
                if(isonline($pm[0]))
      {
        $onlby = "<img src=\"../phpThumb/phpThumb.php?src=../images/onl.gif\" alt=\"+\"/>";
      }else{
        $onlby = "<img src=\"../phpThumb/phpThumb.php?src=../images/ofl.gif\" alt=\"-\"/>";
      }
                if(isonline($pm[1]))
      {
        $onlto = "<img src=\"../phpThumb/phpThumb.php?src=../images/onl.gif\" alt=\"+\"/>";
      }else{
        $onlto = "<img src=\"../phpThumb/phpThumb.php?src=../images/ofl.gif\" alt=\"-\"/>";
      }
      $bylnk = "<a href=\"../profile.php?who=$pm[0]&amp;sid=$sid\">$onlby".getnick_uid($pm[0])."</a>";
      $tolnk = "<a href=\"../profile.php?who=$pm[1]&amp;sid=$sid\">$onlto".getnick_uid($pm[1])."</a>";
      $main.="$bylnk <img src=\"../phpThumb/phpThumb.php?src=../images/in.gif\" alt=\"-\"/> $tolnk";
      $tmopm = date("d m y - h:i:s",$pm[3]);
      $main.=" $tmopm<br/>";
    
        $pmtext=getbbcode($pm[2],$sid,1);
        $main.=$pmtext;
        $main.="<br/>--------------<br/>";
          }
          $main.="</p><p align=\"center\">";
          if($page>1)
        {
          $ppage = $page-1;
          $main.="<a href=\"readpms.php?type=tools&amp;page=$ppage&amp;sid=$sid&amp;who=$who\">«Prev</a> ";
        }
        if($page<$num_pages)
        {
          $npage = $page+1;
          $main.="<a href=\"readpms.php?type=tools&amp;page=$npage&amp;sid=$sid&amp;who=$who\">Next»</a>";
        }}
    
       if($num_pages<1){
        $main.="<p align=\"center\">";
        $main.="<img src=\"../phpThumb/phpThumb.php?src=../images/error.gif\" alt=\"-\"/>";
        $main.="Sorry No Pms Have Been Sent";
        }  
    
    
         if($num_pages>2)
         {
          $rets = "<form action=\"readpms.php\" method=\"get\">";
          $rets .= "<input name=\"page\" style=\"-wap-input-format: '*N'\" size=\"2\"/>";
          $rets .= "<input type=\"hidden\" name=\"action\" value=\"$action\">";
          $rets .= "<input type=\"hidden\" name=\"sid\" value=\"$sid\">";
          $rets .= "<input type=\"hidden\" name=\"who\" value=\"$who\">";
          $rets .= "<input type=\"Submit\" name=\"Submit\" Value=\"Go To Page\"></form>";
          $main.="$rets";
          }
    
    
        $main.="<br/>$page/$num_pages<br/>";
        
    
    
    $main.="<br/>
    $fivekey<a $key5 href=\"./tools.php?type=tools&amp;sid=$sid\">Back</a>
    </p>\n";
    }else{
    addonline(getuid_sid($sid),"In The Forbidden Zone!","");
    $main.="<img src=\"../images/error.gif\" alt=\"x\"/><br/>Permission Denied!<br/>
    <br/>
    $fivekey<a $key5 href=\"./tools.php?type=tools&amp;sid=$sid\">Back</a>
    </p>\n";
    }
    $L1="$sixkey<a $key6 href=\"../inbox/inbox.php?sid=$sid\">Inbox</a>";
    $L2="$sevenkey<a $key7 href=\"../buds/buds.php?sid=$sid\">BuddyList</a>";
    $L3="$eightkey<a $key8 href=\"../chat/public.php?sid=$sid\">Chat</a>";
    $L4="$ninekey<a $key9 href=\"../forums/forums.php?sid=$sid\">Forums</a>";
    $L5="$zerokey<a $key0 href=\"../main.php?sid=$sid\"><img src=\"../images/home.gif\" alt=\"\"/>Main Menu</a>";
    echo xhtml($sid,$title,1,$L1,$L2,$L3,$L4,$L5,0,0,0,$main);
    ?>
    THIS IS THE ERROR FOR READ PMS
    Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/spiceywa/public_html/admin/readpms.php on line 52
    You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND toid=2) ORDER BY timesent' at line 1
    AND THIS IS THE ERROR FOR READ POPUPS
    Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/spiceywa/public_html/admin/readpopups.php on line 39
    You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ORDER BY timesent' at line 1

    -
    Code:
    READ POP UPS
    <?php
    define('WCS',true);
    include('../core/main.inc');
    header_type();
    cleardata();
    if(ipbanned(ip(),browser())){
    if(!shield(getuid_sid($sid))){
    echo head_tag("Ip Blocked!!!",0,0);
    echo ipbanned_msg();
    echo foot_tag();
    exit();
    }
    }
    if(!islogged($sid)){
    echo head_tag("Error!!!",0,0);
    echo session_expired();
    echo foot_tag();
    exit();
    }
    if(banned(getuid_sid($sid))){
    echo head_tag("Error!!!",1,getnick_sid($sid));
    echo banned_msg($sid);
    echo foot_tag();
    exit();
    }
    mysql_query("UPDATE users SET browser='".browser()."', ipaddress='".ip()."', host='".subno()."' WHERE id='".getuid_sid($sid)."'");
    
    addonline(getuid_sid($sid),"Admin Tools","");
    echo head_tag(getnick_sid($sid)."@Admin Tools",1,getnick_sid($sid));
    $title="<b>Admin Tools</b>";
    $main="<p align=".align().">\n";
    $level=mysql_fetch_array(mysql_query("SELECT level FROM users WHERE id='".getuid_sid($sid)."'"));
    if($level[0]>4){
    
        
        $uid = getuid_sid($sid);
        if($page=="" || $page<=0)$page=1;
        $myid = getuid_sid($sid);
        $pms = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM popups WHERE byid=$who ORDER BY timesent"));
        echo mysql_error();
        $num_items = $pms[0]; //changable
        $items_per_page= 10;
        $num_pages = ceil($num_items/$items_per_page);
        if($page>$num_pages)$page= $num_pages;
        $limit_start = ($page-1)*$items_per_page;
        if($num_items>0)
        {
          
          $pms = mysql_query("SELECT byid, toid, text, timesent FROM popups WHERE byid=$who ORDER BY timesent LIMIT $limit_start, $items_per_page");
          while($pm=mysql_fetch_array($pms))
          {
                if(isonline($pm[0]))
      {
        $onlby = "<img src=\"../phpThumb/phpThumb.php?src=../images/onl.gif\" alt=\"+\"/>";
      }else{
        $onlby = "<img src=\"../phpThumb/phpThumb.php?src=../images/ofl.gif\" alt=\"-\"/>";
      }
                if(isonline($pm[1]))
      {
        $onlto = "<img src=\"../phpThumb/phpThumb.php?src=../images/onl.gif\" alt=\"+\"/>";
      }else{
        $onlto = "<img src=\"../phpThumb/phpThumb.php?src=../images/ofl.gif\" alt=\"-\"/>";
      }
      $bylnk = "<a href=\"../profile.php?who=$pm[0]&amp;sid=$sid\">$onlby".getnick_uid($pm[0])."</a>";
      $tolnk = "<a href=\"../profile.php?who=$pm[1]&amp;sid=$sid\">$onlto".getnick_uid($pm[1])."</a>";
      $main.="$bylnk <img src=\"../phpThumb/phpThumb.php?src=../images/in.gif\" alt=\"-\"/> $tolnk";
      $tmopm = date("d m y - h:i:s",$pm[3]);
      $main.=" $tmopm<br/>";
    
        $pmtext=getbbcode($pm[2],$sid,1);
        $main.=$pmtext;
        $main.="<br/>--------------<br/>";
          }
          $main.="</p><p align=\"center\">";
          if($page>1)
        {
          $ppage = $page-1;
          $main.="<a href=\"readpopups.php?type=tools&amp;page=$ppage&amp;sid=$sid&amp;who=$who\">«Prev</a> ";
        }
        if($page<$num_pages)
        {
          $npage = $page+1;
          $main.="<a href=\"readpopups.php?type=tools&amp;page=$npage&amp;sid=$sid&amp;who=$who\">Next»</a>";
        }}
    
       if($num_pages<1){
        $main.="<p align=\"center\">";
        $main.="<img src=\"../phpThumb/phpThumb.php?src=../images/error.gif\" alt=\"-\"/>";
        $main.="Sorry No Pop ups Have Been Sent";
        }  
    
    
        if($num_pages>2)
         {
          $rets = "<form action=\"readpopups.php\" method=\"get\">";
          $rets .= "<input name=\"page\" style=\"-wap-input-format: '*N'\" size=\"2\"/>";
          $rets .= "<input type=\"hidden\" name=\"action\" value=\"$action\">";
          $rets .= "<input type=\"hidden\" name=\"sid\" value=\"$sid\">";
          $rets .= "<input type=\"hidden\" name=\"who\" value=\"$who\">";
          $rets .= "<input type=\"Submit\" name=\"Submit\" Value=\"Go To Page\"></form>";
          $main.="$rets";
          }
    
    
        $main.="<br/>$page/$num_pages<br/>";
        
    
    
    $main.="<br/>
    $fivekey<a $key5 href=\"./tools.php?type=tools&amp;sid=$sid\">Back</a>
    </p>\n";
    }else{
    addonline(getuid_sid($sid),"In The Forbidden Zone!","");
    $main.="<img src=\"../images/error.gif\" alt=\"x\"/><br/>Permission Denied!<br/>
    <br/>
    $fivekey<a $key5 href=\"./tools.php?type=tools&amp;sid=$sid\">Back</a>
    </p>\n";
    }
    $L1="$sixkey<a $key6 href=\"../inbox/inbox.php?sid=$sid\">Inbox</a>";
    $L2="$sevenkey<a $key7 href=\"../buds/buds.php?sid=$sid\">BuddyList</a>";
    $L3="$eightkey<a $key8 href=\"../chat/public.php?sid=$sid\">Chat</a>";
    $L4="$ninekey<a $key9 href=\"../forums/forums.php?sid=$sid\">Forums</a>";
    $L5="$zerokey<a $key0 href=\"../main.php?sid=$sid\"><img src=\"../images/home.gif\" alt=\"\"/>Main Menu</a>";
    echo xhtml($sid,$title,1,$L1,$L2,$L3,$L4,$L5,0,0,0,$main);
    ?>
    THIS IS FOR WAPDESIRE V_2 SCRIPT

    thanks to any one that can help me fix this problem
    HELP THEM WHO HELPS YOU



    i only work on wapdesire v_2 coding only

    #2
    sounds to me like timesent is not a field in your inbox sql

    Comment

    Working...
    X