Page 1 of 1

A count of forums

Posted: Wed Aug 12, 2009 12:10 pm
by Monotoko
Hello fellow programmers :)

I have a little bit of a problem in that i cannot figure out how to create this function. I have a hosting account with over 1000 domains attatched to it
one of them is a forum hosting company i own, which takes up about 200 of those domains with forums.

this script is going to be stored in:
/home/monotoko/public_html/danzaforums.com

what i want it to do is go into: /home/monotoko/public_html
then go into every folder and look for forum.txt

if it has forum.txt, it is a forum, if it doesnt its not.

i just need it to tell me how many forums the server has by counting up the amount of forum.txt files, is there a way to do this?

Thank you
~Daniel

Re: A count of forums

Posted: Wed Aug 12, 2009 12:57 pm
by Weirdan

Code: Select all

 
ls -d /home/monotoko/public_html/*/* | grep forum.txt | wc -l
 

Re: A count of forums

Posted: Wed Aug 12, 2009 1:41 pm
by Monotoko
Ahha very nice, it does the job and gives me a number.
My other admin has just suggested something though.

Is there anyway we could generate some sort of log.txt, with each folder if i got the creation script to automatically entered the domain into the forums.txt?
something like:

Code: Select all

log.txt
http://www.thisisaforum.com located in folder /home/monotoko/public_html/test1
and then give us an entire list of the forums and where they are?

Re: A count of forums

Posted: Wed Aug 12, 2009 4:36 pm
by Monotoko
If this isnt possible in PHP please let me know, and i shall look into other web-based languages