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/viewTopPages.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['tagId'])){ die("no id specified"); } $tag_id = $_REQUEST['tagId']; $sql = "SELECT u.username,u.user_id FROM 50mm_users u,50mm_tags t WHERE t.user_id=u.user_id AND tag_id='$tag_id'"; if( !($result = $db->sql_query($sql)) ){ $sql_error = $db->sql_error(); die($sql_error['message']); } $row = $db->sql_fetchrow($result); $uid = $row['user_id']; $uname = $row['username']; include_once('includes/bookTop.php'); $sql = "SELECT AVG(v.vote) as average,COUNT(v.vote),t.tag_image,t.tag_id FROM 50mm_tag_votes v,50mm_tags t WHERE v.tag_id = t.tag_id AND (TO_DAYS(NOW()) - TO_DAYS(v.entry_time)) <= ".BOOK_VOTE_SAMPLE_DAYS." GROUP BY t.tag_id HAVING COUNT(v.vote) >= ".BOOK_VOTES_REQUIRED." ORDER BY average DESC LIMIT ".BOOK_NUM_TOP; if( !($result = $db->sql_query($sql)) ){ $sql_error = $db->sql_error(); die($sql_error['message']); } //make an array of all the content owned by this users $index = 0; $tag_array = Array(); $counter = 0; while($row = $db->sql_fetchrow($result)){ if($tag_id == $row['tag_id']){ $index = $counter; } array_push($tag_array,$row['tag_id']); $counter++; } if(($index + 1) < $counter){ $next_photo = $tag_array[$index+1]; $next_url = $_SERVER['PHP_SELF']."?tagId=$next_photo"; $next = "<a href=\"$next_url\"><img src=\"images/next.gif\" border=\"0\"></a>"; }else{ $next = ""; } if(($index - 1) >= 0){ $previous_photo = $tag_array[$index-1]; $previous_url = $_SERVER['PHP_SELF']."?tagId=$previous_photo"; $previous = "<a href=\"$previous_url\"><img src=\"images/previous.gif\" border=\"0\"></a>"; }else{ $previous = ""; } $pg_name = basename($_SERVER['PHP_SELF']); include_once('includes/header.php'); ?> <style> .voteTitle{font-size:12px;font-weight:bold;} </style> <script> function tagVote(){ tagForm.submit(); } </script> <table width="700" border="0" cellspacing="10" cellpadding="0" align="center"> <tr> <td align="center" valign="top" width="17"><?echo $previous?></td> <td align="center" valign="top" width="17"><a href="battle.php"><img src="images/home.gif" border="0"></a></td> <td align="center" valign="top" width="17"><?echo $next?></td> <td align="right" valign="top"> <?php include_once('includes/ads/468x60.php'); ?> <!-- AdRevenue Ad Code <script src="http://www.50mmlosangeles.com/advertise/index.php?section=serve&id=50&output=js"></script>--></td> </tr> </table> <form name="tagForm" action="<?echo $_SERVER['PHP_SELF']?>" method="GET"> <table border="0" cellspacing="5" cellpadding="0" align="center"> <tr> <td>Vote on this page:</td> <td> <? $tag_vote_arr = Array(); $tag_vote_arr[1]="Toy"; $tag_vote_arr[2]="Aight"; $tag_vote_arr[3]="Clean"; $tag_vote_arr[4]="The Shit"; $tag_vote_arr[5]="Legendary"; if(is_authorized()){ $radio = ""; $i=0; while (list($key, $text) = each($tag_vote_arr)) { $i++; $radio.= '<td><input name="vote" type="radio" value="'.$key.'" onClick="tagVote()";><span class="voteTitle">'.$text.'</span></td>'."\n"; if($i < count($tag_vote_arr)){ $radio.='<td width="20"> </td>'."\n"; } } echo $radio; }else{ echo "<td>you must be logged in to vote <a href=\"login.php?refurl=".urlencode($_SERVER['REQUEST_URI'])."\">click here</a> to login!</td>"; } ?> </td> </tr> </table> <input type="hidden" name="userId" value="<?echo $uid;?>"> <input type="hidden" name="tagId" value="<?echo $tag_id;?>"> </form> <? $sql = "SELECT AVG(vote) as avg_vote FROM 50mm_tag_votes WHERE tag_id='$tag_id' GROUP BY tag_id"; if( !($result = $db->sql_query($sql)) ){ $sql_error = $db->sql_error(); die($sql_error['message']); } $row = $db->sql_fetchrow($result); $avg_num = round($row['avg_vote']); if($avg_num > 0){ $avg = $tag_vote_arr[$avg_num]; }else{ $avg = "no votes casted"; } $user_vote =""; if(is_authorized()){ $sql = "SELECT vote FROM 50mm_tag_votes WHERE voter_id='".$_SESSION['user_id']."' AND tag_id='$tag_id'"; if( !($result = $db->sql_query($sql)) ){ $sql_error = $db->sql_error(); die($sql_error['message']); } $row = $db->sql_fetchrow($result); $vote = $row['vote']; if($vote > 0){ $user_vote = "You voted this: ".$tag_vote_arr[$vote]; }else{ $user_vote = "You've not yet voted on this"; } } ?> <table border="0" cellspacing="0" cellpadding="0" align="center"> <tr> <td> <?echo $user_vote;?><br>Average Vote: <?echo $avg;?><br> <? //get tag $sql = "SELECT tag_image,page_num FROM 50mm_tags WHERE tag_id='$tag_id'"; if( !($result = $db->sql_query($sql)) ){ $sql_error = $db->sql_error(); die($sql_error['message']); } $row = $db->sql_fetchrow($result); $tag_image = BOOK_LIMG_DIR.$row['tag_image']; $pnum = $row['page_num']; echo "<img src=\"$tag_image\" border=\"0\"><br>\n"; ?> </td> </tr> </table> <? if ($uid == $_SESSION['user_id']){ echo "<a href=\"bookDraw.php?userId=$uid&pageNum=$pnum\">Hit this page.</a>"; } ?> <br><br> <?include_once('includes/bookBottom.php');?> <br><br> <table width="100%" border="0" cellspacing="0" cellpadding="0" align="center"> <tr valign="top"> <td> <? /* $sql = "SELECT AVG(vote) as vote,u.username,u.user_id FROM 50mm_tag_votes v, 50mm_users u WHERE v.user_id=u.user_id GROUP BY tag_id ORDER BY vote DESC LIMIT 50"; if( !($result = $db->sql_query($sql)) ){ $sql_error = $db->sql_error(); die($sql_error['message']); } $tags = "Top Rated:<br>"; $count = 0; while($row = $db->sql_fetchrow($result)){ if( (!empty($row['user_id'])) && (!empty($row['username'])) ){ if($count == 0){ $tags.='<a href="viewBook.php?userId='.$row['user_id'].'">'.$row['username'].'</a>'; }else{ $tags.=' | <a href="viewBook.php?userId='.$row['user_id'].'">'.$row['username'].'</a>'; } $count++; } } echo $tags;*/ ?> </td> <td width="20"> </td> <td> <? /* $sql = "SELECT t.user_id,u.username FROM 50mm_tags t, 50mm_users u WHERE t.user_id=u.user_id GROUP BY user_id ORDER BY t.tag_date DESC LIMIT 50"; if( !($result = $db->sql_query($sql)) ){ $sql_error = $db->sql_error(); die($sql_error['message']); } $tags = "Recent Pages:<br>"; $count = 0; while($row = $db->sql_fetchrow($result)){ if( (!empty($row['user_id'])) && (!empty($row['username'])) ){ if($count == 0){ $tags.='<a href="blackBook.php?userId='.$row['user_id'].'">'.$row['username'].'</a>'; }else{ $tags.=' | <a href="blackBook.php?userId='.$row['user_id'].'">'.$row['username'].'</a>'; } $count++; } } echo $tags; */ ?> </td> </tr> </table> <? include_once('includes/footer.php'); include_once('includes/appBottom.php'); ?>