Gallery For Lavalair (converted To Wml)

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

    Gallery For Lavalair (converted To Wml)

    put this in gallery.php
    Code:
    <?php
    /*
    IrisBlaze wap forum
    by Ra&#39;ed Shabana
    */
    //» »
    //« «
    include("config.php");
    include("core.php");
    //session_start();
    header("Content-type: text/vnd.wap.wml");
    header("Cache-Control: no-store, no-cache, must-revalidate");
    echo("<?xml version=\"1.0\"?>");
    echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\"". " \"http://www.wapforum.org/DTD/wml_1.1.xml\">";
    
    ?>
    
    <wml>
    
    <?php
    connectdb();
    $action = $_GET["action"];
    $sid = $_GET["sid"];
    $page = $_GET["page"];
    $who = $_GET["who"];
    
    if(islogged($sid)==false)
    {
        echo "<card id=\"main\" title=\"Natasu\">";
          echo "<p align=\"center\">";
          echo "You are not logged in
    ";
          echo "Or Your session has been expired
    
    ";
          echo "<a href=\"index.php\">Login</a>";
          echo "</p>";
          echo "</card>";
          echo "</wml>";
          exit();
    }
    $uid = getuid_sid($sid);
    if(isbanned($uid))
        {
            echo "<card id=\"main\" title=\"Natasu\">";   
          echo "<p align=\"center\">";
          echo "<img src=\"images/notok.gif\" alt=\"x\"/>
    ";
          echo "You are [b]Banned[/b]
    ";
          $banto = mysql_fetch_array(mysql_query("SELECT timeto FROM fun_penalties WHERE uid=&#39;".$uid."&#39; AND penalty=&#39;1&#39;"));
          $remain = $banto[0]- time();
          $rmsg = gettimemsg($remain);
          echo "Time to finish your penalty: $rmsg
    
    ";
          //echo "<a href=\"index.php\">Login</a>";
          echo "</p>";
    echo "</card>";
          echo "</wml>";
          exit();
        }
    
    if($action=="main")
    {
      addonline(getuid_sid($sid),"user gallery","");
         echo "<card id=\"main\" title=\"Natasu\">";
      echo "
    
    ";
    
    $males = mysql_fetch_array(mysql_query("SELECT COUNT(DISTINCT uid) FROM fun_gallery WHERE sex=&#39;M&#39;"));
    echo "<a href=\"gallery.php?action=male&amp;sid=$sid\"><img src=\"images/male.gif\" alt=\"\"/>Male Gallery($males[0])</a>
    ";
    echo "
    ";
    $females = mysql_fetch_array(mysql_query("SELECT COUNT(DISTINCT uid) FROM fun_gallery WHERE sex=&#39;F&#39;"));
    echo "<a href=\"gallery.php?action=female&amp;sid=$sid\"><img src=\"images/female.gif\" alt=\"\"/>Female Gallery($females[0])</a>
    ";
    echo "
    ";
    echo "<a href=\"gallery.php?action=gallery&amp;sid=$sid\">+Add Photo+</a>
    ";
      echo "<a href=\"index.php?action=main&amp;sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>";
    echo "Home</a>";
      echo "</p>";
      echo "</card>";
      
    
    }
    else if($action=="gallery")
    {
      addonline(getuid_sid($sid),"Adding Photo","");
         echo "<card id=\"main\" title=\"Natasu\">";
      echo "<p align=\"center\">";
    echo "If you have a url to ur photo u may add it to the gallery below
    Please note that only .jpeg/.jpg files will show in gallery.
    All other file formats will be removed my staff
    
    ";
    
    echo "[size="1"]Image URL:[/size] <input name=\"itemurl\" maxlength=\"100\" value=\"http://\"/>
    ";
    echo "<anchor>Add Photo";
    echo "<go href=\"genproc.php?action=addgal&amp;sid=$sid\" method=\"post\">";
    echo "<postfield name=\"itemurl\" value=\"$(itemurl)\"/>";
    echo "</go></anchor>";
    
      echo "
    
    ";
    echo "<a href=\"gallery.php?action=main&amp;sid=$sid\">User Gallery</a>
    ";
      echo "<a href=\"index.php?action=main&amp;sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>";
    echo "Home</a>";
      echo "</p>";
       echo "</card>";
    
    
    }
    else if($action=="male")
    {
          addonline(getuid_sid($sid),"Viewing Male Gallery","");
          echo "<card id=\"main\" title=\"Natasu\">";
        $uid = getuid_sid($sid);
    
    
    
        //////ALL gallery SCRIPT <<
    
        if($page=="" || $page<=0)$page=1;
    
    
        if($who!="")
        {
        $noi = mysql_fetch_array(mysql_query("SELECT COUNT(DISTINCT uid) FROM fun_gallery WHERE sex=&#39;M&#39;"));
        }else{
        $noi = mysql_fetch_array(mysql_query("SELECT COUNT(DISTINCT uid) FROM fun_gallery WHERE sex=&#39;M&#39;"));
        }
    
        $num_items = $noi[0]; //changable
        $items_per_page= 5;
        $num_pages = ceil($num_items/$items_per_page);
        if(($page>$num_pages)&&$page!=1)$page= $num_pages;
        $limit_start = ($page-1)*$items_per_page;
    
    $sql = "SELECT DISTINCT uid FROM fun_gallery WHERE sex=&#39;M&#39; ORDER BY uid ASC LIMIT $limit_start, $items_per_page";
    
    echo "
    
    [size="1"]";
        $items = mysql_query($sql);
        echo mysql_error();
        
        if(mysql_num_rows($items)>0)
        {
        while ($item = mysql_fetch_array($items))
        {
    $who = $item[0];
    $user=getnick_uid($who);
    
    $countpics = mysql_fetch_array(mysql_query("SELECT COUNT(id) FROM fun_gallery WHERE uid=&#39;".$who."&#39;"));
            $lnk = "<a href=\"gallery.php?action=viewuser&amp;who=$who&amp;sid=$sid\">$user($countpics[0])</a>
    ";
           echo "$lnk"; 
        }
        }
    
        echo "[/size]</p>";
    echo "<p align=\"center\">";
        if($page>1)
        {
          $ppage = $page-1;
          echo "<a href=\"gallery.php?action=$action&amp;page=$ppage&amp;sid=$sid\">«PREV</a> ";
        }
        if($page<$num_pages)
        {
          $npage = $page+1;
          echo "<a href=\"gallery.php?action=$action&amp;page=$npage&amp;sid=$sid\">Next»</a>";
        }
        echo "
    $page/$num_pages
    ";
        if($num_pages>2)
        {
          $rets = "Jump to page<input name=\"pg\" format=\"*N\" size=\"3\"/>";
            $rets .= "<anchor>[GO]";
            $rets .= "<go href=\"gallery.php\" method=\"get\">";
            $rets .= "<postfield name=\"action\" value=\"$action\"/>";
            $rets .= "<postfield name=\"sid\" value=\"$sid\"/>";
            $rets .= "<postfield name=\"page\" value=\"$(pg)\"/>";
            $rets .= "</go></anchor>";
    
            echo $rets;
        }
    
    echo "<a href=\"gallery.php?action=main&amp;sid=$sid\">User Gallery</a>
    ";
    echo "<a href=\"index.php?action=main&amp;sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>";
    echo "Home</a>";
        echo "</p>";
         echo "</card>";
    
    
    }
    else if($action=="female")
    {
         addonline(getuid_sid($sid),"Viewing Female Gallery","");
           echo "<card id=\"main\" title=\"Natasu\">";
        $uid = getuid_sid($sid);
    
    
        //////ALL gallery SCRIPT <<
    
        if($page=="" || $page<=0)$page=1;
        if($who!="")
        {
        $noi = mysql_fetch_array(mysql_query("SELECT COUNT(DISTINCT uid) FROM fun_gallery WHERE sex=&#39;F&#39;"));
        }else{
        $noi = mysql_fetch_array(mysql_query("SELECT COUNT(DISTINCT uid) FROM fun_gallery WHERE sex=&#39;F&#39;"));
        }
    
        $num_items = $noi[0]; //changable
        $items_per_page= 5;
        $num_pages = ceil($num_items/$items_per_page);
        if(($page>$num_pages)&&$page!=1)$page= $num_pages;
        $limit_start = ($page-1)*$items_per_page;
    
    $sql = "SELECT DISTINCT uid FROM fun_gallery WHERE sex=&#39;F&#39; ORDER BY uid ASC LIMIT $limit_start, $items_per_page";
    
    echo "
    
    [size="1"]";
        $items = mysql_query($sql);
        echo mysql_error();
        if(mysql_num_rows($items)>0)
        {
        while ($item = mysql_fetch_array($items))
        {
    $who = $item[0];
    $user=getnick_uid($who);
    $countpics = mysql_fetch_array(mysql_query("SELECT COUNT(id) FROM fun_gallery WHERE uid=&#39;".$who."&#39;"));
            $lnk = "<a href=\"gallery.php?action=viewuser&amp;who=$who&amp;sid=$sid\">$user($countpics[0])</a>
    ";
            
    echo "$lnk";
    
        }
        }else{
    echo "female gallery is empty";
    }
        echo "[/size]</p>";
    echo "<p align=\"center\">";
        if($page>1)
        {
          $ppage = $page-1;
          echo "<a href=\"gallery.php?action=$action&amp;page=$ppage&amp;sid=$sid\">«PREV</a> ";
        }
        if($page<$num_pages)
        {
          $npage = $page+1;
          echo "<a href=\"gallery.php?action=$action&amp;page=$npage&amp;sid=$sid\">Next»</a>";
        }
        echo "
    $page/$num_pages
    ";
        if($num_pages>2)
        {
          $rets = "Jump to page<input name=\"pg\" format=\"*N\" size=\"3\"/>";
            $rets .= "<anchor>[GO]";
            $rets .= "<go href=\"gallery.php\" method=\"get\">";
            $rets .= "<postfield name=\"action\" value=\"$action\"/>";
            $rets .= "<postfield name=\"sid\" value=\"$sid\"/>";
            $rets .= "<postfield name=\"page\" value=\"$(pg)\"/>";
            $rets .= "</go></anchor>";
    
            echo $rets;
        }
    
    echo "<a href=\"gallery.php?action=main&amp;sid=$sid\">User Gallery</a>
    ";
    echo "<a href=\"index.php?action=main&amp;sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>";
    echo "Home</a>";
        echo "</p>";
    echo "</card>";
    
    }
    else if($action=="viewuser")
    {
          $who = $_GET["who"];
        addonline(getuid_sid($sid),"Viewing user Photos","");
             echo "<card id=\"main\" title=\"Natasu\">";
        $uid = getuid_sid($sid);
    
    
    
        //////ALL gallery SCRIPT <<
    
        if($page=="" || $page<=0)$page=1;
        if($who!="")
        {
        $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM fun_gallery WHERE uid=&#39;".$who."&#39;"));
        }else{
        $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM fun_gallery"));
        }
        $num_items = $noi[0]; //changable
        $items_per_page= 1;
        $num_pages = ceil($num_items/$items_per_page);
        if(($page>$num_pages)&&$page!=1)$page= $num_pages;
        $limit_start = ($page-1)*$items_per_page;
    
        if($who!="")
        {
            $sql = "SELECT id, sex, itemurl FROM fun_gallery WHERE uid=&#39;".$who."&#39; ORDER BY id DESC LIMIT $limit_start, $items_per_page";
            }else{
    $sql = "SELECT id, sex, itemurl, uid FROM fun_gallery  ORDER BY id DESC LIMIT $limit_start, $items_per_page";
            }
    
    echo "<p align=\"center\">";
        $items = mysql_query($sql);
        echo mysql_error();
        if(mysql_num_rows($items)>0)
        {
        while ($item = mysql_fetch_array($items))
        {
          $id = $item[0];
        $img = $item[2];
        
          
            $lnk = "<img src=\"max.php?filename=$img\" alt=\"$id\"/>
    ";
        $rinfo = mysql_fetch_array(mysql_query("SELECT COUNT(*) as nofr, SUM(prate) as nofp FROM fun_prate WHERE pid=&#39;".$id."&#39;"));
    $counts = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM fun_prate WHERE pid=&#39;".$id."&#39;"));
    if($counts[0]>0) {
        $ther = $rinfo[1]/$rinfo[0];
        $rating = "Rating: $ther/$rinfo[1] (votes($counts[0]))
    ";
    }else{
    $rating = "";
    }
    
             $gall = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM fun_galcomments WHERE pid=&#39;".$id."&#39;"));
    $me = getuid_sid($sid);
    if($who=="$me") {
    $use = "<a href=\"genproc.php?action=useav&amp;sid=$sid&amp;gid=$item[0]\">Use as Avatar</a> | ";
    }else{
    $use = "";
    }
          if(candelgal($uid, $item[0]))
          {
            $delnk = "<a href=\"genproc.php?action=delgal&amp;sid=$sid&amp;gid=$item[0]\">Remove Photo</a>";
          }else{
            $delnk = "";
          }
          echo "$lnk$rating<a href=\"$img\">Download Photo</a>
     $use$delnk
    <a href=\"gallery.php?who=$who&amp;action=comments&amp;sid=$sid&amp;gid=$item[0]\">Comments($gall[0])</a>
    ";
          
    
        }
        }
        echo "</p>";
    echo "<p align=\"center\">";
        if($page>1)
        {
          $ppage = $page-1;
          echo "<a href=\"gallery.php?action=$action&amp;page=$ppage&amp;sid=$sid&amp;who=$who\">«PREV</a> ";
        }
        if($page<$num_pages)
        {
          $npage = $page+1;
          echo "<a href=\"gallery.php?action=$action&amp;page=$npage&amp;sid=$sid&amp;who=$who\">Next»</a>";
        }
        echo "
    $page/$num_pages
    ";
        if($num_pages>2)
        {
           $rets = "Jump to page<input name=\"pg\" format=\"*N\" size=\"3\"/>";
            $rets .= "<anchor>[GO]";
            $rets .= "<go href=\"gallery.php\" method=\"get\">";
            $rets .= "<postfield name=\"action\" value=\"$action\"/>";
            $rets .= "<postfield name=\"sid\" value=\"$sid\"/>";
            $rets .= "<postfield name=\"page\" value=\"$(pg)\"/>";
            $rets .= "</go></anchor>";
    
            echo $rets;
        }
    echo "
    <a href=\"gallery.php?action=main&amp;sid=$sid\">User Gallery</a>
    ";
      echo "<a href=\"index.php?action=main&amp;sid=$sid\">Home</a>";
    
        echo "</p>";
         echo "</card>";
      
    
    }
    else if($action=="comments")
    {
        $who = $_GET["who"];
    $gid = $_GET["gid"];
        addonline(getuid_sid($sid),"Viewing Photo Comments","");
                echo "<card id=\"main\" title=\"Natasu\">";
        $uid = getuid_sid($sid);
        
        //////ALL LISTS SCRIPT <<
    
        if($page=="" || $page<=0)$page=1;
        $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM fun_galcomments WHERE pid=&#39;".$gid."&#39;"));
        $num_items = $noi[0]; //changable
        $items_per_page= 5;
        $num_pages = ceil($num_items/$items_per_page);
        if(($page>$num_pages)&&$page!=1)$page= $num_pages;
        $limit_start = ($page-1)*$items_per_page;
    
        
           $sql = "SELECT id, pid, text, byuser, time FROM fun_galcomments WHERE pid=&#39;".$gid."&#39; ORDER BY id DESC LIMIT $limit_start, $items_per_page";
    
    
        echo "
    
    ";
        $items = mysql_query($sql);
        echo mysql_error();
        if(mysql_num_rows($items)>0)
        {
        while ($item = mysql_fetch_array($items))
        {
            
              if(isonline($item[3]))
      {
        $iml = "<img src=\"images/onl.gif\" alt=\"+\"/>";
        
      }else{
        $iml = "<img src=\"images/ofl.gif\" alt=\"-\"/>";
      }
        $snick = getnick_uid($item[3]);
          $lnk = "<a href=\"index.php?action=viewuser&amp;who=$item[3]&amp;sid=$sid\">$iml$snick</a>:";
          $bs = date("d m y-H:i:s",$item[4]);
          echo "$lnk
    [size="1"]";
          
    $me = getuid_sid($sid);
    if($who=="$me") {
    $can = "a";
    }else{
    $can = "b";
    }
      if(ismod($uid)||$can=="a")
      {
       $delnk = "<a href=\"modproc.php?action=delcmt&amp;sid=$sid&amp;id=$item[0]\">[x]</a>";
          }else{
            $delnk = "";
          }
          $text = parsepm($item[2], $sid);
          echo "$text $delnk
    ";
    echo "$bs";
    echo "
    ";
          echo "[/size]";
    
        }
        }
        echo "</p>";
        echo "<p align=\"center\">";
        if($page>1)
        {
          $ppage = $page-1;
          echo "<a href=\"gallery.php?action=$action&amp;page=$ppage&amp;sid=$sid&amp;who=$who&amp;gid=$gid\">«PREV</a> ";
        }
        if($page<$num_pages)
        {
          $npage = $page+1;
          echo "<a href=\"gallery.php?action=$action&amp;page=$npage&amp;sid=$sid&amp;who=$who&amp;gid=$gid\">Next»</a>";
        }
        echo "
    $page/$num_pages
    ";
        if($num_pages>2)
        {
           $rets = "Jump to page<input name=\"pg\" format=\"*N\" size=\"3\"/>";
            $rets .= "<anchor>[GO]";
            $rets .= "<go href=\"gallery.php\" method=\"get\">";
            $rets .= "<postfield name=\"action\" value=\"$action\"/>";
            $rets .= "<postfield name=\"sid\" value=\"$sid\"/>";
            $rets .= "<postfield name=\"page\" value=\"$(pg)\"/>";
            $rets .= "</go></anchor>";
    
            echo $rets;
        }
    
        echo "</p>";
      ////// UNTILL HERE >>
        echo "<p align=\"center\">";
       $me = getuid_sid($sid);
    if($me!="$who") {
        echo "<a href=\"gallery.php?action=addcomment&amp;sid=$sid&amp;who=$who&amp;gid=$gid\">Add Comment</a>
    ";
    }
    echo "<a href=\"gallery.php?action=main&amp;sid=$sid\">User Gallery</a>
    ";
        echo "<a href=\"index.php?action=main&amp;sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>";
    echo "Home</a>";
      echo "</p>";
      echo "</card>";
    
    }
    else if($action=="addcomment")
    {
        $who = $_GET["who"];
    $gid = $_GET["gid"];
        addonline(getuid_sid($sid),"Adding Photo Comments","");
         echo "<card id=\"main\" title=\"Natasu\">";
        $uid = getuid_sid($sid);
        $sql = "SELECT itemurl FROM fun_gallery  WHERE id=&#39;".$gid."&#39;";
    
    echo "<p align=\"center\">";
    $items = mysql_query($sql);
        echo mysql_error();
        if(mysql_num_rows($items)>0)
        {
        while ($item = mysql_fetch_array($items))
        {
          
        $img = $item[0];
        
          $lnk = "<img src=\"max.php?filename=$img\" alt=\"$id\"/>
    ";
            
          echo "$lnk";
    echo "<go href=\"genproc.php?action=commentadd&amp;sid=$sid&amp;gid=$gid\" method=\"post\">";
    echo "<postfield name=\"text\" value=\"$(text)\"/>";
    echo "</go>";
    
    
      $vb = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM fun_prate WHERE uid=&#39;".$uid."&#39; AND pid=&#39;".$gid."&#39;"));
      if($vb[0]==0)
      {
      
      echo "Rate Photo: <select name=\"prate\">";
      echo "<option value=\"1\">1</option>";
      echo "<option value=\"2\">2</option>";
      echo "<option value=\"3\">3</option>";
      echo "<option value=\"4\">4</option>";
      echo "<option value=\"5\">5</option>";
      echo "<option value=\"6\">6</option>";
      echo "<option value=\"7\">7</option>";
      echo "<option value=\"8\">8</option>";
      echo "<option value=\"9\">9</option>";
      echo "<option value=\"10\">10</option>";
      echo "</select>
    ";
    
      }else{
    $rinfo = mysql_fetch_array(mysql_query("SELECT COUNT(*) as nofr, SUM(prate) as nofp FROM fun_prate WHERE pid=&#39;".$gid."&#39;"));
    $counts = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM fun_prate WHERE pid=&#39;".$gid."&#39;"));
    if($counts[0]>0) {
        $ther = $rinfo[1]/$rinfo[0];
        $rating = "Rating: $ther/$rinfo[1] (votes$counts[0])
    ";
    }else{
    $rating = "";
    }
        echo "$rating";
      }
    
    
    echo "Comment:
    ";
    echo "<input name=\"text\" maxlength=\"150\"/>
    ";
    echo "<anchor>Add";
    echo "<go href=\"genproc.php?action=commentadd&amp;sid=$sid&amp;gid=$gid\" method=\"post\">";
    echo "<postfield name=\"text\" value=\"$(text)\"/>";
    echo "</go></anchor>
    ";
        }
        }
        echo "<a href=\"gallery.php?action=main&amp;sid=$sid\">User Gallery</a>
    ";
    
        echo "<a href=\"index.php?action=main&amp;sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>";
    echo "Home</a>";
      echo "</p>";
      echo "</card>";
     
    }else{
          addonline(getuid_sid($sid),"Lost in user gallery lol","");
        
            echo "<card id=\"main\" title=\"Natasu\">";
      echo "<p align=\"center\">";
      echo "I don&#39;t know how did you get into here, but there&#39;s nothing to show
    
    ";
    echo "<a href=\"gallery.php?action=main&amp;sid=$sid\">User Gallery</a>
    ";
      echo "<a href=\"index.php?action=main&amp;sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>";
    echo "Home</a>";
      echo "</p>";
       echo "</card>";
    }
    
    
    ?>
    
    </wml>

    #2
    in genproc.php put this...
    Code:
    else if($action=="useav")
    {
        $gid = $_GET["gid"];
      addonline(getuid_sid($sid),"Updating Avatar","");
     echo "<card id=\"main\" title=\"Natasu\">";
      echo "<p align=\"center\">";
    $getimg = mysql_fetch_array(mysql_query("SELECT itemurl FROM fun_gallery WHERE id=&#39;".$gid."&#39;"));
    
    $avatar = $getimg[0];
      $uid = getuid_sid($sid);
    
        $res = mysql_query("Update ibwf_users SET avatar=&#39;".$avatar."&#39; WHERE id=&#39;".$uid."&#39;");
        if($res)
            {
                echo "<img src=\"images/ok.gif\" alt=\"o\"/>Avatar was successfully updated
    ";
            }else{
              echo "<img src=\"images/notok.gif\" alt=\"x\"/>Database Error!
    ";
            }
        echo "
    ";
      echo "<a href=\"index.php?action=main&amp;sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>";
    echo "Home</a>";
      echo "</p>";
    echo "</card>";
    
    }
    
    else if($action=="delgal")
    {
        $gid = $_GET["gid"];
      addonline(getuid_sid($sid),"Deleting Gallery Photo","");
      echo "<card id=\"main\" title=\"Natasu\">";
      echo "<p align=\"center\">";
      $itemowner = mysql_fetch_array(mysql_query("SELECT uid FROM fun_gallery WHERE id=&#39;".$gid."&#39;"));
      if(ismod(getuid_sid($sid))||getuid_sid($sid)==$itemowner[0])
      {
        $res = mysql_query("DELETE FROM fun_gallery WHERE id=&#39;".$gid."&#39;");
    $res2 = mysql_query("DELETE FROM fun_galcomments WHERE pid=&#39;".$gid."&#39;");
    $res3 = mysql_query("DELETE FROM fun_prate WHERE pid=&#39;".$gid."&#39;");
        if($res||res2||res3)
            {
                echo "<img src=\"images/ok.gif\" alt=\"o\"/>Photo Deleted From Gallery
    ";
            }else{
              echo "<img src=\"images/notok.gif\" alt=\"x\"/>Database Error!
    ";
            }
      }else{
        echo "<img src=\"images/notok.gif\" alt=\"X\"/>You can&#39;t delete this Photo";
      }
      echo "
    
    ";
      echo "<a href=\"index.php?action=main&amp;sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>";
    echo "Home</a>";
      echo "</p>";
    echo "</card>";
    
    }
    
    else if($action=="addgal")
    {
       
    
      $itemurl = $_POST["itemurl"];
    
       $uid = getuid_sid($sid);
    echo "<card id=\"main\" title=\"Natasu\">";
    echo "<p align=\"center\">";
      $nopl = mysql_fetch_array(mysql_query("SELECT sex FROM fun_users WHERE id=&#39;".$uid."&#39;"));
      if($nopl[0]==&#39;M&#39;)
      {
        $usex = "M";
      }else if($nopl[0]==&#39;F&#39;){
        $usex = "F";
      }else{
        $usex = "M";
      }
        
          $res = mysql_query("INSERT INTO fun_gallery SET uid=&#39;".$uid."&#39;, itemurl=&#39;".$itemurl."&#39;, sex=&#39;".$usex."&#39;");
          if($res)
          {
            echo "<img src=\"images/ok.gif\" alt=\"O\"/>User Photo Added
    ";
          }else{
            echo "<img src=\"images/notok.gif\" alt=\"X\"/>Database Error
    ";
          }
          
          echo "<a href=\"gallery.php?action=main&amp;sid=$sid\">User Gallery</a>
    ";
      echo "<a href=\"index.php?action=main&amp;sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>";
      echo "Home</a>";
      echo "</p></card>";
    }
    
    else if($action=="commentadd")
    {
        $text = $_POST["text"];
       $prate = $_POST["prate"];
    
      $gid = $_GET["gid"];
      addonline(getuid_sid($sid),"Adding Photo Comment","");
      echo "<card id=\"main\" title=\"Natasu\">";
          echo "<p align=\"center\">";
          $crdate = time();
          $uid = getuid_sid($sid);
          $res = false;
    
          if(trim($text)!="")
          {
            
          $res = mysql_query("INSERT INTO fun_galcomments SET text=&#39;".$text."&#39;, byuser=&#39;".$uid."&#39;, time=&#39;".$crdate."&#39;, pid=&#39;".$gid."&#39;");
          }
          if($res)
          {
            echo "<img src=\"images/ok.gif\" alt=\"O\"/>Comment Added Successfully
    ";
          }else{
            echo "<img src=\"images/notok.gif\" alt=\"X\"/>Error Adding Comment";
          }
    if($prate!="") {
    $res2 = mysql_query("INSERT INTO fun_prate SET uid=&#39;".$uid."&#39;, pid=&#39;".$gid."&#39;, prate=&#39;".$prate."&#39;");
        if($res2)
        {
            echo "<img src=\"images/ok.gif\" alt=\"o\"/>Photo rated successfully
    ";
        }else{
            echo "<img src=\"images/notok.gif\" alt=\"x\"/>Database Error!
    ";
        }
      }      
    
          echo "
    
    ";
          echo "<a href=\"index.php?action=main&amp;sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>";
    echo "Home</a>";
          echo "</p>";
          
    echo "</card>";
    
    }

    Comment


      #3
      in modproc.php
      Code:
      MODPROC.PHP
      
      else if($action=="delcmt")
      {
        $id = $_GET["id"];
         echo "<card id=\"main\" title=\"Natasu\">";
        echo "<p align=\"center\">";
      
        $res = mysql_query("DELETE FROM fun_galcomments WHERE id =&#39;".$id."&#39;");
        if($res)
                {
                mysql_query("INSERT INTO fun_mlog SET action=&#39;comment&#39;, details=&#39;[b]".getnick_uid(getuid_sid($sid))."[/b] Deleted a Photo Comment&#39;, actdt=&#39;".time()."&#39;");
                  echo "<img src=\"images/ok.gif\" alt=\"O\"/>Comment deleted";
                }else{
                  echo "<img src=\"images/notok.gif\" alt=\"X\"/>Database Error";
                }
        echo "
      
      ";
      
      
        echo "<a href=\"index.php?action=main&amp;sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>";
      echo "Home</a>";
        echo "</p>";
      echo "</card>";
      
      }

      Comment


        #4
        core.php
        Code:
        function candelgal($uid, $item)
        {
          $candoit = mysql_fetch_array(mysql_query("SELECT  uid FROM fun_gallery WHERE id=&#39;".$item."&#39;"));
          if($uid==$candoit[0]||ismod($uid))
          {
            return true;
          }
          return false;
        }

        Comment


          #5
          max.php
          Code:
          <?php
          $height= 100;
          $width= 100;
          // Content type
          header(&#39;Content-type: image/jpeg&#39;);
          if(!$filename)
          $filename="./images/nopic.jpg";
          // Get new dimensions
          list($width_orig, $height_orig) = getimagesize($filename);
          
          if ($width && ($width_orig < $height_orig)) {
             $width = ($height / $height_orig) * $width_orig;
          } else {
             $height = ($width / $width_orig) * $height_orig;
          }
          
          // Resample
          $image_p = imagecreatetruecolor($width, $height);
          $image = imagecreatefromjpeg($filename);
          imagecopyresampled($image_p, $image, 0, 0, 0, 0, $width, $height, $width_orig, $height_orig);
          
          // Output
          imagejpeg($image_p, null, 100);
          ImageDestroy ($image_p);
          ?>

          Comment


            #6
            admincp.php
            Code:
            else if($action=="addgal")
            {
                echo "<card id=\"main\" title=\"Natasu\">";
                echo "<p align=\"center\">";
            echo "Username: <input name=\"user\" maxlength=\"100\"/>
            ";
            echo "Image URL: <input name=\"itemurl\" maxlength=\"100\"/>
            ";
            echo "<anchor>Add Photo";
            echo "<go href=\"admproc.php?action=addgal&amp;sid=$sid\" method=\"post\">";
            echo "<postfield name=\"user\" value=\"$(user)\"/>";
            echo "<postfield name=\"itemurl\" value=\"$(itemurl)\"/>";
            echo "</go></anchor>";
                echo "</p>";
                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 "</card>"; 
            }

            Comment


              #7
              adminproc.php
              Code:
              else if($action=="addgal")
              {
                  $user = $_POST["user"];
                $itemurl = $_POST["itemurl"];
              
                 $uid = getuid_nick($user);
                    echo "<card id=\"main\" title=\"Natasu\">";
                    echo "<p align=\"center\">";
              $nopl = mysql_fetch_array(mysql_query("SELECT sex FROM fun_users WHERE id=&#39;".$uid."&#39;"));
                if($nopl[0]==&#39;M&#39;)
                {
                  $usex = "M";
                }else if($nopl[0]==&#39;F&#39;){
                  $usex = "F";
                }else{
                  $usex = "M";
                }
              
                    $res = mysql_query("INSERT INTO fun_gallery SET uid=&#39;".$uid."&#39;, itemurl=&#39;".$itemurl."&#39;, sex=&#39;".$usex."&#39;");
                    if($res)
                    {
                      echo "<img src=\"images/ok.gif\" alt=\"O\"/>User Photo Added
              ";
                    }else{
                      echo "<img src=\"images/notok.gif\" alt=\"X\"/>Database Error
              ";
                    }
                    
                    echo "<a href=\"index.php?action=admincp&amp;sid=$sid\"><img src=\"images/admn.gif\" alt=\"*\"/>";
                echo "Admin CP</a>
              ";
                echo "<a href=\"index.php?action=main&amp;sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>";
                echo "Home</a>";
                echo "</p>";
                echo "</card>";
              }

              Comment


                #8
                SQL
                Code:
                SQL
                
                CREATE TABLE fun_galcomments (
                  id int(99) NOT NULL auto_increment,
                  pid int(99) NOT NULL,
                  `text` varchar(200) NOT NULL,
                  byuser varchar(100) NOT NULL,
                  `time` varchar(99) NOT NULL,
                  PRIMARY KEY  (id),
                  UNIQUE KEY `text` (`text`)
                ) ENGINE=MyISAM  DEFAULT CHARSET=latin1;
                
                -- --------------------------------------------------------
                
                -- 
                -- Table structure for table &#39;fun_gallery&#39;
                -- 
                
                CREATE TABLE fun_gallery (
                  id int(100) NOT NULL auto_increment,
                  uid int(100) NOT NULL,
                  sex varchar(255) NOT NULL,
                  itemurl varchar(255) NOT NULL,
                  PRIMARY KEY  (id),
                  UNIQUE KEY `name` (itemurl)
                ) ENGINE=MyISAM  DEFAULT CHARSET=latin1;
                
                -- Table structure for table &#39;fun_prate&#39;
                -- 
                
                CREATE TABLE fun_prate (
                  id int(100) NOT NULL auto_increment,
                  pid int(100) NOT NULL default &#39;0&#39;,
                  uid int(100) NOT NULL default &#39;0&#39;,
                  prate char(1) NOT NULL,
                  PRIMARY KEY  (id)
                ) ENGINE=MyISAM  DEFAULT CHARSET=latin1;

                Comment


                  #9
                  if there&#39;s something wrong with this... post it here... i just converted this manually...

                  Comment


                    #10
                    u need a blank jpg image in ur images folder
                    Code:
                    $filename="./images/nopic.jpg";
                    upload one there

                    Comment


                      #11
                      u need a blank jpg image in ur images folder
                      Code:
                      $filename="./images/nopic.jpg";
                      upload one there[/b]
                      it should be in jpg format.. right? tnx wizard.. but i have a question about this script... why is it that when i add comment on the user pic my rating doesn&#39;t show... what&#39;s wrong with the script?

                      Comment


                        #12
                        if there&#39;s something wrong with this... post it here... i just converted this manually...[/b]
                        well done, it is working:D

                        Comment


                          #13
                          well done, it is working:D[/b]
                          tnx...

                          Comment


                            #14
                            it should be in jpg format.. right? tnx wizard.. but i have a question about this script... why is it that when i add comment on the user pic my rating doesn&#39;t show... what&#39;s wrong with the script?[/b]
                            u must av done something wrong. it works in my xhtml. ill look@ it later. i gotta get ready for school now

                            Comment


                              #15
                              Thanks guys...altho i am yet to test it myself but i&#39;m still appreciative of the script!

                              Comment

                              Working...
                              X