Guest User

Untitled

a guest
Apr 24th, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.95 KB | None | 0 0
  1. <? 
  2.    
  3.     $latest = $_POST['latest'];
  4.     $articleId = $_POST['article'];
  5.    
  6.     include 'includes/functions.php';
  7.    
  8.     $query = "
  9.  
  10.     SELECT
  11.         fr.nid, fr.title, fr.id, fr.comment, fr.date AS date2,
  12.         u.avatar, u.rank, u.signature, u.username AS author,
  13.         (SELECT COUNT(tfr.id) FROM forum_reply tfr WHERE tfr.user_id = fr.user_id) AS post_count
  14.     FROM
  15.         forum_reply fr
  16.         INNER JOIN account u ON u.id = fr.user_id
  17.         INNER JOIN blog b ON b.id = fr.nid
  18.     WHERE
  19.       fr.nid = $articleId AND fr.id > $latest
  20.     ORDER BY
  21.       fr.date ASC LIMIT 1";
  22.  
  23.     $result = @mysql_query($query);
  24.    
  25.     if(mysql_num_rows($result) > 0) {  
  26.          
  27.     $row = mysql_fetch_row($result, MYSQL_ASSOC);
  28.    
  29.     {
  30.        
  31.         $html = '<div class="comments">';
  32.  
  33.         $html .= '<div class="commentsAvatar">';
  34.        
  35.         $html .= '<div class="overlay_fade">';
  36.        
  37.         $html .= '<a href="#" onclick="return show_info(\''.$row['author'].'\');"><div class="overlay_zoom zoom_white"></div>';
  38.        
  39.         $html .= '<img src="\''.$row['avatar'].'\'" /></a>';
  40.        
  41.         $html .= '</div></div><h4>';
  42.        
  43.         $html .= '<a href="#" onclick="return show_info(\''.$row['author'].'\');">'.$row['author'].'</a>';
  44.        
  45.         $html .= '</h4>';
  46.  
  47.         $html .= '<div style="margin-top: 16px; overflow: hidden;">';
  48.        
  49.         $html .= '<p style="margin-bottom: 18px;">\''.nl2br(bbcode_format(convert_bbcodes(htmlentities($row['comment'], ENT_COMPAT, 'UTF-8')))).'\'</p>';
  50.  
  51.         $html .= '<img src="/images/miniIcons2/clock.png" class="iconSmall">';
  52.        
  53.         $html .= '<abbr class="timeago" style="font-size: 11px; margin-left: -5px;" title="\''.$row['date2'].'\'">\''.$row['date2'].'\'</abbr>';
  54.        
  55.         $html .= '<div style="float: right;">';
  56.        
  57.         $html .= '<a href="#" class="buttonSmall"><img src="/images/miniIcons2/pencil.png" class="iconSmall">Reply</a>';
  58.        
  59.         $html .= '</div><br /><br /></div></div><div style="clear: both; margin-bottom: 15px;"></div>';    
  60.        
  61.         json_encode(Array('comment_id' => $latest, 'html' => $html))
  62.     }}
  63.    
  64.    
  65.    
  66.     ?>
Add Comment
Please, Sign In to add comment