Follow us on Facebook and Twitter!

Recent Comments..again
#1
Sad 
Hi
I'm testing Commentics and works well with Recent Comments..but I'd like, instead of the date,
PHP Code:
echo $comment["name"] . " on <a href='" $page["url"] . "'>" $page["reference"] . "</a> at " . [b]date("g:ia (jS-M)"strtotime($comment["dated"]));[/b
10/20 characters (best 2/3 words) of the written comments, I tried some changes.. but my skills are so limited Huh..is it possible? Rolleyes
tks in advance
regards
Reply
#2
Hi,

This will display the first 20 characters of the comment:

PHP Code:
// Start of 'Recent Comments' **********************************************************************************************
echo "<h3>Recent Comments</h3>";

$comments mysql_query("SELECT * FROM `" $cmtx_mysql_table_prefix "comments` WHERE `is_approved` = '1' ORDER BY `dated` DESC LIMIT 5");

while (
$comment mysql_fetch_array($comments)) {

    
$page_query mysql_query("SELECT * FROM `" $cmtx_mysql_table_prefix "pages` WHERE `id` = '" $comment["page_id"] . "'");
    
$page mysql_fetch_assoc($page_query);
    
    
$comment_snippet $comment["comment"];
    
$comment_snippet str_ireplace("<br />"" "$comment_snippet);
    
$comment_snippet str_ireplace("<p></p>"" "$comment_snippet);
    
$comment_snippet strip_tags($comment_snippet);
    
$comment_snippet html_entity_decode($comment_snippetENT_QUOTES'UTF-8');
    
$comment_snippet substr($comment_snippet020);
    
$comment_snippet htmlspecialchars($comment_snippetENT_NOQUOTES'UTF-8');

    echo 
$comment["name"] . " on <a href='" $page["url"] . "'>" $page["reference"] . "</a> said " $comment_snippet;
    echo 
"<br/>";
    
}
// End of 'Recent Comments' ************************************************************************************************ 
Have you completed the interview?
Reply
#3
works fine thank you...
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Recent Comments resp. Pages kooler 2 2,021 02-Aug-2013, 06:29 PM
Last Post: kooler
  Recent Comments CommiC 6 4,674 23-Jun-2013, 12:09 AM
Last Post: CommiC
  Improved Manage Comments Addon MuffinMan 5 3,378 21-Apr-2013, 09:30 PM
Last Post: MuffinMan
  using permalinks on recent comments module otuzel 2 2,313 12-Mar-2013, 11:11 PM
Last Post: otuzel
  Recent Comments Add On Help brande 3 2,990 27-Jan-2013, 10:31 PM
Last Post: Steven
  recent comment add on style brande 0 1,556 23-Jan-2013, 08:08 PM
Last Post: brande
  Add-ons Recent Comments not working ! besric 4 3,704 07-Nov-2012, 05:16 PM
Last Post: besric
  Auto populate your comments table corculator 0 1,873 25-Feb-2012, 01:25 PM
Last Post: corculator
  Cannot get recent comments add on to work stevylake 1 2,184 04-Sep-2011, 01:25 PM
Last Post: Steven

Forum Jump:


Users browsing this thread: 1 Guest(s)