Methos Usergallery Help

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Methos Usergallery Help

    in user gallery comment page i cannot go to second page.i got error.plz help me to fix it.
    thankz in advance.

    Error
    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 '-5, 5' at line 1
    Code:
    Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/public_html/wap/web/usergallery.php on line 411
    comment php code.

    Code:
    else
    if($action=="comments")
    {
    
      addonline(getuid_sid($sid),"User Gallery","");
     echo "<head>";
          echo "<title>COMMENTS</title>";
          echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
          echo "</head>";
          echo "<body>";
      echo "<p align=\"center\">[size="1"]";
      echo "
    ";
      echo "[/size]</p>";
          //////ALL LISTS SCRIPT <<
    
        if($page=="" || $page<=0)$page=1;
        $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_usergallery_rating WHERE imageid=&#39;".$whoimage."&#39; and commentsyn =&#39;Y&#39;"));
        $num_items = $noi[0]; //changable
        $items_per_page= 5;
        $num_pages = ceil($num_items/$items_per_page);
        if(($page>$num_pages)&&$page!=1)$page= $num_pages;
        $limit_start = ($page-1)*$items_per_page;
        
        $uidinfo = mysql_fetch_array(mysql_query("SELECT uid FROM ibwf_usergallery WHERE id=&#39;".$whoimage."&#39;"));
        $uid = getuid_sid($sid);
    
        
        $sql = "SELECT rating, comments, byuid, time, commentsreply, id  FROM ibwf_usergallery_rating WHERE imageid =&#39;".$whoimage."&#39; and commentsyn =&#39;Y&#39; ORDER BY time DESC LIMIT $limit_start, $items_per_page";
    
    
        echo "
    
    ";
        $items = mysql_query($sql);
        echo mysql_error();
        if(mysql_num_rows($items)>0)
       {
        while ($item = mysql_fetch_array($items))
        {
            
        if(isonline($item[2]))
      {
        $iml = "<img src=\"images/onl.gif\" alt=\"+\"/>";
        
      }else{
        $iml = "<img src=\"images/ofl.gif\" alt=\"-\"/>";
      }
        if(strlen($item[1])>1){
             
          $snick = getnick_uid($item[2]);
          $lnk = "[size="1"]<a href=\"index.php?action=viewuser&amp;who=$item[2]&amp;sid=$sid\">$iml$snick:</a> [b]$item[0]/10[/b][/size]";
          echo "$lnk
    [size="1"]";
          $bs = date("d/m/y",$item[3]);
          $text = parsepm($item[1], $sid);
          if(($uid==$uidinfo[0]) and (strlen($item[4])<1))
          {
            $replylink = "<a href=\"usergallery.php?action=commentreply&amp;sid=$sid&amp;id=$item[5]\">Reply to Comment</a>
    [i]$bs[/i]";
          }else{
            $replylink = " [i]$bs[/i]";
          }
          echo "$text";
          if(strlen($item[4])>1)
          {
          $text1 = parsepm($item[4], $sid);
          echo "
    [b][i]Reply:[/i] $text1[/b]";
          }
          echo "
    $replylink
    
    ";
          echo "[/size]";
        }
        }
        }
        echo "</p>";
        echo "<p align=\"center\">";
        if($page>1)
        {
          $ppage = $page-1;
          echo "<a href=\"usergallery.php?action=$action&amp;page=$ppage&amp;sid=$sid&amp;who=$who\">«Prev</a> ";
        }
        if($page<$num_pages)
        {
          $npage = $page+1;
          echo "<a href=\"usergallery.php?action=$action&amp;page=$npage&amp;sid=$sid&amp;who=$who\">Next»</a>";
        }
        echo "
    $page/$num_pages
    ";
        if($num_pages>2)
        {
          $rets = "Jump to page<input name=\"pg\" format=\"*N\" size=\"3\"/>";
            $rets .= "<anchor>[GO]";
            $rets .= "<go href=\"usergallery.php\" 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\">";
       echo "
    
    <a href=\"usergallery.php?action=main&amp;sid=$sid\">«Back to Gallery</a>
    ";
       
      echo "
    <a href=\"index.php?action=main&amp;sid=$sid\"><img src=\"../images/home.gif\" alt=\"\"/>Home</a>";
      echo "</p>";
      echo "</body>";
    }
    <div align="center">My Web Community ......... http://pahasara.net



    </div>

    #2
    just change THIS:

    if($page>1)
    {
    $ppage = $page-1;
    echo "<a href=\"usergallery.php?action=$action&amp;page=$pp age&amp;sid=$sid&amp;who=$who\">«Prev</a> ";
    }
    if($page<$num_pages)
    {
    $npage = $page+1;
    echo "<a href=\"usergallery.php?action=$action&amp;page=$np age&amp;sid=$sid&amp;who=$who\">Next»</a>";
    }


    TO THIS:


    if($page>1)
    {
    $ppage = $page-1;
    echo "<a href=\"gallery.php?action=$action&amp;sid=$sid&amp ;page=$ppage&amp;whoimage=$whoimage\">« Prev</a> ";
    }
    echo " $page/$num_pages ";
    if($page<$num_pages)
    {
    $npage = $page+1;
    echo "<a href=\"gallery.php?action=$action&amp;sid=$sid&amp ;page=$npage&amp;whoimage=$whoimage\">Next »</a>";
    }

    Comment


      #3
      in user gallery comment page i cannot go to second page.i got error.plz help me to fix it.
      thankz in advance.

      Error
      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 &#39;-5, 5&#39; at line 1
      Code:
      Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/public_html/wap/web/usergallery.php on line 411
      comment php code.

      Code:
      else
      if($action=="comments")
      {
      
        addonline(getuid_sid($sid),"User Gallery","");
       echo "<head>";
            echo "<title>COMMENTS</title>";
            echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
            echo "</head>";
            echo "<body>";
      ...............
      .................
      ....................
      }
      [/b]
      i dont understand.. i might be wrong...
      but i dont know why have you posted your &#39;&#39;comment.php&#39;&#39;
      while you get mentioned in error line that problem is
      in &#39;&#39;usergallery.php&#39;&#39; ?
      It's better to keep your mouth shut and give the impression that you're stupid, than to open it and remove all doubt.
      ⓣⓗⓔ ⓠⓤⓘⓔⓣⓔⓡ ⓨⓞⓤ ⓑⓔ©ⓞⓜⓔ, ⓣⓗⓔ ⓜⓞⓡⓔ ⓨⓞⓤ ⓐⓡⓔ ⓐⓑⓛⓔ ⓣⓞ ⓗⓔⓐⓡ !
      ιη тнєσяу, тнє ρяα¢тι¢є ιѕ α яєѕυℓт σƒ тнє тнєσяу, вυт ιη ρяα¢тι¢є ιѕ тнє σρρσѕιтє.
      キノgんイノ刀g 4 ア乇ムc乇 ノ丂 レノズ乇 キucズノ刀g 4 √ノ尺gノ刀ノイリ!

      Comment


        #4
        just change THIS:

        if($page>1)
        {
        $ppage = $page-1;
        echo "<a href=\"usergallery.php?action=$action&amp;page=$pp age&amp;sid=$sid&amp;who=$who\">«Prev</a> ";
        }
        if($page<$num_pages)
        {
        $npage = $page+1;
        echo "<a href=\"usergallery.php?action=$action&amp;page=$np age&amp;sid=$sid&amp;who=$who\">Next»</a>";
        }
        TO THIS:
        if($page>1)
        {
        $ppage = $page-1;
        echo "<a href=\"gallery.php?action=$action&amp;sid=$sid&amp ;page=$ppage&amp;whoimage=$whoimage\">« Prev</a> ";
        }
        echo " $page/$num_pages ";
        if($page<$num_pages)
        {
        $npage = $page+1;
        echo "<a href=\"gallery.php?action=$action&amp;sid=$sid&amp ;page=$npage&amp;whoimage=$whoimage\">Next »</a>";
        }[/b]

        it wrkz bro..thnkz a lot .....
        <div align="center">My Web Community ......... http://pahasara.net



        </div>

        Comment


          #5
          shot, no problem. anything to help.

          Comment

          Working...
          X