PDA

View Full Version : How count only links in category?


Romario
09-14-2005, 07:58 AM
Now count links+subcategories in every category, how count only links?

yktan
09-14-2005, 08:23 AM
Hi Romario,

Open up \submit.php
Find ALL occurance of:
Content visible to registered users only.
Replace ALL occurance with:
Content visible to registered users only.

Romario
09-14-2005, 09:28 AM
Thanks, yktan you good man!!!

yktan
09-14-2005, 09:33 AM
No problem at all Romario :)

vkaryl
09-14-2005, 05:23 PM
yktan, my submit.php (NONE of them! all RC5.2) doesn't have the lines you indicate need to be replaced....

Is this a "specific version" fix maybe?

yktan
09-14-2005, 05:35 PM
Hi vkaryl, I found the same lines in index.php for RC5.2, did you search one line at a time?:
Content visible to registered users only.
Content visible to registered users only.

Regards,
York Kie

vkaryl
09-14-2005, 05:38 PM
Hmm. Doesn't have that one either. In fact, \submit.php doesn't have anything that starts with Content visible to registered users only. at all.

AND I'm looking at submit.php in the download distro for rev.76 and they're not there either.... I see now you've said index.php - should I be looking there instead?

Okay, in index.php I'm finding the lines okay. Thanks for your help!

yktan
09-14-2005, 05:55 PM
Oops, my error. It should be index.php. It's to do with directory listing, so there is no way it's in submit.php. Thanks for bringing this up, I will fix my intial reply.

Regards,
York Kie

vkaryl
09-14-2005, 08:02 PM
Need to enter a bitty caveat about using this:

There are two sets of lines ref'ed with this fix, one each for "links" and "categories" in two places in index.php: one set begins about line 105 and the other begins about line 168.

Changing all 4 lines (instruction to change all occurrences....) results in doubling the count of links. I commented out one each of the changed lines (the first ones actually, though I don't know if it matters which) in order to produce the actual link count.

If I should be doing something else, yktan, could you let me know? Thanks.

[Edit: actually, I just went back in and replaced the original lines with "category" in them, then commented THEM out, and it works just fine....

Now all I need to do is figure out how to NOT have the number of links listed next to main page category titles. (I know I know - NEVER satisfied! Sorry!)]

vkaryl
09-14-2005, 10:25 PM
Content visible to registered users only.

And thanks to another piece of wonderful programming stuff from yktan, my very bright friend, I now have THAT handled as well.... by adding into this section in main.tpl

Content visible to registered users only.

this little hunk that I rewrote a bit from

Content visible to registered users only.

to

Content visible to registered users only.

which resulted in this:

Content visible to registered users only.

So now I have counts everywhere BUT on my main page.

Thanks again, yktan!

mdarriba
09-22-2005, 07:57 PM
Hi!
I´m reading all the information and I realy want to show category+links in each categories and I use the code but dont works, I´am doing something wrong, could you please help me?

yktan
09-23-2005, 04:50 AM
Content visible to registered users only.

Hi mdarriba, the original script already counts categories+links. This thread is trying to replace that with count of links only.

Regards,
York Kie

mdarriba
09-23-2005, 07:21 PM
Hi!
my english is not very good, the Idea is cout all in one category, sub categories, sub sub categiries, and ALL links in te categories.

Thanks for your time!

yktan
09-24-2005, 09:02 AM
Hi mdarriba,

Now I understand what you are trying to do. This has been discussed before on this forum. Though not impossible, we highly recommend against such a feature because recursing through the categories and counting all the links might push your server and database load sky high if there are many concurrent users.

Tell me if you are still interested.

Regards,
York Kie

mdarriba
09-25-2005, 04:49 AM
Hi York!!
I agree with you in that but Im Interested to know how I can do that
Thank you for your help And Time!

Mariano

yktan
09-25-2005, 08:51 AM
Hi mdarriba, could you tell me which version of PHPLD have you got installed?

Regards,
York Kie

mdarriba
09-25-2005, 03:38 PM
Hi I have the RC5 Version

Timeless
10-08-2005, 08:32 PM
i am also interested on that script. could u sent it to me please?! or tell me what i should change for this?

suzkaw
10-10-2005, 04:12 AM
I think some code I posted the other day might be what you are wanting.

Check it out and see if that is what you need:
{old url removed}

In action:
Pre Loved Motorcycles Directory

Timeless
10-10-2005, 08:23 AM
i have already saw ur side, nice one btw..... and this is exactly what i want :)

i hope we get this fixed for my side! :roll:

tx Timeless