USER1, USER2, USER3, USER4), true); $modlevel = $levels[$modlevel]; foreach($levels as $level=>$modlevel){ $uresult=dbquery("SELECT * FROM ".$db_prefix."users WHERE user_mod='$level' ORDER BY user_name"); if(dbrows($uresult)>0){ $user_option_list.=""; while($udata=dbarray($uresult)){ if($udata['user_id']==$selected_user_id) {$sel=" selected";}else{$sel="";} $user_option_list.=""; } $user_option_list.=""; } } return $user_option_list; } if(!iMEMBER){ opentable($locale['402']); echo $locale['MUP_004']."\n"; closetable(); }elseif(isset($_POST['btn_cancel'])){ fallback(FUSION_SELF."?album_id=".$album_id); }elseif(($action == "deletephotopic") && isset($photo_id)) { if(file_exists(PHOTOS.$photo_id.".jpg")) unlink(PHOTOS.$photo_id.".jpg"); if(file_exists(PHOTOS.$photo_id."t.jpg")) unlink(PHOTOS.$photo_id."t.jpg"); fallback(FUSION_SELF."?action=editphoto&photo_id=".$photo_id); }elseif($action=="deletephoto"){ if(isset($photo_id)){ $data=dbarray(dbquery("SELECT album_id, photo_order FROM ".$db_prefix."photos WHERE photo_id='$photo_id'")); $album_id=$data['album_id']; $photo_order=$data['photo_order']; $result=dbquery("UPDATE ".$db_prefix."photos SET photo_order=(photo_order-1) WHERE photo_order>'$photo_order'"); $result=dbquery("DELETE FROM ".$db_prefix."photos WHERE photo_id='$photo_id'"); if(file_exists(PHOTOS.$photo_id.".jpg")) unlink(PHOTOS.$photo_id.".jpg"); fallback(FUSION_SELF."?album_id=".$album_id); } }elseif(isset($_POST['btn_save_photo'])){ $photo_title=stripinput($photo_title); $result=dbquery("SELECT photo_title FROM ".$db_prefix."photos WHERE photo_title='$photo_title' AND photo_id<>'$photo_id' AND album_id='$album_id'"); if(dbrows($result)!=0){ $error=$locale['422']; }else{ $error=""; if($action=="editphoto"){ if($photo_order<$photo_order2){ $result=dbquery("UPDATE ".$db_prefix."photos SET photo_order=(photo_order+1) WHERE photo_order>='$photo_order' AND photo_order<'$photo_order2'"); }elseif($photo_order>$photo_order2){ $result=dbquery("UPDATE ".$db_prefix."photos SET photo_order=(photo_order-1) WHERE photo_order>'$photo_order2' AND photo_order<='$photo_order'"); } $result=dbquery("UPDATE ".$db_prefix."photos SET album_id='$album_id',photo_title='$photo_title',photo_date='".time()."', user_id='$photo_added_by',photo_order='$photo_order' WHERE photo_id='$photo_id'"); }else{ if($photo_order==""){ $photo_order=dbresult(dbquery("SELECT MAX(photo_order) FROM ".$db_prefix."photos WHERE album_id='$album_id'"),0)+1; }else{ $result=dbquery("UPDATE ".$db_prefix."photos SET photo_order=(photo_order+1) WHERE photo_order>='$photo_order' AND album_id='$album_id'"); } $result=dbquery("INSERT INTO ".$db_prefix."photos VALUES ('','$album_id','$photo_title','".time()."','".$userdata['user_id']."','0','$photo_order')"); } $photo_id=dbresult(dbquery("SELECT photo_id FROM ".$db_prefix."photos WHERE photo_title='$photo_title' AND album_id='$album_id'"),0); if(is_uploaded_file($_FILES['photo_pic_file']['tmp_name'])){ if($_FILES['photo_pic_file']['size']>=$settings['album_max_b']){ $error=sprintf($locale['423'], $settings['album_max_b']); }elseif(!$imageFile=@getImageSize($_FILES['photo_pic_file']['tmp_name'])){ $error=$locale['424']; }elseif($imageFile[2]<>2){ $error=$locale['425']; }elseif($imageFile[0]>2000||$imageFile[1]>2000){ $error=sprintf($locale['426'], $settings['album_max_w'], $settings['album_max_h']); }else{ if(file_exists(PHOTOS.$photo_id.".jpg")) unlink(PHOTOS.$photo_id.".jpg"); if(file_exists(PHOTOS.$photo_id."t.jpg")) unlink(PHOTOS.$photo_id."t.jpg"); move_uploaded_file($_FILES['photo_pic_file']['tmp_name'], PHOTOS.$photo_id.".jpg"); chmod(PHOTOS.$photo_id.".jpg",0644); createThumbnail(PHOTOS.$photo_id.".jpg",PHOTOS.$photo_id."t.jpg",$settings['thumb_image_w'],$settings['thumb_image_h']); } } } if($error<>""){ opentable($locale['420']); echo"

".$locale['421']."
$error

\n"; closetable(); }else{ fallback(BASEDIR."photogallery.php?album=".$album_id); } }elseif($action=="mup"){ $data=dbarray(dbquery( "SELECT t1.photo_id id1, t2.photo_id id2, t1.album_id FROM ".$db_prefix."photos t1 INNER JOIN ".$db_prefix."photos t2 WHERE t1.photo_order = t2.photo_order+1 AND t1.photo_id = '$photo_id' AND t2.album_id='$album_id'" )); $id1=$data['id1']; $id2=$data['id2']; $result=dbquery("UPDATE ".$db_prefix."photos SET photo_order=photo_order-1 WHERE photo_id='$id1'"); $result=dbquery("UPDATE ".$db_prefix."photos SET photo_order=photo_order+1 WHERE photo_id='$id2'"); fallback(FUSION_SELF."?album_id=".$album_id); }elseif($action=="mdown"){ $data=dbarray(dbquery( "SELECT t1.photo_id id1, t2.photo_id id2, t1.album_id FROM ".$db_prefix."photos t1 INNER JOIN ".$db_prefix."photos t2 WHERE t1.photo_order = t2.photo_order-1 AND t1.photo_id = '$photo_id' AND t2.album_id='$album_id'" )); $id1=$data['id1']; $id2=$data['id2']; $result=dbquery("UPDATE ".$db_prefix."photos SET photo_order=photo_order+1 WHERE photo_id='$id1'"); $result=dbquery("UPDATE ".$db_prefix."photos SET photo_order=photo_order-1 WHERE photo_id='$id2'"); fallback(FUSION_SELF."?album_id=".$album_id); }else{ if($action=="editphoto"){ $result=dbquery( "SELECT tp.*, user_name, COUNT(comment_id) comment_count FROM (".$db_prefix."photos tp INNER JOIN ".$db_prefix."users USING (user_id)) LEFT JOIN ".$db_prefix."comments ON photo_id = comment_item_id AND comment_type = 'P' WHERE photo_id='$photo_id' GROUP BY photo_id ORDER BY photo_order" ); $data=dbarray($result); $photo_id=$data['photo_id']; $album_id=$data['album_id']; $photo_title=stripslashes($data['photo_title']); $photo_added_by=$data['user_id']; $photo_added_by_name=$data['user_name']; $photo_order=$data['photo_order']; $photo_comments=$data['comment_count']; opentable($locale['401']." - ($photo_id - $photo_title)"); }else{ opentable($locale['402']); } $result = dbquery("SELECT * FROM ".$db_prefix."photo_albums WHERE album_id=19 ORDER BY album_id DESC"); while ($data = dbarray($result)) { $albumsel = ($album_id == $data['album_id'] ? " selected" : ""); $albumlist .= "\n"; } echo "
\n"; echo "\n"; echo "\n"; if($action=="editphoto"){ echo "\n"; echo ""; echo ""; } echo "\n"; echo "\n"; if(file_exists(PHOTOS.$photo_id."t.jpg")){ echo "\n"; } echo "\n\n
".$locale['404'].":
".$locale['MUP_005']."
".$locale['406'].":".$locale[
".$locale['405'].":"; if(file_exists(PHOTOS.$photo_id.".jpg")){ echo "

".$locale['412']."
".$locale["; }else{ echo "
".sprintf($locale['419'], $settings['thumb_image_w'], $settings['thumb_image_h']).""; } echo "

\n"; if($action=="editphoto"){ echo "\n"; } echo "
\n"; closetable(); tablebreak(); if($action=="editphoto" && $photo_comments>0){ opentable("Photo Comments"); $result = dbquery( "SELECT user_name, fc.* FROM ".$db_prefix."comments AS fc LEFT JOIN ".$db_prefix."users ON comment_name = user_id WHERE comment_item_id='$photo_id' AND comment_type='P' ORDER BY comment_datestamp ASC" ); $cnt_comments = dbrows($result); if ($cnt_comments != 0) { $i = 1; while ($data = dbarray($result)) { echo ""; if ($data['user_name']) { echo "".$data['user_name'].""; } else { echo $data['comment_name']; } echo "
\n".parsesmileys(parseubb($data['comment_message']))."
\n"; echo strftime($settings['longdate'], $data['comment_datestamp'])."\n"; if ($i != $cnt_comments) { echo "

\n"; } else { echo "\n"; } $i++; } } else { echo $locale['601']."\n"; } closetable(); tablebreak(); } } echo "\n"; include BASEDIR."side_right.php"; include BASEDIR."footer.php"; ?>