Back to vBulletin 4.x Template Modifications

Currently Active IRC Users
Mod Version: 1.00, by Saar

vB Version: 4.1.2 Rating: (0 vote - 0 average) Installs: 8
Released: 02 Apr 2011 Last Update: Never Downloads: 36
Not Supported Uses Plugins Template Edits Additional Files Re-usable Code Translations  

I will work on a more user-friendly version of this article, I am not a programmer and this is actually my first modification, so there may still be some glitches. I originally wrote this modification, because I couldn't find any working hack for vBulletin 4 (which is the reason why I am writing these lines on vB.org), so I did some research and after two weeks I finally had a working active IRC nicklist on the forums. The main problem was to figure out, how to print the output of a text file on the forums and displaying it below "Currently Active Users" on FORUMHOME.

Those two articles were very helpful to me:
[1] http://www.vbulletin.com/forum/showthread.php/173937-How-to-Include-a-PHP-or-HTML-File
[2] [vBulletin 4] Simple way of including an external PHP file

Okay, let's start...

This modification requires an https://en.wikipedia.org/wiki/Eggdrop running on your server, please install and configure it first, before proceeding. On a Debian (Lenny) server you do that with the following command:

Code:
$ aptitude install eggdrop
Create a directory where all modifications and config files are stored at with appropriate permissions

Code:
$ mkdir /home/eggdrop
$ adduser eggdrop
$ chown eggdrop:eggdrop /home/eggdrop
$ chmod 700 /home/eggdrop -r
Copy the eggdrop configuration file to that directory

Code:
$ cp /usr/share/doc/eggdrop-data/examples/eggdrop.conf.gz /home/eggdrop
$ cd /home/eggdrop
$ gunzip eggdrop.conf.gz
How to get a working eggdrop.conf, please visit http://eggwiki.org/Eggdrop.

Now let's implement the required modification to get the user list.

Code:
$ nano eggdrop.conf
Find:
Code:
# A few IRC networks (EFnet and Undernet) have added some simple checks to
# prevent drones from connecting to the IRC network. While these checks are
# fairly trivial, they will prevent your Eggdrop from automatically
# connecting. In an effort to work-around these, we have developed a couple of
# TCL scripts to automate the process.
Below that add
Code:
source /home/eggdrop/nickplus.tcl
Download the following modification from egghelp.org: NickPlus
[1] http://www.egghelp.org/tclhtml/3478-4-0-0-1-nicklist.htm
and upload the nickplus.tcl to /home/eggdrop

Edit the nickplus.tcl to make the necessary changes, read the commented lines!

Code:
$ nano nickplus.tcl
Find:
Code:
# Change dumpfile to the path where you'd like the file to be written.
Below that add:
Code:
set dumpfile "/path/to/your/forum/nicklist.txt"
Now log on to your vBulletin Administrator Control Panel and add the following plugin (Hook Location: global_start):

Code:
ob_start();
  require_once('/path/to/your/forum/irc.php');
  $php_include = ob_get_contents();
ob_end_clean();
vB_Template::preRegister('FORUMHOME',array('php_include' => $php_include));
Create a irc.php in your forum home directory with the following contents:

Code:
$ touch /path/to/your/forum/irc.php
Code:
<html>
<head>
</head>
<body>
<?php
        $lines = file ('/path/to/your/forum/htdocs/nicklist.txt');
        $count = count($lines);
                if ($count == 1)
        {
        echo  "There is currently ".$count." user online. Network: irc.rizon.net, Port: 6667, Channel: #yourchannel";
        }
        else{
        echo  "There are currently ".$count." users online. Network: irc.rizon.net, Port 6667, Channel: #yourchannel";
        }
        echo "<br>";
?>
<font color="#417394">
<?php
        $fh = fopen("/path/to/your/forum/nicklist.txt", 'r');
        $pageText = fread($fh, 25000);
        echo $pageText;
?>
</font>
</body>
</html>
Create a nicklist.txt in your forum home directory with proper permissions:

Code:
$ touch /path/to/your/forum/nicklist.txt
$ chown eggdrop:eggdrop /path/to/your/forum/nicklist.txt
$ chmod 775 /path/to/your/forum/nicklist.txt
In your vBulletin Administrator Control Panel edit the FORUMHOME template:

Find:
Code:
            <!-- end logged-in users -->
            </vb:if>
            {vb:raw template_hook.forumhome_wgo_pos2}
            <vb:if condition="$show['upcomingevents']">
            <div id="wgo_events" class="wgo_subblock section">
                <h3 class="blocksubhead"><img src="{vb:stylevar imgdir_misc}/event.png" alt="{vb:rawphrase todays_events}" /><vb:if condition="$show['todaysevents']">{vb:rawphrase todays_events}<vb:else />{vb:rawphrase upcoming_events_for_the_next_x_days, {vb:raw vboptions.showevents}}</vb:if></h3>
                <ol>
                    {vb:raw upcomingevents}
                </ol>
            </div>
            </vb:if>
            {vb:raw template_hook.forumhome_wgo_pos3}
            <vb:if condition="$show['birthdays']">
Below that add:
Code:
            <!-- irc -->
            <div id="wgo_irc" class="wgo_subblock section">
                <h3 class="blocksubhead"><img src="{vb:stylevar imgdir_misc}/users_online.png" alt="Currently Active IRC Users" />Currently Active IRC Users</h3>
                <ol>{vb:raw php_include}</ol>
            </div>
            <!-- end irc -->
Now start your eggdrop:

Code:
$ aptitude install su
$ su eggdrop
$ cd ~
$ eggdrop -m ./eggdrop.conf
Now configure your bot, set password etc. (read the eggdrop help wiki!) and restart your bot.

Code:
$ eggdrop
Et voilà!

Any comments, feedback, suggestions? Wanna write a plugin for this or improve this modification? Go ahead, this is free for use.

Download

File Type: %1$s irc.php (660 Bytes, 38 downloads)

Screenshots

Click image for larger version
Name:	screenshot.png
Views:	449
Size:	16.0 KB
ID:	127838  

Similar Mods

Users in IRC Channel(s) vBulletin 2.x Full Releases
Track IRC users using PHP... vBulletin 2.x Full Releases

vblts.ru supports vBulletin®, 2022-2024