Problem With Gallery

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

    Problem With Gallery

    Hello!

    I have problem with Gallery. Go to http://mobilmega.net/web1 and see everuthing about this write.... When i doo upload pictures,there is NOWHERE, no to Base and Gallery!!!

    Does somebody look on my site where is problem???

    Thank!

    #2
    you have got the wrong link to the photos

    http://mobilmega.net/bmpro.gif

    it should be:

    http://mobilmega.net/usergallery/bmpro.gif

    but then again i could be wrong as your delete (unlink) didnt work either

    Warning: unlink(../usergallery/) [function.unlink]: No such file or directory in /home/.squeaky/stojan/mobilmega.net/web1/gallery.php on line 900

    you need to create a folder called usergallery i guess? and make sure your uploads are going into it
    without seeing the script its hopeless trying to help ? :P

    Comment


      #3
      see my code

      gallery.php

      Code:
      <?php
      
      /*
      MethosWap (Chat-Forum by Methos)
      [url="http://www.methos.co.za"]http://www.methos.co.za[/url]
      [email]methos@methos.co.za[/email]
      */
      
      
      include("config.php");
      include("core.php");
      include("xhtmlfunctions.php");
      include("themecs.php");
      
      header("Content-type: text/html; charset=ISO-8859-1");
      echo "<?xml version=\"1.0\" encoding=\"ISO-8859-1\" ?>";
      echo "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">";
      ?>
      
      <?php
      $bcon = connectdb();
      if (!$bcon)
      {
          echo xhtmlheadnotheme("$sitetitle (DB Error!)");
          echo "<p align=\"center\">";
          echo "<img src=\"images/exit.gif\" alt=\"*\"/>
      ";
          echo "ERROR! cannot connect to database
      
      ";
          echo "This error happens usually when backing up the database, please be patient, The site will be up any minute
      
      ";
          echo "[b]THANK YOU VERY MUCH[/b]
      
      ";
          echo "<a href=\"http://wapb2b.playfon.com/?d_e=79772025\">1000&#39;s of Downloads</a>
      ";
            echo "<a href=\"http://click.buzzcity.com/click.php?bid=1&amp;partnerid=10019\"><img src=\"http://ads.buzzcity.com/show.php?bid=1&amp;partnerid=10019\" alt=\"\" /></a>";
          echo "</p>";
          echo xhtmlfoot();
          exit();
      }
      
      $action = $_GET["action"];
      $page = $_GET["page"];
      $sid = $_GET["sid"];
      $whoimage = $_GET["whoimage"];
      $uid = getuid_sid($sid);
      
      $popuppm = mysql_fetch_array(mysql_query("SELECT popuppm FROM ibwf_users WHERE id=&#39;".$uid."&#39;"));
      
      if(islogged($sid)==false)
          {
            echo xhtmlheadnotheme("$sitetitle (Not Logged In!)");
            echo "<p align=\"center\">";
            echo "You are not logged in
      ";
            echo "Or Your session has been expired
      
      ";
            echo "</p>";
            echo "<p align=\"center\">";
            echo "<form action=\"login.php\" method=\"get\">";
            echo "Username:<input name=\"loguid\" size=\"8\" maxlength=\"30\"/>
      ";
            echo "Password:<input name=\"logpwd\" size=\"8\" maxlength=\"30\" type=\"password\" />
      ";
            echo "<input type=\"submit\" value=\"Login\"/>";
            echo "</form>"; 
            echo "</p>";
            echo xhtmlfoot();
            exit();
          } 
      
      if(isbanned($uid))
          {
            echo xhtmlheadnotheme("$sitetitle (BANNED!)");
            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_metpenaltiespl WHERE uid=&#39;".$uid."&#39; AND penalty=&#39;1&#39;"));
            $banres = mysql_fetch_array(mysql_query("SELECT lastpnreas FROM ibwf_users WHERE id=&#39;".$uid."&#39;"));      
            $remain = $banto[0]- time();
            $rmsg = gettimemsg($remain);
            echo "Time to finish your penalty: $rmsg
      
      ";
            echo "Ban Reason: $banres[0]";
            echo "</p>";
            echo xhtmlfoot();
            exit();
          }
      
      
      ////////////////////////////////////////GALLERY MAIN PAGE
      if($action=="main")
      {
        addonline(getuid_sid($sid),"Gallery - xHML:v3","");
        $pstyle = theme($sid);
        echo xhtmlhead("Gallery",$pstyle);
        
        echo "<div class=\"HTAB\" style=\"background:#FFFFFF\">";
        
            if ($popuppm[0]=="1"){
          include("popups.php");
          }  
       
              echo "<div>";    
              echo "$lightorangeh";
                  echo "<center>$sitetitle Member&#39;s Gallery</center></div>";
              echo "$lightorangeb";
                  echo "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"169\">";
                      echo "<tr>";
                          echo "<td class=\"IL-R\">";
                                $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_usergallery WHERE sex=&#39;F&#39;"));
                                echo "<a href=\"gallery.php?action=females&amp;sid=$sid\"><img src=\"images/female.gif\" alt=\"*\"/>Females</a>($noi[0])
      ";
                                $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_usergallery WHERE sex=&#39;M&#39;"));
                                echo "<a href=\"gallery.php?action=males&amp;sid=$sid\"><img src=\"images/male.gif\" alt=\"*\"/>Males</a>($noi[0])";
                          echo "</td>";
                      echo "</tr>";
                  echo "</table>";
              echo "</div>";
              echo "</div>";
              
        echo "</div>";   
          
          echo "<p align=\"center\">";
            echo "[size="1"]MMS or E-MAIL your Photo to [b]methoswap@methos.co.za[/b] including your membername, or just click the Link below to Upload a Photo straight from your Phone.[/size]
      
      ";
            echo "<a href=\"gallery.php?action=upload&amp;sid=$sid\">Add Your Photo</a>";
          echo "</p>";    
          
        echo "
      
      [size="1"]";
        echo "<a href=\"index.php?action=main&amp;sid=$sid\">Home</a>";
        echo " > ";
        echo "Gallery";
        echo "[/size]</p>";  
        
        echo xhtmlfoot();
      }
      
      
      ////////////////////////////////////////MALE GALLERY
      else if($action=="males")
      {
        addonline(getuid_sid($sid),"Male Gallery - xHML:v3","");
        $pstyle = theme($sid);
        echo xhtmlhead("Male Gallery",$pstyle);
        
        echo "<div class=\"HTAB\" style=\"background:#FFFFFF\">";
        
            if ($popuppm[0]=="1"){
          include("popups.php");
          }  
       
              echo "<div>";    
              echo "$lightorangeh";
                  echo "<center>Male Gallery</center></div>";
              echo "$lightorangeb";
                  echo "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"169\">";
                      echo "<tr>";
                          echo "<td class=\"IL-R\">";
                              if($page=="" || $page<=0)$page=1;                    
                          
                              if($who!="")
                              {
                              $noi = mysql_fetch_array(mysql_query("SELECT COUNT(DISTINCT uid) FROM ibwf_usergallery WHERE sex=&#39;M&#39;"));
                              }else{
                              $noi = mysql_fetch_array(mysql_query("SELECT COUNT(DISTINCT uid) FROM ibwf_usergallery WHERE sex=&#39;M&#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;
                          
                              $sql = "SELECT DISTINCT `uid` FROM `ibwf_usergallery` WHERE sex=&#39;M&#39; ORDER BY `id` DESC LIMIT $limit_start , $items_per_page";
                          
                              $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_usergallery WHERE uid=&#39;".$who."&#39;"));
                                  $lnk = "<a href=\"gallery.php?action=viewuserphoto&amp;who=$who&amp;sid=$sid\">$user($countpics[0])</a>
      ";
                                 echo "$lnk"; 
                              }
                              }
                          echo "</td>";
                      echo "</tr>";
                  echo "</table>";
              echo "</div>";
              echo "</div>";
              
        echo "</div>";   
          
          echo "<p align=\"center\">";
          if($page>1)
          {
            $ppage = $page-1;
            echo "<a href=\"gallery.php?action=$action&amp;page=$ppage&amp;sid=$sid\">[size="1"]« Prev[/size]</a> ";
          }
          echo "[size="1"] $page/$num_pages [/size]";
          if($page<$num_pages)
          {
            $npage = $page+1;
            echo "<a href=\"gallery.php?action=$action&amp;page=$npage&amp;sid=$sid\">[size="1"]Next »[/size]</a>";
          }    
          if($num_pages>2)
          {     
              $rets = "<center><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></center>";
              echo $rets;  
          }
          echo "</p>";    
          
        echo "
      
      [size="1"]";
        echo "<a href=\"index.php?action=main&amp;sid=$sid\">Home</a>";
        echo " > ";
        echo "<a href=\"gallery.php?action=main&amp;sid=$sid\">Gallery</a>";
        echo " > ";
        echo "Male Gallery";
        echo "[/size]</p>";  
        
        echo xhtmlfoot();
      }
      
      
      ////////////////////////////////////////FEMALE GALLERY
      else if($action=="females")
      {
        addonline(getuid_sid($sid),"Female Gallery - xHML:v3","");
        $pstyle = theme($sid);
        echo xhtmlhead("Fmale Gallery",$pstyle);
        
        echo "<div class=\"HTAB\" style=\"background:#FFFFFF\">";
        
            if ($popuppm[0]=="1"){
          include("popups.php");
          }  
       
              echo "<div>";    
              echo "$lightorangeh";
                  echo "<center>Female Gallery</center></div>";
              echo "$lightorangeb";
                  echo "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"169\">";
                      echo "<tr>";
                          echo "<td class=\"IL-R\">";
                              if($page=="" || $page<=0)$page=1;                    
                          
                              if($who!="")
                              {
                              $noi = mysql_fetch_array(mysql_query("SELECT COUNT(DISTINCT uid) FROM ibwf_usergallery WHERE sex=&#39;F&#39;"));
                              }else{
                              $noi = mysql_fetch_array(mysql_query("SELECT COUNT(DISTINCT uid) FROM ibwf_usergallery WHERE sex=&#39;F&#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;
                          
                              $sql = "SELECT DISTINCT `uid` FROM `ibwf_usergallery` WHERE sex=&#39;F&#39; ORDER BY `id` DESC LIMIT $limit_start , $items_per_page";
                          
                              $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_usergallery WHERE uid=&#39;".$who."&#39;"));
                                  $lnk = "<a href=\"gallery.php?action=viewuserphoto&amp;who=$who&amp;sid=$sid\">$user($countpics[0])</a>
      ";
                                 echo "$lnk"; 
                              }
                              }
                          echo "</td>";
                      echo "</tr>";
                  echo "</table>";
              echo "</div>";
              echo "</div>";
              
        echo "</div>";   
          
          echo "<p align=\"center\">";
          if($page>1)
          {
            $ppage = $page-1;
            echo "<a href=\"gallery.php?action=$action&amp;page=$ppage&amp;sid=$sid\">[size="1"]« Prev[/size]</a> ";
          }
          echo "[size="1"] $page/$num_pages [/size]";
          if($page<$num_pages)
          {
            $npage = $page+1;
            echo "<a href=\"gallery.php?action=$action&amp;page=$npage&amp;sid=$sid\">[size="1"]Next »[/size]</a>";
          }    
          if($num_pages>2)
          {     
              $rets = "<center><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></center>";
              echo $rets;  
          }
          echo "</p>";    
          
        echo "
      
      [size="1"]";
        echo "<a href=\"index.php?action=main&amp;sid=$sid\">Home</a>";
        echo " > ";
        echo "<a href=\"gallery.php?action=main&amp;sid=$sid\">Gallery</a>";
        echo " > ";
        echo "Female Gallery";
        echo "[/size]</p>";  
        
        echo xhtmlfoot();
      }
      
      
      
      else if($action=="viewuserphoto")
      {
        addonline(getuid_sid($sid),"Viewing Users Photo&#39;&#39;s - xHTML:v3","");
        $pstyle = theme($sid);
        echo xhtmlhead("Viewing Users Photo&#39;s",$pstyle);
      
        $who = $_GET["who"];
        $uid1 = getuid_sid($sid);
        $nick = getnick_uid($who);
        
         echo "<div class=\"HTAB\" style=\"background:#FFFFFF\">";
        
            if ($popuppm[0]=="1"){
          include("popups.php");
          }  
       
              echo "<div>";    
              echo "$lightorangeh";
                  echo "<center><a href=\"index.php?action=viewuser&amp;who=$who&amp;sid=$sid\">$nick</a>&#39;s Gallery</center></div>";
              echo "$lightorangeb";
                  echo "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"169\">";
                      echo "<tr>";
                          echo "<td class=\"IL-R\"><center>";
                              if($page=="" || $page<=0)$page=1;
                              $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_usergallery WHERE uid=&#39;".$who."&#39;"));
                              $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;
                          
                              //changable sql
                          
                              $sql = "SELECT uid, id, imageurl, sex, descript FROM ibwf_usergallery WHERE uid=&#39;".$who."&#39; ORDER BY time DESC LIMIT $limit_start, $items_per_page";
      
                              $items = mysql_query($sql);
                              
                              echo mysql_error();
                              if(mysql_num_rows($items)>0)
                              {
                              while ($item = mysql_fetch_array($items))
                              {
                                  $sql = "SELECT rating FROM ibwf_usergallery_rating WHERE imageid=&#39;".$item[1]."&#39;";        
                                  $imginfo = mysql_query($sql);
                                  
                                  echo mysql_error();
                                  if(mysql_num_rows($imginfo)>0)
                                  {
                                     while ($imginfos = mysql_fetch_array($imginfo)){ 
                                        $ratingtotal = $ratingtotal + $imginfos[0];}
                                  }
                                  
                          
                                  if($totalcomments<1){$totalcomments=0;}         
                                  $norm = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_usergallery_rating WHERE imageid=&#39;".$item[1]."&#39;"));
                                  if ($norm[0]>0){
                                  $rating = ceil($ratingtotal/$norm[0]);
                                  }else{$rating=0;}
                                  
                                  $rated = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_usergallery_rating WHERE byuid=&#39;".$uid1."&#39; and imageid =&#39;".$item[1]."&#39;"));
                                  $totalcomments = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_usergallery_rating WHERE imageid =&#39;".$item[1]."&#39; and commentsyn =&#39;Y&#39;"));
                                  $userinfo = mysql_fetch_array(mysql_query("SELECT name FROM ibwf_users WHERE id=&#39;".$item[0]."&#39;"));
                                  
                                  
                                  if(canratephoto($uid1, $item[0]) and ($rated[0]==0))
                                  {
                                   echo "<a href=\"gallery.php?action=rate&amp;sid=$sid&amp;whoimage=$item[1]\">Rate This Photo</a>";
                                  }
                                  if($uid1==$item[0])
                                  {
                                   echo "<a href=\"genproc.php?action=upavg&amp;sid=$sid&amp;avsrc=$item[2]\">Use As Avatar</a>";
                                  }
                                  if(($uid1=="1") or ($uid1==$item[0]))
                                  {
                                   echo " / <a href=\"gallery.php?action=del&amp;sid=$sid&amp;whoimage=$item[1]\">Delete</a>";
                                  }
                                  echo "
      <a href=\"$item[2]\"><img src=\"$item[2]\" alt=\"$userinfo[0]: $page\"/></a>
      ";                            
                                  if($uid1==$item[0])
                                  {
                                  if(strlen($item[4])>1){
                                  $edtlnk = "<a href=\"gallery.php?action=edtdescript&amp;sid=$sid&amp;whoimage=$item[1]\">*</a>";
                                  }else{
                                  $edtlnk = "<a href=\"gallery.php?action=edtdescript&amp;sid=$sid&amp;whoimage=$item[1]\">*Add Description*</a>";
                                  }
                                  echo "[size="1"]$item[4] [/size]$edtlnk
      
      ";
                                  }
                                  echo "Rating: $rating/10 (<a href=\"gallery.php?action=votes&amp;sid=$sid&amp;whoimage=$item[1]\">$norm[0]</a> Votes)
      <a href=\"gallery.php?action=comments&amp;sid=$sid&amp;whoimage=$item[1]\">Comments</a>($totalcomments[0])";
                                  echo "
      ";
                                  $ratingtotal = 0;
                                  $sex = $item[3];        
                              }
                              }
                          echo "</center></td>";
                      echo "</tr>";
                  echo "</table>";
              echo "</div>";
              echo "</div>";
              
        echo "</div>";  
        
          echo "
      
      <center>";
          if($page>1)
          {
            $ppage = $page-1;
            echo "<a href=\"gallery.php?action=$action&amp;sid=$sid&amp;page=$ppage&amp;who=$who\">[size="1"]« Prev[/size]</a> ";
          }
          echo "[size="1"] $page/$num_pages [/size]";
          if($page<$num_pages)
          {
            $npage = $page+1;
            echo "<a href=\"gallery.php?action=$action&amp;sid=$sid&amp;page=$npage&amp;who=$who\">[size="1"]Next »[/size]</a>";
          }
          
          if($num_pages>2)
          {
              $rets = "<center><form action=\"gallery.php\" method=\"get\">";
              $rets .= "Jump to Photo:<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 .= "<input type=\"hidden\" name=\"page\" value=\"$(pg)\"/>";
              $rets .= "</form></center>";
              echo $rets;  
          }
          echo "</center></p>";    
          
        echo "
      
      [size="1"]";
        echo "<a href=\"index.php?action=main&amp;sid=$sid\">Home</a>";
        echo " > ";
        echo "<a href=\"gallery.php?action=main&amp;sid=$sid\">Gallery</a>";  
        echo " > ";
        if ($sex=="M"){
        echo "<a href=\"gallery.php?action=males&amp;sid=$sid\">Male Gallery</a>";
        }else{
        echo "<a href=\"gallery.php?action=females&amp;sid=$sid\">Female Gallery</a>";
        }
        echo " > ";
        echo "$userinfo[0]";
        echo "[/size]</p>";  
        
        echo xhtmlfoot();
      }
      
      
      ////////////////////////////////////////RATE A PHOTO
      else if($action=="rate")
      {
        addonline(getuid_sid($sid),"Rating a Photo - xHTML:v3","");
        echo xhtmlheadnotheme("Rating a Photo");
      
        $uid1 = getuid_sid($sid);
        $item = mysql_fetch_array(mysql_query("SELECT uid, id, imageurl, sex FROM ibwf_usergallery WHERE uid=&#39;".$whoimage."&#39;"));
        
        $rated = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_usergallery_rating WHERE byuid=&#39;".$uid1."&#39; and imageid =&#39;".$whoimage."&#39;"));
        
        if(canratephoto($uid1, $item[0]) and ($rated[0]==0))
        {  
        echo "<p align=\"center\">[size="1"]";
        echo "Rate this members Photo: 1=Low, 10=High
      You can also leave a comment for this photo!
      ";
        echo "
      ";
        echo "[/size]</p>";
        echo "
      
      ";
          echo "<form action=\"gallery.php?action=rateuser&amp;sid=$sid&amp;whoimage=$whoimage\" method=\"post\">";
          echo "[size="1"]Rate:[/size] <select name=\"rate\" value=\"$rate[0]\">";
          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>
      ";
          
        echo "[size="1"]Comments:[/size] <input name=\"comment\" format=\"*M\" maxlength=\"200\"/>
      ";
        echo "<input type=\"submit\" value=\"Rate\"/>";
        echo "</form>"; 
        }else{
        echo "You have already rated this Photo";
        }
        echo "</p>"; 
          
        echo "
      
      [size="1"]";
        echo "<a href=\"index.php?action=main&amp;sid=$sid\">Home</a>";
        echo " > ";
        echo "<a href=\"gallery.php?action=main&amp;sid=$sid\">Gallery</a>";
        echo " > ";
        echo "Rating a Photo";
        echo "[/size]</p>";  
        
        echo xhtmlfoot();
      }
      
      
      ////////////////////////////////////////READ COMMENTS
      else if($action=="comments")
      {
        addonline(getuid_sid($sid),"Reading Photo&#39;&#39;s Comments - xHTML:v3","");
        $pstyle = theme($sid);
        echo xhtmlhead("Reading Photo&#39;s Comments",$pstyle);
        
        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]);
            $uid1 = getuid_sid($sid);
              
                if($uid==$uidinfo[0])
                {  
                    $dellnk = "<a href=\"gallery.php?action=delvote&amp;sid=$sid&amp;whoimage=$item[5]\">*</a>";
                }else{
                  $dellnk = "";          
                }
                
            $lnk = "[size="1"]<a href=\"index.php?action=viewuser&amp;who=$item[2]&amp;sid=$sid\">$iml$snick:</a> [b]$item[0]/10[/b] $dellnk[/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=\"gallery.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 "
      
      <center>";
          if($page>1)
          {
            $ppage = $page-1;
            echo "<a href=\"gallery.php?action=$action&amp;sid=$sid&amp;page=$ppage&amp;whoimage=$whoimage\">[size="1"]« Prev[/size]</a> ";
          }
          echo "[size="1"] $page/$num_pages [/size]";
          if($page<$num_pages)
          {
            $npage = $page+1;
            echo "<a href=\"gallery.php?action=$action&amp;sid=$sid&amp;page=$npage&amp;whoimage=$whoimage\">[size="1"]Next »[/size]</a>";
          }
          
          if($num_pages>2)
          {
              $rets = "<center><form action=\"gallery.php\" method=\"get\">";
              $rets .= "Jump to Photo:<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=\"whoimage\" value=\"$whoimage\"/>";
              $rets .= "<input type=\"hidden\" name=\"page\" value=\"$(pg)\"/>";
              $rets .= "</form></center>";
              echo $rets;  
          }
          echo "</center></p>";    
          
        echo "
      
      [size="1"]";
        echo "<a href=\"index.php?action=main&amp;sid=$sid\">Home</a>";
        echo " > ";
        echo "<a href=\"gallery.php?action=main&amp;sid=$sid\">Gallery</a>";
        echo " > ";
        echo "Reading Photo&#39;s Comments";
        echo "[/size]</p>";  
        
        echo xhtmlfoot();
      }
      
      
      ////////////////////////////////////////MAKE A COMMENT
      else if($action=="commentreply")
      {
        addonline(getuid_sid($sid),"Replying to a Photo&#39;&#39;s Comment - xHTML:v3","");
        $pstyle = theme($sid);
        echo xhtmlhead("Replying to a Photo&#39;s Comment",$pstyle);
        
        $id = $_GET["id"];
        
        echo "<p align=\"center\">[size="1"]";
        echo "Reply to a Comment
      ";
        echo "
      ";
        echo "[/size]</p>";
        echo "
      
      ";
        echo "<form action=\"gallery.php?action=commentreplyaction&amp;sid=$sid&amp;id=$id\" method=\"post\">";
        echo "[size="1"]Reply:[/size] <input name=\"reply\" format=\"*M\" maxlength=\"200\"/>
      ";
        echo "<input type=\"submit\" value=\"Reply\"/>";
        echo "</form>"; 
        echo "</p>"; 
          
        echo "
      
      [size="1"]";
        echo "<a href=\"index.php?action=main&amp;sid=$sid\">Home</a>";
        echo " > ";
        echo "<a href=\"gallery.php?action=main&amp;sid=$sid\">Gallery</a>";
        echo " > ";
        echo "Replying to a Comment";
        echo "[/size]</p>";  
        
        echo xhtmlfoot();
      }
      
      
      ////////////////////////////////////////READ VOTES WITHOUT COMMENTS
      else if($action=="votes")
      {
        addonline(getuid_sid($sid),"Viewing Votes of a Photo - xHTML:v3","");
        $pstyle = theme($sid);
        echo xhtmlhead("Viewing Votes of a Photo",$pstyle);
        
        echo "<p align=\"center\">[size="1"]";
        echo "
      ";
        echo "[/size]</p>";
      
          if($page=="" || $page<=0)$page=1;
          $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_usergallery_rating WHERE imageid=&#39;".$whoimage."&#39;"));
          $num_items = $noi[0]; //changable
          $items_per_page= 20;
          $num_pages = ceil($num_items/$items_per_page);
          if(($page>$num_pages)&&$page!=1)$page= $num_pages;
          $limit_start = ($page-1)*$items_per_page;
          
          $imageratinginfo = "SELECT rating, byuid  FROM ibwf_usergallery_rating WHERE imageid=&#39;".$item[1]."&#39;";
          $uidinfo = mysql_fetch_array(mysql_query("SELECT uid FROM ibwf_usergallery WHERE id=&#39;".$whoimage."&#39;"));
          
          $sql = "SELECT rating, byuid, time  FROM ibwf_usergallery_rating WHERE imageid =&#39;".$whoimage."&#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[1]))
        {
          $iml = "<img src=\"images/onl.gif\" alt=\"+\"/>";
          
        }else{
          $iml = "<img src=\"images/ofl.gif\" alt=\"-\"/>";
        }
        
          
          $snick = getnick_uid($item[1]);
          $uid1 = getuid_sid($sid);
              
                if($uid==$uidinfo[0])
                {  
                    $dellnk = "<a href=\"gallery.php?action=delvote&amp;sid=$sid&amp;whoimage=$whoimage\">*</a>";
                }else{
                  $dellnk = "";          
                }
            $lnk = "<a href=\"index.php?action=viewuser&amp;who=$item[1]&amp;sid=$sid\">$iml$snick:</a> [b]$item[0]/10[/b] $dellnk";
            echo "$lnk
      ";
          
          }
          }
          echo "</p>";
          echo "
      
      <center>";
          if($page>1)
          {
            $ppage = $page-1;
            echo "<a href=\"gallery.php?action=$action&amp;sid=$sid&amp;page=$ppage&amp;who=$who\">[size="1"]« Prev[/size]</a> ";
          }
          echo "[size="1"] $page/$num_pages [/size]";
          if($page<$num_pages)
          {
            $npage = $page+1;
            echo "<a href=\"gallery.php?action=$action&amp;sid=$sid&amp;page=$npage&amp;who=$who\">[size="1"]Next »[/size]</a>";
          }
          
          if($num_pages>2)
          {
              $rets = "<center><form action=\"gallery.php\" method=\"get\">";
              $rets .= "Jump to Photo:<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 .= "<input type=\"hidden\" name=\"page\" value=\"$(pg)\"/>";
              $rets .= "</form></center>";
              echo $rets;  
          }
          echo "</center></p>";
          
        echo "
      
      [size="1"]";
        echo "<a href=\"index.php?action=main&amp;sid=$sid\">Home</a>";
        echo " > ";
        echo "<a href=\"gallery.php?action=main&amp;sid=$sid\">Gallery</a>";
        echo " > ";
        echo "Votes";
        echo "[/size]</p>";  
        
        echo xhtmlfoot();
      }
      
      
      ////////////////////////////////////////RATE USER
      else if($action=="rateuser")
      {
        addonline(getuid_sid($sid),"Rating a Photo - xHTML:v3","");
        $pstyle = theme($sid);
        echo xhtmlhead("Rating a Photo",$pstyle);
      
        $rate = $_POST["rate"];
        $comment = $_POST["comment"];
      
        $uid1 = getuid_sid($sid);
        $item = mysql_fetch_array(mysql_query("SELECT uid, id, imageurl, sex FROM ibwf_usergallery WHERE uid=&#39;".$whoimage."&#39;"));
        
        $rated = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_usergallery_rating WHERE byuid=&#39;".$uid1."&#39; and imageid =&#39;".$whoimage."&#39;"));
        
        if(canratephoto($uid1, $item[0]) and ($rated[0]==0))
        {  
         echo "<p align=\"center\">";
         $uid = getuid_sid($sid);
         if((strlen($comment))>1){   
         $res= mysql_query("INSERT INTO ibwf_usergallery_rating SET imageid=&#39;".$whoimage."&#39;, rating=&#39;".$rate."&#39;, comments=&#39;".$comment."&#39;, byuid=&#39;".$uid."&#39;, time=&#39;".time()."&#39;, commentsyn=&#39;Y&#39;");
         }else
         if((strlen($comment))<2){   
         $res= mysql_query("INSERT INTO ibwf_usergallery_rating SET imageid=&#39;".$whoimage."&#39;, rating=&#39;".$rate."&#39;, comments=&#39;".$comment."&#39;, byuid=&#39;".$uid."&#39;, time=&#39;".time()."&#39;, commentsyn=&#39;N&#39;");
         }
      
         if(($res) and ((strlen($comment))>1)){
         
           echo "<img src=\"images/ok.gif\" alt=\"o\"/>Rated Successfully
      ";
           echo "<img src=\"images/ok.gif\" alt=\"o\"/>Comments added Successfully
      ";
         }else
         if(($res) and ((strlen($comment))<2)){
         
           echo "<img src=\"images/ok.gif\" alt=\"o\"/>Rated Successfully
      ";
           echo "<img src=\"images/notok.gif\" alt=\"x\"/>No Comments were added
      ";
         }
         else{
           echo "<img src=\"images/notok.gif\" alt=\"x\"/>Rated unsuccessfully
      ";
           echo "<img src=\"images/notok.gif\" alt=\"x\"/>No Comments were added
      ";
         }
         }else{
         echo "You have already rated this Photo";
         }
        echo "</p>"; 
          
        echo "
      
      [size="1"]";
        echo "<a href=\"index.php?action=main&amp;sid=$sid\">Home</a>";
        echo " > ";
        echo "<a href=\"gallery.php?action=main&amp;sid=$sid\">Gallery</a>";
        echo " > ";
        echo "Rating a Photo";
        echo "[/size]</p>";  
        
        echo xhtmlfoot();
      }
      
      
      ////////////////////////////////////////REPLY TO COMMENT
      else if($action=="commentreplyaction")
      {
        addonline(getuid_sid($sid),"Replying To a Photo&#39;&#39;s Comment - xHTML:v3","");
        $pstyle = theme($sid);
        echo xhtmlhead("Replying to a Photo&#39;s Comment",$pstyle);
       
        $id = $_GET["id"];
        $reply = $_POST["reply"];
          
        echo "<p align=\"center\">";
        $uid = getuid_sid($sid);
        $res = mysql_query("UPDATE ibwf_usergallery_rating SET commentsreply=&#39;".$reply."&#39; WHERE id=&#39;".$id."&#39;");
         if($res){
         
           echo "<img src=\"images/ok.gif\" alt=\"o\"/>Replyed Successfully
      ";
         }
         else{
           echo "<img src=\"images/notok.gif\" alt=\"x\"/>Replyed unsuccessfully
      ";
         }
        echo "</p>"; 
          
        echo "
      
      [size="1"]";
        echo "<a href=\"index.php?action=main&amp;sid=$sid\">Home</a>";
        echo " > ";
        echo "<a href=\"gallery.php?action=main&amp;sid=$sid\">Gallery</a>";
        echo " > ";
        echo "Replyed to a Comment";
        echo "[/size]</p>";  
        
        echo xhtmlfoot();
      }
      
      
      ////////////////////////////////////////UPLOAD PHOTO
      else if($action=="upload")
      {
        addonline(getuid_sid($sid),"Uploading a Photo - xHTML:v3","");
        echo xhtmlheadnotheme("Uploading a Photo");
       
        $rate = $_POST["rate"];
        $comment = $_POST["comment"];
        
        echo "
      
      ";
          echo "<center>Photo Uploader</center>
      ";
            echo "[size="1"]Note:
      ";   
            echo "* File size limit 512kb. If your upload does not work, try a smaller Photo.
      ";
            echo "* Allowed formats: [b].jpg, .gif, .bmp, .png[/b]
      ";
            echo "* You have the right to distribute the Photo
      ";
            echo "* The Photo does not violate the <a href=\"index.php?action=terms&amp;sid=$sid\">Terms of Use</a>
      ";
            echo "<center>
      Pick a Photo to upload, and press &#39;Upload&#39;
      ";
          echo "<form enctype=\"multipart/form-data\" method=\"post\" action=\"upload.php?action=upload&amp;sid=$sid\">";
          echo "<input type=\"file\" name=\"f1\" size=\"15\">
      ";
          echo "Description: <input name=\"descript\" maxlength=\"100\" size=\"20\"/>";
          echo "<input type=\"hidden\" name=\"action\" value=\"image\" />
      ";
          echo "<INPUT TYPE=\"submit\" name=\"upl\" VALUE=\"Upload\"></form>";   
        echo "</center>[/size]</p>"; 
          
        echo "
      
      [size="1"]";
        echo "<a href=\"index.php?action=main&amp;sid=$sid\">Home</a>";
        echo " > ";
        echo "<a href=\"gallery.php?action=main&amp;sid=$sid\">Gallery</a>";
        echo " > ";
        echo "Uploading a Photo";
        echo "[/size]</p>";  
        
        echo xhtmlfoot();
      }
      
      
      ////////////////////////////////////////DEL PHOTO
      else if($action=="del")
      {
        $pstyle = theme($sid);
        echo xhtmlhead("User Gallery",$pstyle);
        
            echo "<p align=\"center\">";
              
          $imageurl = mysql_fetch_array(mysql_query("SELECT imageurl FROM ibwf_usergallery WHERE id=&#39;".$whoimage."&#39;"));
          $imagename = explode("/",$imageurl[0]);
          $delpath = "../usergallery/$imagename[4]";
          unlink($delpath);
          $res = mysql_query("DELETE FROM ibwf_usergallery WHERE id=&#39;".$whoimage."&#39;");
          $res = mysql_query("DELETE FROM ibwf_usergallery_rating WHERE imageid=&#39;".$whoimage."&#39;");      
      
              if($res)
            {
              echo "<img src=\"images/ok.gif\" alt=\"O\"/>Photo and all the Comments have been deleted";
            }else{
              echo "<img src=\"images/notok.gif\" alt=\"X\"/>Error deleting Photo";
            }
        echo "</p>"; 
          
        echo "
      
      [size="1"]";
        echo "<a href=\"index.php?action=main&amp;sid=$sid\">Home</a>";
        echo " > ";
        echo "<a href=\"gallery.php?action=main&amp;sid=$sid\">Gallery</a>";
        echo " > ";
        echo "Deleting a Photo";
        echo "[/size]</p>";  
        
        echo xhtmlfoot();
      }
      
      
      ////////////////////////////////////////DEL COMMENT
      else if($action=="delvote")
      {
        $pstyle = theme($sid);
        echo xhtmlhead("User Gallery",$pstyle);
        
        echo "<p align=\"center\">";
        
            if($res)
            {
              echo "<img src=\"images/ok.gif\" alt=\"O\"/>Photo and all the Comments have been deleted";
            }else{
              echo "<img src=\"images/notok.gif\" alt=\"X\"/>Error deleting Photo";
            }      
        echo "</p>"; 
          
        echo "
      
      [size="1"]";
        echo "<a href=\"index.php?action=main&amp;sid=$sid\">Home</a>";
        echo " > ";
        echo "<a href=\"gallery.php?action=main&amp;sid=$sid\">Gallery</a>";
        echo " > ";
        echo "Deleting Comment";
        echo "[/size]</p>";  
        
        echo xhtmlfoot();
      }
      
      
      ////////////////////////////////////////EDIT DESCRIPTION / ADD DESCRIPTION
      else if($action=="edtdescript")
      {
        $pstyle = theme($sid);
        echo xhtmlhead("User Gallery",$pstyle);
        
        echo "<p align=\"center\">";
        
            if($res)
            {
              echo "<img src=\"images/ok.gif\" alt=\"O\"/>Photo and all the Comments have been deleted";
            }else{
              echo "<img src=\"images/notok.gif\" alt=\"X\"/>Error deleting Photo";
            }      
        echo "</p>"; 
          
        echo "
      
      [size="1"]";
        echo "<a href=\"index.php?action=main&amp;sid=$sid\">Home</a>";
        echo " > ";
        echo "<a href=\"gallery.php?action=main&amp;sid=$sid\">Gallery</a>";
        echo " > ";
        echo "Deleting Comment";
        echo "[/size]</p>";  
        
        echo xhtmlfoot();
      }
      
      
      ////////////////////////////////////////LOST IN GALLERY
      else
      {
        addonline(getuid_sid($sid),"Lost in Gallery - xHTML:v3","");
        echo xhtmlheadnotheme("Lost In 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 "</p>";
        
        echo "
      
      [size="1"]";
        echo "<a href=\"index.php?action=main&amp;sid=$sid\">Home</a>";
        echo " > ";
        echo "<a href=\"gallery.php?action=main&amp;sid=$sid\">Gallery</a>";
        echo " > ";
        echo "LOST";
        echo "[/size]</p>";  
      
        echo xhtmlfoot();
      }
      ?>

      Comment


        #4
        still need upload.php to see where you photo`s are being uploaded to

        Comment


          #5
          Code:
          <?php
          
          /*
          MethosWap Chat-Forum
          by Methos
          [url="http://www.methos.co.za"]http://www.methos.co.za[/url]
          [url="http://wap.methos.co.za"]http://wap.methos.co.za[/url]
          [email]methos@methos.co.za[/email]
          */
          
          
          include("config.php");
          include("core.php");
          include("xhtmlfunctions.php");
          include("themecs.php");
          include("class.upload.php");
          
          header("Content-type: text/html; charset=ISO-8859-1");
          echo "<?xml version=\"1.0\" encoding=\"ISO-8859-1\" ?>";
          echo "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">";
          ?>
          
          <?php
          $bcon = connectdb();
          if (!$bcon)
          {
              echo xhtmlheadnotheme("$sitetitle (DB Error!)");
              echo "<p align=\"center\">";
              echo "<img src=\"images/exit.gif\" alt=\"*\"/>
          ";
              echo "ERROR! cannot connect to database
          
          ";
              echo "This error happens usually when backing up the database, please be patient, The site will be up any minute
          
          ";
              echo "[b]THANK YOU VERY MUCH[/b]
          
          ";
              echo "<a href=\"http://wapb2b.playfon.com/?d_e=79772025\">1000&#39;s of Downloads</a>
          ";
                echo "<a href=\"http://click.buzzcity.com/click.php?bid=1&amp;partnerid=10019\"><img src=\"http://ads.buzzcity.com/show.php?bid=1&amp;partnerid=10019\" alt=\"\" /></a>";
              echo "</p>";
              echo xhtmlfoot();
              exit();
          }
          
          $sid = $_GET["sid"];
          $uid = getuid_sid($sid);
          $descript = $_POST["descript"];
          
          if(islogged($sid)==false)
              {
                echo xhtmlheadnotheme("$sitetitle (Not Logged In!)");
                echo "<p align=\"center\">";
                echo "You are not logged in
          ";
                echo "Or Your session has been expired
          
          ";
                echo "</p>";
                echo "<p align=\"center\">";
                echo "<form action=\"login.php\" method=\"get\">";
                echo "Username:<input name=\"loguid\" size=\"8\" maxlength=\"30\"/>
          ";
                echo "Password:<input name=\"logpwd\" size=\"8\" maxlength=\"30\" type=\"password\" />
          ";
                echo "<input type=\"submit\" value=\"Login\"/>";
                echo "</form>"; 
                echo "</p>";
                echo xhtmlfoot();
                exit();
              } 
          
          if(isbanned($uid))
              {
                echo xhtmlheadnotheme("$sitetitle (BANNED!)");
                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_metpenaltiespl WHERE uid=&#39;".$uid."&#39; AND penalty=&#39;1&#39;"));
                $banres = mysql_fetch_array(mysql_query("SELECT lastpnreas FROM ibwf_users WHERE id=&#39;".$uid."&#39;"));      
                $remain = $banto[0]- time();
                $rmsg = gettimemsg($remain);
                echo "Time to finish your penalty: $rmsg
          
          ";
                echo "Ban Reason: $banres[0]";
                echo "</p>";
                echo xhtmlfoot();
                exit();
              }
          
          error_reporting(E_ALL); 
          
          $userinfo = mysql_fetch_array(mysql_query("SELECT name, sex FROM ibwf_users WHERE id=&#39;".$uid."&#39;"));
          $membername = $userinfo[0];
          
          
          ////////////////////////////////////////UPLOADING AND HANDLING THE IMAGE
          if ($_POST[&#39;action&#39;] == &#39;image&#39;)
          {
                addonline(getuid_sid($sid),"Uploading Photo - xHTML:v3","");
                echo xhtmlheadnotheme("Uploading Photo");
          
                echo "<p align=\"center\">";
          
              // ---------- IMAGE UPLOAD ----------
              
              // we create an instance of the class, giving as argument the PHP object 
              // corresponding to the file field from the form
              // All the uploads are accessible from the PHP object $_FILES
              $handle = new Upload($_FILES[&#39;f1&#39;]);
          
              // then we check if the file has been uploaded properly
              // in its *temporary* location in the server (often, it is /tmp)
              if ($handle->uploaded) {
                  
                  // yes, the file is on the server
                  // below are some example settings which can be used if the uploaded file is an image.
                  $handle->image_resize            = true;
                  $handle->image_ratio_y           = true;
                  $handle->image_x                 = 200;
          
                  // now, we start the upload &#39;process&#39;. That is, to copy the uploaded file
                  // from its temporary location to the wanted location
                  // It could be something like $handle->Process(&#39;/home/www/my_uploads/&#39;);
                  $handle->Process(&#39;wap/usergallery&#39;);
                  
                  // we check if everything went OK
                  if ($handle->processed) {
                      // everything was fine !
          
                      echo &#39;  File uploaded with success
          &#39;;
                      echo &#39;  [img]&#39;. $imgpath . &#39;/&#39; . $handle->file_dst_name . &#39;[/img]
          &#39;;
                      $info = getimagesize($handle->file_dst_pathname);
                      $imageurl = "$imgpath/$handle->file_dst_name";
                      $reg = mysql_query("INSERT INTO ibwf_usergallery SET uid=&#39;".$uid."&#39;, imageurl=&#39;".$imageurl."&#39;, sex=&#39;".$userinfo[1]."&#39;, time=&#39;".time()."&#39;, descript=&#39;".$descript."&#39;");
          
                  } else {
                      // one error occured
          
                      echo &#39;  File not uploaded to the wanted location
          &#39;;
                      echo &#39;  Error: &#39; . $handle->error . &#39;
          &#39;;
          
                  }
          
                  // we delete the temporary files
                  $handle-> Clean();
          
              } else {
                  // if we&#39;re here, the upload file failed for some reasons
                  // i.e. the server didn&#39;t receive the file
          
                  echo &#39;  File not uploaded on the server
          &#39;;
                  echo &#39;  Error: &#39; . $handle->error . &#39;&#39;;
              }
          
              echo "</p>";     
            
            echo "
          
          [size="1"]";
            echo "<a href=\"index.php?action=main&amp;sid=$sid\">Home</a>";
            echo " > ";
            echo "<a href=\"gallery.php?action=main&amp;sid=$sid\">Gallery</a>";
            echo " > ";
            echo "Uploading Photo";
            echo "[/size]</p>";  
            
            echo xhtmlfoot();
          }
          ?>

          Comment


            #6
            to me it looks to me like half the uploading coding is misssing but it might be done on functions instead ???
            mind u i am a littlle tipsy tring to look at this coding :P

            Comment


              #7
              same problem with me. any idea how to fix it.

              Comment


                #8
                in upload.php right maybe u didnt add the folder gallery and u only use this /$somethngimgcode try to check
                com site: http://vampist.net
                download site: http://wapdloads.net
                fb: http://www.facebook.com/pmplx

                Comment


                  #9
                  or if u already created the folder u muzt chm0od it to 777
                  com site: http://vampist.net
                  download site: http://wapdloads.net
                  fb: http://www.facebook.com/pmplx

                  Comment


                    #10
                    Code:
                    <?php
                    include("xhtmlfunctions.php");
                    header("Content-type: text/html; charset=ISO-8859-1");
                    echo "<?xml version=\"1.0\" encoding=\"ISO-8859-1\" ?>";
                    echo "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">";
                    
                    ?>
                    
                    <?php
                    include('class.upload.php');
                    include("config.php");
                    include("core.php");
                    
                    $bcon = connectdb();
                    
                    $sid = $_GET["sid"];
                    $uid = getuid_sid($sid);
                    
                    set_time_limit(0);
                    
                    if(islogged($sid)==false)
                    {
                          $pstyle = gettheme1("1");
                          echo xhtmlhead("WapLive",$pstyle);
                          echo "<p align=\"center\">";
                          echo "You are not logged in<br/>";
                          echo "Or Your session has been expired<br/><br/>";
                          echo "<a href=\"index.php\">Login</a>";
                          echo "</p>";
                      echo xhtmlfoot();
                          exit();
                        }
                    
                    if(isbanned($uid))
                        {
                          $pstyle = gettheme($sid);
                          echo xhtmlhead("WapLive",$pstyle);
                          echo "<p align=\"center\">";
                          echo "<img src=\"images/notok.gif\" alt=\"x\"/><br/>";
                          echo "You are <b>Banned</b><br/>";
                          $banto = mysql_fetch_array(mysql_query("SELECT timeto FROM ibwf_metpenaltiespl WHERE uid='".$uid."' AND penalty='1'"));
                    	  $banres = mysql_fetch_array(mysql_query("SELECT lastpnreas FROM ibwf_users WHERE id='".$uid."'"));
                    	  
                          $remain = $banto[0]- (time() - $timeadjust) ;
                          $rmsg = gettimemsg($remain);
                          echo "Time to finish your penalty: $rmsg<br/><br/>";
                    	  echo "Ban Reason: $banres[0]";
                          //echo "<a href=\"index.php\">Login</a>";
                          echo "</p>";
                      echo xhtmlfoot();
                          exit();
                        }
                    
                    //////////////////////////////////Members List
                    
                    error_reporting(E_ALL); 
                    
                    // we first include the upload class, as we will need it here to deal with the uploaded file
                    
                    $userinfo = mysql_fetch_array(mysql_query("SELECT name, sex FROM ibwf_users WHERE id='".$uid."'"));
                    $membername = $userinfo[0];
                    
                    // we have three forms on the test page, so we redirect accordingly
                    if ($_POST['action'] == 'image') {
                          $pstyle = gettheme($sid);
                          echo xhtmlhead("WapLive",$pstyle);
                          echo "<p align=\"center\">";
                    
                        // ---------- IMAGE UPLOAD ----------
                        
                        // we create an instance of the class, giving as argument the PHP object 
                        // corresponding to the file field from the form
                        // All the uploads are accessible from the PHP object $_FILES
                        $handle = new Upload($_FILES['my_field']);
                    
                        // then we check if the file has been uploaded properly
                        // in its *temporary* location in the server (often, it is /tmp)
                        if ($handle->uploaded) {
                            
                            // yes, the file is on the server
                            // below are some example settings which can be used if the uploaded file is an image.
                            $handle->image_resize            = true;
                            $handle->image_ratio_y           = true;
                            $handle->image_x                 = 150;
                    
                            // now, we start the upload 'process'. That is, to copy the uploaded file
                            // from its temporary location to the wanted location
                            // It could be something like $handle->Process('/home/www/');
                            $handle->Process('usergallery/');
                            
                            // we check if everything went OK
                            if ($handle->processed) {
                                // everything was fine !
                    
                                echo '  file uploaded with success<br/>';
                                echo '  <img src="usergallery/' . $handle->file_dst_name . '" /><br/>';
                                $info = getimagesize($handle->file_dst_pathname);
                                echo '  link to the file just uploaded: <a href="usergallery/' . $handle->file_dst_name . '">' . $handle->file_dst_name . '</a><br/>';
                                $imageurl = "usergallery/$handle->file_dst_name";
                                $reg = mysql_query("INSERT INTO ibwf_usergallery SET uid='".$uid."', imageurl='".$imageurl."', sex='".$userinfo[1]."', time='".(time() - $timeadjust)."'");
                    
                            } else {
                                // one error occured
                    
                                echo '  file not uploaded to the wanted location<br/>';
                                echo '  Error: ' . $handle->error . '<br/>';
                    
                            }
                    
                            // we delete the temporary files
                            $handle-> Clean();
                    
                        } else {
                            // if we're here, the upload file failed for some reasons
                            // i.e. the server didn't receive the file
                    
                            echo '  file not uploaded on the server<br/>';
                            echo '  Error: ' . $handle->error . '';
                        }
                        
                    
                        echo "</p>"; 
                      ////// UNTILL HERE >> 
                        echo "<p align=\"center\">";
                       echo "<br/><br/><a href=\"usergallery.php?action=main&amp;sid=$sid\">&#171;Back to Gallery</a><br/>";
                        echo "<a href=\"index.php?action=main&amp;sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>";
                    echo "Home</a>";
                      echo "</p>";
                    
                    
                    echo xhtmlfoot();
                    }
                    ?>
                    here are mu upload file just create a folder usergallery
                    ________________
                    Jacques
                    jacques@gw-designs.co.za
                    http://coding.biz.tm
                    Come join and lets make it a place to learn all the noobies how to code
                    __________________

                    NEVER FORGET TO CLICK THE TANX BUTTON IF U LIKE WHAT IM SHARING OR HELPING WITH

                    Comment

                    Working...
                    X