Gallery Upload Script..

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

    Gallery Upload Script..

    i made some revisions on Tommie. scripts and wizards script..

    upload.php

    Code:
    <?php
    include("config.php");
    include("core.php");
    //session_start();
    header("Content-type: text/html; charset=ISO-8859-1");
    echo "<?xml version=\"1.0\" encoding=\"ISO-8859-1\" ?>";
    echo "<!DOCTYPE html PUBLIC \"-//WAPFORUM//DTD XHTML Mobile 1.0//EN\"\"http://www.wapforum.org/DTD/xhtml-mobile10.dtd\">";
    echo "<html xmlns=\"http://www.w3.org/1999/xhtml\">";
    
    echo "<head><title>$title</title>";
          echo "<link rel=\"StyleSheet\" type=\"text/css\" href=\"style/default.css\" />";
    echo "<meta http-equiv=\"Cache-Control\" content=\"must-revalidate\" />
    <meta http-equiv=\"Cache-Control\" content=\"no-cache\"/>
    <meta name=\"description\" content=\"Natasu\"> 
    <meta name=\"keywords\" content=\"free, natasu, community, forums, chat, wap, communicate\"></head>";
    echo "<body>";
    
    
    $bcon = connectdb();
    if (!$bcon)
    {
        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 "you can temperoray be in this site <a href=\"$siteurl\">$title</a> while $title is offline
    ";
        echo "[b]THANK YOU VERY MUCH[/b]";
        echo "</p>";
        echo "</html>";
        echo "</body>";
        exit();
    }
    $brws = explode(" ",$_SERVER[HTTP_USER_AGENT] );
    $ubr = $brws[0];
    $uip = getip();
    $action = $_GET["action"];
    $sid = $_GET["sid"];
    $page = $_GET["page"];
    $who = $_GET["who"];
    
    
    $uid = getuid_sid($sid);
    
    cleardata();
    
    if(isipbanned($uip,$ubr))
        {
          if(!isshield(getuid_sid($sid)))
          {
          echo "<p align=\"center\">";
          echo "<img src=\"images/notok.gif\" alt=\"x\"/>
    ";
          echo "This IP address is blocked
    ";
          echo "
    ";
          echo "How ever we grant a shield against IP-Ban for our great users, you can try to see if you are shielded by trying to log-in, if you kept coming to this page that means you are not shielded, so come back when the ip-ban period is over
    
    ";
          $banto = mysql_fetch_array(mysql_query("SELECT timeto FROM ibwf_penalties WHERE penalty=&#39;2&#39; AND ipadd=&#39;".$uip."&#39; AND browserm=&#39;".$ubr."&#39; LIMIT 1 "));
          //echo mysql_error();
          $remain =  $banto[0] - time();
          $rmsg = gettimemsg($remain);
          echo " IP: $rmsg
    
    ";
          
          echo "</p>";
          echo "
    
    ";
      echo "<form align=\"left\" action=\"login.php\" method=\"post\" ENCTYPE=\"multipart/form-data\">";
    
      echo "UserID: <input name=\"loguid\" format=\"*x\" maxlength=\"30\"/>
    ";
      echo "Password: <input type=\"password\" name=\"logpwd\"  maxlength=\"30\"/>
    ";
      echo "<postfield name=\"loguid\" value=\"$(loguid)\"/>";
      echo "<postfield name=\"logpwd\" value=\"$(logpwd)\"/>";
      echo "<input type=\"submit\" value=\"Login!\"/>
    ";
      echo "</form>";
      echo "</p>";
          echo "</body>";
          echo "</html>";
          exit();
          }
       }
    if(($action != "") && ($action!="terms"))
    {
        $uid = getuid_sid($sid);
        if((islogged($sid)==false)||($uid==0))
        {
          
          echo "You are not logged in
    ";
          echo "Or Your session has been expired
    
    ";
          echo "<a href=\"index.php\">Login</a>
    
    ";
          echo "</p>";
          echo "</body>";
          echo "</html>";
          exit();
        }
        
        
        
    }
    //echo isbanned($uid);
    if(isbanned($uid))
        {
          echo "<p align=\"center\">";
          echo "<img src=\"images/notok.gif\" alt=\"x\"/>
    ";
          echo "You are [b]Banned[/b]
    ";
          $banto = mysql_fetch_array(mysql_query("SELECT timeto FROM ibwf_penalties WHERE uid=&#39;".$uid."&#39; AND penalty=&#39;1&#39;"));
          $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 "<a href=\"index.php\">Login</a>";
          echo "</p>";
          echo "</body>";
          echo "</html>";
          exit();
        }
    
    $res = mysql_query("UPDATE ibwf_users SET browserm=&#39;".$ubr."&#39;, ipadd=&#39;".$uip."&#39; WHERE id=&#39;".getuid_sid($sid)."&#39;");
    
    
    if($action=="uploader")
    {
    addvisitor();
    addonline(getuid_sid($sid),"User Pic Uploader","");
    $nick = getnick_sid($sid);
    $uid = getuid_sid($sid);
    $nopl = mysql_fetch_array(mysql_query("SELECT sex FROM ibwf_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";
      }
    echo "Welcome $nick
    ";
    //get file name
    if ($upload="upload"&&$file_name){
    if (!eregi("\.(jpeg|jpg)$",$file_name)){
    print "[b]Unsuported File extention!!![/b]";
    }else{
    $file_name = preg_replace(
                 &#39;/[^a-zA-Z0-9\.\$\%\&#39;\`\-\@\{\}\~\!\#\(\)\&\_\^]/&#39;
                 ,&#39;&#39;,str_replace(array(&#39; &#39;,&#39;%20&#39;),array(&#39;_&#39;,&#39;_&#39;),$file_name));
    if(strlen($file_name)>53){ print "[b]File Name to long!!![/b]";
    }else{
    if (empty($file)) {
    print "[b]No input file specified!!![/b]";
    }else{
    if (file_exists($file_name))
                {
                echo "Pic already exists";
                echo "
    <a href=\"upload.php\">Upload xhtml</a>
    ";
                      echo "
    <a href=\"index.php\">Uploads</a>
    ";
                      echo "[b]Natasu ©[/b]
    ";
                      print "</p></body></html>";
                exit();
                }
    
    $pics = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM gallery where uid=&#39;".$uid."&#39;"));
    $cpic = $pics[0]+1;
    $rev = strrev ($file_name);
    $exp = explode (".", $rev);
    $true = strrev ($exp[0]);
    $trueext = strtolower ($true);
    $picn = "$nick$cpic.$trueext";
    copy("$file", "gallery/$file_name") or
    die("Couldn&#39;t copy file.");
    $adds = mysql_query("INSERT INTO gallery SET uid=&#39;".$uid."&#39;, file=&#39;$file_name&#39;, sex=&#39;".$usex."&#39;");
        if ($adds) {
    
              echo "added pic $file_name
    ";
    
             } else {
    
                  echo "Please try again
    ";
               }
    
    
    echo "file has been successfully uploaded";
    }
    }
    }
    }
    ?>
    <?php
    echo "<form align=\"left\" action=\"upload.php?action=uploader&amp;sid=$sid\" method=\"post\" ENCTYPE=\"multipart/form-data\">
    File: 
    <input type=\"file\" name=\"file\" size=\"30\"/>
    
    <input type=\"submit\" value=\"Upload\"/>
    
    <a href=\"pics.php?action=gallery&amp;sid=$sid\">Back to Gallery</a>
    
    <a href=\"index.php?action=main&amp;sid=$sid\">Home</a>
    
    
    <font color=\"red\">Natasu ©</font>";
    }
    echo "</form>
    </body>
    </html>";
    ?>

    ch777 the folder gallery..

    #2
    pics.php

    Code:
    <?php
    include("config.php");
    include("core.php");
    connectdb();
    header("Content-type: text/vnd.wap.wml"); 
    echo "<?xml version=\"1.0\"?>";
    echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\" \"http://www.wapforum.org/DTD/wml_1.1.xml\">"; 
    echo "<wml>"; 
    $bcon = connectdb();
    if (!$bcon)
    {
        echo "<card id=\"main\" title=\"Natasu (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 "you can temperoray be in this site <a href=\"http://chatheaven.wen.ru\">$site_name</a> while $site_name is offline
    ";
        echo "[b]THANK YOU VERY MUCH[/b]";
        echo "</p>";
        echo "</card>";
        echo "</wml>";
        exit();
    }
    $brws = explode(" ",$_SERVER[HTTP_USER_AGENT] );
    $ubr = $brws[0];
    $uip = getip();
    $action = $_GET["action"];
    $sid = $_GET["sid"];
    $page = $_GET["page"];
    $who = $_GET["who"];
    
    
    $uid = getuid_sid($sid);
    
    cleardata();
    
    if(isipbanned($uip,$ubr))
        {
          if(!isshield(getuid_sid($sid)))
          {
            echo "<card id=\"main\" title=\"Natasu\">";
          echo "<p align=\"center\">";
          echo "<img src=\"images/notok.gif\" alt=\"x\"/>
    ";
          echo "This IP address is blocked
    ";
          echo "
    ";
          echo "How ever we grant a shield against IP-Ban for our great users, you can try to see if you are shielded by trying to log-in, if you kept coming to this page that means you are not shielded, so come back when the ip-ban period is over
    
    ";
          $banto = mysql_fetch_array(mysql_query("SELECT  timeto FROM ibwf_penalties WHERE  penalty=&#39;2&#39; AND ipadd=&#39;".$uip."&#39; AND browserm=&#39;".$ubr."&#39; LIMIT 1 "));
          //echo mysql_error();
          $remain =  $banto[0] - time();
          $rmsg = gettimemsg($remain);
          echo " IP: $rmsg
    
    ";
          
          echo "</p>";
          echo "
    
    ";
      echo "UserID: <input name=\"loguid\" format=\"*x\" maxlength=\"30\"/>
    ";
      echo "Password: <input type=\"password\" name=\"logpwd\"  maxlength=\"30\"/>
    ";
      echo "<anchor>LOGIN<go href=\"login.php\" method=\"get\">";
      echo "<postfield name=\"loguid\" value=\"$(loguid)\"/>";
      echo "<postfield name=\"logpwd\" value=\"$(logpwd)\"/>";
      echo "</go></anchor>";
      echo "</p>";
          echo "</card>";
          echo "</wml>";
          exit();
          }
       }
    if(($action != "") && ($action!="terms"))
    {
        $uid = getuid_sid($sid);
        if((islogged($sid)==false)||($uid==0))
        {
            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();
        }
        
        
        
    }
    //echo isbanned($uid);
    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 ibwf_penalties 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 "<a href=\"index.php\">Login</a>";
          echo "</p>";
          echo "</card>";
          echo "</wml>";
          exit();
        }
    
    $res = mysql_query("UPDATE ibwf_users SET browserm=&#39;".$ubr."&#39;, ipadd=&#39;".$uip."&#39; WHERE id=&#39;".getuid_sid($sid)."&#39;");
    
    ?>
    <?php
    if($action=="gallery")
    {
      addonline(getuid_sid($sid),"Viewing Gallery","");
         echo "<card id=\"main\" title=\"Natasu\">";
      echo "<p align=\"center\">";
    
    $males = mysql_fetch_array(mysql_query("SELECT COUNT(DISTINCT uid) FROM gallery WHERE sex=&#39;M&#39;"));
    echo "<a href=\"pics.php?action=male&amp;sid=$sid\">Male Gallery($males[0])</a>
    ";
    echo "
    ";
    $females = mysql_fetch_array(mysql_query("SELECT COUNT(DISTINCT uid) FROM gallery WHERE sex=&#39;F&#39;"));
    echo "<a href=\"pics.php?action=female&amp;sid=$sid\">Female Gallery($females[0])</a>
    ";
    echo "
    ";
    echo "<a href=\"upload.php?action=uploader&amp;sid=$sid\">Upload Photo</a>
    ";
      echo "<a href=\"index.php?action=main&amp;sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>";
    echo "Home</a>";
      echo "</p>";
      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 gallery WHERE sex=&#39;F&#39;"));
        }else{
        $noi = mysql_fetch_array(mysql_query("SELECT COUNT(DISTINCT uid) FROM 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 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 gallery WHERE uid=&#39;".$who."&#39;"));
            $lnk = "<a href=\"pics.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=\"pics.php?action=$action&amp;page=$ppage&amp;sid=$sid\">«PREV</a> ";
        }
    
    if($page<$num_pages)
        {
          $npage = $page+1;
          echo "<a href=\"pics.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=\"pics.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=\"pics.php?action=gallery&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 gallery WHERE sex=&#39;M&#39;"));
        }else{
        $noi = mysql_fetch_array(mysql_query("SELECT COUNT(DISTINCT uid) FROM 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 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 gallery WHERE uid=&#39;".$who."&#39;"));
            $lnk = "<a href=\"pics.php?action=viewuser&amp;who=$who&amp;sid=$sid\">$user($countpics[0])</a>
    ";
    echo "$lnk";
    
        }
        }else{
    echo "male gallery is empty";
    }
        echo "[/size]</p>";
    echo "<p align=\"center\">";
        if($page>1)
        {
          $ppage = $page-1;
          echo "<a href=\"pics.php?action=$action&amp;page=$ppage&amp;sid=$sid\">«PREV</a> ";
        }
    
    if($page<$num_pages)
        {
          $npage = $page+1;
          echo "<a href=\"pics.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=\"pics.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=\"pics.php?action=gallery&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 gallery WHERE uid=&#39;".$who."&#39;"));
        }else{
        $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM 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, file FROM gallery WHERE uid=&#39;".$who."&#39; ORDER BY id DESC LIMIT $limit_start, $items_per_page";
            }else{
    $sql = "SELECT id, sex, file, uid FROM 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];
        $ext = getext($item[2]);
            $ime = getextimg($ext);
     $lnk = "<img src=\"image.php?id=$item[0]\" alt=\"pic\"/>
    ";
    
    $me = getuid_sid($sid);
    if($who=="$me")
    {
    $use = "<a href=\"genproc.php?action=useavtr&amp;sid=$sid&amp;vid=$item[0]\">Use as Avatar</a> | ";
    }else{
    $use = "";
    }
    if(candelgal($uid, $item[0]))
          {
            $delnk = "<a href=\"genproc.php?action=delpic&amp;sid=$sid&amp;vid=$item[0]\">Remove Photo</a>";
          }else{
            $delnk = "";
          }
    echo "$lnk<a href=\"gallery/$item[2]\">Download Photo</a>
     $use$delnk
    ";
          
    
        }
        }
     echo "</p>";
    echo "<p align=\"center\">";
        if($page>1)
        {
          $ppage = $page-1;
          echo "<a href=\"pics.php?action=$action&amp;page=$ppage&amp;sid=$sid&amp;who=$who\">«PREV</a> ";
        }
        if($page<$num_pages)
        {
          $npage = $page+1;
          echo "<a href=\"pics.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=\"pics.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=\"pics.php?action=gallery&amp;sid=$sid\">User Gallery</a>
    ";
      echo "<a href=\"index.php?action=main&amp;sid=$sid\">Home</a>";
    
        echo "</p>";
         echo "</card>";
      
    
    }
    
    ?>
    
    </wml>

    Comment


      #3
      genproc.php

      Code:
      //////////////////////////////////////////DELPIC
      else if($action=="delpic")
      {
          $vid = $_GET["vid"];
        addonline(getuid_sid($sid),"Deleting Gallery Pic","");
        echo "<card id=\"main\" title=\"Natasu\">";
        echo "<p align=\"center\">";
        $itemowner = mysql_fetch_array(mysql_query("SELECT uid, file FROM gallery WHERE id=&#39;".$vid."&#39;"));
        if(ismod(getuid_sid($sid))||getuid_sid($sid)==$itemowner[0])
        {
          $res = mysql_query("DELETE FROM gallery WHERE id=&#39;".$vid."&#39;");
        if($res)
              {
              $myFile = "gallery/$itemowner[1]";
              unlink($myFile);
      
      
              echo "<img src=\"../images/ok.gif\" alt=\"o\"/>Pic 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 item";
        }
      
      
        echo "
      
      ";
        echo "<a href=\"index.php?action=main&amp;sid=$sid\"><img src=\"../images/home.gif\" alt=\"*\"/>";
      echo "Home</a>";
        echo "</p></card>";
      }
      
      /////////////////////////////////////////AVATAR
      else if($action=="useavtr")
      {
          $vid = $_GET["vid"];
        addonline(getuid_sid($sid),"Updating Avatar","");
      echo "<card id=\"main\" title=\"Natasu\">";
        echo "<p align=\"center\">";
      $getimg = mysql_fetch_array(mysql_query("SELECT file FROM gallery WHERE id=&#39;".$vid."&#39;"));
      
      $avatar = $getimg[0];
        $uid = getuid_sid($sid);
      
      $res = mysql_query("Update ibwf_users SET avatar=&#39;gallery/".$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>";
      
      }

      Comment


        #4
        core.php

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

        Comment


          #5
          ARGH this one is even harder to installlllll

          help me with the previous 1
          sigpiceeeeerrr....

          Comment


            #6
            image.php

            Code:
            <?php
            include("config.php");
            include("core.php");
            connectdb();
            $pic = mysql_fetch_array(mysql_query("SELECT * FROM gallery WHERE id =&#39;".$id."&#39;"));
            // The file
            $filename = "gallery/$pic[2]";
            
            // Set a maximum height and width
            $width = 75;
            $height = 75;
            
            // Content type
            header(&#39;Content-type: image/jpeg&#39;);
            
            // Get new dimensions
            list($width_orig, $height_orig) = getimagesize($filename);
            
            $ratio_orig = $width_orig/$height_orig;
            
            if ($width/$height > $ratio_orig) {
               $width = $height*$ratio_orig;
            } else {
               $height = $width/$ratio_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);
            ?>

            Comment


              #7
              lol...cant u zip this and upload it with an instructions file for php begiiners?

              Comment


                #8
                thanatos, can u ziped and atach that gallery here plss?

                Comment


                  #9
                  mmhm. the script in wml+xhtml is easier

                  Comment


                    #10
                    How tO upload this gallery ? where this all codes shud be copied i mean wht shud be the names of files where this codes are to be copied pls explain in detail thnx

                    Comment


                      #11
                      man the name of files are given, but u must just to copy in that files , thanatos can u ziped here?

                      Comment


                        #12
                        man the name of files are given, but u must just to copy in that files , thanatos can u ziped here?[/b]
                        Where are the names of files given i dont see which is index.php , pics.php ,upload.phph only image.php is named wht abt oders pls post the script in zip file wid instructions how to install it thnx

                        Comment


                          #13
                          hi
                          why not adding these all in a zip rar file and explaining the procudure.

                          Thanks
                          Netbug

                          Comment


                            #14
                            wizard,tommie/thandos u should complete this topic by making a .rar file.thanks

                            Comment


                              #15
                              I agree with wiz

                              Comment

                              Working...
                              X