Version: 1.00, by FASherman
Developer Last Online: May 2011
Version: 2.2.x
Rating:
Released: 11-27-2002
Last Update: Never
Installs: 8
No support by the author.
Okay, I'm not sure if this qualifies as a "true" hack or not. Feel free to move this to an appropriate area, if not.
At any rate, I have 18 IRC channels supporting a range of topics. What I needed was something to keep track of how many users where in each channel.
1. Create a tables named ircstat in your vbulletin database. The table consists of two fields, channelname (type = text) and channelusers (type = int, length = 3, Not Null, Default = 0).
2. Insert a row for each IRC channel you want to monitor:
INSERT INTO ircstat(channelname,channelusers) VALUES ('#channel','0')
Case IS important. It must match your IRC channel name EXACTLY.
3. Create a perl script called ircstat.pl. Cut and paste below into it and change the values that need changing:
4. Run this script out of cron. Every 5 minutes if you have 1 or 2 channels, every 10 minutes if you have more than 2 channels.
Remember, all this does is keeps the database updated. with the number of users in your channels. You'll have to decide where you want to display this information and make the appropriate php/template hacks.
Show Your Support
This modification may not be copied, reproduced or published elsewhere without author's permission.
Open two browsers to this page. Leave one there. In the second, enter one of the discussion rooms. Doesn't matter which one. Wait until you see the census bot join and leave.
Refresh the first browser and verify that the info updated and that your nick in listed in the room.
You're correct. As I said, the script is really an lightweight IRCbot and, like many bots, it got temporarily k-lined. I switched it over to a new bot-friendly server and its fine.
First of all, I've been begging for this for months....thank you!
I could use a little help though. I'm not sure exactly how to fill out some of the values.
Quote:
INSERT INTO ircstat(channelname,channelusers) VALUES ('#channel','0')
Okay, you stated that it is case sensitive, so I assume something should be edited here. I only have one channel, #reefaquariumguide, do I enter this into the #channel spot? And do I leave a 0 after it?
Do I edit that with the name of my channel as well?
I've got it setup now but get nothing. I am monitoring the chat and the bot never shows up. Just in case I setup the cron wrong I also tried running it in the command prompt. I checked the error logs and I don't see any errors it caused, but nothing shows up in the chat.
Okay, solved my own question through trial and error I think. For others who might be as dumb as me.....put your channel in the first part I asked about....the second part stays as is.
The database is updating for me now. Could you give me a quick clue on what to edit in the php/templates? I tried putting $channelusers into the forumhome template but think I need to do something else because nothing displays.
Come on guys, someone help me out? I have the hack basically working, but being a PHP/SQL dummy I don't know how to make the variables work so I can display it. I know how to edit a template and put the variable where I want it.....but it is empty. I think I need to edit index.php maybe? I've been waiting for a who's in chat hack that didn't require eggdrop since January.......now I'm so close but not quite there.
You're on the right track. You have a variable in a template, but it contains nothing because it hasn't been loaded. Go into index.php and add the sql commands to load the variable.
Sorry for the late response, but I've been working on a tcl script for an eggdrop bot that does the database inserts directly via Mytcl on JOINs PARTs KICKs, QUICKs and server pings. That way the data will always be current since it'll be even driven, not time driven.