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/articles.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'); include_once('includes/ads/468x60.php'); ?> <? $pgnum = 1; if(isset($_REQUEST['pgnum'])){ $pgnum = $_REQUEST['pgnum']; } //get content $sql = "SELECT page_body FROM 50mm_pages WHERE page_name ='articles'"; if( !($result = $db->sql_query($sql)) ){ $sql_error = $db->sql_error(); die($sql_error['message']); } $row = $db->sql_fetchrow($result); echo stripslashes($row['page_body']); //get pagination $sql = "SELECT COUNT(*) AS total FROM 50mm_stories WHERE story_type = 'ARTICLE' AND approved = 1"; if( !($result = $db->sql_query($sql)) ){ $sql_error = $db->sql_error(); die($sql_error['message']); } $row = $db->sql_fetchrow($result); $total = $row['total']; $offset = ($pgnum-1) * RESULTS_PER_PAGE; $pgnav = ""; if($total>0){ $bnav = get_pagination($total,$pgnum,$_SERVER['PHP_SELF'],RESULTS_PER_PAGE); //determine displaying page ? or ? $highpg = $pgnum*RESULTS_PER_PAGE; if($highpg>$total){ $highpg = $total; } $lowpg = $offset+1; //$total_pages = ceil($total/RESULTS_PER_PAGE); $pgnav = "<div>Displaying $lowpg - $highpg of ".$total." Articles...</div>"; $pgnav.="<div>Page:$bnav</div>"; } echo $pgnav; ?> <br><br> <? //grab all approved articles. Even ones that have no user_id associated with them. $sql="SELECT story_id, story_title, story_body, u.user_id, s.entry_time, username FROM 50mm_stories s LEFT JOIN 50mm_users u ON s.user_id = u.user_id WHERE s.story_type = 'ARTICLE' AND approved = 1 ORDER BY s.entry_time DESC LIMIT $offset,".RESULTS_PER_PAGE; if( !($story_result = $db->sql_query($sql)) ){ $sql_error = $db->sql_error(); die($sql_error['message']); } $html = ""; while($row = $db->sql_fetchrow($story_result)){ $story_id = $row['story_id']; $imgsql = "SELECT image FROM 50mm_embed WHERE story_id = '$story_id' LIMIT 1"; if( !($imgresult = $db->sql_query($imgsql)) ){ $sql_error = $db->sql_error(); die($sql_error['message']); } $html.='<table cellpadding="0" cellspacing="0" border="0" width="100%">'."\n"; $html.='<tr valign="top">'."\n"; $html.='<td>'."\n"; $html.='<div class="title"><br>'.$row['story_title'].'</div><br>'."\n"; $unix = get_unix_time($row['entry_time']); $date = date("m.j.y",$unix); //$html.='Posted '.$date.' by '.'<a href="viewProfile.php?userId='.$row['user_id'].'">'.$row['username'].'</a><br><br>'."\n"; $imgrow = $db->sql_fetchrow($imgresult); if(!empty($imgrow['image'])){ $image_info = @getimagesize(ROOT_DIR.STORY_LIMG_DIR.$imgrow['image']); $js = "popImage('".urlencode(STORY_LIMG_DIR.$imgrow['image'])."','".$image_info[0]."','".$image_info[1]."');"; $html.="<img src=\"".STORY_SIMG_DIR.$imgrow['image']."\" border=\"0\" hspace=\"15\" align=\"right\" style=\"cursor:pointer;\" onClick=\"".$js."\">"; } $html.= get_html_text(get_trim_string($row['story_body'],400))."\n"; $html.= '<a href="viewStory.php?storyId='.$row['story_id'].'"><br><br>[ Read More... ]</a><br><br>'."\n"; $html.='</td>'."\n"; $html.='<br><br><div class="borderLines" height="1"><img src="images/spacer.gif" width="100%" height="1"></div></tr>'."\n"; $html.='</table>'."\n"; } echo $html; ?> <? include_once('includes/footer.php'); include_once('includes/appBottom.php'); ?>