Error In Gallery Comments

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

    Error In Gallery Comments

    can somebody plz help me in gallery comments. i m getting error in gallery comments if any user tries to delete his comments on gallery then they cant delete the comments given by other users in gallery.here it is the codings below.i m getting error like "I don't know how did you get into here but there's nothing to show" plz tell me. thanks
    ---------------------------------------------------------------------------------------

    else if($action=="comments")
    {
    $who = $_GET["who"];
    $gid = $_GET["gid"];
    addonline(getuid_sid($sid),"Viewing Photo Comments","");
    echo "<card id=\"main\" title=\"GALLERY\">";
    $uid = getuid_sid($sid);

    //////ALL LISTS SCRIPT <<

    if($page=="" || $page<=0)$page=1;
    $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM fun_galcomments WHERE pid=&#39;".$gid."&#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;


    $sql = "SELECT id, pid, text, byuser, time FROM fun_galcomments WHERE pid=&#39;".$gid."&#39; ORDER BY id 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[3]))
    {
    $iml = "<img src=\"images/onl.gif\" alt=\"+\"/>";

    }else{
    $iml = "<img src=\"images/ofl.gif\" alt=\"-\"/>";
    }
    $snick = getnick_uid($item[3]);
    $lnk = "<a href=\"index.php?action=viewuser&who=$item[3]&sid=$sid\">$iml$snick</a>:";
    $bs = date("d m y-H:i:s",$item[4]);
    echo "$lnk
    ";

    $me = getuid_sid($sid);
    if($who=="$me") {
    $can = "a";
    }else{
    $can = "b";
    }
    if(ismod($uid)||$can=="a")
    {
    $delnk = "<a href=\"modproc.php?action=delcmt&sid=$sid&id=$item[0]\">[x]</a>";
    }else{
    $delnk = "";
    }
    $text = parsepm($item[2], $sid);
    echo "$text $delnk
    ";
    echo "$bs";
    echo "
    ";
    echo "
    ";

    }
    }
    echo "</p>";
    echo "<p align=\"center\">";
    if($page>1)
    {
    $ppage = $page-1;
    echo "<a href=\"gallery.php?action=$action&page=$ppage&sid= $sid&who=$who&gid=$gid\">«PREV</a> ";
    }
    if($page<$num_pages)
    {
    $npage = $page+1;
    echo "<a href=\"gallery.php?action=$action&page=$npage&sid= $sid&who=$who&gid=$gid\">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=\"gallery.php\" method=\"get\">";
    $rets .= "<postfield name=\"action\" value=\"$action\"/>";
    $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\">";
    $me = getuid_sid($sid);
    if($me!="$who") {
    echo "<a href=\"gallery.php?action=addcomment&sid=$sid&who= $who&gid=$gid\">Add Comment</a>
    ";
    }
    echo "<a href=\"gallery.php?action=main&sid=$sid\">User Gallery</a>
    ";
    echo "<a href=\"index.php?action=main&sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>";
    echo "Home</a>";
    echo "</p>";
    echo "</card>";

    }
    else if($action=="addcomment")
    {
    $who = $_GET["who"];
    $gid = $_GET["gid"];
    addonline(getuid_sid($sid),"Adding Photo Comments","");
    echo "<card id=\"main\" title=\"GALLERY\">";
    $uid = getuid_sid($sid);
    $sql = "SELECT itemurl FROM fun_gallery WHERE id=&#39;".$gid."&#39;";

    echo "<p align=\"center\">";
    $items = mysql_query($sql);
    echo mysql_error();
    if(mysql_num_rows($items)>0)
    {
    while ($item = mysql_fetch_array($items))
    {

    $img = $item[0];

    $lnk = "<img src=\"max.php?filename=$img\" alt=\"$id\"/>
    ";

    echo "$lnk";
    echo "<go href=\"genproc.php?action=commentadd&sid=$sid&gid= $gid\" method=\"post\">";
    echo "<postfield name=\"text\" value=\"$(text)\"/>";
    echo "</go>";


    $vb = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM fun_prate WHERE uid=&#39;".$uid."&#39; AND pid=&#39;".$gid."&#39;"));
    if($vb[0]==0)
    {

    echo "Rate Photo: <select name=\"prate\">";
    echo "<option value=\"1\">1</option>";
    echo "<option value=\"2\">2</option>";
    echo "<option value=\"3\">3</option>";
    echo "<option value=\"4\">4</option>";
    echo "<option value=\"5\">5</option>";
    echo "<option value=\"6\">6</option>";
    echo "<option value=\"7\">7</option>";
    echo "<option value=\"8\">8</option>";
    echo "<option value=\"9\">9</option>";
    echo "<option value=\"10\">10</option>";
    echo "</select>
    ";

    }else{
    $rinfo = mysql_fetch_array(mysql_query("SELECT COUNT(*) as nofr, SUM(prate) as nofp FROM fun_prate WHERE pid=&#39;".$gid."&#39;"));
    $counts = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM fun_prate WHERE pid=&#39;".$gid."&#39;"));
    if($counts[0]>0) {
    $ther = $rinfo[1]/$rinfo[0];
    $rating = "Rating: $ther/$rinfo[1] (votes$counts[0])
    ";
    }else{
    $rating = "";
    }
    echo "$rating";
    }


    echo "Comment:
    ";
    echo "<input name=\"text\" maxlength=\"150\"/>
    ";
    echo "<anchor>Add";
    echo "<go href=\"genproc.php?action=commentadd&sid=$sid&gid= $gid\" method=\"post\">";
    echo "<postfield name=\"text\" value=\"$(text)\"/>";
    echo "</go></anchor>
    ";
    }
    }
    echo "<a href=\"gallery.php?action=main&sid=$sid\">User Gallery</a>
    ";

    echo "<a href=\"index.php?action=main&sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>";
    echo "Home</a>";
    echo "</p>";
    echo "</card>";

    }else{
    addonline(getuid_sid($sid),"Lost in user gallery lol","");

    echo "<card id=\"main\" title=\"GALLERY\">";
    echo "<p align=\"center\">";
    echo "I don&#39;t know how did you get into here, but there&#39;s nothing to show

    ";
    echo "<a href=\"gallery.php?action=main&sid=$sid\">User Gallery</a>
    ";
    echo "<a href=\"index.php?action=main&sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>";
    echo "Home</a>";
    echo "</p>";
    echo "</card>";
    }
    echo "</wml>";

    ?>
    sigpic

    WANT GOOD CHEAP HOSTING WITH 99% UPTIME? THEN PM ME FOR DETAILS!!

    #2
    plz can somebody will tell whats wrong in above codings.
    sigpic

    WANT GOOD CHEAP HOSTING WITH 99% UPTIME? THEN PM ME FOR DETAILS!!

    Comment


      #3
      copy and replace
      Code:
      else if($action=="comments")
      {
      $who = $_GET["who"];
      $gid = $_GET["gid"];
      addonline(getuid_sid($sid),"Viewing Photo Comments","");
      echo "<card id=\"main\" title=\"GALLERY\">";
      $uid = getuid_sid($sid);
      
      //////ALL LISTS SCRIPT <<
      
      if($page=="" || $page<=0)$page=1;
      $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM fun_galcomments WHERE pid=&#39;".$gid."&#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;
      
      
      $sql = "SELECT id, pid, text, byuser, time FROM fun_galcomments WHERE pid=&#39;".$gid."&#39; ORDER BY id 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[3]))
      {
      $iml = "<img src=\"images/onl.gif\" alt=\"+\"/>";
      
      }else{
      $iml = "<img src=\"images/ofl.gif\" alt=\"-\"/>";
      }
      $snick = getnick_uid($item[3]);
      $lnk = "<a href=\"index.php?action=viewuser&who=$item[3]&sid=$sid\">$iml$snick</a>:";
      $bs = date("d m y-H:i:s",$item[4]);
      echo "$lnk
      [size="1"]";
      
      $me = getuid_sid($sid);
      if($who=="$me") {
      $can = "a";
      }else{
      $can = "b";
      }
      if(ismod($uid)||$can=="a")
      {
      $delnk = "<a href=\"gallery.php?action=del&sid=$sid&id=$item[0]\">[x]</a>";
      }else{
      $delnk = "";
      }
      $text = parsepm($item[2], $sid);
      echo "$text $delnk
      ";
      echo "$bs";
      echo "
      ";
      echo "[/size]";
      
      }
      }
      echo "</p>";
      echo "<p align=\"center\">";
      if($page>1)
      {
      $ppage = $page-1;
      echo "<a href=\"gallery.php?action=$action&page=$ppage&sid=$sid&who=$who&gid=$gid\">«PREV</a> ";
      }
      if($page<$num_pages)
      {
      $npage = $page+1;
      echo "<a href=\"gallery.php?action=$action&page=$npage&sid=$sid&who=$who&gid=$gid\">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=\"gallery.php\" method=\"get\">";
      $rets .= "<postfield name=\"action\" value=\"$action\"/>";
      $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\">";
      $me = getuid_sid($sid);
      if($me!="$who") {
      echo "<a href=\"gallery.php?action=addcomment&sid=$sid&who=$who&gid=$gid\">Add Comment</a>
      ";
      }
      echo "<a href=\"gallery.php?action=main&sid=$sid\">User Gallery</a>
      ";
      echo "<a href=\"index.php?action=main&sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>";
      echo "Home</a>";
      echo "</p>";
      echo "</card>";
      
      }
      else if($action=="addcomment")
      {
      $who = $_GET["who"];
      $gid = $_GET["gid"];
      addonline(getuid_sid($sid),"Adding Photo Comments","");
      echo "<card id=\"main\" title=\"GALLERY\">";
      $uid = getuid_sid($sid);
      $sql = "SELECT itemurl FROM fun_gallery WHERE id=&#39;".$gid."&#39;";
      
      echo "<p align=\"center\">";
      $items = mysql_query($sql);
      echo mysql_error();
      if(mysql_num_rows($items)>0)
      {
      while ($item = mysql_fetch_array($items))
      {
      
      $img = $item[0];
      
      $lnk = "<img src=\"max.php?filename=$img\" alt=\"$id\"/>
      ";
      
      echo "$lnk";
      echo "<go href=\"genproc.php?action=commentadd&sid=$sid&gid=$gid\" method=\"post\">";
      echo "<postfield name=\"text\" value=\"$(text)\"/>";
      echo "</go>";
      
      
      $vb = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM fun_prate WHERE uid=&#39;".$uid."&#39; AND pid=&#39;".$gid."&#39;"));
      if($vb[0]==0)
      {
      
      echo "Rate Photo: <select name=\"prate\">";
      echo "<option value=\"1\">1</option>";
      echo "<option value=\"2\">2</option>";
      echo "<option value=\"3\">3</option>";
      echo "<option value=\"4\">4</option>";
      echo "<option value=\"5\">5</option>";
      echo "<option value=\"6\">6</option>";
      echo "<option value=\"7\">7</option>";
      echo "<option value=\"8\">8</option>";
      echo "<option value=\"9\">9</option>";
      echo "<option value=\"10\">10</option>";
      echo "</select>
      ";
      
      }else{
      $rinfo = mysql_fetch_array(mysql_query("SELECT COUNT(*) as nofr, SUM(prate) as nofp FROM fun_prate WHERE pid=&#39;".$gid."&#39;"));
      $counts = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM fun_prate WHERE pid=&#39;".$gid."&#39;"));
      if($counts[0]>0) {
      $ther = $rinfo[1]/$rinfo[0];
      $rating = "Rating: $ther/$rinfo[1] (votes$counts[0])
      ";
      }else{
      $rating = "";
      }
      echo "$rating";
      }
      
      
      echo "Comment:
      ";
      echo "<input name=\"text\" maxlength=\"150\"/>
      ";
      echo "<anchor>Add";
      echo "<go href=\"genproc.php?action=commentadd&sid=$sid&gid=$gid\" method=\"post\">";
      echo "<postfield name=\"text\" value=\"$(text)\"/>";
      echo "</go></anchor>
      ";
      }
      }
      echo "<a href=\"gallery.php?action=main&sid=$sid\">User Gallery</a>
      ";
      
      echo "<a href=\"index.php?action=main&sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>";
      echo "Home</a>";
      echo "</p>";
      echo "</card>";
      
      }else if($action=="del")
      {
      $id = $_GET["id"];
        addonline(getuid_sid($sid),"Deleting gallery comment","");
      
      echo "<card id=\"main\" title=\"GALLERY\">";
            echo "<p align=\"center\">";
              echo "
      ";
          $res = mysql_query("DELETE FROM fun_galcomments WHERE id=&#39;".$id."&#39;");
              if($res)
            {
              echo "<img src=\"images/ok.gif\" alt=\"O\"/>Photo Comment has been deleted by rukiya";
            }else{
              echo "<img src=\"images/notok.gif\" alt=\"X\"/>Error deleting Photo commment";
            }
      
         echo "
      
      <a href=\"gallery.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=\"*\"/>";
      echo "Home</a>";
        echo "</p>";
        echo "</card>";
      }
      else{
      addonline(getuid_sid($sid),"Lost in user gallery lol","");
      
      echo "<card id=\"main\" title=\"GALLERY\">";
      echo "<p align=\"center\">";
      echo "I don&#39;t know how did you get into here, but there&#39;s nothing to show
      
      ";
      echo "<a href=\"gallery.php?action=main&sid=$sid\">User Gallery</a>
      ";
      echo "<a href=\"index.php?action=main&sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>";
      echo "Home</a>";
      echo "</p>";
      echo "</card>";
      }
      echo "</wml>";
      
      ?>

      Comment


        #4
        i been havin problems wit that but cant seem to fix it

        ERROR:

        document type does not allow element "go" here; missing one of "do", "anchor" start-tag.


        method="post"><postfield name="text" value="$(text)"/


        in the red thats where the error is at

        Comment


          #5
          this is the html version

          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\">";
          
              
          
          
          connectdb();
          $action = $_GET["action"];
          $sid = $_GET["sid"];
          $page = $_GET["page"];
          $who = $_GET["who"];
          
          
          
          
              echo "<head>";
          
              echo "<title>HT Portal</title>";
          
          
          $uid = getuid_sid($sid);
          
              echo "<link rel=\"StyleSheet\" type=\"text/css\" href=\"style.css\" />";
          
          
          echo "
          <meta http-equiv=\"Cache-Control\" content=\"must-revalidate\" />
          <meta http-equiv=\"Cache-Control\" content=\"no-cache\"/>
          <meta name=\"description\" content=\"HT Portal :)\"> 
          <meta name=\"keywords\" content=\"free, community, forums, chat, wap, communicate\">
          ";
          
          
              
              echo "</head>";
          
              echo "<body>";
          
          if(islogged($sid)==false)
          {
          
                echo "<p align=\"center\">";
                echo "You are not logged in
          ";
                echo "Or Your session has been expired
          
          ";
                echo "<a href=\"index.php\">Login</a>";
                echo "</p>";
          
                exit();
          }
          $uid = getuid_sid($sid);
          if(isbanned($uid))
              {  
                echo "<p align=\"center\">";
                echo "<img src=\"images/notok.gif\" alt=\"x\"/>
          ";
                echo "You are [b]Banned[/b]
          ";
                $banto = mysql_fetch_array(mysql_query("SELECT timeto FROM ibwf_penalties WHERE uid=&#39;".$uid."&#39; AND penalty=&#39;1&#39;"));
                $remain = $banto[0]- time();
                $rmsg = gettimemsg($remain);
                echo "Time to finish your penalty: $rmsg
          
          ";
                //echo "<a href=\"index.php\">Login</a>";
                echo "</p>";
          
                exit();
              }
          
          if($action=="main")
          {
            addonline(getuid_sid($sid),"user gallery","");
           
          echo "<p align=\"center\">";
          
          
          echo "[b]Random gallery Image[/b]
          ";
          $eeee=mysql_fetch_array(mysql_query("SELECT id FROM ibwf_gallery ORDER BY RAND() LIMIT 1"));
          $rmg=mysql_fetch_array(mysql_query("SELECT itemurl, uid FROM ibwf_gallery WHERE id=&#39;".$eeee[0]."&#39;"));
          
          
          
           $wick = getnick_uid($rmg[1]);
          
          
          echo "$wick
          ";
          echo "<IMG HEIGHT=\"100\" WIDTH=\"100\" SRC=\"$rmg[0]\">";
          
          
          echo "</p>";
          
          
          
          
            echo "
          
          ";
          
          $males = mysql_fetch_array(mysql_query("SELECT COUNT(DISTINCT uid) FROM ibwf_gallery WHERE sex=&#39;M&#39;"));
          echo "<a href=\"gallery.php?action=male&amp;sid=$sid\"><img src=\"images/male.gif\" alt=\"\"/>Male Gallery($males[0])</a>
          ";
          echo "
          ";
          $females = mysql_fetch_array(mysql_query("SELECT COUNT(DISTINCT uid) FROM ibwf_gallery WHERE sex=&#39;F&#39;"));
          echo "<a href=\"gallery.php?action=female&amp;sid=$sid\"><img src=\"images/female.gif\" alt=\"\"/>Female Gallery($females[0])</a>
          ";
          echo "
          ";
          echo "<a href=\"gallery.php?action=gallery&amp;sid=$sid\">+Add Photo+</a>
          ";
          echo "<a href=\"index.php?action=upload&amp;sid=$sid\">+Upload Photo+</a>
          ";
            echo "<a href=\"index.php?action=main&amp;sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>";
          echo "Home</a>";
            echo "</p>";
          
            
          
          }
          else if($action=="upload")
          {
              addonline(getuid_sid($sid),"Uploading my pic","");
          
          
           
          echo "<form align=\"center\" action=\"gallery.php?action=updone&amp;sid=$sid\" method=\"post\" ENCTYPE=\"multipart/form-data\">";
          
             echo "[size="1"][b]NOTE: please rename your picture before upload (without symbols) symbols may cause site errors[/b][/size]
          ";
             echo "<font color=\"#FF0000\">your image will be uploaded to htportal.net/forum/gallery/pics/filename
          </font>";
          
             echo "<form align=\"center\" action=\"gallery.php?action=updone&amp;sid=$sid\" method=\"post\" ENCTYPE=\"multipart/form-data\">";
             echo "File: <input type=\"file\" name=\"fpic\" size=\"50\"/>
          ";
             echo "<input type=\"submit\" value=\"Add/ Upload!\"/>";
             echo "</form>";
             echo "
          
          ";
          
          echo "<a href=\"gallery.php?action=main&amp;sid=$sid\">User Gallery</a>
          ";
              echo "<center><a href=\"index.php?action=main&amp;sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>Home</a></center>";
            
          }
          else if($action=="gallery")
          {
            addonline(getuid_sid($sid),"Adding Photo","");
          
            echo "<p align=\"center\">";
             $uid = getuid_sid($sid);
                 $leigh = mysql_fetch_array(mysql_query("SELECT validate FROM ibwf_users WHERE id=&#39;".$uid."&#39;"));
          
          
          if($leigh[0]=="2")
          {
          echo "You are not yet validated this fuction is not avalible to you untill your validated
          ";
                   echo "
          
          <a href=\"index.php?action=main&amp;sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>";
          echo "Home</a>";
          }
          if($leigh[0]=="1")
          {
          echo "If you have a url to ur photo u may add it to the gallery below
          Please note that only .jpeg/.jpg files will show in gallery.
          All other file formats will be removed my staff
          
          ";
          echo "<form action=\"genproc.php?action=addgal&amp;sid=$sid\" method=\"post\">";
          echo "[size="1"]Image URL:[/size] <input name=\"itemurl\" maxlength=\"100\" value=\"http://\"/>
          ";
          echo "<input type=\"submit\" value=\"Add\"/>";
          echo "</form>";
          
            echo "
          
          ";
          echo "<a href=\"gallery.php?action=main&amp;sid=$sid\">User Gallery</a>
          ";
            echo "<a href=\"index.php?action=main&amp;sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>";
          echo "Home</a>";
            echo "</p>";
          
          
          }
          }
          else if($action=="male")
          {
                addonline(getuid_sid($sid),"Viewing Male Gallery","");
          
              $uid = getuid_sid($sid);
          
          
          
              //////ALL gallery SCRIPT <<
          
              if($page=="" || $page<=0)$page=1;
          
          
              if($who!="")
              {
              $noi = mysql_fetch_array(mysql_query("SELECT COUNT(DISTINCT uid) FROM ibwf_gallery WHERE sex=&#39;M&#39;"));
              }else{
              $noi = mysql_fetch_array(mysql_query("SELECT COUNT(DISTINCT uid) FROM ibwf_gallery WHERE sex=&#39;M&#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;
          
          $sql = "SELECT DISTINCT uid FROM ibwf_gallery WHERE sex=&#39;M&#39; ORDER BY uid ASC LIMIT $limit_start, $items_per_page";
          
          echo "
          
          [size="1"]";
              $items = mysql_query($sql);
              echo mysql_error();
              
              if(mysql_num_rows($items)>0)
              {
              while ($item = mysql_fetch_array($items))
              {
          $who = $item[0];
          $user=getnick_uid($who);
          
          $countpics = mysql_fetch_array(mysql_query("SELECT COUNT(id) FROM ibwf_gallery WHERE uid=&#39;".$who."&#39;"));
                  $lnk = "<a href=\"gallery.php?action=viewuser&amp;who=$who&amp;sid=$sid\">$user($countpics[0])</a>
          ";
                 echo "$lnk";
              }
              }
          
              echo "[/size]</p>";
          echo "<p align=\"center\">";
              if($page>1)
              {
                $ppage = $page-1;
                echo "<a href=\"gallery.php?action=$action&amp;page=$ppage&amp;sid=$sid\">«PREV</a> ";
              }
              if($page<$num_pages)
              {
                $npage = $page+1;
                echo "<a href=\"gallery.php?action=$action&amp;page=$npage&amp;sid=$sid\">Next»</a>";
              }
              echo "
          $page/$num_pages
          ";
              if($num_pages>2)
              {
                  $rets = "<form action=\"gallery.php\" method=\"get\">";
                $rets .= "Jump to page<input name=\"page\" format=\"*N\" size=\"3\"/>";
                  $rets .= "<input type=\"submit\" value=\"GO\"/>";
                  $rets .= "<input type=\"hidden\" name=\"action\" value=\"$action\"/>";
                  $rets .= "<input type=\"hidden\" name=\"sid\" value=\"$sid\"/>";
                  $rets .= "</form>";
          
                  echo $rets;
              }
          
          echo "<a href=\"gallery.php?action=main&amp;sid=$sid\">User Gallery</a>
          ";
          echo "<a href=\"index.php?action=main&amp;sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>";
          echo "Home</a>";
              echo "</p>";
             
          
          
          }
          else if($action=="female")
          {
               addonline(getuid_sid($sid),"Viewing Female Gallery","");
                 
              $uid = getuid_sid($sid);
          
          
              //////ALL gallery SCRIPT <<
          
              if($page=="" || $page<=0)$page=1;
              if($who!="")
              {
              $noi = mysql_fetch_array(mysql_query("SELECT COUNT(DISTINCT uid) FROM ibwf_gallery WHERE sex=&#39;F&#39;"));
              }else{
              $noi = mysql_fetch_array(mysql_query("SELECT COUNT(DISTINCT uid) FROM ibwf_gallery WHERE sex=&#39;F&#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;
          
          $sql = "SELECT DISTINCT uid FROM ibwf_gallery WHERE sex=&#39;F&#39; ORDER BY uid ASC LIMIT $limit_start, $items_per_page";
          
          echo "
          
          [size="1"]";
              $items = mysql_query($sql);
              echo mysql_error();
              if(mysql_num_rows($items)>0)
              {
              while ($item = mysql_fetch_array($items))
              {
          $who = $item[0];
          $user=getnick_uid($who);
          $countpics = mysql_fetch_array(mysql_query("SELECT COUNT(id) FROM ibwf_gallery WHERE uid=&#39;".$who."&#39;"));
                  $lnk = "<a href=\"gallery.php?action=viewuser&amp;who=$who&amp;sid=$sid\">$user($countpics[0])</a>
          ";
                  
          echo "$lnk";
          
              }
              }else{
          echo "female gallery is empty";
          }
              echo "[/size]</p>";
          echo "<p align=\"center\">";
              if($page>1)
              {
                $ppage = $page-1;
                echo "<a href=\"gallery.php?action=$action&amp;page=$ppage&amp;sid=$sid\">«PREV</a> ";
              }
              if($page<$num_pages)
              {
                $npage = $page+1;
                echo "<a href=\"gallery.php?action=$action&amp;page=$npage&amp;sid=$sid\">Next»</a>";
              }
              echo "
          $page/$num_pages
          ";
              if($num_pages>2)
              {
                      $rets = "<form action=\"gallery.php\" method=\"get\">";
                $rets .= "Jump to page<input name=\"page\" format=\"*N\" size=\"3\"/>";
                  $rets .= "<input type=\"submit\" value=\"GO\"/>";
                  $rets .= "<input type=\"hidden\" name=\"action\" value=\"$action\"/>";
                  $rets .= "<input type=\"hidden\" name=\"sid\" value=\"$sid\"/>";
                  $rets .= "</form>";;
          
                  echo $rets;
              }
          
          echo "<a href=\"gallery.php?action=main&amp;sid=$sid\">User Gallery</a>
          ";
          echo "<a href=\"index.php?action=main&amp;sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>";
          echo "Home</a>";
              echo "</p>";
          
          
          }
          else if($action=="viewuser")
          {
                $who = $_GET["who"];
              addonline(getuid_sid($sid),"Viewing user Photos","");
                   echo "<card id=\"main\" title=\"Natasu\">";
              $uid = getuid_sid($sid);
          
          
          
              //////ALL gallery SCRIPT <<
          
              if($page=="" || $page<=0)$page=1;
              if($who!="")
              {
              $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_gallery WHERE uid=&#39;".$who."&#39;"));
              }else{
              $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_gallery"));
              }
              $num_items = $noi[0]; //changable
              $items_per_page= 1;
              $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, sex, itemurl FROM ibwf_gallery WHERE uid=&#39;".$who."&#39; ORDER BY id DESC LIMIT $limit_start, $items_per_page";
                  }else{
          $sql = "SELECT id, sex, itemurl, uid FROM ibwf_gallery  ORDER BY id DESC LIMIT $limit_start, $items_per_page";
                  }
          
          echo "<p align=\"center\">";
              $items = mysql_query($sql);
              echo mysql_error();
              if(mysql_num_rows($items)>0)
              {
              while ($item = mysql_fetch_array($items))
              {
                $id = $item[0];
              $img = $item[2];
              
                
                  $lnk = "<img src=\"$img\" alt=\"$id\"/>
          ";
              $rinfo = mysql_fetch_array(mysql_query("SELECT COUNT(*) as nofr, SUM(prate) as nofp FROM ibwf_prate WHERE pid=&#39;".$id."&#39;"));
          $counts = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_prate WHERE pid=&#39;".$id."&#39;"));
          if($counts[0]>0) {
              $ther = $rinfo[1]/$rinfo[0];
              $rating = "Rating: $ther/$rinfo[1] (votes($counts[0]))
          ";
          }else{
          $rating = "";
          }
          
                   $gall = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_galcomments WHERE pid=&#39;".$id."&#39;"));
          $me = getuid_sid($sid);
          if($who=="$me") {
          $use = "<a href=\"genproc.php?action=useav&amp;sid=$sid&amp;gid=$item[0]\">Use as Avatar</a> | ";
          }else{
          $use = "";
          }
                if(candelgal($uid, $item[0]))
                {
                  $delnk = "<a href=\"genproc.php?action=delgal&amp;sid=$sid&amp;gid=$item[0]\">Remove Photo</a>";
                }else{
                  $delnk = "";
                }
                echo "$lnk$rating<a href=\"$img\">Download Photo</a>
           $use$delnk
          <a href=\"gallery.php?who=$who&amp;action=comments&amp;sid=$sid&amp;gid=$item[0]\">Comments($gall[0])</a>
          ";
                
          
              }
              }
              echo "</p>";
          echo "<p align=\"center\">";
              if($page>1)
              {
                $ppage = $page-1;
                echo "<a href=\"gallery.php?action=$action&amp;page=$ppage&amp;sid=$sid&amp;who=$who\">«PREV</a> ";
              }
              if($page<$num_pages)
              {
                $npage = $page+1;
                echo "<a href=\"gallery.php?action=$action&amp;page=$npage&amp;sid=$sid&amp;who=$who\">Next»</a>";
              }
              echo "
          $page/$num_pages
          ";
              if($num_pages>2)
              {
                   $rets = "<form action=\"gallery.php\" method=\"get\">";
                $rets .= "Jump to page<input name=\"page\" format=\"*N\" size=\"3\"/>";
                  $rets .= "<input type=\"submit\" value=\"GO\"/>";
                  $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 .= "</form>";
          
                  echo $rets;
              }
          echo "
          <a href=\"gallery.php?action=main&amp;sid=$sid\">User Gallery</a>
          ";
            echo "<a href=\"index.php?action=main&amp;sid=$sid\">Home</a>";
          
              echo "</p>";
               echo "</card>";
            
          
          }
          else if($action=="comments")
          {
              $who = $_GET["who"];
          $gid = $_GET["gid"];
              addonline(getuid_sid($sid),"Viewing Photo Comments","");
                      echo "<card id=\"main\" title=\"Natasu\">";
              $uid = getuid_sid($sid);
              
              //////ALL LISTS SCRIPT <<
          
              if($page=="" || $page<=0)$page=1;
              $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_galcomments WHERE pid=&#39;".$gid."&#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;
          
              
                 $sql = "SELECT id, pid, text, byuser, time FROM ibwf_galcomments WHERE pid=&#39;".$gid."&#39; ORDER BY id 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[3]))
            {
              $iml = "<img src=\"images/onl.gif\" alt=\"+\"/>";
              
            }else{
              $iml = "<img src=\"images/ofl.gif\" alt=\"-\"/>";
            }
              $snick = getnick_uid($item[3]);
                $lnk = "<a href=\"index.php?action=viewuser&amp;who=$item[3]&amp;sid=$sid\">$iml$snick</a>:";
                $bs = date("d m y-H:i:s",$item[4]);
                echo "$lnk
          [size="1"]";
                
          $me = getuid_sid($sid);
          if($who=="$me") {
          $can = "a";
          }else{
          $can = "b";
          }
            if(ismod($uid)||$can=="a")
            {
             $delnk = "<a href=\"modproc.php?action=delcmt&amp;sid=$sid&amp;id=$item[0]\">[x]</a>";
                }else{
                  $delnk = "";
                }
                $text = parsepm($item[2], $sid);
                echo "$text $delnk
          ";
          echo "$bs";
          echo "
          ";
                echo "[/size]";
          
              }
              }
              echo "</p>";
              echo "<p align=\"center\">";
              if($page>1)
              {
                $ppage = $page-1;
                echo "<a href=\"gallery.php?action=$action&amp;page=$ppage&amp;sid=$sid&amp;who=$who&amp;gid=$gid\">«PREV</a> ";
              }
              if($page<$num_pages)
              {
                $npage = $page+1;
                echo "<a href=\"gallery.php?action=$action&amp;page=$npage&amp;sid=$sid&amp;who=$who&amp;gid=$gid\">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=\"gallery.php\" method=\"get\">";
                  $rets .= "<postfield name=\"action\" value=\"$action\"/>";
                  $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\">";
             $me = getuid_sid($sid);
          if($me!="$who") {
              echo "<a href=\"gallery.php?action=addcomment&amp;sid=$sid&amp;who=$who&amp;gid=$gid\">Add Comment</a>
          ";
          }
          echo "<a href=\"gallery.php?action=main&amp;sid=$sid\">User Gallery</a>
          ";
              echo "<a href=\"index.php?action=main&amp;sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>";
          echo "Home</a>";
            echo "</p>";
            echo "</card>";
          
          }
          else if($action=="addcomment")
          {
              $who = $_GET["who"];
          $gid = $_GET["gid"];
              addonline(getuid_sid($sid),"Adding Photo Comments","");
          
              $uid = getuid_sid($sid);
              $sql = "SELECT itemurl FROM ibwf_gallery  WHERE id=&#39;".$gid."&#39;";
          echo "<title>Add Comment</title>";
          echo "<p align=\"center\">";
             $uid = getuid_sid($sid);
          
          /*
          echo "You are not yet validated this fuction is not avalible to you untill your validated
          ";
                   echo "
          
          <a href=\"index.php?action=main&amp;sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>";
          echo "Home</a>";
          */
          if($uid[0]=="1")
          {
          $items = mysql_query($sql);
              echo mysql_error();
              if(mysql_num_rows($items)>0)
              {
              while ($item = mysql_fetch_array($items))
              {
                
              $img = $item[0];
              
                $lnk = "<img src=\"$img\" width=\"100\" alt=\"$id\"/>
          ";
                  
                echo "$lnk";
          echo "<go href=\"genproc.php?action=commentadd&amp;sid=$sid&amp;gid=$gid\" method=\"post\">";
          echo "<postfield name=\"text\" value=\"$(text)\"/>";
          echo "</go>";
          
          
            $vb = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_prate WHERE uid=&#39;".$uid."&#39; AND pid=&#39;".$gid."&#39;"));
            if($vb[0]==0)
            {
            echo "<form action=\"genproc.php?action=commentadd&amp;sid=$sid&amp;gid=$gid\" method=\"post\">";
            echo "Rate Photo: <select name=\"prate\">";
            echo "<option value=\"1\">1</option>";
            echo "<option value=\"2\">2</option>";
            echo "<option value=\"3\">3</option>";
            echo "<option value=\"4\">4</option>";
            echo "<option value=\"5\">5</option>";
            echo "<option value=\"6\">6</option>";
            echo "<option value=\"7\">7</option>";
            echo "<option value=\"8\">8</option>";
            echo "<option value=\"9\">9</option>";
            echo "<option value=\"10\">10</option>";
            echo "</select>
          ";
          
            }else{
          $rinfo = mysql_fetch_array(mysql_query("SELECT COUNT(*) as nofr, SUM(prate) as nofp FROM ibwf_prate WHERE pid=&#39;".$gid."&#39;"));
          $counts = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_prate WHERE pid=&#39;".$gid."&#39;"));
          if($counts[0]>0) {
              $ther = $rinfo[1]/$rinfo[0];
              $rating = "Rating: $ther/$rinfo[1] (votes$counts[0])
          ";
          }else{
          $rating = "";
          }
              echo "$rating";
            }
          
          
          echo "Comment:
          ";
          echo "<input name=\"text\" maxlength=\"150\"/>
          ";
          echo "<input type=\"submit\" value=\"Add\"/>";
          echo "</form>
          ";
              }
              }
              echo "<a href=\"gallery.php?action=main&amp;sid=$sid\">User Gallery</a>
          ";
          
              echo "<a href=\"index.php?action=main&amp;sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>";
          echo "Home</a>";
            echo "</p>";
            }
          
          }else{
                addonline(getuid_sid($sid),"Lost in user gallery lol","");
              
            echo "<p align=\"center\">";
            echo "I don&#39;t know how did you get into here, but there&#39;s nothing to show
          
          ";
          echo "<a href=\"gallery.php?action=main&amp;sid=$sid\">User Gallery</a>
          ";
            echo "<a href=\"index.php?action=main&amp;sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>";
          echo "Home</a>";
            echo "</p>";
          
          }
          echo "</body></html>";
          
          ?>

          Comment


            #6
            if the info u got solved the problem let us know, so we can provide u with further assistance
            wapZan Mobile site builder - Yours is here



            http://wapzan.com?ref=2wap

            Comment


              #7
              thank you very much. it works...

              WapCHAT Forum Currenltly changing over to xhtml

              My Dowloads Site

              Comment

              Working...
              X