Best of joomla gives you news, joomla templates, tutorials and websites about Joomla , FireBoard and FireMessage official page.
| No account yet?   |
Welcome, Guest
Please Login or Register.    Lost Password?
FireBoard Manual Latest release discussions Download FireBoard Spread FireBoard!
Re:Recount Categories Stats ERROR (1 viewing) (1) Guest
Go to bottom Favoured: 0
TOPIC: Re:Recount Categories Stats ERROR
#47227
Re:Recount Categories Stats ERROR 8 Months, 1 Week ago  
Goodbyte wrote:
parent==id whould be a suspicous setting. You have to find out which threads have a root with parent!=0 or which thread has no messages with parent==0.
But I think a dev should confirm, that we are on the right way.


[code:1]while ($messages_iter->loadNextObject($l)) {
$i++;
//if($i==100) { die(); }
$cat_l = $l->catid;

while ($cat_l) {
if ($l->parent == 0) {
$ctg[$cat_l]->numTopics++;
}
else {
$ctg[$cat_l]->numPosts++;
}

$ctg[$cat_l]->id_last_msg = $l->id; --------error
$ctg[$cat_l]->time_last_msg = $l->time; -------error
$cat_l = $ctg[$cat_l]->parent;
}
}
[/code:1]

Sorry....i have edited, the error is in internal while cycle...
simbus82 (User)
Junior Boarder
Posts: 32
graphgraph
User Offline Click here to see the profile of this user
Gender: Male PolesineOnLine Location: Italy -> Veneto -> Between rivers Adige and Po Birthdate: 1982-12-26
Logged Logged
 
Last Edit: 2008/03/17 23:31 By simbus82. Reason: mistake
 
The administrator has disabled public write access.  
#47228
Re:Recount Categories Stats ERROR 8 Months, 1 Week ago  
Goodbyte wrote:

But I think a dev should confirm, that we are on the right way.


Good luck with that!
grumblemarc (User)
Platinum Boarder
Posts: 3559
graph
User Offline Click here to see the profile of this user
Gender: Male
Logged Logged
 
The administrator has disabled public write access.  
#47229
Re:Recount Categories Stats ERROR 8 Months, 1 Week ago  
Sorry....i have edited, the error is in internal while cycle...

[code:1]while ($cat_l) {

if ($l->parent == 0)
{
$ctg[$cat_l]->numTopics++;
}
else
{
$ctg[$cat_l]->numPosts++;
}

$ctg[$cat_l]->id_last_msg = $l->id; --------error

$ctg[$cat_l]->time_last_msg = $l->time; -------error

$cat_l = $ctg[$cat_l]->parent;

}[/code:1]


What is the value of the variable that causes the exit from the cycle?
simbus82 (User)
Junior Boarder
Posts: 32
graphgraph
User Offline Click here to see the profile of this user
Gender: Male PolesineOnLine Location: Italy -> Veneto -> Between rivers Adige and Po Birthdate: 1982-12-26
Logged Logged
 
Last Edit: 2008/03/17 23:36 By simbus82.
 
The administrator has disabled public write access.  
#47264
Re:Recount Categories Stats ERROR 8 Months, 1 Week ago  
The loop will be left if $cat_l==0. The last line updates $cat_l to to value of the parent-field. So the inner loop will be left if an entry with parent==0 is found.

You should inspect the database and look out for threads that has no message with parent==0 and fix them. Keep in mind to do a database-backup before manipulating it.
Goodbyte (User)
Junior Boarder
Posts: 84
graphgraph
User Offline Click here to see the profile of this user
Logged Logged
 
The administrator has disabled public write access.  
#47271
Re:Recount Categories Stats ERROR 8 Months, 1 Week ago  
Goodbyte wrote:
The loop will be left if $cat_l==0. The last line updates $cat_l to to value of the parent-field. So the inner loop will be left if an entry with parent==0 is found.

You should inspect the database and look out for threads that has no message with parent==0 and fix them. Keep in mind to do a database-backup before manipulating it.


So i have to find thread with subject with "Re:" but with a parent=0

thread and messages text are in 2 different table... i don't know to search threads with parent=0 and message=0....
simbus82 (User)
Junior Boarder
Posts: 32
graphgraph
User Offline Click here to see the profile of this user
Gender: Male PolesineOnLine Location: Italy -> Veneto -> Between rivers Adige and Po Birthdate: 1982-12-26
Logged Logged
 
Last Edit: 2008/03/18 13:53 By simbus82.
 
The administrator has disabled public write access.  
#47290
Re:Recount Categories Stats ERROR 8 Months, 1 Week ago  
You only have to search jos_fb_messages. You have to find threads which don't have at least one message with parent==0. Every thread needs exactly/at least one message with parent==0 but in your database there seems to be some threads which don't have a message with parent==0.
Goodbyte (User)
Junior Boarder
Posts: 84
graphgraph
User Offline Click here to see the profile of this user
Logged Logged
 
The administrator has disabled public write access.  
#47291
Re:Recount Categories Stats ERROR 8 Months, 1 Week ago  
Goodbyte wrote:
You should run "SELECT COUNT(thread) FROM jos_fb_messages" and "SELECT COUNT(thread) FROM jos_fb_messages WHERE parent=0" on your database, to assure that every thread has its root (parent==0). Both results has to be the same.

Sorry... I forgot the most important part in these statements. You have to run
"SELECT COUNT(thread) FROM jos_fb_messages GROUP BY thread" and
"SELECT COUNT(thread) FROM fos_fb_messages WHERE parent=0 GROUP BY thread"
Goodbyte (User)
Junior Boarder
Posts: 84
graphgraph
User Offline Click here to see the profile of this user
Logged Logged
 
The administrator has disabled public write access.  
#47300
Re:Recount Categories Stats ERROR 8 Months, 1 Week ago  
Goodbyte wrote:

Sorry... I forgot the most important part in these statements. You have to run
"SELECT COUNT(thread) FROM jos_fb_messages GROUP BY thread" and
"SELECT COUNT(thread) FROM fos_fb_messages WHERE parent=0 GROUP BY thread"


This queries give me same result

2091 thread

and 2091 thread with parent=0

DOH!

i give you this table...for helping to risolve the problem...

[code:1]PRIMARY PRIMARY 10883 Modifica Elimina id
thread INDEX 2176 Modifica Elimina thread
parent INDEX 2720 Modifica Elimina parent
catid INDEX 52 Modifica Elimina catid
ip INDEX 3627 Modifica Elimina ip
userid INDEX 149 Modifica Elimina userid
time INDEX 10883 Modifica Elimina time
locked INDEX 1 Modifica Elimina locked
hold_time INDEX 10883 Modifica Elimina hold[/code:1]
simbus82 (User)
Junior Boarder
Posts: 32
graphgraph
User Offline Click here to see the profile of this user
Gender: Male PolesineOnLine Location: Italy -> Veneto -> Between rivers Adige and Po Birthdate: 1982-12-26
Logged Logged
 
Last Edit: 2008/03/18 20:20 By simbus82.
 
The administrator has disabled public write access.  
#47305
Re:Recount Categories Stats ERROR 8 Months, 1 Week ago  
Then your database-structure seems to be ok and my guess about the problem was wrong.
Sorry, but it looks like I can't help you out of there.
Goodbyte (User)
Junior Boarder
Posts: 84
graphgraph
User Offline Click here to see the profile of this user
Logged Logged
 
Last Edit: 2008/03/18 21:07 By Goodbyte.
 
The administrator has disabled public write access.  
#47307
Re:Recount Categories Stats ERROR 8 Months, 1 Week ago  
Goodbyte wrote:
Then your database-structure seems to be ok and my guess about the problem was wrong.
Sorry, but it looks like I can't help you out of there.


simbus82 (User)
Junior Boarder
Posts: 32
graphgraph
User Offline Click here to see the profile of this user
Gender: Male PolesineOnLine Location: Italy -> Veneto -> Between rivers Adige and Po Birthdate: 1982-12-26
Logged Logged
 
The administrator has disabled public write access.  
Go to top