[Solved]: Number of Categories in statistics is wrong [Solved]: Number of Categories in statistics is wrong
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

[Solved]: Number of Categories in statistics is wrong

Started by Colliope, December 05, 2008, 04:54:27 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Colliope

I've just noticed that the number of categories shown in the statistics on my main page is wrong.
It says there are 21 categories but I've only got 3 categories (no subcategories in them).
Perhap this number includes categories that have been deleted?
Is it possible to correct this number?

Thanks,
C


Nibbler


Colliope

keangenes.com/cpg143
User: TestUser
PW: Temp123

After I created this TestUser account, the number of categories showing increased to 22.

Fabricio Ferrero

Upgrade! If the problems persist, come back and post again.

Upgrade it's not optional but mandadory!
Read Docs and Search the Forum before posting. - Soporte en español
--*--
Fabricio Ferrero's Website

Catching up! :)

Colliope

Sigh. If I can't get any help here without updating I guess I have no choice but to deal with the hassle.

Fabricio Ferrero

You are running too many version behind, more than 10. So, it's so probably when you update you're issue goes away. ;)
Read Docs and Search the Forum before posting. - Soporte en español
--*--
Fabricio Ferrero's Website

Catching up! :)

Hein Traag

Sigh all you want but there is no support on versions older then the current stable one. So please do so and report back with your findings.

Αndré

I had a look at the code on Colliope's website. This "problem" is caused by a mod, which counts the categories and the number of users:
        if ($CONFIG["user_gal_as_root"]) {
          $result = cpg_db_query("SELECT count(*) FROM {$CONFIG['TABLE_CATEGORIES']} WHERE 1");
          $nbEnr = mysql_fetch_array($result);
          $totalCats = $nbEnr[0];
          $result = cpg_db_query("SELECT count(*) FROM {$CONFIG['TABLE_USERS']} WHERE 1");
          $nbEnr = mysql_fetch_array($result);
          $totalUsers = $nbEnr[0];
          $cat_count = $totalCats - $HIDE_USER_CAT - 1 + $totalUsers;
          mysql_free_result($result);
        } else {
          $sql = "SELECT count(*) FROM {$CONFIG['TABLE_CATEGORIES']} WHERE 1";
          $result = cpg_db_query($sql);
          $nbEnr = mysql_fetch_array($result);
          $cat_count = $nbEnr[0] - $HIDE_USER_CAT;
          mysql_free_result($result);
        }


FYI: It seems that this mod (user_gal_as_root) displays the user galleries like public root categories. That's why the calculation of the categorie statistics was modded.

I corrected the issue. Solved!