Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.6 > vBulletin 3.6 Template Modifications
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Fully integrated IRC Stats: Updated with Pisg, Cron guide. Details »»
Fully integrated IRC Stats: Updated with Pisg, Cron guide.
Version: 1.00, by Rawkarma Rawkarma is offline
Developer Last Online: Nov 2009 Show Printable Version Email this Page

Category: Statistics Modifications - Version: 3.6.5 Rating:
Released: 03-03-2007 Last Update: Never Installs: 2
 
No support by the author.

The reasoning behind this post came from a friend of mine that saw my Bulletin Board and requested a detailed walkthrough. Seeing as I was going to spend the time writing this, I thought linking them here and enabling others to read this would be a better use of my time. And id imagine there are many people that will benefit greatly from a more detailed explanation.

This guide will show you how to successfully implement the mod for your VB; configure pisg on your shell; how to set a crontab that will be used to update your stats (not covered by jluerken.) DOES require an eggdrop.

First, all credit for this mod should be giving to jluerken found here.

All I have done is use this mod, corrected a minor error in the code and then updated the pisg help. I have taken this substantially further so you can implement pisg on your IRC Shell with ease.

Important

I am using a *nix server to run pisg and an eggdrop setup that's logging stats for my channel. You will need the same to begin with. One such IRC Shell provider id recommend is Veritynet.net.

This mod was originally created for VB 3.0.3 and was released back in 2004, however, it is running seamlessly on my VB and I am using 6.4.

Fully integrated IRC Stats, Updated with Pisg, Cron guide.

Everything up until dealing with /includes/functions_online.php you can follow from jluerken's own words in the original post: here

Now, I'll assume you have functions_online.php already open and in your preferred text editor.

Find this code:

PHP Code:
case 'index':
                        
$userinfo['action'] = $vbphrase['viewing_index'];
                        
$userinfo['where'] = "<a href=\"$vboptions[forumhome].php?$session[sessionurl]\">$vboptions[bbtitle]</a>";
                        break; 
And then add this directly below:

PHP Code:
case 'ircstats':
                        
$userinfo['action'] = "IRC Stats";
                        
$userinfo['where'] = "<a href=\"ircstats.php\">IRC Stats</a>";
                        break; 
I have included the above and bellow code in the area of functions_online.php so you can better see if it looks right.

case 'index':
$userinfo['action'] = $vbphrase['viewing_index'];
$userinfo['where'] = '<a href="' . $vbulletin->options['forumhome'] . '.php' . $vbulletin->session->vars['sessionurl_q'] . '">' . $vbulletin->options['bbtitle'] . '</a>';
break;
case 'ircstats':
$userinfo['action'] = "IRC Stats";
$userinfo['where'] = "<a href=\"ircstats.php\">IRC Stats</a>";
break;
case 'online':
$userinfo['action'] = $vbphrase['viewing_whos_online'];
break;


In the original mod you're asked to find the bellow code:

PHP Code:
case "$vboptions[forumhome].php":
  
$userinfo['activity'] = 'index';
  break; 
For me, I did not have this in my functions_online.php

Search for: case 'poll.php':

Add this above it:

PHP Code:
case "ircstats.php":
  
$userinfo['activity'] = 'ircstats';
  break; 
So, you're adding this:

case 'poll.php':
$userinfo['activity'] = 'polls';
break;


So it looks something like this:

else
{
$userinfo['activity'] = 'index'; // where are they?
}
break;

case "ircstats.php":
$userinfo['activity'] = 'ircstats';
break;

case 'poll.php':
$userinfo['activity'] = 'polls';
break;


I don't have a use for this function on my VB, however, I still included it, and have no idea how well it will work for you.

Save the file as functions_online.php and upload it to your VB includes dir.

Example path:

/public_html/forum/includes/

At this stage we move onto the pisg configuration; jluerken's pisg help is sketchy and now outdated.

Pisg config

Download the latest version of pisg from the official site: here

Download: pisg-0.70.tar.gz

I use a dedicated IRC Shell to run pisg and you will need to FTP to your own server where your eggdrop lives.

Use your favorite FTP Client and upload pisg-0.70.tar.gz to your shell root dir:

/usr/home/yourname/

Do not put this in public_html!

Now, using an Open source SSH Client we can extract pisg-0.70.tar.gz and I recommend Putty. It's free.

Extracting the tar file

At the command prompt, assuming you have uploaded pisg-0.70.tar.gz, type the following:

tar zxvf pisg-0.70.tar.gz

The file will now extract all contents to a new folder called, pisg-0.70.

Using your FTP Client, (refresh the dir listings if necessary) you'll now see the folder, pisg-0.70.

Rename this to pisg.

We need to give pisg the correct permissions and we do this by using an FTP Client, or SSH via the 'chmod' command.

FTP

Enter the folder pisg and then right click the file, pisg and set file attributes to 755.

SSH

Type the following:

cd pisg

then

chmod +x pisg

Moving the pisg image files to the correct folder on your web server

Now we need to move the images that pisg will use when displaying your statistics to your VB image dir.

The best way to do this is to FTP into the pisg folder (on your shell) and then download gfx and layout folders to your hard drive.

Now, using your FTP on your web server, navigate to your VB image folder and upload all the contents of gfx folder, but not the folder.

To better explain where to upload this, use the path bellow:

/public_html/forum/images/misc/

Place the contents of gfx into the misc folder, but remember, do not upload the folder; just it's contents (the image files.)

Making the ircstats directory

Now, FTP to your VB main dir and create a new folder called ircstats. And inside that folder, you will need to create another folder with the channel name of your IRC channel.

Example path bellow:

/public_html/forum/ircstats/geeks/

In ircstats folder, upload 'default.css'

You can find it in the layout folder you downloaded to your hard drive.

Example path bellow:

/public_html/forum/ircstats/default.css

Ok, we are almost done you will be pleased to know.

Now we need to edit the pisg.cfg file and then set a script (don't panic, it's easy) for the shell server crontab and a cron for for the web server so your stats update at regular intervals.

pisg.cfg

I have put a pisg.cfg.example file in the pisg.zip which you may edit for your IRC channel specifications. Just rename it pisg.cfg and upload it.

The options I have set in that .cfg will output the stats in the same way as the screen shot. You may change these as you see fit. Just make sure you keep the default.css as the theme.

<channel="#yourchannel">
LogDir="/home/yourname/eggdrop/logs/geeks/"
Format="eggdrop"
Network="irc.someplace.com"
Maintainer="You"
OutputFile="/home/yourname/public_html/geeks/ircstats.pisg"
</channel>


LogDir: The place where you have your eggdrop keeping it's channel log files.

OutputFile: The directory to output the ircstats.pisg file.

Create a public_html directory that can be accessed via the web and then make folder for your channel. The ircstats.pisg will be saved inside it each time pisg updates.

/home/yourname/public_html/geeks/ircstats.pisg

I have also included a modified HTMLGenerator.pm file that will output the stats in the same way as you see from the screen shot. In jluerken's original post, he did not seem to mind how it was generating; I myself, found the original HTMLGenerator.pm in pisg didn't look right for my VB board style.

You can use mine, or use the one pisg comes with. Your choice.

Upload this file to pisg's module directory:

/usr/home/yourname/pisg/modules/Pisg/

Pisgchek

Many people use different methods, but I find using a simple script for pisg best when setting a cron.

Using your favorite text editor make a new file and place this code inside it:

#!/bin/sh

statsbin="./pisg"
statpath="/home/yourname/pisg"

cd $statpath

$statsbin

Change yourname and save it: pisgchek

Upload the file to your pisg directory:

/usr/home/yourname/pisg/pisgchek

Chmod the file +x or set file attributes to 755.

Crontabs

You can set crons in a variety of ways, but for ease of use and to save on confusion, we will do it with the bellow method in this guide. If you already know now to set a crontab, be my guest and do it the way you like.

Warning: If you use the my.crontab file you will lose any old crons you have active on your shell. Only use this if you need to -- it's best to use vi or something akin to it and manually edit your crons with: crontab -e.

Crontab on shell server

Make a new file in your text editor.

Insert the code bellow into the file:

8,18,28,38,48,58 * * * * /home/yourname/pisg/pisgchek > /dev/null 2>&1

You can change the times your statistics will update, but I recommend you don't use, 10,20,30 etc. Best to offset the time.

Save the file as: my.crontab

Place the file in your root dir:

/usr/home/yourname/my.crontab

To load your new crontab type, at the shell prompt:

crontab my.crontab

And to make sure it worked, type:

crontab -l

Crontab on web server

Again, make a new file in your text editor and enter the code bellow:

9,19,29,39,49,59 * * * * wget fetch -O /home/yourname/public_html/forum/geeks/ircstats.pisg http://yourshellserver.com/~youruser.../ircstats.pisg > /dev/null 2>&1

This will fetch the ircstats.pisg from the IRC channel folder called geeks, and which is in public_html on your shell: /usr/home/yourname/public_html/geeks/ircstats.pisg; then upload it to the directory of your VB board in folder geeks: /home/yourname/public_html/forum/geeks/ircstats.pisg > /dev/null 2>&1 every 9 mins, of every hour, of every day, of every month.

Save the file: my.crontab

At the prompt in the root dir type:

crontab my.crontab

The best way to test this is all working is to go to your shell prompt and load pisg:

you@shell:/home/yourname/pisg$ ./pisg

Then, on your webserver's command prompt:

webserver:~ > wget fetch -O /home/yourname/public_html/forum/geeks/ircstats.pisg http://yourshellserver.com/~youruser.../ircstats.pisg

Now go look at http://yourdomain.com/forum/geeks/ircstats.php and you should finally see your stats.

I have tried to make that as easy as possible. If you need any further help, post and I will check back and offer pointers etc.

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #2  
Old 03-05-2007, 09:18 PM
daddygrim daddygrim is offline
 
Join Date: Mar 2006
Location: Northern Va
Posts: 353
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

interesting
Reply With Quote
  #3  
Old 03-06-2007, 12:29 AM
ZomgStuff ZomgStuff is offline
 
Join Date: Feb 2007
Posts: 469
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks!
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 09:05 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04105 seconds
  • Memory Usage 2,245KB
  • Queries Executed 16 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (4)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (3)post_thanks_box
  • (3)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (3)post_thanks_postbit_info
  • (2)postbit
  • (3)postbit_onlinestatus
  • (3)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete