Wap Gallery script...!!!..[request]

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

    Wap Gallery script...!!!..[request]

    hello everyone...

    do anyone have wap gallery script.....features i need is ....

    1.auto indexing
    2. thumbnail preview.
    3. download option..


    if any one have it...please share here...

    #2
    <?php
    if(!defined('DRK'))die('Hacking attempt...');

    $uid=IdFromSes($ses);

    if($mode=="viewcat")
    {
    $catid=get_var("category");
    $page=get_var("page");
    if(empty($page))$page=1;
    $catname=fetch_array("name",gallery,"type='C' AND id=$catid");
    $pics=num_rows("id",gallery,"type='I' AND catid=$catid");
    $query=query("*",gallery,"type='I' AND catid=$catid ORDER BY LOWER(name) LIMIT ".($page-1)*$gallerypicsperpage.",$gallerypicsperpage");
    if(mysql_num_rows($query)>0){
    while($row=mysql_fetch_array($query)){
    $color=fetch_array("path",gallery,"type='C' AND id=$catid");
    $gallerylist.="<img src=\"/phpThumb/phpThumb.php?src=$row[path]&amp;f=gif&amp;w=96\" alt=\"$row[name]\" style=\"border:2px inset $color;\"/><br/>
    <a href=\"$row[path]\" style=\"color:$color\">$row[name]</a><br/>\n";
    }
    }
    else $gallerylist="<img src=\"./images/point.gif\" alt=\"[!]\"/>no pictures at the moment!!";
    if($page>1)$controls.="<a href=\"".$action."gallery".$mod."viewcat&amp;page= ".($page-1)."&amp;category=$catid".$session."\">prev</a>";
    if($page>1&&$pics>$page*$gallerypicsperpage)$contr ols.="\n | ";
    if($pics>$page*$gallerypicsperpage)$controls.="<a href=\"".$action."gallery".$mod."viewcat&amp;page= ".($page+1)."&amp;category=$catid".$session."\">ne xt</a>";
    if($page>1||$pics>$page*$gallerypicsperpage)$contr ols.="<br/>";
    $what=Array("sitename","username","catname","pics" ,"gallerylist","controls","page","category");
    $with=Array($sitename,users_table("username",$uid) ,$catname,$pics,$gallerylist,$controls,$page,$cati d);
    Template($what,$with,"gallerypics");
    exit;
    }

    /////UPLOAD GALLERY PICTURE/////
    else if($mode=="upload")
    {
    $time=time();
    $page=get_var("page");
    $category=get_var("category");
    $upload=get_var("upload");
    $nick=UserFromId($uid);
    $size_bytes=1048576;
    $size=round($size_bytes/1048576,1);
    $content_type=array("image/gif","image/jpeg","image/pjpeg","image/bmp");
    $ext=strtolower(strrchr($_FILES['filetoupload'][name],'.'));
    $file_type=$_FILES['filetoupload']['type'];
    $file_name=$_FILES['filetoupload']['name'];
    $file_size=$_FILES['filetoupload']['size'];
    $file_tmp=$_FILES['filetoupload']['tmp_name'];
    if($upload==1){
    if(!is_uploaded_file($_FILES['filetoupload']['tmp_name']))$msg="<img src=\"./images/error.gif\" alt=\"[x]\"/><small>no file selected!!</small>";
    else if(!in_array($file_type,$content_type))$msg="<img src=\"./images/error.gif\" alt=\"[x]\"/><small>invalid file type!!</small>";
    else if($file_size>$size_bytes)$msg="<img src=\"./images/error.gif\" alt=\"[x]\"/><small>exceeded File size limit!! maximum $size mb.</small>";
    else if(num_rows("id",gallery,"uid=$uid"))$msg="<img src=\"./images/error.gif\" alt=\"[x]\"/>you must remove your current picture to proceed!!</small>";
    else if($file_size){
    insert(gallery,"NULL,'I','$nick','/gallery/".strtolower($nick).$ext."','$category','$uid','$t ime'");
    update(userprofiles,"photo='/gallery/".strtolower($nick).$ext."'","uid=$uid");
    move_uploaded_file($file_tmp,"./gallery/".strtolower($nick).$ext);
    $msg="<img src=\"./images/ok.gif\" alt=\"[ok]\"/><small>successfully uploaded picture!!</small>";
    }
    else $msg="<img src=\"./images/error.gif\" alt=\"[x]\"/><small>unknown error!!</small>";
    }
    $what=Array("sitename","username","size","msg","pa ge","category");
    $with=Array($sitename,users_table("username",$uid) ,$size,$msg,$page,$category);
    Template($what,$with,"galleryupload");
    exit;
    }

    /////GALLERY/////
    $query=query("*",gallery,"type='C' ORDER BY id,name");
    if(mysql_num_rows($query)>0){
    while($row=mysql_fetch_array($query)){
    $pics=num_rows("id",gallery,"type='I' AND catid=$row[id]");
    $categories.="<a href=\"".$action."gallery".$mod."viewcat&amp;categ ory=$row[id]".$session."\" style=\"color:$row[path]\">$row[name] ($pics)</a><br/>\n";
    }
    }
    else $categories="<img src=\"./images/point.gif\" alt=\"[!]\"/>no categories at the moment!!";
    $pics=num_rows("id",gallery,"type='I'");
    $query=query("*",gallery,"type='I' ORDER BY RAND() LIMIT 4");
    if(mysql_num_rows($query)>0){
    while($row=mysql_fetch_array($query)){
    $user=UserFromId($row['uid']);
    $random.="<img src=\"/phpThumb/phpThumb.php?src=$row[path]&amp;h=50&amp;f=gif\" alt=\"$user\"/>\n";
    }
    }

    ?>
    Free WebHosting :D

    8):closedeyes:^_^

    Comment

    Working...
    X