2999 ) { $query = "SELECT id,albumname,parent,isprivate,password FROM useralbums WHERE id=$cat"; $resultb = ppmysql_query($query,$link); list( $thecatid, $thecatname, $aparent, $isprivate, $password ) = mysql_fetch_row($resultb); if ( ($isprivate == "yes" && $userid != $aparent) && $adminedit != 1 ) { if ( empty($papass) ) $papass = ""; if ( $password != $papass ) { diewell( $Globals['pp_lang']['noperm'] ); exit; } } } else { $query = "SELECT catname FROM categories where id=$cat"; $resulta = ppmysql_query($query,$link); list( $thecatname ) = mysql_fetch_row($resulta); ppmysql_free_result($resulta); } // // Next and Previous images for display // if ( empty($sort) ) $sort = 1; $query = "SELECT * FROM sort WHERE sortid=$sort"; $resultc = ppmysql_query($query,$link); list($sortid, $sortname, $sortc) = mysql_fetch_row($resultc); ppmysql_free_result( $resultc ); $sortcode = "$sortc"; if ( $thecat == 999 ) { $query = "SELECT p.id,p.user,p.userid,p.cat,p.date,p.title,p.description,p.keywords, p.bigimage,p.width,p.height,p.filesize,p.views,p.medwidth,p.medheight,p.medsize,p.approved,p.rating,f.userid FROM favorites f, photos p WHERE f.userid=$userid AND f.photo=p.id $sortcode"; } elseif ( $cat == 500 ) { $query = "SELECT id FROM photos WHERE cat=500 AND userid=$iuserid $sortcode"; } else $query = "SELECT id FROM photos WHERE cat=$cat $sortcode"; $rows = ppmysql_query($query,$link); $ref=0; $first_image=0; $last_image=0; $ids = array(0); $curr=0; while ( $resultp = mysql_fetch_array($rows) ) { $ref++; $ids[$ref]=$resultp[0]; if ( $ids[$ref] == $photo ) { $curr = $ref; } } ppmysql_free_result($rows); $previous_image = 0; $next_image = 0; if ( $curr > 1 ) { $previous_image = $ids[$curr-1]; } if ( $curr != $ref ) { $next_image = $ids[$curr+1]; } if ( $previous_image == 0 ) $previous_image=$ids[$ref]; if ( $next_image == 0 ) $next_image=$ids[1]; $botbuster=""; if ( $Globals['botbuster'] == "yes" ) $botbuster = ""; $prevlink = "\"{$Globals['pp_lang']['perv']}\"$botbuster"; $nextlink = "\"{$Globals['pp_lang']['next']}\""; // End to get Next and Previous images for display if ( $slideshow == 1 ) { if ( empty($slidedelay) ) $slidedelay = 4; $slideurl = "{$Globals['maindir']}/showphoto.php?photo=$next_image&slideshow=1&papass=$papass&sort=$sort&thecat=$thecat&slidedelay=$slidedelay"; $slidestop = "{$Globals['maindir']}/showphoto.php?photo=$photo&papass=$papass&sort=$sort&thecat=$thecat"; $slidecode = "\"{$Globals['pp_lang']['stop']}\""; $prevlink=""; $nextlink=""; } else { $slidecode=""; if ( $next_image != 0 ) { $slideurl = "{$Globals['maindir']}/slideshow.php?photo=$next_image&sort=$sort&thecat=$thecat"; $slidecode = "\"{$Globals['pp_lang']['start']}\""; } } if ( $slideshow != 1 ) { $exifinfo = ""; if ( $Globals['showexif'] == "yes" ) { $query = "SELECT exifinfo FROM exif WHERE photoid=$photo"; $row = ppmysql_query($query,$link); if ( $row ) { list( $exifinfo ) = mysql_fetch_row($row); } ppmysql_free_result( $row ); } // for childsub, we need to set these globals $ppuser = $iuserid; $tcat = $user; childsub($cat); $childnav = "{$Globals['pp_lang']['home']} $childnav"; } else $childnav=""; $uploadquery = "?cat=$cat"; if ( $width == 0 && $height == 0 ) $sizecode = "n/a"; else $sizecode = "$width x $height"; if ( $slideshow != 1 ) topmenu(); if ( !empty($title) ) printheader( $cat, " $title", $slideshow ); else printheader( $cat, " $bigimage", $slideshow ); $output = "
$menu2 $menu 
"; $count=0; $theext = substr($bigimage,strlen($bigimage) - 4,4); $filename = $bigimage; $filename = str_replace( $theext, "", $filename); $altlink="
"; $profilelink = get_profilelink( $iuserid ); if ( $imgrating && $Globals['allowrate'] == "yes" ) { for ( $x = 1; $x <= $imgrating; $x++ ) { if ( $x == 1 ) $rating = "\"$imgrating"; else $rating .= "\"$imgrating"; } } else { $rating = $Globals['pp_lang']['none']; } if ($approved == "1") { $filesize = $filesize/1024; $filesize = sprintf("%1.1f", $filesize); $filesize = number_format($filesize)."kb"; $dismed = 0; if ($medsize > 0) { $medsize = $medsize/1024; $medsize = sprintf("%1.1f", $medsize); $medsize = number_format($medsize)."kb"; $filesize = "$medsize, $filesize"; if ($size != "big") { $dispmed = 1; $altlink = "
{$Globals['pp_lang']['larger']}

"; } else { $altlink = "
{$Globals['pp_lang']['smaller']}

"; } } if ($Globals['bigsave'] == "yes") { if ( $dispmed == 1 ) { if ( $Globals['onthefly'] == 1 ) { $imgdisp = "\"\""; } else { $imgdisp = "\"\""; } } else { if ( is_multimedia($bigimage) == 1 ) { $mmthumb = "{$Globals['datadir']}/$cat/$iuserid$filename-thumb.jpg"; $dirthumb = "{$Globals['datafull']}/$cat/$iuserid$filename-thumb.jpg"; if ( !file_exists($dirthumb) ) $mmthumb = "{$Globals['idir']}/video.jpg"; $imgdisp = "\"\"
{$Globals['pp_lang']['video']}"; } else { if ( $filesize != "" ) { if ( $Globals['onthefly'] == 1 ) { $imgdisp = " \"$filename\""; } else { $imgdisp = " \"$filename\""; } } else { $imgdisp = "\"\""; } } } } else { $imgdisp = "\"\""; } } else { $imgdisp = "\"\""; } $output .= ""; } if ( $usercomment == 1 && $Globals['allowrate'] == "yes" && $userid != $iuserid ) { $ratedisplay = ""; } if ( !empty($adminopts) || !empty($ratedisplay) ) { $admindisplay = "
$childnav $prevlink $slidecode $nextlink

$imgdisp
$title
"; $admindisplay=""; $adminopts=""; if ( $slideshow != 1 ) { if ( $adminedit == 1 || ($userid == $iuserid && $Globals['userdel'] == "yes") ) { $selected = $cat; catmoveopt(0); $adminopts = "
{$Globals['pp_lang']['move']}:
   {$Globals['pp_lang']['delete']}  
$adminopts$ratedisplay
"; } $ppdate = formatppdate( $date ); $desc = convert_markups( $desc ); $desc = ConvertReturns( $desc ); $output .= "$altlink
"; if ( $userid != "" ) { $query = "SELECT id FROM favorites WHERE photo=$id AND userid=$userid"; $resultf = ppmysql_query($query, $link); $isfav = mysql_num_rows($resultf); if ( $isfav == 0 ) $pmenu .= "{$Globals['pp_lang']['addfav']} | "; else $pmenu .= "{$Globals['pp_lang']['delfav']} | "; } if ( $usercomment == 1 && $Globals['allowpost'] == "yes" ) { $pmenu .= "{$Globals['pp_lang']['post']}"; } if ($userid != "") { if ( !empty($pmenu) ) $pmenu .= " | "; $pmenu .= "{$Globals['pp_lang']['report']}"; } if ( $Globals['enablecard'] == "yes" && $userid != "" ) { if ( !empty($pmenu) ) $pmenu .= " | "; $pmenu .= "{$Globals['pp_lang']['ecard']}"; } if ($Globals['usenotify'] == "yes" && $userid > 0) { $query = "SELECT id FROM notify WHERE userid=$userid AND photo=$photo LIMIT 1"; $results = ppmysql_query($query,$link); list( $notifyid ) = mysql_fetch_row($results); ppmysql_free_result($results); if ( !empty($pmenu) ) $pmenu .= " | "; if ($notifyid != "") { $pmenu .= "{$Globals['pp_lang']['disable']}"; } else { $pmenu .= "{$Globals['pp_lang']['enable']}"; } } if ( $adminedit == 1 || ($userid == $iuserid && $ueditpho == 1) ) { if ( !empty($pmenu) ) $pmenu .= " | "; $pmenu .= "{$Globals['pp_lang']['edit']}"; } if ( $pmenu != "" ) { $output .= ""; } // find similiar posts if ( empty($keywords) ) $keywords = $title; $keylinks = ""; $keys = explode( " ", $keywords ); $keys = array_unique ($keys ); foreach($keys as $eachkey) { if ( !empty($eachkey) && $eachkey != "the" && $eachkey != "a" && $eachkey != "but" && $eachkey != "are" && $eachkey != "and" ) $keylinks .= "$eachkey "; } $output .= ""; if ( $exifinfo != "" ) { $restexif = unserialize(stripslashes($exifinfo)); $output .= "
$pmenu
"; if ( $Globals['allowrate'] == "yes" ) { $output .= ""; } $output .= "
{$Globals['pp_lang']['poster']}: $user ({$Globals['pp_lang']['seeall']})
{$Globals['pp_lang']['views']}: $views
{$Globals['pp_lang']['rating']}: $rating
{$Globals['pp_lang']['date']}: $ppdate
{$Globals['pp_lang']['filesize']}: $filesize
{$Globals['pp_lang']['dims']}: $sizecode
{$Globals['pp_lang']['keywords']}: $keylinks
{$Globals['pp_lang']['desc']}: $desc
\n"; $col = 1; while(list($k,$v)=each($restexif)) { if ( !empty($v) ) { if ( is_numeric($v) ) { if ( strlen($v) == 10 ) $v = formatppdate( $v ); else $v = number_format( $v ); } if ( $k == "IsColor" ) { if ( $v == 1 ) $v = "Yes"; else $v = "No"; } if ( $col == 1 ) $output .= ""; $output .= "\n"; if ( $col == 1 ) $col = 2; else { $col = 1; $output .= ""; } } } if ( $col == 2 ) $output .= ""; } $output .= "
{$Globals['pp_lang']['exif']}
$k: $v
  
"; } else { $output .= "
"; } if ( $slideshow == 1 ){ $output .= "

"; } else { $output .= "$admindisplay"; } if ( $slideshow == 0 && $Globals['allowpost'] == "yes" ) { $query = "SELECT id FROM comments WHERE photo=$photo"; $results = ppmysql_query($query,$link); $comcount = mysql_num_rows($results); if ( $comcount == 0 ) { $compages = 0; } else { if ($pperpage > 0) { $compages=($comcount/$pperpage); } else { $pperpage = $Globals['defaultposts']; $compages = ($comcount/$pperpage); } } if (intval($compages) < $compages) { $compages=intval($compages)+1; } else { $compages=intval($compages); } if ( isset($cpage) ) { $cstartnumb=($cpage*$pperpage)-$pperpage+1; } else { $cpage=1; $cstartnumb=1; } $cc=0; $ckcolor=0; $posts=""; $comq = "
"; $query = "SELECT id,username,userid,date,rating,comment FROM comments WHERE photo=$photo ORDER BY date ASC"; $rows = ppmysql_query($query,$link); while ( list( $id, $user, $cuserid, $date, $rating, $commenttext ) = mysql_fetch_row($rows) ) { if ($rating > 0 && $Globals['allowrate'] == "yes" ) { $ratingdisp = "{$Globals['pp_lang']['rating']}: $rating/5 "; } else { $ratingdisp=""; } $cc++; if ($cc >= $cstartnumb) { if ($cc < ($cstartnumb+$pperpage)) { $profilelink = get_profilelink( $cuserid ); $cclock = formatpptime( $date ); $ppdate = formatppdate( $date ); $query = "SELECT id FROM photos WHERE userid=$cuserid LIMIT 1"; $results = ppmysql_query($query,$link); list( $phoid ) = mysql_fetch_row($results); ppmysql_free_result($results); $cuser=$Globals['pp_lang']['unreg']; $clocation=""; $ctitle=""; $cposts=""; $regdate=""; $ugallery=""; $isonline=""; $hpage=""; if ($Globals['vbversion'] == "2.0.3" || $Globals['vbversion'] == "2.2.0") { if ($cuserid != 0) { $query = "SELECT username,homepage,usertitle,posts,joindate FROM user WHERE userid=$cuserid LIMIT 1"; $results = ppmysql_query($query,$db_link); list( $cuser, $chomepage, $ctitle, $cposts, $regdate ) = mysql_fetch_row($results); ppmysql_free_result( $results ); list($rsec,$rmin,$rhour,$rmday,$rmon,$ryear,$rwday,$ryday,$risdst) = localtime($regdate); $ryear=$ryear+1900; $rmon++; $regdate="$rmon/$ryear"; $query = "SELECT field2 FROM userfield WHERE userid=$cuserid LIMIT 1"; $results = mysql_query($query, $db_link); if ( $results ) { $ufields = mysql_fetch_array($results); $clocation = $ufields['field2']; ppmysql_free_result($results); } $query = "SELECT host FROM session WHERE userid=$cuserid LIMIT 1"; $results = ppmysql_query($query,$db_link); list( $conline ) = mysql_fetch_row($results); ppmysql_free_result($results); } if ($phoid != "") { $ugallery = "\"{$Globals['pp_lang']['visitgallery']}\""; } if ( $cuserid != 0 ) { if ( $chomepage != "" ) { $hpage = "\"Visit"; } if ($conline == "") { $isonline = "\"{$Globals['pp_lang']['offline']}\" "; } else { $isonline = "\"{$Globals['pp_lang']['online']}\" "; } } } if ($Globals['vbversion'] == "Internal") { if ($cuserid != 0) { $query = "SELECT username,homepage,posts,joindate,location FROM users WHERE userid=$cuserid LIMIT 1"; $results = ppmysql_query($query, $db_link); list( $cuser, $chomepage, $cposts, $regdate, $clocation ) = mysql_fetch_row($results); ppmysql_free_result( $results ); list($rsec,$rmin,$rhour,$rmday,$rmon,$ryear,$rwday,$ryday,$risdst) = localtime($regdate); $ryear=$ryear+1900; $regdate="$rmon/$ryear"; } } if ($Globals['vbversion'] == "phpBB") { if ($cuserid != 0) { $query = "SELECT username,user_website,user_posts,user_rank,user_regdate FROM users WHERE user_id=$cuserid LIMIT 1"; $results = ppmysql_query($query,$db_link); list( $cuser, $chomepage, $cposts, $regdate, $ctitlenum ) = mysql_fetch_row($results); ppmysql_free_result( $results ); $query = "SELECT rank_title FROM ranks WHERE rank_id=$ctitlenum LIMIT 1"; $results = ppmysql_query($query,$db_link); list( $ctitle ) = mysql_fetch_row($results); ppmysql_free_result( $results ); $query = "SELECT sess_id FROM sessions WHERE user_id=$cuserid LIMIT 1"; $results = ppmysql_query($query,$db_link); list( $conline ) = mysql_fetch_row($results); ppmysql_free_result( $results ); if ( $chomepage != "" ) { $hpage = "\"{$Globals['pp_lang']['visithome']}\")"; } } if ($phoid != "") { $ugallery = "\"{$Globals['pp_lang']['visitgallery']}\""; } } if ($Globals['vbversion'] == "phpBB2") { if ($cuserid != 0) { if ( !empty( $Globals['dprefix'] ) ) { $utable = "{$Globals['dprefix']}users"; $rtable = "{$Globals['dprefix']}ranks"; } else { $utable = "users"; $rtable = "ranks"; } $query = "SELECT $utable.username,$utable.user_website,$utable.user_posts,$rtable.rank_title,$utable.user_regdate FROM "; $query .= "$utable LEFT JOIN $rtable ON $utable.user_rank = $rtable.rank_id WHERE $utable.user_id=$cuserid LIMIT 1"; $results = ppmysql_query($query, $db_link); if ( $results ) { list( $cuser, $chomepage, $cposts, $ctitle, $regdate ) = mysql_fetch_row($results); ppmysql_free_result( $results ); list($rsec,$rmin,$rhour,$rmday,$rmon,$ryear,$rwday,$ryday,$risdst) = localtime($regdate); $rmon++; $ryear=1900+$ryear; $regdate = "$rmon/$rmday/$ryear"; } } } if ($Globals['vbversion'] == "w3t" || $Globals['vbversion'] == "w3t6") { if ($cuserid != 0) { if ( !empty( $Globals['dprefix'] ) ) { $utable = "{$Globals['dprefix']}Users"; } else { $utable = "w3t_Users"; } $query = "SELECT U_Username,U_Homepage,U_Totalposts,U_Title,U_Registered FROM $utable WHERE U_Number=$cuserid LIMIT 1"; $results = ppmysql_query($query,$db_link); list( $cuser, $chomepage, $cposts, $ctitle, $tdate ) = mysql_fetch_row($results); ppmysql_free_result( $results ); list($rsec,$rmin,$rhour,$rmday,$rmon,$ryear,$rwday,$ryday,$risdst) = localtime($tdate); $rmon++; $ryear=1900+$ryear; $regdate = "$rmon/$rmday/$ryear"; } } if ($Globals['vbversion'] == "Internal" || $Globals['vbversion'] == "w3t" || $Globals['vbversion'] == "w3t6" ) { if ($phoid != "") { $ugallery = "\"{$Globals['pp_lang']['visitgallery']}\""; } if ($chomepage != "" ) { $chomepage = str_replace("http://", "", $chomepage); $hpage = "\"{$Globals['pp_lang']['visithome']}\""; } } if ($regdate != "") $regdate = "

{$Globals['pp_lang']['registered']}: $regdate"; if ($cposts != "") $cposts = "
{$Globals['pp_lang']['posts']}: $cposts"; if ($clocation != "") $clocation = "
{$Globals['pp_lang']['location']}: $clocation"; if ($ctitle != "") $ctitle = "
$ctitle"; if ($ckcolor == 1) { $fillcolor = $Globals['altcolor1']; $ckcolor = 0; } else { $fillcolor = $Globals['altcolor2']; $ckcolor = 1; } $commenttext = convert_markups($commenttext); $commenttext = ConvertReturns($commenttext); $posts .= "
$cuser $ctitle $regdate$clocation$cposts
$commenttext $ratingdisp
$isonline $ppdate $cclock "; } if ($Globals['vbversion'] == "Internal" || $Globals['vbversion'] == "w3t" || $Globals['vbversion'] == "w3t6") { $posts .= "\"{$Globals['pp_lang']['seeprofile']}\" $hpage $ugallery "; } if ( $Globals['vbversion'] == "phpBB" || $Globals['vbversion'] == "phpBB2" ) { $posts .= "\"{$Globals['pp_lang']['seeprofile']}\" $hpage $ugallery "; } } $posts .= "
"; if ( $cuserid > 0 ) { if ($Globals['vbversion'] == "2.0.3" || $Globals['vbversion'] == "2.2.0") { $posts .= " \"{$Globals['pp_lang']['seeprofile']}\" \"{$Globals['pp_lang']['sendpm']}\" $hpage \"{$Globals['pp_lang']['find']}\" \"{$Globals['pp_lang']['addbuddy']}\" $ugallery "; if ( $adminedit == 1 || ($userid == $cuserid && $ueditposts == 1) ) { $posts .= "\"{$Globals['pp_lang']['editdel']}\""; } else { $posts .= " "; } $posts .= "
"; } } } if ( $rows ) ppmysql_free_result( $rows ); if ( $usercomment == 1 && $Globals['allowpost'] == "yes" ) { $comq = "
"; $comq .= ""; if ( $Globals['allowrate'] == "yes" && $userid != $iuserid ) { $comq .= ""; } $comq .= ""; $comq .= "
{$Globals['pp_lang']['addcomments']} {$Globals['pp_lang']['help']}
{$Globals['pp_lang']['username']}$username
{$Globals['pp_lang']['rateover']}
Comments:

{$Globals['pp_lang']['bbcode']}
{$Globals['pp_lang']['smilies']}
"; $comq .= ""; $comq .= "
"; } } $cheader = "
{$Globals['pp_lang']['author']}
{$Globals['pp_lang']['thread']} $postreply 
"; // begin pages/nav system ## $comnav=""; if ($compages > 1) { $comnav .= "
{$Globals['pp_lang']['page']}:  "; $thestart=""; if ($cpage < 11) { $thestart=1; } if ($cpage > 10) { $thestart=$cpage/10; $thestart=intval($thestart); $thestart=$thestart*10; } $theend=$thestart+9; for ($p=$thestart;$p<=$compages;$p++) { if ($p != $thestart) { $comnav .= " | "; } if ($cpage != $p) { if ($p == ($theend+1)) { $thispage="$p>"; } else { $thispage="$p"; } $comnav .= "$thispage"; } if ($p >$theend) { break; } if ($cpage == $p) { $comnav .= "$p"; } } if ($cpage < $compages) { $nextpage=$cpage+1; $more = "\"{$Globals['pp_lang']['more']}\""; } else { $more = " "; } $comnav .= "$more
"; } // end pages/nav ### if ( $Globals['ipcache'] != 0 ) { $ipaddress = findenv("REMOTE_ADDR"); $query = "SELECT userid,date,photo FROM ipcache WHERE ipaddr='$ipaddress' AND type='view' AND photo='$photo' LIMIT 1"; $result = ppmysql_query($query, $link); $numfound = mysql_num_rows($result); if ( $numfound > 0 ) { list( $tuserid, $lastdate, $photo ) = mysql_fetch_row($result); list($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(); $mon = $mon + 1; $mytime = mktime($hour,$min,$sec,$mon,$mday,$year); $hour = $hour - $Globals['ipcache']; $timeout = mktime($hour,$min,$sec,$mon,$mday,$year); if ( $lastdate < $timeout ) { $query = "UPDATE photos SET views=views+1 WHERE id=$photo"; $result = ppmysql_query($query,$link); if ( $userid > 0 && $Globals['vbversion'] == "Internal" ) { $query = "UPDATE users SET views=views+1 WHERE userid=$userid"; $result = ppmysql_query($query,$db_link); } $query = "DELETE FROM ipcache WHERE date < $timeout"; $result = ppmysql_query($query,$link); $query = "INSERT INTO ipcache (userid,ipaddr,date,type,photo) VALUES ('$tuserid', '$ipaddress', '$mytime', 'view', '$photo')"; $result = ppmysql_query($query,$link); } } else { list($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(); $mon = $mon + 1; $mytime = mktime($hour,$min,$sec,$mon,$mday,$year); $query = "INSERT INTO ipcache (userid,ipaddr,date,type,photo) VALUES ('$tuserid', '$ipaddress', '$mytime', 'view', '$photo')"; $result = ppmysql_query($query,$link); $query = "UPDATE photos SET views=views+1 WHERE id=$photo"; $result = ppmysql_query($query,$link); if ( $userid > 0 && $Globals['vbversion'] == "Internal" ) { $query = "UPDATE users SET views=views+1 WHERE userid=$userid"; $result = ppmysql_query($query,$db_link); } } } else { $query = "UPDATE photos SET views=views+1 WHERE id=$photo"; $result = ppmysql_query($query,$link); if ( $userid > 0 && $Globals['vbversion'] == "Internal" ) { $query = "UPDATE users SET views=views+1 WHERE userid=$userid"; $result = ppmysql_query($query,$link); } } if ( $posts != "" ) { print "$output$cheader$posts$comnav$comq{$Globals['cright']}"; } else { print "$output$comq{$Globals['cright']}"; } printfooter(); } // end individual photo display ### ?>