help in this code

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

    help in this code

    i want to put

    PHP Code:
    if(access(getuid_sid($sid))<100)
    {
    $plusses 100-plusses(getuid_sid($sid));
    echo 
    "You need $plusses to enter!
    "
    ;
    }
    else
    {
    }
    echo 
    "You can enter now!"

    but i dont know where to put it.

    i want to put it in gallery so that user cannot see gallery till he dont gains 100 plusses so where to put this code?
    thanks

    #2
    u put it in the gallery

    Comment


      #3
      where in gallery

      Comment


        #4
        where do you want it to show as the user enter the gallery?

        Comment


          #5
          i dont works.i got fatal error

          can u put for me

          PHP Code:
          <?php
          /*
          IrisBlaze wap forum
          by Ra'ed Shabana
          */
          //>> »
          //<< «
          include("config.php");
          include(
          "core.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

          $action 
          $_GET["action"];
          $sid $_GET["sid"];
          $whoimage $_GET["whoimage"];
          $bcon connectdb();
              if(
          islogged($sid)==false)
              {
                
          $pstyle gettheme($sid);
                echo 
          xhtmlhead("Methos",$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();
              }
          $uid getuid_sid($sid);
          if(
          isbanned($uid))
              {
                
          $pstyle gettheme($sid);
                echo 
          xhtmlhead("Methos",$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();
              }

          if(
          $action=="main")
          {
            
          addonline(getuid_sid($sid),"User Gallery","");
            
          $pstyle gettheme($sid);
            echo 
          xhtmlhead("User Gallery",$pstyle);
            echo 
          "<p align=\"center\"><small>";
            echo 
          "<i><b><u>The Gallery of the Members from Methos</u></b></i><br/>";
            echo 
          "<br/>";
            echo 
          "</small></p>";
            echo 
          "<p><small>";
            
          $noi mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_usergallery WHERE sex='F'"));
            echo 
          "<a href=\"usergallery.php?action=females&amp;sid=$sid\"><img src=\"images/female.gif\" alt=\"*\"/>Females</a>($noi[0])<br/>";
            
          $noi mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_usergallery WHERE sex='M'"));
            echo 
          "<a href=\"usergallery.php?action=males&amp;sid=$sid\"><img src=\"images/male.gif\" alt=\"*\"/>Males</a>($noi[0])<br/><br/>";
            echo 
          "<a href=\"usergallery.php?action=upload&amp;sid=$sid\">Add Your Photo</a><br/><br/>";
            echo 
          "</small></p>";
              echo 
          "</p>"
            
          ////// UNTILL HERE >> 
              
          echo "<p align=\"center\">";
              echo 
          "<a href=\"index.php?action=main&amp;sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>";
          echo 
          "Home</a>";
            echo 
          "</p>";
            echo 
          xhtmlfoot();
          }else
          if(
          $action=="males")
          {
            
          addonline(getuid_sid($sid),"Male Gallery","");
            
          $pstyle gettheme($sid);
            echo 
          xhtmlhead("Male Gallery",$pstyle);
            echo 
          "<p align=\"center\"><small>";
            echo 
          "<i><b><u>Male Users From Methos</u></b></i>";
            echo 
          "<br/><br/>";
            echo 
          "</small></p>";
             
          //////ALL LISTS SCRIPT <<
             
          $uid1 getuid_sid($sid); 

              if(
          $page=="" || $page<=0)$page=1;
              
          $noi mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_usergallery WHERE sex='M'"));
              
          $num_items $noi[0]; //changable
              
          $items_per_page5;
              
          $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 FROM ibwf_usergallery WHERE sex='M' ORDER BY id DESC LIMIT $limit_start$items_per_page";


              echo 
          "<p>";
              
          $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='".$item[1]."'";        
                  
          $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='".$item[1]."'"));
                  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='".$uid1."' and imageid ='".$item[1]."'"));
                  
          $totalcomments mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_usergallery_rating WHERE imageid ='".$item[1]."' and commentsyn ='Y'"));
                  
          $userinfo mysql_fetch_array(mysql_query("SELECT name FROM ibwf_users WHERE id='".$item[0]."'"));
                  
                  echo 
          "<a href=\"index.php?action=viewuser&amp;who=$item[0]&amp;sid=$sid\"><b><i><u>$userinfo[0]</u></i></b></a><small>";
                  if(
          canratephoto($uid1$item[0]) and ($rated[0]==0))
                  {
                   echo 
          "<br/><a href=\"usergallery.php?action=rate&amp;sid=$sid&amp;whoimage=$item[1]\">Rate This Photo</a>";
                  }
                  if((
          $uid1=="1") or ($uid1==$item[0]))
                  {
                   echo 
          " / <a href=\"usergallery.php?action=del&amp;sid=$sid&amp;whoimage=$item[1]\">Del</a>";
                  }
                  if(
          $uid1==$item[0])
                  {
                   echo 
          "<br/><a href=\"genproc.php?action=upavg&amp;sid=$sid&amp;avsrc=$item[2]\">Use As Avatar</a>";
                  }
                  echo 
          "</small><br/><img src=\"$item[2]\" alt=\"$userinfo[0]\"/><br/>";
                  echo 
          "<small>Rating: $rating/10 (<a href=\"usergallery.php?action=votes&amp;sid=$sid&amp;whoimage=$item[1]\">$norm[0]</a> Votes)<br/><a href=\"usergallery.php?action=comments&amp;sid=$sid&amp;whoimage=$item[1]\">Comments</a>($totalcomments[0])";
                  echo 
          "</small><br/><br/>";
                  
          $ratingtotal 0;
                  
              }
              }
              
              echo 
          "</p>";
              echo 
          "<p align=\"center\">";
              if(
          $page>1)
              {
                
          $ppage $page-1;
                echo 
          "<a href=\"usergallery.php?action=males&amp;sid=$sid&amp;page=$ppage\">«Prev</a> ";
              }
              if(
          $page<$num_pages)
              {
                
          $npage $page+1;
                echo 
          "<a href=\"usergallery.php?action=males&amp;sid=$sid&amp;page=$npage\">Next»</a>";
              }
              echo 
          "<br/>$page/$num_pages<br/>";
              if(
          $num_pages>2)
              {
                
          $rets "Jump to page<input name=\"pg\" format=\"*N\" size=\"3\"/>";
                  
          $rets .= "<anchor>[GO]";
                  
          $rets .= "<go href=\"usergallery.php\" method=\"get\">";
                  
          $rets .= "<postfield name=\"action\" value=\"$action\"/>";
                  
          $rets .= "<postfield name=\"sid\" value=\"$sid\"/>";
                  
          $rets .= "<postfield name=\"page\" value=\"$(pg)\"/>";
                  
          $rets .= "</go></anchor>";

                  echo 
          $rets;
              }
              echo 
          "</p>"
            
          ////// UNTILL HERE >> 
              
          echo "<p align=\"center\">";
             echo 
          "<br/><br/><a href=\"usergallery.php?action=main&amp;sid=$sid\">«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();
          }else
          if(
          $action=="females")
          {
            
          addonline(getuid_sid($sid),"Female Gallery","");
            
          $pstyle gettheme($sid);
            echo 
          xhtmlhead("Female Gallery",$pstyle);
            echo 
          "<p align=\"center\"><small>";
            echo 
          "<i><b><u>Female Users From Methos</u></b></i>";
            echo 
          "<br/><br/>";
            echo 
          "</small></p>";
             
          //////ALL LISTS SCRIPT <<
             
          $uid1 getuid_sid($sid); 

              if(
          $page=="" || $page<=0)$page=1;
              
          $noi mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_usergallery WHERE sex='F'"));
              
          $num_items $noi[0]; //changable
              
          $items_per_page5;
              
          $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 FROM ibwf_usergallery WHERE sex='F' ORDER BY id DESC LIMIT $limit_start$items_per_page";


              echo 
          "<p>";
              
          $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='".$item[1]."'";        
                  
          $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='".$item[1]."'"));
                  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='".$uid1."' and imageid ='".$item[1]."'"));
                  
          $totalcomments mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_usergallery_rating WHERE imageid ='".$item[1]."' and commentsyn ='Y'"));
                  
          $userinfo mysql_fetch_array(mysql_query("SELECT name FROM ibwf_users WHERE id='".$item[0]."'"));
                  
                  echo 
          "<a href=\"index.php?action=viewuser&amp;who=$item[0]&amp;sid=$sid\"><b><i><u>$userinfo[0]</u></i></b></a><small>";
                  if(
          canratephoto($uid1$item[0]) and ($rated[0]==0))
                  {
                   echo 
          "<br/><a href=\"usergallery.php?action=rate&amp;sid=$sid&amp;whoimage=$item[1]\">Rate This Photo</a>";
                  }
                  if((
          $uid1=="1") or ($uid1==$item[0]))
                  {
                   echo 
          " / <a href=\"usergallery.php?action=del&amp;sid=$sid&amp;whoimage=$item[1]\">Del</a>";
                  }
                  if(
          $uid1==$item[0])
                  {
                   echo 
          "<br/><a href=\"genproc.php?action=upavg&amp;sid=$sid&amp;avsrc=$item[2]\">Use As Avatar</a>";
                  }
                  echo 
          "</small><br/><img src=\"$item[2]\" alt=\"$userinfo[0]\"/><br/>";
                  echo 
          "<small>Rating: $rating/10 (<a href=\"usergallery.php?action=votes&amp;sid=$sid&amp;whoimage=$item[1]\">$norm[0]</a> Votes)<br/><a href=\"usergallery.php?action=comments&amp;sid=$sid&amp;whoimage=$item[1]\">Comments</a>($totalcomments[0])";
                  echo 
          "</small><br/><br/>";
                  
          $ratingtotal 0;
                  
              }
              }
              
              echo 
          "</p>";
              echo 
          "<p align=\"center\">";
              if(
          $page>1)
              {
                
          $ppage $page-1;
                echo 
          "<a href=\"usergallery.php?action=males&amp;sid=$sid&amp;page=$ppage\">«Prev</a> ";
              }
              if(
          $page<$num_pages)
              {
                
          $npage $page+1;
                echo 
          "<a href=\"usergallery.php?action=males&amp;sid=$sid&amp;page=$npage\">Next»</a>";
              }
              echo 
          "<br/>$page/$num_pages<br/>";
              if(
          $num_pages>2)
              {
                
          $rets "Jump to page<input name=\"pg\" format=\"*N\" size=\"3\"/>";
                  
          $rets .= "<anchor>[GO]";
                  
          $rets .= "<go href=\"usergallery.php\" method=\"get\">";
                  
          $rets .= "<postfield name=\"action\" value=\"$action\"/>";
                  
          $rets .= "<postfield name=\"sid\" value=\"$sid\"/>";
                  
          $rets .= "<postfield name=\"page\" value=\"$(pg)\"/>";
                  
          $rets .= "</go></anchor>";

                  echo 
          $rets;
              }
              echo 
          "</p>"
            
          ////// UNTILL HERE >> 
              
          echo "<p align=\"center\">";
             echo 
          "<br/><br/><a href=\"usergallery.php?action=main&amp;sid=$sid\">«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();
          }else
          if(
          $action=="rate")
          {
            
          addonline(getuid_sid($sid),"User Gallery","");
            
          $pstyle gettheme($sid);
            echo 
          xhtmlhead("Rate - User Gallery",$pstyle);
            echo 
          "<p align=\"center\"><small>";
            echo 
          "Rate this members Photo: 1=Low, 10=High<br/>You can also leave a comment for this photo!<br/>";
            echo 
          "<br/>";
            echo 
          "</small></p>";
            echo 
          "<p>";
              echo 
          "<form action=\"usergallery.php?action=rateuser&amp;sid=$sid&amp;whoimage=$whoimage\" method=\"post\">";
              echo 
          "<small>Rate:</small> <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><br/>";
              
            echo 
          "<small>Comments:</small> <input name=\"comment\" format=\"*M\" maxlength=\"200\"/><br/>";
            echo 
          "<input type=\"submit\" value=\"Rate\"/>";
            echo 
          "</form>"
            
              echo 
          "</p>"
            
          ////// UNTILL HERE >> 
              
          echo "<p align=\"center\">";
             echo 
          "<br/><br/><a href=\"usergallery.php?action=main&amp;sid=$sid\">«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();
          }else
          if(
          $action=="comments")
          {
            
          addonline(getuid_sid($sid),"User Gallery","");
            
          $pstyle gettheme($sid);
            echo 
          xhtmlhead("User Gallery",$pstyle);
            echo 
          "<p align=\"center\"><small>";
            echo 
          "<br/>";
            echo 
          "</small></p>";
                
          //////ALL LISTS SCRIPT <<

              
          if($page=="" || $page<=0)$page=1;
              
          $noi mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_usergallery_rating WHERE imageid='".$whoimage."' and commentsyn ='Y'"));
              
          $num_items $noi[0]; //changable
              
          $items_per_page5;
              
          $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='".$whoimage."'"));
              
          $uid getuid_sid($sid);

              
              
          $sql "SELECT rating, comments, byuid, time, commentsreply, id  FROM ibwf_usergallery_rating WHERE imageid ='".$whoimage."' and commentsyn ='Y' ORDER BY time DESC LIMIT $limit_start$items_per_page";


              echo 
          "<p>";
              
          $items mysql_query($sql);
              echo 
          mysql_error();
              if(
          mysql_num_rows($items)>0)
              {
              while (
          $item mysql_fetch_array($items))
              {
                  
              if(
          isonline($item[2]))
            {
              
          $iml "<img src=\"images/onl.gif\" alt=\"+\"/>";
              
            }else{
              
          $iml "<img src=\"images/ofl.gif\" alt=\"-\"/>";
            }
              if(
          strlen($item[1])>1){
                   
                
          $snick getnick_uid($item[2]);
                
          $lnk "<small><a href=\"index.php?action=viewuser&amp;who=$item[2]&amp;sid=$sid\">$iml$snick:</a> <b>$item[0]/10</b></small>";
                echo 
          "$lnk<br/><small>";
                
          $bs date("d/m/y",$item[3]);
                
          $text parsepm($item[1], $sid);
                if((
          $uid==$uidinfo[0]) and (strlen($item[4])<1))
                {
                  
          $replylink "<a href=\"usergallery.php?action=commentreply&amp;sid=$sid&amp;id=$item[5]\">Reply to Comment</a><br/><i>$bs</i>";
                }else{
                  
          $replylink " <i>$bs</i>";
                }
                echo 
          "$text";
                if(
          strlen($item[4])>1)
                {
                
          $text1 parsepm($item[4], $sid);
                echo 
          "<br><b><i>Reply:</i> $text1</b>";
                }
                echo 
          "<br/>$replylink<br/><br/>";
                echo 
          "</small>";
              }
              }
              }
              echo 
          "</p>";
              echo 
          "<p align=\"center\">";
              if(
          $page>1)
              {
                
          $ppage $page-1;
                echo 
          "<a href=\"usergallery.php?action=$action&amp;page=$ppage&amp;sid=$sid&amp;who=$who\">«Prev</a> ";
              }
              if(
          $page<$num_pages)
              {
                
          $npage $page+1;
                echo 
          "<a href=\"usergallery.php?action=$action&amp;page=$npage&amp;sid=$sid&amp;who=$who\">Next»</a>";
              }
              echo 
          "<br/>$page/$num_pages<br/>";
              if(
          $num_pages>2)
              {
                
          $rets "Jump to page<input name=\"pg\" format=\"*N\" size=\"3\"/>";
                  
          $rets .= "<anchor>[GO]";
                  
          $rets .= "<go href=\"usergallery.php\" method=\"get\">";
                  
          $rets .= "<postfield name=\"action\" value=\"$action\"/>";
                  
          $rets .= "<postfield name=\"who\" value=\"$who\"/>";
                  
          $rets .= "<postfield name=\"sid\" value=\"$sid\"/>";
                  
          $rets .= "<postfield name=\"page\" value=\"$(pg)\"/>";
                  
          $rets .= "</go></anchor>";

                  echo 
          $rets;
              }
              echo 
          "</p>"
            
          ////// UNTILL HERE >> 
              
          echo "<p align=\"center\">";
             echo 
          "<br/><br/><a href=\"usergallery.php?action=main&amp;sid=$sid\">«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();
          }else
          if(
          $action=="commentreply")
          {
            
          addonline(getuid_sid($sid),"User Gallery","");
            
          $pstyle gettheme($sid);
            echo 
          xhtmlhead("User Gallery",$pstyle);
            
          $id $_GET["id"];
            echo 
          "<p align=\"center\"><small>";
            echo 
          "Reply to a Comment<br/>";
            echo 
          "<br/>";
            echo 
          "</small></p>";
            echo 
          "<p>";
              echo 
          "<form action=\"usergallery.php?action=commentreplyaction&amp;sid=$sid&amp;id=$id\" method=\"post\">";
            echo 
          "<small>Reply:</small> <input name=\"reply\" format=\"*M\" maxlength=\"200\"/><br/>";
            echo 
          "<input type=\"submit\" value=\"Reply\"/>";
            echo 
          "</form>"
            
              echo 
          "</p>"
            
          ////// UNTILL HERE >> 
              
          echo "<p align=\"center\">";
             echo 
          "<br/><br/><a href=\"usergallery.php?action=main&amp;sid=$sid\">«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();
          }else
          if(
          $action=="votes")
          {
            
          addonline(getuid_sid($sid),"User Gallery","");
            
          $pstyle gettheme($sid);
            echo 
          xhtmlhead("User Gallery",$pstyle);
            echo 
          "<p align=\"center\"><small>";
            echo 
          "<br/>";
            echo 
          "</small></p>";
                
          //////ALL LISTS SCRIPT <<

              
          if($page=="" || $page<=0)$page=1;
              
          $noi mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_usergallery_rating WHERE imageid='".$whoimage."'"));
              
          $num_items $noi[0]; //changable
              
          $items_per_page20;
              
          $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='".$item[1]."'";

              
                  
          $sql "SELECT rating, byuid, time  FROM ibwf_usergallery_rating WHERE imageid ='".$whoimage."' ORDER BY time DESC LIMIT $limit_start$items_per_page";


              echo 
          "<p>";
              
          $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]);
                
          $lnk "<a href=\"index.php?action=viewuser&amp;who=$item[1]&amp;sid=$sid\">$iml$snick:</a> <b>$item[0]/10</b>";
                echo 
          "$lnk<br/>";
              
              }
              }
              echo 
          "</p>";
              echo 
          "<p align=\"center\">";
              if(
          $page>1)
              {
                
          $ppage $page-1;
                echo 
          "<a href=\"usergallery.php?action=$action&amp;page=$ppage&amp;sid=$sid&amp;who=$who\">«Prev</a> ";
              }
              if(
          $page<$num_pages)
              {
                
          $npage $page+1;
                echo 
          "<a href=\"usergallery.php?action=$action&amp;page=$npage&amp;sid=$sid&amp;who=$who\">Next»</a>";
              }
              echo 
          "<br/>$page/$num_pages<br/>";
              if(
          $num_pages>2)
              {
                
          $rets "Jump to page<input name=\"pg\" format=\"*N\" size=\"3\"/>";
                  
          $rets .= "<anchor>[GO]";
                  
          $rets .= "<go href=\"usergallery.php\" method=\"get\">";
                  
          $rets .= "<postfield name=\"action\" value=\"$action\"/>";
                  
          $rets .= "<postfield name=\"who\" value=\"$who\"/>";
                  
          $rets .= "<postfield name=\"sid\" value=\"$sid\"/>";
                  
          $rets .= "<postfield name=\"page\" value=\"$(pg)\"/>";
                  
          $rets .= "</go></anchor>";

                  echo 
          $rets;
              }
              echo 
          "</p>"
            
          ////// UNTILL HERE >> 
              
          echo "<p align=\"center\">";
             echo 
          "<br/><br/><a href=\"usergallery.php?action=main&amp;sid=$sid\">«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();
          }else


          if(
          $action=="rateuser")
          {
             
          addonline(getuid_sid($sid),"Rate a User","");
             
          $rate $_POST["rate"];
             
          $comment $_POST["comment"];
             
          $pstyle gettheme($sid);
            echo 
          xhtmlhead("User Gallery",$pstyle);
             echo 
          "<p align=\"center\">";
             
          $uid getuid_sid($sid);
             if((
          strlen($comment))>1){   
             
          $resmysql_query("INSERT INTO ibwf_usergallery_rating SET imageid='".$whoimage."', rating='".$rate."', comments='".$comment."', byuid='".$uid."', time='".(time() - $timeadjust)."', commentsyn='Y'");
             }else
             if((
          strlen($comment))<2){   
             
          $resmysql_query("INSERT INTO ibwf_usergallery_rating SET imageid='".$whoimage."', rating='".$rate."', comments='".$comment."', byuid='".$uid."', time='".(time() - $timeadjust)."', commentsyn='N'");
             }

             if((
          $res) and ((strlen($comment))>1)){
             
               echo 
          "<img src=\"images/ok.gif\" alt=\"o\"/>Rated Successfully<br/>";
               echo 
          "<img src=\"images/ok.gif\" alt=\"o\"/>Comments added Successfully<br/>";
             }else
             if((
          $res) and ((strlen($comment))<2)){
             
               echo 
          "<img src=\"images/ok.gif\" alt=\"o\"/>Rated Successfully<br/>";
               echo 
          "<img src=\"images/notok.gif\" alt=\"x\"/>No Comments were added<br/>";
             }
             else{
               echo 
          "<img src=\"images/notok.gif\" alt=\"x\"/>Rated unsuccessfully<br/>";
               echo 
          "<img src=\"images/notok.gif\" alt=\"x\"/>No Comments were added<br/>";
             }
              echo 
          "</p>"
            
          ////// UNTILL HERE >> 
              
          echo "<p align=\"center\">";
             echo 
          "<br/><br/><a href=\"usergallery.php?action=main&amp;sid=$sid\">«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();
          }else


          if(
          $action=="commentreplyaction")
          {
             
          addonline(getuid_sid($sid),"Reply To Comment","");
             
          $id $_GET["id"];
             
          $reply $_POST["reply"];
             
          $pstyle gettheme($sid);
            echo 
          xhtmlhead("User Gallery",$pstyle);
             echo 
          "<p align=\"center\">";
             
          $uid getuid_sid($sid);
             
          $res mysql_query("UPDATE ibwf_usergallery_rating SET commentsreply='".$reply."' WHERE id='".$id."'");


             if(
          $res){
             
               echo 
          "<img src=\"images/ok.gif\" alt=\"o\"/>Replyed Successfully<br/>";
             }
             else{
               echo 
          "<img src=\"images/notok.gif\" alt=\"x\"/>Replyed unsuccessfully<br/>";
             }
              echo 
          "</p>"
            
          ////// UNTILL HERE >> 
              
          echo "<p align=\"center\">";
             echo 
          "<br/><br/><a href=\"usergallery.php?action=main&amp;sid=$sid\">«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();
          }else


          if(
          $action=="upload")
          {
             
          addonline(getuid_sid($sid),"Uploading a Photo","");
             
          $rate $_POST["rate"];
             
          $comment $_POST["comment"];
             
          $pstyle gettheme($sid);
            echo 
          xhtmlhead("Uploading",$pstyle);
            
          set_time_limit(0);
             echo 
          "<p><small>";
             echo 
          "You can now upload your photo direct from your phone. If this doesn't work, MMS or E-Mail me the photo to <b>methoswap@gmail.com</b><br/>Note: You must rename your photo to your username if you MMS or E-Mail it.<br/>";
             
           
                      echo 
          "<br/>Pick a Photo to upload, and press 'upload'<br/>";
                      echo 
          " <form name=\"form2\" enctype=\"multipart/form-data\" method=\"post\" action=\"upload.php?action=upload&amp;sid=$sid\" />";
                      echo 
          "<input type=\"file\" size=\"32\" name=\"my_field\" value=\"\" />";
                      echo 
          "<input type=\"hidden\" name=\"action\" value=\"image\" /><br/>";
                      echo 
          "<input type=\"submit\" name=\"Submit\" value=\"upload\" />";
                      echo 
          "</form>";
             
              echo 
          "</small></p>"
            
          ////// UNTILL HERE >> 
              
          echo "<p align=\"center\">";
             echo 
          "<br/><br/><a href=\"usergallery.php?action=main&amp;sid=$sid\">«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();
          }
          //////////// Delete users posts
          else if($action=="del")
          {

              
          $pstyle gettheme($sid);
            echo 
          xhtmlhead("User Gallery",$pstyle);
                echo 
          "<p align=\"center\">";

                  echo 
          "<br/>";
              
          $res mysql_query("DELETE FROM ibwf_usergallery WHERE id='".$whoimage."'");
              
          $res mysql_query("DELETE FROM ibwf_usergallery_rating WHERE imageid='".$whoimage."'");
                

                  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 
          "<br/><br/><a href=\"usergallery.php?action=main&amp;sid=$sid\">«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();
          }else

          {
            
          addonline(getuid_sid($sid),"Lost in Gallery","");
            
          $pstyle gettheme($sid);
            echo 
          xhtmlhead("Gallery",$pstyle);
            echo 
          "<p align=\"center\">";
            echo 
          "I don't know how did you get into here, but there's nothing to show<br/><br/>";
            echo 
          "<a href=\"index.php?action=main&amp;sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>";
            echo 
          "Home</a>";
            echo 
          "</p>";
            echo 
          xhtmlfoot();
          }

          ?>

          Comment


            #6
            try tthis and modify
            Code:
            if($action=="main")
            {
              addonline(getuid_sid($sid),"User Gallery","");
              $pstyle = gettheme($sid);
              echo xhtmlhead("User Gallery",$pstyle);
              echo "<p align=\"center\"><small>";
              echo "<i><b><u>The Gallery of the Members from Methos</u></b></i><br/>";
              echo "<br/>";
              echo "</small></p>";
              echo "<p><small>";
            
            
            
            if(access(getuid_sid($sid))<100)
            {
            $plusses = 100-plusses(getuid_sid($sid));
            echo "You need $plusses to enter!
            ";
            }else{
            //////[b]look this man... else statement is false..[/b]
            
              $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_usergallery WHERE sex='F'"));
              echo "<a href=\"usergallery.php?action=females&amp;sid=$sid\"><img src=\"http://coding-talk.com/images/female.gif\" alt=\"*\"/>Females</a>($noi[0])<br/>";
              $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_usergallery WHERE sex='M'"));
              echo "<a href=\"usergallery.php?action=males&amp;sid=$sid\"><img src=\"http://coding-talk.com/images/male.gif\" alt=\"*\"/>Males</a>($noi[0])<br/><br/>";
              echo "<a href=\"usergallery.php?action=upload&amp;sid=$sid\">Add Your Photo</a><br/><br/>";
            
            }///endif
            
            
              echo "</small></p>";
                echo "</p>"; 
              ////// UNTILL HERE >> 
                echo "<p align=\"center\">";
                echo "<a href=\"index.php?action=main&amp;sid=$sid\"><img src=\"http://coding-talk.com/images/home.gif\" alt=\"*\"/>";
            echo "Home</a>";
              echo "</p>";
              echo xhtmlfoot();
            }
            com site: http://vampist.net
            download site: http://wapdloads.net
            fb: http://www.facebook.com/pmplx

            Comment


              #7
              not working yet

              fatal error coming

              Call to undefined function plusses()


              core is

              function access($uid)
              {
              $pluss = mysql_fetch_array(mysql_query("SELECT plusses FROM ibwf_users WHERE id='".$uid."'"));
              return $pluss[0];
              }
              Last edited by godzilla; 11.11.09, 16:46.

              Comment


                #8
                $plusses = 100-plusses(getuid_sid($sid));

                this is wrong to ur code lol.....just add function plusses in your core.php
                com site: http://vampist.net
                download site: http://wapdloads.net
                fb: http://www.facebook.com/pmplx

                Comment


                  #9
                  it must be


                  Code:
                  if(access(getuid_sid($sid))<100)
                  {
                  
                  $credits = mysql_fetch_array(mysql_query("SELECT plusses FROM ibwf_users WHERE id='".$uid."'"));
                  
                  echo "Your current plusses is $credits[0] so you need 100 plusses to enter!";
                  
                  }else{
                  }









                  then it will be





                  Code:
                  if($action=="main")
                  {
                    addonline(getuid_sid($sid),"User Gallery","");
                    $pstyle = gettheme($sid);
                    echo xhtmlhead("User Gallery",$pstyle);
                    echo "<p align=\"center\"><small>";
                    echo "<i><b><u>The Gallery of the Members from Methos</u></b></i><br/>";
                    echo "<br/>";
                    echo "</small></p>";
                    echo "<p><small>";
                  
                  
                  
                  if(access(getuid_sid($sid))<100)
                  {
                  
                  $credits = mysql_fetch_array(mysql_query("SELECT plusses FROM ibwf_users WHERE id='".$uid."'"));
                  
                  echo "Your current plusses is $credits[0] so you need 100 plusses to enter!";
                  
                  }else{
                  //////look this man... else statement is false..
                  
                    $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_usergallery WHERE sex='F'"));
                    echo "<a href=\"usergallery.php?action=females&amp;sid=$sid\"><img src=\"http://coding-talk.com/images/female.gif\" alt=\"*\"/>Females</a>($noi[0])<br/>";
                    $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_usergallery WHERE sex='M'"));
                    echo "<a href=\"usergallery.php?action=males&amp;sid=$sid\"><img src=\"http://coding-talk.com/images/male.gif\" alt=\"*\"/>Males</a>($noi[0])<br/><br/>";
                    echo "<a href=\"usergallery.php?action=upload&amp;sid=$sid\">Add Your Photo</a><br/><br/>";
                  
                  }///endif
                  
                  
                    echo "</small></p>";
                      echo "</p>"; 
                    ////// UNTILL HERE >> 
                      echo "<p align=\"center\">";
                      echo "<a href=\"index.php?action=main&amp;sid=$sid\"><img src=\"http://coding-talk.com/images/home.gif\" alt=\"*\"/>";
                  echo "Home</a>";
                    echo "</p>";
                    echo xhtmlfoot();
                  }
                  com site: http://vampist.net
                  download site: http://wapdloads.net
                  fb: http://www.facebook.com/pmplx

                  Comment


                    #10
                    thanks metal

                    its working now

                    Comment


                      #11
                      ...

                      Originally posted by godzilla View Post
                      thanks metal

                      its working now
                      ur welcome mate...!

                      dont forget to click thanks!
                      Last edited by wapmetal; 12.11.09, 01:07.
                      com site: http://vampist.net
                      download site: http://wapdloads.net
                      fb: http://www.facebook.com/pmplx

                      Comment


                        #12
                        ok i did it.

                        again thanks for makimg me remember about that.hehe

                        Comment

                        Working...
                        X