Guest User

Untitled

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