Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.0 > vBulletin 3.0 Full Releases

Reply
 
Thread Tools
[Add on] Who's Chatting on Forum Home Page for Sigmachat Details »»
[Add on] Who's Chatting on Forum Home Page for Sigmachat
Version: 1.00, by ChurchMedia ChurchMedia is offline
Developer Last Online: Jun 2013 Show Printable Version Email this Page

Version: 3.0.3 Rating:
Released: 07-20-2004 Last Update: Never Installs: 3
 
No support by the author.

Add-on by ChurchMedia
Who's Chatting on Forum Home Page for Sigmachat

You must have the SigmaChat Complete Integration & Authentication hack installed first and be signed up with SigmaChat, of course.

This will add a "Who's Chatting" box on your forum home page.

Just like "Who's Online", if you click on "Who's Chatting" it will take you to a page with just the chatters.

If you are logged in, there is a link to the chat room. If you are not logged in, there is a link to register.

~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
Note that the problem of having a space in your user name is corrected. However, if the user name has an _underscore_ in it there may be problems.
To remove the feature that replaces underscores with spaces, remove this line (Line 57 in chat_home.php):

PHP Code:
$username str_replace("_"" ",$username); 
1 file change
1 new template
2 template changes

WARNING #1: This hack WILL speed up your Who's Chatting hits! If you seriously want Who's Chatting on your front page, keep in mind that you may have to buy extra hits! Otherwise, don't install this hack! I've found that it increased my chat room traffic dramatically, so I think it's worth buying the hits.

WARNING #2: When you do run out of Who's Chatting hits, your forum home page will break (you will get a blank page)! If this happens, in forum/index.php FIND
PHP Code:
include('chat_home.php'); 
and replace it with
PHP Code:
//include('chat_home.php'); 
Then buy more chat hits. When your upgrade goes through, remove the // from the line above to reactivate the hack.

Show Your Support

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

Comments
  #22  
Old 08-17-2004, 10:58 PM
tamarian tamarian is offline
 
Join Date: Oct 2001
Location: Canada
Posts: 1,205
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

O.k., here goes:

Note: You need the chat_global.php from the sigma chat hack provided by sigmachat.

1. Create a new file called chat_cache.php or something else, and paste this into it:

PHP Code:
<?php
  
  
// replace with actual path to your forum main directory, no trailing slash
          
chdir("/path/to/forum");
  
        require_once(
"./global.php");
        require_once(
"./chat_global.php");
  
        
error_reporting(E_ALL & ~E_NOTICE);
        
define('NO_REGISTER_GLOBALS'1);
        
define('THIS_SCRIPT','chat_online');
  
        
$globaltemplates = array("sigmachat_chatting",);
  
        
$SIGMACHAT_CP_PASSWORD_MD5 md5($SIGMACHAT_CP_PASSWORD);
      
$womurl "http://$SIGMACHAT_SERVER/vbwho.pl?id=$SIGMACHAT_CHAT_ROOM_ID&pw=$SIGMACHAT_CP_PASSWORD_MD5";
  
        
$users = array();
        
$user_count = -1;
        
$wom_hits_remaining 0;
        
$wom_message '';
        if(
$womh fopen($womurl'r'))
        {
           while(!
feof($womh))
           {
              
$womcontent fgets($womh1048576);
              if(
$user_count == -1)
              {
                 
$wom_hits_remaining $womcontent;
                 
$user_count++;
              }
              else if( (
$user_count == 0) && ($wom_hits_remaining 0) )
              {
                 die;
              }
              else
              {
                 if(
$womcontent != '')
                  
$users[] = rtrim($womcontent);
                 
$user_count++;
              }
           }
           
fclose($womh);
        }
        else
        {
           die;
        }
  
        
$SIGMACHAT_CHATTING_COUNT $user_count;
      if (
$SIGMACHAT_CHATTING_COUNT 0$SIGMACHAT_CHATTING_COUNT "Chatting: " $SIGMACHAT_CHATTING_COUNT;
          else 
$SIGMACHAT_CHATTING_COUNT "";
  
          foreach(
$users as $username)
        {
           
$SIGMACHAT_USERNAME "$username";
  
          if (
$bbuserinfo $DB_site->query_first('SELECT userid, usergroupid, username, salt FROM ' TABLE_PREFIX 'user WHERE username = "' addslashes(htmlspecialchars_uni($username)) . '"'))
           {
          
$SIGMACHAT_USERNAME "<a href=\"member.php?u=" $bbuserinfo[userid] . "\">" $bbuserinfo[username] . "";
           }
  
      
$chat_names .= "<a href=\"member.php?u=" $bbuserinfo[userid] . "\">" $bbuserinfo[username] . "" ", ";
  
        }
          
$chat_names addslashes($chat_names);
      
$DB_site->query("UPDATE " TABLE_PREFIX "template SET template=\"$SIGMACHAT_CHATTING_COUNT\", template_un=\"$SIGMACHAT_CHATTING_COUNT\" WHERE title='sigmachat_chatting_cache_bit'");
      
$DB_site->query("UPDATE " TABLE_PREFIX "template SET template=\"$chat_names\", template_un=\"$chat_names\" WHERE title='sigmachat_chatting_cache'");
  
?>
2. Update the first line in the code above with the right path to your forum home dir on your server.

3. Create two empty templates: sigmachat_chatting_cache_bit and sigmachat_chatting_cache

4. Edit index.php

Find:

PHP Code:
'FORUMHOME'
Add after:
PHP Code:
         'sigmachat_chatting_cache',
         
'sigmachat_chatting_cache_bit'
Find:

PHP Code:
$today vbdate('Y-m-d'TIMENOWfalsefalse); 
Add after:

PHP Code:
$sigmachat_chatting =  $templatecache['sigmachat_chatting_cache'];
 
$sigmachat_chatting_bit =  $templatecache['sigmachat_chatting_cache_bit']; 
5. Use $sigmachat_chatting_bit and $sigmachat_chatting in your FORUMHOME template. The first has the number of members in the chat room, and the second has the list of the members and their profile links.

6. Add a cron job to your server, ever 10 minutes. Example:

*/10 * * * * /usr/bin/php /path/to/forum/chat_cache.php > /dev/null 2>&1

7. If you have a problem, feel free to ask, but keep in mind that you need to back up your files and templates in case it doesn't work for you.
Reply With Quote
  #23  
Old 10-19-2004, 05:52 PM
Brent H's Avatar
Brent H Brent H is offline
 
Join Date: Sep 2004
Location: Phoenix, AZ
Posts: 162
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This is my first time trying to add a cron job to my site, and I have no idea where to begin. Where do I put that bit of code in?
Reply With Quote
  #24  
Old 10-20-2004, 02:26 AM
Brent H's Avatar
Brent H Brent H is offline
 
Join Date: Sep 2004
Location: Phoenix, AZ
Posts: 162
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Alright nevermind, I just asked my hosting company and they rudely told me they don't support it. Jerks.

I've got it installed and the link goes to the embedded chat... I want it to pop up. I don't know how to change it

EDIT: Woot, fixed it. Ain't it great when you go begging for help, and then figure out how to do it all by yourself? I feel like such a big boy now.
Reply With Quote
  #25  
Old 08-06-2005, 07:37 PM
rstan rstan is offline
 
Join Date: Mar 2004
Posts: 22
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

/cloaked users show in who online.....anyone else notice this?
Reply With Quote
  #26  
Old 09-08-2005, 08:38 PM
Bounce's Avatar
Bounce Bounce is offline
 
Join Date: Mar 2004
Location: Edinburgh,Scotland
Posts: 919
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

How come mine is showing -1 Users when there is indeed 0 folk in my room :nervous:
Reply With Quote
  #27  
Old 10-03-2005, 09:40 AM
j?rg j?rg is offline
 
Join Date: Feb 2005
Posts: 7
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

hi,

have someone a plugin for vb3.5.

i want display the user´s on my forumhome!
Reply With Quote
Reply

Thread Tools

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 01:53 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.04743 seconds
  • Memory Usage 2,302KB
  • Queries Executed 23 (?)
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
  • (8)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (7)post_thanks_box
  • (7)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (7)post_thanks_postbit_info
  • (6)postbit
  • (7)postbit_onlinestatus
  • (7)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_postinfo_query
  • fetch_postinfo
  • 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
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete