User Gallery Script

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

    User Gallery Script

    the script only shows the photo of user with uid 1 in the male gallery but the other photos are in the database. can someone help me with it please. to c the problem look at my site http://www.funmobile.ws and check user gallery. try to add ur own photo n c

    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>$stitle</title>";
        echo "<link rel=\"StyleSheet\" type=\"text/css\" href=\"style/style.css\" />";
    echo "
    <meta http-equiv=\"Cache-Control\" content=\"must-revalidate\" />
    <meta http-equiv=\"Cache-Control\" content=\"no-cache\"/>
    <meta name=\"description\" content=\"Fun mobile :)\"> 
    <meta name=\"keywords\" content=\"free, community, forums, chat, wap, communicate\">
    ";
        echo "</head>";
    
        echo "<body>";
    connectdb();
    $action = $_GET["action"];
    $sid = $_GET["sid"];
    $page = $_GET["page"];
    $who = $_GET["who"];
    
    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 fun_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 "Send your photos to [email]gallery@funmobile.ws[/email] with username and password
    ";
    echo "Your pictures will be added within 2 days after being sent!";
    echo "</p>
    
    ";
    echo "<a href=\"gallery.php?action=male&amp;sid=$sid\">Male Gallery
    ";
    echo "<a href=\"gallery.php?action=female&amp;sid=$sid\">Female Gallery
    ";
    
    echo "</p><p align=\"center\">";
      echo "<a href=\"index.php?action=main&amp;sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>";
    echo "Home</a>";
      echo "</p>";
        
    
    }
    else if($action=="gallery")
    {
      addonline(getuid_sid($sid),"Adding Photo","");
      
      echo "<p align=\"center\">";
    echo "If you have a url to ur photo u may add it to the gallery below
    
    ";
    echo "<form action=\"genproc.php?action=addphoto&amp;sid=$sid\" method=\"post\">";  
    echo "Image URL: <input name=\"imglink\" type=\"text\"/>
    ";
    echo "Sex: <select name=\"sex\">";
    echo "<option value=\"M\">Male</option>";
    echo "<option value=\"F\">Female</option>";
    echo "</select>";
    echo "
    <input type=\"submit\" value=\"Add Photo\"/>";
    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),"Male gallery","");
      
      echo "
    
    ";
    $countusers = mysql_fetch_array(mysql_query("SELECT COUNT(uid) FROM fun_gallery WHERE sex=&#39;M&#39; "));
    
        if($page=="" || $page<=0)$page=1;
    
        $num_items = $countusers[0];
        $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;
    
    
    $getgalusers = mysql_fetch_array(mysql_query("SELECT id, uid, imglink, sex FROM fun_gallery WHERE sex=&#39;M&#39; ORDER BY uid $limit_start, $items_per_page;"));
    if($getgalusers) {
    $user = getnick_uid($getgalusers[1]);
    $who = $getgalusers[1];
    $link = "<a href=\"gallery.php?action=viewuser&amp;sid=$sid&amp;who=$who\">$user</a>
    ";    
    echo $link;
    }else{
    echo "Male User Gallery is empty";
    }
    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\">«PREV</a> ";
        }
        if($page<$num_pages)
        {
          $npage = $page+1;
          echo "<a href=\"gallery.php?action=$action&amp;page=$npage&amp;sid=$sid\">Next»</a>";
        }
        if($num_pages>1)
        {
        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 "
    ";
    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),"Female gallery","");
    echo "
    
    ";
    
    $countusers = mysql_fetch_array(mysql_query("SELECT COUNT(uid) FROM fun_gallery WHERE sex=&#39;F&#39;")); 
    
    if($page=="" || $page<=0)$page=1;
    
        $num_items = $countusers[0];
        $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;
    
    
     
    $getgalusers = mysql_fetch_array(mysql_query("SELECT id, uid, imglink, sex FROM fun_gallery WHERE sex=&#39;F&#39; ORDER BY uid $limit_start, $items_per_page;"));
    if($getgalusers) {
    $user = getnick_uid($getgalusers[1]);
    $who = $getgalusers[1];
    $link = "<a href=\"gallery.php?action=viewuser&amp;sid=$sid&amp;who=$who\">$user</a>
    ";    
    echo $link;
    }else{
    echo "Female User Gallery is empty";
    }    
    
    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\">«PREV</a> ";
        }
        if($page<$num_pages)
        {
          $npage = $page+1;
          echo "<a href=\"gallery.php?action=$action&amp;page=$npage&amp;sid=$sid\">Next»</a>";
        }
        if($num_pages>1)
        {
        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 "
    ";
    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")
    {
      addonline(getuid_sid($sid),"viewing user pics","");
    $countusers = mysql_fetch_array(mysql_query("SELECT COUNT(id) FROM fun_gallery WHERE uid=&#39;".$who."&#39;")); 
    
    if($page=="" || $page<=0)$page=1;
    
        $num_items = $countusers[0];
        $items_per_page= 3;
        $num_pages = ceil($num_items/$items_per_page);
        if(($page>$num_pages)&&$page!=1)$page= $num_pages;
        $limit_start = ($page-1)*$items_per_page;
    
    
     
    $getphotos = mysql_fetch_array(mysql_query("SELECT id, imglink FROM fun_gallery WHERE uid=&#39;".$who."&#39; ORDER BY id $limit_start, $items_per_page;"));
      echo "
    
    ";
    if($getphotos) {
    $img = "<img src=\"$getphotos[1]\" alt=\"$getphotos[0]\"/>
    ";
    $dnl = "<a href=\"$getphotos[1]\">Download</a>
    
    ";
    echo "$img$dnl";
    }
    
    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>";
        }
        if($num_pages>1)
        {
        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 "
    ";
    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=\"index.php?action=main&amp;sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>";
    echo "Home</a>";
      echo "</p>";
    }
    
        echo "</body>";
        echo "</html>";
    ?>

    #2
    Code:
    $getgalusers = mysql_fetch_array(mysql_query("SELECT id, uid, imglink, sex FROM fun_gallery WHERE sex=&#39;M&#39; ORDER BY uid $limit_start, $items_per_page;"));
    IS wrong you have forgotten LIMIT!

    Code:
    $getgalusers = mysql_fetch_array(mysql_query("SELECT id, uid, imglink, sex FROM fun_gallery WHERE sex=&#39;M&#39; ORDER BY uid LIMIT $limit_start, $items_per_page"));
    Advertise your mobile site for FREE with AdTwirl

    Comment


      #3
      Code:
      $getgalusers = mysql_fetch_array(mysql_query("SELECT id, uid, imglink, sex FROM fun_gallery WHERE sex=&#39;M&#39; ORDER BY uid $limit_start, $items_per_page;"));
      IS wrong you have forgotten LIMIT!

      Code:
      $getgalusers = mysql_fetch_array(mysql_query("SELECT id, uid, imglink, sex FROM fun_gallery WHERE sex=&#39;M&#39; ORDER BY uid LIMIT $limit_start, $items_per_page"));
      [/b]
      thanks gums but there is still something wrong. it still doesnt show all the records and all the imges check my site n c. here is the code im using
      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>$stitle</title>";
          echo "<link rel=\"StyleSheet\" type=\"text/css\" href=\"style/style.css\" />";
      echo "
      <meta http-equiv=\"Cache-Control\" content=\"must-revalidate\" />
      <meta http-equiv=\"Cache-Control\" content=\"no-cache\"/>
      <meta name=\"description\" content=\"Fun mobile :)\"> 
      <meta name=\"keywords\" content=\"free, community, forums, chat, wap, communicate\">
      ";
          echo "</head>";
      
          echo "<body>";
      connectdb();
      $action = $_GET["action"];
      $sid = $_GET["sid"];
      $page = $_GET["page"];
      $who = $_GET["who"];
      
      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 fun_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 "Send your photos to [email]gallery@funmobile.ws[/email] with username and password
      ";
      echo "Your pictures will be added within 2 days after being sent!";
      echo "</p>
      
      ";
      echo "<a href=\"gallery.php?action=male&amp;sid=$sid\">Male Gallery
      ";
      echo "<a href=\"gallery.php?action=female&amp;sid=$sid\">Female Gallery
      ";
      echo "<a href=\"gallery.php?action=gallery&amp;sid=$sid\">+ Add Photo</a>";
      echo "</p><p align=\"center\">";
        echo "<a href=\"index.php?action=main&amp;sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>";
      echo "Home</a>";
        echo "</p>";
          
      
      }
      else if($action=="gallery")
      {
        addonline(getuid_sid($sid),"Adding Photo","");
        
        echo "<p align=\"center\">";
      echo "If you have a url to ur photo u may add it to the gallery below
      
      ";
      echo "<form action=\"genproc.php?action=addphoto&amp;sid=$sid\" method=\"post\">";  
      echo "Image URL: <input name=\"imglink\" type=\"text\"/>
      ";
      echo "Sex: <select name=\"sex\">";
      echo "<option value=\"M\">Male</option>";
      echo "<option value=\"F\">Female</option>";
      echo "</select>";
      echo "
      <input type=\"submit\" value=\"Add Photo\"/>";
      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),"Male gallery","");
        
        echo "
      
      ";
      $countusers = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM fun_gallery WHERE sex=&#39;M&#39; "));
      
          if($page=="" || $page<=0)$page=1;
      
          $num_items = $countusers[0];
          $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;
      
      
      $getgalusers = mysql_fetch_array(mysql_query("SELECT id, uid, imglink, sex FROM fun_gallery WHERE sex=&#39;M&#39; ORDER BY uid LIMIT $limit_start, $items_per_page"));
      if($getgalusers) {
      $user = getnick_uid($getgalusers[1]);
      $who = $getgalusers[1];
      $link = "<a href=\"gallery.php?action=viewuser&amp;sid=$sid&amp;who=$who\">$user</a>
      ";    
      echo $link;
      }else{
      echo "Male User Gallery is empty";
      }
      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\">«PREV</a> ";
          }
          if($page<$num_pages)
          {
            $npage = $page+1;
            echo "<a href=\"gallery.php?action=$action&amp;page=$npage&amp;sid=$sid\">Next»</a>";
          }
          if($num_pages>1)
          {
          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 "
      ";
      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),"Female gallery","");
      echo "
      
      ";
      
      $countusers = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM fun_gallery WHERE sex=&#39;F&#39;")); 
      
      if($page=="" || $page<=0)$page=1;
      
          $num_items = $countusers[0];
          $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;
      
      
       
      $getgalusers = mysql_fetch_array(mysql_query("SELECT id, uid, imglink, sex FROM fun_gallery WHERE sex=&#39;F&#39; ORDER BY uid LIMIT $limit_start, $items_per_page"));
      if($getgalusers) {
      $user = getnick_uid($getgalusers[1]);
      $who = $getgalusers[1];
      $link = "<a href=\"gallery.php?action=viewuser&amp;sid=$sid&amp;who=$who\">$user</a>
      ";    
      echo $link;
      }else{
      echo "Female User Gallery is empty";
      }    
      
      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\">«PREV</a> ";
          }
          if($page<$num_pages)
          {
            $npage = $page+1;
            echo "<a href=\"gallery.php?action=$action&amp;page=$npage&amp;sid=$sid\">Next»</a>";
          }
          if($num_pages>1)
          {
          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 "
      ";
      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")
      {
        addonline(getuid_sid($sid),"viewing user pics","");
      $countusers = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM fun_gallery WHERE uid=&#39;".$who."&#39;")); 
      
      if($page=="" || $page<=0)$page=1;
      
          $num_items = $countusers[0];
          $items_per_page= 3;
          $num_pages = ceil($num_items/$items_per_page);
          if(($page>$num_pages)&&$page!=1)$page= $num_pages;
          $limit_start = ($page-1)*$items_per_page;
      
      
       
      $getphotos = mysql_fetch_array(mysql_query("SELECT id, imglink FROM fun_gallery WHERE uid=&#39;".$who."&#39; ORDER BY id LIMIT $limit_start, $items_per_page"));
        echo "
      
      ";
      if($getphotos) {
      $img = "<img src=\"$getphotos[1]\" alt=\"$getphotos[0]\"/>
      ";
      $dnl = "<a href=\"$getphotos[1]\">Download</a>
      
      ";
      echo "$img$dnl";
      }
      
      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>";
          }
          if($num_pages>1)
          {
          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 "
      ";
      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=\"index.php?action=main&amp;sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>";
      echo "Home</a>";
        echo "</p>";
      }
      
          echo "</body>";
          echo "</html>";
      ?>
      and these r my databse records for the gallery table
      Code:
      INSERT INTO fun_gallery VALUES (1, 1, &#39;[url]http://funmobile.ws/images/logo.gif&#39;[/url], &#39;M&#39;);
      INSERT INTO fun_gallery VALUES (2, 1, &#39;[url]http://funmobile.ws/images/login.gif&#39;[/url], &#39;M&#39;);
      INSERT INTO fun_gallery VALUES (3, 21, &#39;[url]http://fimizone.org/forum/images/logo.gif&#39;[/url], &#39;M&#39;);
      INSERT INTO fun_gallery VALUES (4, 21, &#39;[url]http://fimizone.org/forum/images/login.gif&#39;[/url], &#39;M&#39;);
      INSERT INTO fun_gallery VALUES (5, 37, &#39;[url]http://htportal.net&#39;[/url], &#39;M&#39;);
      INSERT INTO fun_gallery VALUES (6, 26, &#39;[url]http://prowap.biz/images/logo.gif&#39;[/url], &#39;M&#39;);
      INSERT INTO fun_gallery VALUES (7, 101, &#39;[url]http://metalmafia.co.uk/uploader/ghostskull.gif&#39;[/url], &#39;M&#39;);
      INSERT INTO fun_gallery VALUES (8, 13, &#39;&#39;, &#39;F&#39;);
      INSERT INTO fun_gallery VALUES (9, 11, &#39;C:/Documents and settings&#39;, &#39;F&#39;);
      INSERT INTO fun_gallery VALUES (10, 11, &#39;C:\\Documents and Settings\\grave\\Local Settings\\Temp\\Rar$ML06.062\\cece.rar&#39;, &#39;M&#39;);
      INSERT INTO fun_gallery VALUES (11, 11, &#39;C:\\Documents and Settings\\grave\\Local Settings\\Temp\\Rar$ML01.906\\cece.rar&#39;, &#39;F&#39;);
      INSERT INTO fun_gallery VALUES (12, 28, &#39;[url]http://clevy.net&#39;[/url], &#39;M&#39;);

      Comment


        #4
        Please upload sql table for gallery file

        Comment


          #5
          some of the table records are wrong that could be another reason why most images dont load
          Advertise your mobile site for FREE with AdTwirl

          Comment


            #6
            Code:
            else if($action=="male")
            {
              addonline(getuid_sid($sid),"Male gallery","");
              
              echo "
            
            ";
            $countusers = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM fun_gallery WHERE sex=&#39;M&#39; "));
            
                if($page=="" || $page<=0)$page=1;
            
                $num_items = $countusers[0];
                $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;
            
            
            $getgalusers = mysql_fetch_array(mysql_query("SELECT id, uid, imglink, sex FROM fun_gallery WHERE sex=&#39;M&#39; ORDER BY uid LIMIT $limit_start, $items_per_page"));
            if($getgalusers) {
            $user = getnick_uid($getgalusers[1]);
            $who = $getgalusers[1];
            $link = "<a href=\"gallery.php?action=viewuser&amp;sid=$sid&amp;who=$who\">$user</a>
            ";    
            echo $link;
            }else{
            echo "Male User Gallery is empty";
            }
            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\">«PREV</a> ";
                }
                if($page<$num_pages)
                {
                  $npage = $page+1;
                  echo "<a href=\"gallery.php?action=$action&amp;page=$npage&amp;sid=$sid\">Next»</a>";
                }
                if($num_pages>1)
                {
                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 "
            ";
            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>";
                
            
            }
            i have a problem there. it doesnt show all the male users who have records in the gallery even though the record is in the db

            Comment


              #7
              Everything looks fine, please post the sql table or just row names of your table, possible that the row names dont match.
              Code:
              $getgalusers = mysql_fetch_array(mysql_query("SELECT id, uid, imglink, sex FROM fun_gallery WHERE sex=&#39;M&#39; ORDER BY uid LIMIT $limit_start, $items_per_page"));
              add after order by uid the way how do you want to order desc for descending and asc for ascending

              i think i have found the bug, here is the code which schould work. i havnt tested it.

              Code:
              $getgalusers = mysql_fetch_array(mysql_query("SELECT `id`, `uid`, `imglink`, `sex` FROM `fun_gallery` WHERE `sex`=&#39;M&#39; ORDER BY `id` DESC LIMIT $limit_start, $items_per_page"));
              Code:
              else if($action=="male")
              {
                addonline(getuid_sid($sid),"Male gallery","");
                
                echo "
              
              ";
              $countusers = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM fun_gallery WHERE sex=&#39;M&#39; "));
              
                  if($page=="" || $page<=0)$page=1;
              
                  $num_items = $countusers[0];
                  $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;
              
              
              $q=mysql_query("SELECT `id`, `uid`, `imglink`, `sex` FROM `fun_gallery` WHERE `sex`=&#39;M&#39; ORDER BY `id` DESC LIMIT $limit_start, $items_per_page");
              $num_rows = mysql_num_rows($q); 
              if ($num_rows==0) echo &#39;Male User Gallery is empty
              &#39;;
              while($getgalusers = mysql_fetch_array($q)){
              $user = getnick_uid($getgalusers[1]);
              $who = $getgalusers[1];
              $link = "<a href=\"gallery.php?action=viewuser&amp;sid=$sid&amp;who=$who\">$user</a>
              ";    
              echo $link;
              }
              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\">«PREV</a> ";
                  }
                  if($page<$num_pages)
                  {
                    $npage = $page+1;
                    echo "<a href=\"gallery.php?action=$action&amp;page=$npage&amp;sid=$sid\">Next»</a>";
                  }
                  if($num_pages>1)
                  {
                  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 "
              ";
              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>";
                  
              
              }
              Advertise your mobile site for FREE with AdTwirl

              Comment


                #8
                Everything looks fine, please post the sql table or just row names of your table, possible that the row names dont match.
                Code:
                $getgalusers = mysql_fetch_array(mysql_query("SELECT id, uid, imglink, sex FROM fun_gallery WHERE sex=&#39;M&#39; ORDER BY uid LIMIT $limit_start, $items_per_page"));
                add after order by uid the way how do you want to order desc for descending and asc for ascending

                i think i have found the bug, here is the code which schould work. i havnt tested it.

                Code:
                $getgalusers = mysql_fetch_array(mysql_query("SELECT `id`, `uid`, `imglink`, `sex` FROM `fun_gallery` WHERE `sex`=&#39;M&#39; ORDER BY `id` DESC LIMIT $limit_start, $items_per_page"));
                Code:
                else if($action=="male")
                {
                  addonline(getuid_sid($sid),"Male gallery","");
                  
                  echo "
                
                ";
                $countusers = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM fun_gallery WHERE sex=&#39;M&#39; "));
                
                    if($page=="" || $page<=0)$page=1;
                
                    $num_items = $countusers[0];
                    $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;
                $q=mysql_query("SELECT `id`, `uid`, `imglink`, `sex` FROM `fun_gallery` WHERE `sex`=&#39;M&#39; ORDER BY `id` DESC LIMIT $limit_start, $items_per_page");
                $num_rows = mysql_num_rows($q); 
                if ($num_rows==0) echo &#39;Male User Gallery is empty
                &#39;;
                while($getgalusers = mysql_fetch_array($q)){
                $user = getnick_uid($getgalusers[1]);
                $who = $getgalusers[1];
                $link = "<a href=\"gallery.php?action=viewuser&amp;sid=$sid&amp;who=$who\">$user</a>
                ";    
                echo $link;
                }
                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\">«PREV</a> ";
                    }
                    if($page<$num_pages)
                    {
                      $npage = $page+1;
                      echo "<a href=\"gallery.php?action=$action&amp;page=$npage&amp;sid=$sid\">Next»</a>";
                    }
                    if($num_pages>1)
                    {
                    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 "
                ";
                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>";
                    
                
                }
                [/b]
                k thanks. ill try it later

                Comment


                  #9
                  i have a problem with this section of the coding.
                  Code:
                  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(*) FROM fun_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 id, uid FROM fun_gallery WHERE sex=&#39;M&#39; ORDER BY uid DESC 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[1];
                  $user=getnick_uid($who);
                  
                          $lnk = "<a href=\"gallery.php?action=viewuser&amp;who=$who&amp;sid=$sid\">$user</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>";
                      
                  
                  }
                  it shows the male users like
                  michael
                  michael
                  michael but i want it to show each user only once. can someone help me please.......... check my site http://funmobile.ws if you dont understand

                  Comment


                    #10
                    i fixed it lol

                    Comment


                      #11
                      its not displaying d image of the user

                      Comment


                        #12
                        its not displaying d image of the user[/b]
                        yes it is lol. just click on the username n u&#39;ll see all their photos. im adding photo comment feature but its giving me a hard time....... must b cuz im sleepy lol

                        Comment


                          #13
                          where did i go wrong here?
                          Code:
                          else if($action=="comments")
                          {
                          
                                $who = $_GET["who"];
                          $gid = $_GET["gid"];
                          
                              addonline(getuid_sid($sid),"Viewing Photos Comments","");
                              //////ALL LISTS SCRIPT <<
                          
                              if($page=="" || $page<=0)$page=1;
                              if($gid!="")
                              {
                              $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM fun_galcomments WHERE pid=&#39;".$gid."&#39;"));
                              }else{
                              $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM fun_galcomments WHERE pid=&#39;".$gid."&#39;"));
                              }
                              $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($gid!="")
                              {
                                  $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";
                                  }else{
                          $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))
                              {
                                $by = $items[3];
                          $byuser=$getnick_uid($by);
                          $link="<a href=\"index.php?action=viewuser&amp;sid=$sid&amp;who=$by\">$byuser</a>:";
                          $text=$items[2];
                          $time=$items[4];
                                  
                                
                                echo "$link $text
                          $time
                          ";
                                
                              }
                              }
                          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=\"lists.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 = "<form action=\"lists.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=\"who\" value=\"$who\"/>";
                                  $rets .= "<input type=\"hidden\" name=\"sid\" value=\"$sid\"/>";
                                $rets .= "<input type=\"hidden\" name=\"gid\" value=\"$gid\"/>";
                                  
                                  $rets .= "</form>";
                          
                                  echo $rets;
                              }
                          
                              //echo "<a href=\"gallery.php?action=viewuser&amp;sid=$sid&amp;who=$who\">$whonick Photo Gallery</a>
                          ";
                          
                              echo "<a href=\"index.php?action=main&amp;sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>";
                          echo "Home</a>";
                              echo "</p>";
                              
                          
                          }
                          i get this error
                          Code:
                          Fatal error: Function name must be a string in /home/funmobil/public_html/gallery.php on line 381
                          on this line
                          Code:
                          $byuser=$getnick_uid($by);

                          Comment


                            #14
                            gallery script done

                            Comment


                              #15
                              user gallery now updated with photo comments, use as avatar button for photo owner, download photo, rate photo, owners or moderator/admin can delete photo n much more

                              Comment

                              Working...
                              X