Forum Index
RegisterSearchFAQMemberlistUsergroupsLog in
Latest_Comments 1.1 for 2.5.x
Goto page Previous  1, 2, 3, 4  Next
 
Reply to topic    Forum Index » Additional Downloads View previous topic
View next topic
Latest_Comments 1.1 for 2.5.x
Author Message
master7



Joined: 11 Apr 2006
Posts: 27

Post Reply with quote
Saszoo wrote:
Yeah, we've noticed it and discussed it here: [ http://english.cutenews.ru/forum/viewtopic.php?t=822&highlight=latest+comments+rss ],
The whitespace was causing it, strange thing Razz


Sorry, I didn't found this post Wink

On other sietes I read, that the "whitespace" causes XML error every time when you include php file into site.

_________________
www.wieliczka24.info

www.master7.rowerpower.org
Tue Apr 01, 2008 12:35 pm View user's profile Send private message
Guest








Please login to hide the ads.

ivanh



Joined: 16 Aug 2007
Posts: 69

Post =] cnru rox Reply with quote
i have two problems

if i use
Code:
<?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 View user's profile Send private message Visit poster's website
FI-DD
Admin


Joined: 22 Sep 2005
Posts: 2668
Location: Germany

Post Reply with quote
http://english.cutenews.ru/forum/sort-by-latest-reply-t1494.html
Thu Apr 03, 2008 9:58 am View user's profile Send private message
ivanh



Joined: 16 Aug 2007
Posts: 69

Post Reply with quote
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 View user's profile Send private message Visit poster's website
flyboy17



Joined: 21 Feb 2007
Posts: 47

Post Reply with quote
great plug-in, but one request Rolling Eyes Smile

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! Smile
Sun Jun 08, 2008 5:44 pm View user's profile Send private message
FI-DD
Admin


Joined: 22 Sep 2005
Posts: 2668
Location: Germany

Post Reply with quote
In latest_comments.php change this:
Code:
$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:
Code:
   $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 View user's profile Send private message
flyboy17



Joined: 21 Feb 2007
Posts: 47

Post Reply with quote
Hello FI-DD

Thanks, i just tested your code and it seems to work correct thanks Smile
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:
Code:
  $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:
Quote:
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 Sad
Tue Jun 10, 2008 8:13 pm View user's profile Send private message
FI-DD
Admin


Joined: 22 Sep 2005
Posts: 2668
Location: Germany

Post Reply with quote
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 View user's profile Send private message
flyboy17



Joined: 21 Feb 2007
Posts: 47

Post Reply with quote
I completly reinstall this plug-in with your change, but there are still double posts in the latest comments.
And also for some reason there is also a delay of 1 messages. (somewhere a wrong for-loop?)
Thanks for your help, i appreciate. Smile



ScreenShot055.jpg
 Description:

Download
 Filename:  ScreenShot055.jpg
 Filesize:  72.47 KB
 Downloaded:  9 Time(s)

Thu Jun 19, 2008 4:20 pm View user's profile Send private message
FI-DD
Admin


Joined: 22 Sep 2005
Posts: 2668
Location: Germany

Post Reply with quote
I made a small change in the code above. But I doubt that fixed it.
Fri Jun 20, 2008 1:37 pm View user's profile Send private message
flyboy17



Joined: 21 Feb 2007
Posts: 47

Post Reply with quote
Hello

This one works fine thanks! Very Happy
But still have a delay of 1 comment? Sad
Any idea?
Thanks again Smile
Sat Jun 21, 2008 11:33 pm View user's profile Send private message
flyboy17



Joined: 21 Feb 2007
Posts: 47

Post Reply with quote
Sorry to disturb you again Sad
But now there URL is wrong.
I replaced the original in latest_comments.php
Quote:
$output = str_replace('{link}', cute_get_link($get_news), $output);

but without any success (he just ignored the {link})

Template:
Quote:
<a href="{link}#{comment-id}">{title}</a>


gives me:
Quote:
http://www.flightlevel.be/#219


Normal link would be:
Quote:
http://www.flightlevel.be/080619_rise-of-the-fuel-price-fall-of-the-airlines.html#219

Tue Jun 24, 2008 4:50 pm View user's profile Send private message
FI-DD
Admin


Joined: 22 Sep 2005
Posts: 2668
Location: Germany

Post Reply with quote
Did you clear the cache?
Thu Jun 26, 2008 5:36 pm View user's profile Send private message
flyboy17



Joined: 21 Feb 2007
Posts: 47

Post Reply with quote
Yes i did Smile
Also deleted the .txt file; so a new one should be created
Thu Jun 26, 2008 9:57 pm View user's profile Send private message
flyboy17



Joined: 21 Feb 2007
Posts: 47

Post Reply with quote
Any idees? Smile thanks
Thu Jul 17, 2008 5:01 pm View user's profile Send private message
Display posts from previous:    
Reply to topic    Forum Index » Additional Downloads All times are GMT + 1 Hour
Goto page Previous  1, 2, 3, 4  Next
Page 3 of 4

 
Jump to: 
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



Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL / Music Lyrics.