Mini Shell Moded By TiGER HeX
Home
||
Turbo Force
||
B-F Config_Cpanel
Current Path :
/
var
/
www
/
ridazz
/
includes
/
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
//var/www/ridazz/includes/forumThreads.php
<? if (!is_numeric($topic_id)) { // guarantee we have a number and not a string $topic_id = 0; } if($topic_id != 0){ $reply_count = 0; //get topic title $sql = "SELECT t.title,DATE_SUB(t.entry_time, INTERVAL 3 HOUR) AS entry_time,u.username,u.user_id,t.body,t.image FROM 50mm_forum_topics t,50mm_users u WHERE t.topic_id = '$topic_id' AND u.user_id=t.user_id"; if( !($result = $db->sql_query($sql)) ){ $sql_error = $db->sql_error(); die($sql_error['message']); } $thread ="<div class=\"threads\">\n"; if($db->sql_numrows($result) > 0){ $row = $db->sql_fetchrow($result); //$sql = "SELECT r.reply_id,r.body,r.image, r.entry_time,u.username,u.user_id,r.reply_to_id,ru.user_id AS reply_to_user_id, ru.username AS reply_to_username FROM 50mm_forum_replies r,50mm_users u LEFT JOIN 50mm_forum_replies AS rr ON rr.reply_id = r.reply_to_id LEFT JOIN 50mm_users AS ru ON ru.user_id = rr.user_id WHERE r.topic_id = '$topic_id' AND u.user_id=r.user_id ORDER BY r.entry_time ASC"; $sql = "SELECT r.reply_id,r.body,r.image,DATE_SUB(r.entry_time, INTERVAL 3 HOUR) AS entry_time,u.username,u.user_id,r.reply_to_id,ru.user_id AS reply_to_user_id, ru.username AS reply_to_username FROM 50mm_users u, 50mm_forum_replies r LEFT JOIN 50mm_forum_replies AS rr ON rr.reply_id = r.reply_to_id LEFT JOIN 50mm_users AS ru ON ru.user_id = rr.user_id WHERE r.topic_id = '$topic_id' AND u.user_id=r.user_id ORDER BY r.entry_time ASC"; if( !($result = $db->sql_query($sql)) ){ $sql_error = $db->sql_error(); die($sql_error['message']); } $reply_count = $db->sql_numrows($result); $unix = get_unix_time($row['entry_time']); $date = date("m.j.y - g:i a",$unix); $thread.= "<div class=\"reply\"><a name=\"reply-initial\"></a><div class=\"title\">".$row['title']."</div>"; $thread.= "<a href=\"#bottom\"><img src=\"images/bottom_pg.gif\"border=0></a> Thread started by <a href=\"viewProfile.php?userId=".$row['user_id']."\">".$row['username']."</a> at $date<br><br>"; if(!empty($row['image'])){ $image_info = @getimagesize(ROOT_DIR.FORUM_LIMG_DIR.$row['image']); $js = "popImage('".urlencode(FORUM_LIMG_DIR.$row['image'])."','".$image_info[0]."','".$image_info[1]."');"; $thread.="<img src=\"".FORUM_SIMG_DIR.$row['image']."\" border=\"0\" hspace=\"10\" align=\"right\" style=\"cursor:pointer;\" onClick=\"".$js."\">"; } $thread.=$row['body']."<br><br>\n"; if ($reply_count > 0) { $reply_url = append_query("forumReply.php","topicId",$topic_id); $reply_url = append_query($reply_url,"pgnum",$pgnum); $reply_url = append_query($reply_url,"reply_to_id",'0'); $thread.= "<a href=\"".$reply_url."\">reply</a><br><br>"; } $thread.="<div style=\"clear:both;\"></div></div>"; } //$thread.="<br clear=\"all\"><br><br><br><br>"; //$thread.="<div style=\"background-color:#000000;line-height:1px;font-size:1px;\" height=\"1\"> </div><br>\n"; echo $thread;/* $sql = "SELECT r.reply_id,r.body,r.image,r.entry_time,u.username,u.user_id,r.reply_to_id,ru.user_id AS reply_to_user_id, ru.username AS reply_to_username FROM 50mm_forum_replies r,50mm_users u LEFT JOIN 50mm_forum_replies AS rr ON rr.reply_id = r.reply_to_id LEFT JOIN 50mm_users AS ru ON ru.user_id = rr.user_id WHERE r.topic_id = '$topic_id' AND u.user_id=r.user_id ORDER BY r.entry_time ASC"; if( !($result = $db->sql_query($sql)) ){ $sql_error = $db->sql_error(); die($sql_error['message']); } */ $thread = ""; if($reply_count > 0){ while($row = $db->sql_fetchrow($result)){ $thread.="<div class=\"reply\"><a name=\"reply-".$row['reply_id']."\"><br></a>\n"; $unix = get_unix_time($row['entry_time']); $date = date("m.j.y - g:i a",$unix); if(!empty($row['image'])){ $image_info = @getimagesize(ROOT_DIR.FORUM_LIMG_DIR.$row['image']); $js = "popImage('".urlencode(FORUM_LIMG_DIR.$row['image'])."','".$image_info[0]."','".$image_info[1]."');"; $thread.="<img src=\"".FORUM_SIMG_DIR.$row['image']."\" border=\"0\" hspace=\"10\" align=\"right\" style=\"cursor:pointer;\" onClick=\"".$js."\">"; } $body = stripslashes($row['body']); $thread.=$body."<br><br><br><br><a href=\"#top\"><img src=\"images/tar_top_pg.gif\" style=\"border:0;margin-left:2px;\"></a>\n"; $thread.="<a href=\"viewProfile.php?userId=".$row['user_id']."\" target=\"_top\">".$row['username']."</a>"; if ($row['reply_to_username'] and $row['reply_to_username'] != $row['username']) { $thread.="<br> responding to a <a href=\"#reply-".$row['reply_to_id']."\">comment</a> by ".$row['reply_to_username']."\n"; } elseif ($row['reply_to_username'] === 0) { $thread.="<br> responding to the <a href=\"#reply-initial\">initial comment</a>\n"; } $thread.= "<br>".$date."<br><br>\n"; $reply_url = append_query("forumReply.php","topicId",$topic_id); $reply_url = append_query($reply_url,"pgnum",$pgnum); $reply_url = append_query($reply_url,"reply_to_id",$row['reply_id']); $thread.="<a href=\"".$reply_url."\">reply</a><br><br>\n"; $thread.="<div style=\"clear:both\"></div></div>\n"; //$thread.="<br clear=\"all\"><br>"; //$thread.="<div style=\"background-color:#000000;line-height:1px;font-size:1px;\" height=\"1\"> </div><br>\n"; } $thread.="<a name=\"bottom\"></a></div>\n"; echo $thread; }else{ //$reply_url = append_query("forumReply.php","topicId",$topic_id); //$reply_url = append_query($reply_url,"pgnum",$pgnum); //echo "<a href=\"".$reply_url."\">reply</a><br><br><br>\n"; } } ?>