Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > Premium Archives > vB Chat
vBChat CMPS Module? Details »»
vBChat CMPS Module?
Version: , by kevinnguyen kevinnguyen is offline
Developer Last Online: Nov 2023 Show Printable Version Email this Page

Version: Unknown Rating:
Released: 03-04-2005 Last Update: Never Installs: 0
 
No support by the author.

Is there one? If not, please make it
Thanks

Show Your Support

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

Comments
  #2  
Old 03-05-2005, 07:52 PM
Zero Tolerance's Avatar
Zero Tolerance Zero Tolerance is offline
 
Join Date: Feb 2004
Location: England
Posts: 813
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'll see if i can get one made for the CMPS, no garentee though.

- Zero Tolerance
Reply With Quote
  #3  
Old 03-06-2005, 08:48 PM
PET's Avatar
PET PET is offline
 
Join Date: Jan 2002
Location: Timisoara/Romania
Posts: 305
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

a CMPS module showing the online chat users.
Reply With Quote
  #4  
Old 03-27-2005, 01:29 AM
Caveman2k2 Caveman2k2 is offline
 
Join Date: Mar 2005
Posts: 32
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

A cmps module would be great! Thanks for a great hack.
Reply With Quote
  #5  
Old 04-07-2005, 07:58 PM
wirewolf's Avatar
wirewolf wirewolf is offline
 
Join Date: Jun 2004
Location: New York City
Posts: 74
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I've been fooling around with a Chat module for my CMPS and I got it to work. I took part of the stock onlineusers.php file and part of the vBchat php coding that is edited into the index.php file. Making the template was the easy part. I just copied a stock mini module and inserted the html coding from the FORUMHOME edit in the vBChat install. Heres' my adv_portal_chatroom template:
HTML Code:
<script type="text/javascript">
<!--
function OpenvBChat(){
vBChat = window.open('/yourforumdirectory/vBChat.php?$session[sessionurl]','vBChat','directories=no,height='+window.screen.height+',width='+window.screen.width+',location=no,menubar=no,scrollbars=yes,status=no,toolbar=no')

return false;
}
-->
</script>
<table align="center" border="0" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" class="tborder" width="100%">
<tr>
<td class="tcat"><span class="smallfont"><b>$vba_options[portal_blockbullet] <b>The Chat Room</b></span></td>
</tr>
<tr>
<td class="alt1" colspan="2"><span class="smallfont">Users Currently Inside the Chat Room</span></td>
</tr>
<tr>
<td class="alt2" width="100%">
<div class="smallfont">{$invBChat}</div>
</td>
</tr>
<tr>
<td class="alt1" align="center"><a href="/yourforumdirectory/vBChat.php?$session[sessionurl]" onclick='return OpenvBChat();'><span class="smallfont">Open Chat Room</span></a></td>
</tr>
</table>
<br />
If you already have a link to your Chat in the navbar, and your navbar is displayed on your CMPS Pages, you probally don't need to include the java script in the template file.

Here's my module file - chat_portal.php:
PHP Code:
<?php

$forumusers 
'';


    
$forumusers $DB_site->query("
            SELECT session.userid, username, usergroupid, (user.options & 
$_USEROPTIONS[invisible]) AS invisible,
                session.location
            FROM " 
TABLE_PREFIX "session AS session
            LEFT JOIN " 
TABLE_PREFIX "user AS user USING (userid)
            WHERE session.lastactivity > " 
. (TIMENOW $vboptions['cookietimeout']) . "
            ORDER BY invisible ASC, username ASC
    "
);
    
            
    if (
$DB_site->num_rows($forumusers))
    {
        
// Get the users in vBChat
    
$vbchat_users = array();

    while (
$loggedin $DB_site->fetch_array($forumusers))
    {
        
$userid $loggedin['userid'];
        if (!
$userid)
        {    
// Guest
            
$numberguest++;
            
$inforum["$loggedin[inforum]"]++;
        }
        else if (empty(
$userinfos["$userid"]) OR ($userinfos["$userid"]['lastactivity'] < $loggedin['lastactivity']))
        {
            
$userinfos["$userid"] = $loggedin;
        }

        if(
preg_match("/vBChat.php/",$loggedin['location']) && $loggedin['userid']){
        
$vbchat_users[$loggedin['userid']] = $loggedin;
        }

    }

    
// Configure Peeps In vBChat
    
$invBChat "";

    if(
is_array($vbchat_users)){
        foreach(
$vbchat_users as $invbc){
            if(
$invBChat == ""){
            
$extra "";
            } else {
            
$extra ", ";
            }

        
// Get Username Style
        
$invbc['musername'] = fetch_musername($invbc);

        
$invBChat .= "{$extra}<a href='/yourforumdirectory/member.php?{$session['sessionurl']}&u={$invbc['userid']}'>{$invbc['musername']}</a>";
        }
    }

    if(
$invBChat == ""){
    
$invBChat "<i>No one is currently in the Chat Room</i>";
    }
    
        eval(
'$home[$onlineid][\'content\'] = "' fetch_template('adv_portal_chatroom') . '";');
                            

unset(
$forumusers);

    }

?>
And adding the settings (add new module) to CMPS:
Quote:
Module Title: Chat Room
Module Identifier: none
File to Include: chat_portal.php
OR Template to Include: leave blank
Active: yes
Column: whatever
Display Order: whatever
Templates Used: adv_portal_chatroom
(Set other options)
Attached are three screenshots, before and after logging in to Chat, and of the module settings for my test News Page.

Zero, you may want to look at the coding in my chat_portal.php file. It works, but some of the coding may not be needed, or I may have some essential parts missing (any security problems). Warning to others, this does work, but if you want to experiment with it, go ahead. But it may not be 100% yet.

One odd thing. I set this up on one of my CMPS pages to experiment with, http://shipmodeling.net/cmps_index.php?page=news
It was set up for the Chat Module to be on the right hand side, my News Module in the center and the Online Users to be on the left (see screenshot #3).
However as you can see, the Chat shows up on the left where the Online Users should be, the News is ok in the center, but there is a blank space on the right side. It's probally someting stupid that I missed. But I'll keep checking it out.

John

BTW Zero, great script. I invited some of my members to try out vBChat before releasing it to the whole forum. They loved it!

Add on:
Found the problem with the Module showing in the wrong side. The eval statement was wrong in my chat_portal.php file.
PHP Code:
eval('$home[$onlineid][\'content\'] = "' fetch_template('adv_portal_chatroom') . '";'); 
Has to be:
PHP Code:
eval('$home[$mods[\'modid\']][\'content\'] = "' fetch_template('adv_portal_chatroom') . '";'); 
The $onlineid referred to the onlineusers template. If you're using a custom module without a module identifier, you have to use the $home[$mods[\'modid\'] in that part of the eval statement. See last screenshot.
Attached Files
File Type: (21.3 KB, 114 views)
File Type: (21.3 KB, 102 views)
File Type: (21.3 KB, 79 views)
File Type: (21.3 KB, 87 views)
Reply With Quote
  #6  
Old 04-10-2005, 04:09 PM
knobster knobster is offline
 
Join Date: Apr 2005
Location: North Carolina
Posts: 15
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Works great wirewolf! Thanks for sharing!
Reply With Quote
  #7  
Old 04-10-2005, 09:07 PM
wirewolf's Avatar
wirewolf wirewolf is offline
 
Join Date: Jun 2004
Location: New York City
Posts: 74
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You're welcome, knobster. I guess you tried it out. I've had it on my forum for about a week with no problems. So far, so good.
John
Reply With Quote
  #8  
Old 05-01-2005, 02:08 AM
jzewatsky jzewatsky is offline
 
Join Date: Nov 2004
Posts: 51
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This is really great! I have always had trouble getting members active in the chat. As a matter of fact, I wish there was a way to actually have vBchat running in a module on a cmps page. This is the next best thing! Thank you very much!

I do appear to have a small problem. Is there any reason that the module does not show up until someone is in the chat room? If there is no one in chat, the module does not show up. Once someone enters, it appears to stay active. Am I missing something?

Thanks again
Reply With Quote
  #9  
Old 06-30-2005, 05:11 PM
AbSoluTc AbSoluTc is offline
 
Join Date: Jul 2002
Posts: 12
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Got a problem with this. Did everything as stated. Shows up on the left without the eval statement modified.

If I add the statement eval, new modified one it throws it on the right, but everything under it moves too the bottom of the page and is super long (regular width). No longer a box.

Any suggestions?
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 02:34 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04594 seconds
  • Memory Usage 2,332KB
  • 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
  • (1)bbcode_html
  • (3)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (9)post_thanks_box
  • (9)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (9)post_thanks_postbit_info
  • (8)postbit
  • (4)postbit_attachment
  • (9)postbit_onlinestatus
  • (9)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
  • postbit_attachment
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete