 |
 |
 |
 |
 |
| Author |
Message |
MemorX
Joined: 20 Mar 2008 Posts: 2
|
|
Error with user publication count |
|
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 |
|
 |
Guest
|
|
|
Please login to hide the ads.
|
|
|
|
 |
scottdallas

Joined: 04 May 2006 Posts: 1802 Location: US |
|
|
|
 |  | 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
last update: 07-22-08: 8:30 pm |
|
| Fri Mar 28, 2008 2:15 am |
|
 |
D72

Joined: 22 Feb 2007 Posts: 217 Location: NL |
|
|
|
didnt knew of the existence of the plug... 
|
|
| Fri Mar 28, 2008 8:53 am |
|
 |
FI-DD
Admin

Joined: 22 Sep 2005 Posts: 2668 Location: Germany |
|
|
|
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:
 |  | add_action('head', 'cache_remove'); |
and add above:
 |  | 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 |
|
 |
|
|
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
|
|
 |
 |
 |
|