A count of forums

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Monotoko
Forum Commoner
Posts: 64
Joined: Fri Oct 26, 2007 4:24 pm

A count of forums

Post 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
User avatar
Weirdan
Moderator
Posts: 5978
Joined: Mon Nov 03, 2003 6:13 pm
Location: Odessa, Ukraine

Re: A count of forums

Post by Weirdan »

Code: Select all

 
ls -d /home/monotoko/public_html/*/* | grep forum.txt | wc -l
 
Monotoko
Forum Commoner
Posts: 64
Joined: Fri Oct 26, 2007 4:24 pm

Re: A count of forums

Post 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?
Monotoko
Forum Commoner
Posts: 64
Joined: Fri Oct 26, 2007 4:24 pm

Re: A count of forums

Post by Monotoko »

If this isnt possible in PHP please let me know, and i shall look into other web-based languages
Post Reply