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/viewPhoto.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'); if(isset($_REQUEST['galleryId'])){ $gallery_id = $_REQUEST['galleryId']; }else{ die("no id specified"); } if(isset($_REQUEST['artistId'])){ $artist_id = $_REQUEST['artistId']; }else{ die("no id specified"); } $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 artist name $sql = "SELECT artist_name,location FROM 50mm_artists WHERE artist_id='$artist_id'"; if( !($result = $db->sql_query($sql)) ){ $sql_error = $db->sql_error(); die($sql_error['message']); } $row = $db->sql_fetchrow($result); $artist_name = $row['artist_name']; $artist_location = $row['location']; //make an array of all the content owned by this artist $sql = "SELECT gallery_id FROM 50mm_gallery WHERE artist_id='$artist_id' 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++; } //also get all related photos $sql = "SELECT g.gallery_id FROM 50mm_gallery g, 50mm_other_artists o WHERE g.approved = 1 AND o.artist_id ='$artist_id' AND g.gallery_id = o.gallery_id ORDER BY entry_time DESC"; if( !($result = $db->sql_query($sql)) ){ $sql_error = $db->sql_error(); die($sql_error['message']); } 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']."?artistId=$artist_id&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']."?artistId=$artist_id&galleryId=$previous_photo&pgnum=$pgnum"; $previous = "<a href=\"$previous_url\"><img src=\"images/previous.gif\" border=\"0\"></a>"; }else{ $previous = ""; } //get gallery pic $sql = "SELECT g.image,g.comment,g.year_painted,u.username,g.user_id,g.location,g.entry_time FROM 50mm_gallery g, 50mm_users u WHERE g.gallery_id = '$gallery_id' AND u.user_id=g.user_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 = ""; } $uname = $row['username']; $uid = $row['user_id']; $location = $row['location']; $unix = get_unix_time($row['entry_time']); $date = date("m.j.y",$unix); $image = $row['image']; $blurbs ="<div style=\"width:350px;\">"; $link = "<a href=\"viewProfile.php?userId=$uid\">$uname</a>"; if(!empty($location)){ $blurbs.=$location." ".$photo_year."<br><br>"; }else{ $blurbs.=$photo_year."<br>"; } //get all artist involved with this pic. This takes two sql statements because of poor planning $result_array = Array(); $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']); } while($row = $db->sql_fetchrow($result)){ array_push($result_array,$row); } $sql = "SELECT a.artist_id,a.artist_name FROM 50mm_artists a, 50mm_gallery g WHERE g.gallery_id = '$gallery_id' AND a.artist_id = g.artist_id"; if( !($result = $db->sql_query($sql)) ){ $sql_error = $db->sql_error(); die($sql_error['message']); } while($row = $db->sql_fetchrow($result)){ array_push($result_array,$row); } $other_artist = ""; while(list($key,$row) = each($result_array)){ if($row['artist_id'] != $artist_id){//this is the primary artist so don't show them here $other_artist.="<a href=\"artist.php?artistId=".$row['artist_id']."\">".$row['artist_name']."</a> "; } } if(!empty($other_artist)){ $blurbs.= "Other artists involved: ".$other_artist."<br><br>"; } $blurbs.= $photo_blurb."<br><br>Posted $date by $link<br>"; $blurbs.="</div>\n"; $pg_name = basename($_SERVER['PHP_SELF']); include_once('includes/header.php'); ?> <script src="js/gallery.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;?>"> </form> <?}else{?> <span class="hilite">You voted this photo:<br> <?echo $vote_name?></span><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"><?echo $artist_name;?></div><?echo $artist_location;?></td> </tr> </table> <br> <div class="title"> <!--<iframe id="photoIframe" src="iphoto.php?galleryId=<?echo $gallery_id?>" marginheight="0" marginwidth="0" frameborder="0" scrolling="auto" width="100%" height="400"></iframe>--> <? 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{ $photo = ROOT_DIR.GALLERY_LIMG_DIR.$image; echo "Photo '$photo' not available. Please report this error with a direct link to this page to photo_error@50mmlosangeles.com"; } ?><br> <?echo $blurbs?> <!-- end display --></div> </td> </tr> </table> <? include_once('includes/footer.php'); include_once('includes/appBottom.php'); ?>