PDA

View Full Version : Display total number of listings for each main category


Timeless
10-08-2005, 05:51 PM
Hi All,

at first, tx, really nice script!

now to my problem. I have add this code from suzkaw

http://www.phplinkdirectory.com/forum/viewtopic.php?t=834

in the function.php and in the index.php. On the first view, it looks like that the counts are right, because a "0" comes up (i had no link inside at the moment). But the counts works only on the subcatagories and not on the main site (top).

Because on the main site (top) it comes only up with "1" or a "0" and this "1" stand still. normaly should there displayed a "4" after i had add 4 test links in subcategories.

So the subcategories count right i think...

for example here my site:

www.webverzeichnis-webkatalog.de

if u look on the first categorie "arbeit & berufe" it shows a "1" but under in the subkategories are 4 Test links added.

how is that possible?! any idea?...please help, if i finished this lil prob, i can write more categories and then the side is finished. Thanx

In short, i would that on the main site are the links displayed from each subkategorie under. Because so all users know, how many links are already there. (inside)

here are my code in the index.php what i had add and what suzkaw wrote, maybe there is my error. :roll: its from line 160 - 171

Content visible to registered users only.

tx a lot guys :?

suzkaw
10-10-2005, 04:26 AM
I am not sure why it wouldn't be displaying all of them.

Can you try to open the index file and where you have this:
$row['COUNT']=get_count($arr_childs);

Just above it add:
print_r($arr_childs);

This should print an array of all the ids that where found. Then see if it matches the same ids.

Timeless
10-10-2005, 08:22 AM
Hi M8,

tx that u try to help me.

I have add now your code above this line:

this comes up now :roll: , take a look:

http://www.webverzeichnis-webkatalog.de/

and now?!

If u need access to my directory, its no problem. I would appreciate it..
Btw i have the newest version installed!

tx a lot
Timeless

ps: on the top categorie "sport & Fitness" its displayed a "0" but if u klick on it, there is a link in the deep subcategorie. mmhh why on "arbeit & berufe" a 1 and here a 0...this just for info..maybe it helps u to find the error.tx

suzkaw
10-10-2005, 05:01 PM
What is the category id of the "Sportmedizin" category?

You should be able to find this in the database table.

Timeless
10-10-2005, 05:49 PM
Hi,

i dunno what u exaclty need (ID or Parent ID), maybe more :roll: , so here two screens of both database tables..:

"Sportmedizin" has the ID 441

"Arbeit & Berufe" (top) has the ID 2


Content visible to registered users only.

Content visible to registered users only.

thank you suzkaw

suzkaw
10-11-2005, 05:18 PM
It seems it isn't recurring all the way down to your child categories.

When I get some time I will see what would be causing this. It might take me a few days because of other obligations. So you might want to change it back for now.

Timeless
10-12-2005, 08:24 AM
Ok, can u please catch me if u are ready...i make so long a break with working on my directory. cause i cant understand why other admins runs this without this feature...for me is it without counting links on the highest stage worthless. Because it looks like that in the directory is nothing added.

ok, please gimme a call then.

Timeless
10-13-2005, 09:40 AM
HI All they are interested, hey suzkaw,

i have read in last days alot about php. I have now self make on small change, what i had tought it could be right...its on the functions.php code and it looks like that the count works right now.

take a look:

www.webverzeichnis-webkatalog.de

but i dont trust the peace...can u explain me why my changing works in that way? i have just test a bit...

your code in the functions.php:

if (count($arr_new) >= '1')

my change:

if (count($arr_new) >= '0')

just a 0..it works now..but why?

tx for explaining!