Forum Index
RegisterSearchFAQMemberlistUsergroupsLog in
Error with user publication count

 
Reply to topic    Forum Index » Bugs and errors View previous topic
View next topic
Error with user publication count
Author Message
MemorX



Joined: 20 Mar 2008
Posts: 2

Post Error with user publication count Reply with quote
Hi,

We are using Cutenews.Ru for two of our sites, and this is working good, but there is a strange error with the publication count. Each time a user posts, the counter goes wild. We use the nice little "syncro" plugin to fix it, but I wonder why there is so little information about this on the forum?

I found one post about it, under Additional Download (The Syncro Plugin), but it was unanswered. Is this a rare problem, or is it general?

And if there is no easy solution to this, would it be possible to "autorun" this plugin every time news is posted?

Thanks.
Thu Mar 27, 2008 11:44 pm View user's profile Send private message
Guest








Please login to hide the ads.

scottdallas



Joined: 04 May 2006
Posts: 1802
Location: US

Post Reply with quote
Quote:
Is this a rare problem, or is it general?


I think it is rare and FI-DD will probably be the only guy that will know how to automate his synchronization plugin. The only time I get an inaccurate count is when I import feeds, delete feeds, import again. It doesn't delete the deleted feeds from the overall pub count. But, that's just side thoughts cause that's obviously not what yours is doing wrong.

Might be a server issue...

_________________
www.scottdizzle.com uses cnr Smile
last update: 07-22-08: 8:30 pm
Fri Mar 28, 2008 2:15 am View user's profile Send private message Visit poster's website AIM Address
D72



Joined: 22 Feb 2007
Posts: 217
Location: NL

Post Reply with quote
didnt knew of the existence of the plug... Embarassed
Fri Mar 28, 2008 8:53 am View user's profile Send private message
FI-DD
Admin


Joined: 22 Sep 2005
Posts: 2668
Location: Germany

Post Reply with quote
When did you download CNR? I remember that I did some changes to the post count code. Maybe you downloaded the script before I made those changes?

To automatically run the syncro script open inc/plugins.inc.php and find this:
Code:
add_action('head', 'cache_remove');


and add above:
Code:
add_action('head', 'synchro_posts');

function synchro_posts(){
global $sql, $config_http_script_dir;

      $all_users = array();
      
      foreach($sql->select(array('table' => 'users', 'where' => array("level < 4"))) as $row){
         $all_users[$row['username']] = 0;
      }
      
      foreach($sql->select(array('table' => 'news')) as $row){
         $all_users[$row['author']]++;
      }
   
      foreach($all_users as $username => $count){
         $sql->update(array(
               'table' => 'users',
               'where' => array("username = ".$username),
               'values' => array('publications' => $count)
         ));
      }

}

Wed Apr 02, 2008 6:04 pm View user's profile Send private message
Display posts from previous:    
Reply to topic    Forum Index » Bugs and errors All times are GMT + 1 Hour
Page 1 of 1

 
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.