| SOLVED Missed topics and replies update when move 3 Years, 11 Months ago |
|
Hello,
I\'m approaching for the first time the use of Joomla and Fireboard, and now I\'m testing the update to Fireboard 1.0.4.
I found a bug in the function of moving topic from a category to another one, but as I\'m not a programmer I\'m not able to solve it on myself :(
When I move a topic, the count of topics and replies in the list of categories is not updated.
So, if I have 1 topic in cat A and 1 topic in cat B, after the moving from A to B the list of category is unchanged but, if I enter in cat A, I will find it\'s empty, as correct, and both topics are in cat B, as correct.
By looking at the file listcat.php and in the table _fb_categories, I\'ve seen the problem is related to the fact that the visualization of the category doesn\'t make a topics and replies count when called, but reads the values in _fb_categories (fields numTopics and numPosts) and those values are not affected by the domovepost function in post.php.
I\'m sure this could be easily fixed by anyone has more programming knowledge than me and I would be glad if someone might give me any advise for the solution (...if not the adjusted code ;) )
Thank you very much (...and sorry for my poor English and my poor technical wording!)
ADDED: As from my description of the problem, I believe the same may be solved in two different ways: by adjusting the values in fields numTopics and numPosts when move the topic or by counting the real occurences of the topics and replies inside the category when it is displayed.
I\'m not a programmer, but my personal good sense feeling is that the second one is far more better than the first one, avoiding any risk of misalignment of the values. Of course, this is true if this solution doesn\'t affect the system from any other point of view (i.e. performance).
Lino59
|
|
|
| SOLVED Missed topics and replies update when move 3 Years, 11 Months ago |
|
Hello,
I\'m approaching for the first time the use of Joomla and Fireboard, and now I\'m testing the update to Fireboard 1.0.4.
I found a bug in the function of moving topic from a category to another one, but as I\'m not a programmer I\'m not able to solve it on myself :(
When I move a topic, the count of topics and replies in the list of categories is not updated.
So, if I have 1 topic in cat A and 1 topic in cat B, after the moving from A to B the list of category is unchanged but, if I enter in cat A, I will find it\'s empty, as correct, and both topics are in cat B, as correct.
By looking at the file listcat.php and in the table _fb_categories, I\'ve seen the problem is related to the fact that the visualization of the category doesn\'t make a topics and replies count when called, but reads the values in _fb_categories (fields numTopics and numPosts) and those values are not affected by the domovepost function in post.php.
I\'m sure this could be easily fixed by anyone has more programming knowledge than me and I would be glad if someone might give me any advise for the solution (...if not the adjusted code ;) )
Thank you very much (...and sorry for my poor English and my poor technical wording!)
ADDED: As from my description of the problem, I believe the same may be solved in two different ways: by adjusting the values in fields numTopics and numPosts when move the topic or by counting the real occurences of the topics and replies inside the category when it is displayed.
I\'m not a programmer, but my personal good sense feeling is that the second one is far more better than the first one, avoiding any risk of misalignment of the values. Of course, this is true if this solution doesn\'t affect the system from any other point of view (i.e. performance).
Lino59
|
|
|
| Re:Missed topics and replies update when move topi 3 Years, 11 Months ago |
|
I solved the issue by myself, simply copying the code from the sub-category module where the topics and the replies are counted and not read from the category table.
For everyone which may be interested, here is the code I added in /components/com_fireboard/template/default/listcat.php from line 539:
(here is the actual ?> tag, to be deleted or commented)
//count the number of topics posted in each forum
$database->setQuery(\"SELECT id FROM #__fb_messages WHERE catid=\'$singlerow->id\' and parent=\'0\' and hold=\'0\'\");
$num = $database->loadObjectList();
$numtopics = count($num);
//count the number of replies posted in each forum
$database->setQuery(\"SELECT id FROM #__fb_messages WHERE catid=\'$singlerow->id\' and parent!=\'0\' and hold=\'0\'\");
$num = $database->loadObjectList();
$numreplies = count($num);
?>
Unfortunately, this doesn\'t solve the misalignment of fields numTopics and numPosts in _fb_categories table, but I hope they are not used in any other place. If I will find this give me any problem, I will be worried in that moment ;)
Hoping this may be useful, bye.
NOTE: I don\'t know how to add SOLVED to the topic subject: may anyone help me?
|
|
|
|