 |
 |
 |
 |
 |
| Author |
Message |
master7

Joined: 11 Apr 2006 Posts: 27
|
|
|
| Tue Apr 01, 2008 12:35 pm |
|
 |
Guest
|
|
|
Please login to hide the ads.
|
|
|
|
 |
ivanh
Joined: 16 Aug 2007 Posts: 69
|
|
=] cnru rox |
|
i have two problems
if i use  |  | <?php include($cutepath . '/data/latest_comments.txt'); ?> | in say index.php
would this show all the latest comments?
i was wondering how i can display the lastest comments of a particular category aswell as all
maybe a function like $latest_comments[id] or something like that im not entirely sure
another thing
about a yr ago there was a post about how you can sort your news according to latest comments
i was wondering what the code was again
something like
$sort =array('latest_comm', 'ASC');
|
|
| Thu Apr 03, 2008 8:40 am |
|
 |
FI-DD
Admin

Joined: 22 Sep 2005 Posts: 2668 Location: Germany |
|
|
| Thu Apr 03, 2008 9:58 am |
|
 |
ivanh
Joined: 16 Aug 2007 Posts: 69
|
|
|
|
thanks for the link fi-dd!
could you help me with the first question aswell?
sorry if you explained it above - i didnt understand it ;(
|
|
| Thu Apr 03, 2008 1:17 pm |
|
 |
flyboy17
Joined: 21 Feb 2007 Posts: 47
|
|
|
|
great plug-in, but one request
I would like to show only unique newsitems (for example; when there are 7 replies on just 1 newsitem; the output will be those 7, same, newsitems)
So, is it possible? I tried to change the sql query but i thing i did something wrong (no 'recently commented news' at all)
(I changed sql query with --> distinct(post_id)
Thanks for you help! 
|
|
| Sun Jun 08, 2008 5:44 pm |
|
 |
FI-DD
Admin

Joined: 22 Sep 2005 Posts: 2668 Location: Germany |
|
|
|
In latest_comments.php change this:
 |  | $comments = $sql-> select(array('table' => 'comments',
'orderby' => array('date', 'DESC'),
'limit' => array(0, $number)));
foreach ($comments as $comment){
$comm_id = $comment['id'];
$xid = $comment['post_id'];
$author = $comment['author'];
$output = $template_active;
$output = str_replace('{id}', $xid, $output);
$output = str_replace('{author}', $author, $output);
$output = str_replace('{title}', get_title($xid,$max_length), $output);
$output = str_replace('{comment-id}', $comm_id, $output);
$strOUT .= $output . "\n";
} |
to this:
 |  | $comments = $sql->select(array('table' => 'comments',
'orderby' => array('date', 'DESC')));
$i = 0;
foreach ($comments as $comment){
if(!isset($found[$comment['post_id']]) and $i < $number){
$comm_id = $comment['id'];
$xid = $comment['post_id'];
$author = $comment['author'];
$output = $template_active;
$output = str_replace('{id}', $xid, $output);
$output = str_replace('{author}', $author, $output);
$output = str_replace('{title}', get_title($xid,$max_length), $output);
$output = str_replace('{comment-id}', $comm_id, $output);
$strOUT .= $output . "\n";
$found[$comment['post_id']] = true;
$i++;
}
else{
continue;
}
} |
(Not tested.)
Last edited by FI-DD on Fri Jun 20, 2008 1:37 pm; edited 1 time in total |
|
| Tue Jun 10, 2008 7:58 pm |
|
 |
flyboy17
Joined: 21 Feb 2007 Posts: 47
|
|
|
|
Hello FI-DD
Thanks, i just tested your code and it seems to work correct thanks
Except; when i delete a comment this plug-in still shows that reaction.
* I also used your 'fast' edition of this plug-in (code is slightly different i suppose)
Original:
 |  | $comments = $sql-> select(array('table' => 'comments',
'orderby' => array('date', 'DESC'),
'limit' => array(0, $number)));
foreach ($comments as $comment){
$comm_id = $comment['id'];
$xid = $comment['post_id'];
$get_news = reset($sql->select(array('table' => 'news', 'where' => array("id = ".$comment['post_id']))));
$author = $comment['author'];
$output = $template_active;
$output = str_replace('{link}', cute_get_link($get_news), $output);
$output = str_replace('{author}', $author, $output);
$output = str_replace('{title}', get_title($xid,$max_length), $output);
$output = str_replace('{comment-id}', $comm_id, $output);
$output = str_replace('{date}', date("H:i", $comment['date']), $output);
$strOUT .= $output . "\n";
} |
Install Instructions:
 |  | You might also want to edit editcomments.mdu so if you remove a comment the comment display will be
updated at same time. Look for the line that starts "msg('info', $echo['headerDeleted']," and
add latest_comments(10, 40); above it. | --> doesn't work anymore 
|
|
| Tue Jun 10, 2008 8:13 pm |
|
 |
FI-DD
Admin

Joined: 22 Sep 2005 Posts: 2668 Location: Germany |
|
|
|
Don't know. But I doubt that the changes I made are the reason for it not working anymore.
If you add that line in editcomments.mdu then the script checks the comments and puts them into the txt file. Since the comment is deleted it shouldn't be in the txt file anymore. Maybe it is a caching problem?
|
|
| Tue Jun 17, 2008 5:45 pm |
|
 |
flyboy17
Joined: 21 Feb 2007 Posts: 47
|
|
|
| Thu Jun 19, 2008 4:20 pm |
|
 |
FI-DD
Admin

Joined: 22 Sep 2005 Posts: 2668 Location: Germany |
|
|
|
I made a small change in the code above. But I doubt that fixed it.
|
|
| Fri Jun 20, 2008 1:37 pm |
|
 |
flyboy17
Joined: 21 Feb 2007 Posts: 47
|
|
|
|
Hello
This one works fine thanks!
But still have a delay of 1 comment?
Any idea?
Thanks again 
|
|
| Sat Jun 21, 2008 11:33 pm |
|
 |
flyboy17
Joined: 21 Feb 2007 Posts: 47
|
|
|
|
Sorry to disturb you again
But now there URL is wrong.
I replaced the original in latest_comments.php
 |  | $output = str_replace('{link}', cute_get_link($get_news), $output); |
but without any success (he just ignored the {link})
Template:
 |  | <a href="{link}#{comment-id}">{title}</a> |
gives me:
 |  | http://www.flightlevel.be/#219 |
Normal link would be:
 |  | http://www.flightlevel.be/080619_rise-of-the-fuel-price-fall-of-the-airlines.html#219 |
|
|
| Tue Jun 24, 2008 4:50 pm |
|
 |
FI-DD
Admin

Joined: 22 Sep 2005 Posts: 2668 Location: Germany |
|
|
|
Did you clear the cache?
|
|
| Thu Jun 26, 2008 5:36 pm |
|
 |
flyboy17
Joined: 21 Feb 2007 Posts: 47
|
|
|
|
Yes i did
Also deleted the .txt file; so a new one should be created
|
|
| Thu Jun 26, 2008 9:57 pm |
|
 |
flyboy17
Joined: 21 Feb 2007 Posts: 47
|
|
|
| Thu Jul 17, 2008 5:01 pm |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
|
|
 |
 |
 |
|