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

Reply
 
Thread Tools
YAPIH (Yet Another PHPMyChat Integration Hack) 1.0 Details »»
YAPIH (Yet Another PHPMyChat Integration Hack) 1.0
Version: 1.00, by version version is offline
Developer Last Online: Nov 2002 Show Printable Version Email this Page

Version: 2.2.x Rating:
Released: 04-08-2002 Last Update: Never Installs: 15
 
No support by the author.

YAPIH (Yet Another PHPMyChat Integration Hack) 1.0 by Joshua McNeese <jmcneese@enterthemuse.com>

Now, first off, this is not an 'out-of-the-box' hack, that you can just uncompress and change a config file and expect to work right off the bat. This hack was the result of me spending a considerable amount of time hand-editing files and replacing variables to convice PHPMyChat to use the VBulletin user database table. You will have to modify this to work with your server/configuration, and if you are not familiar with the PHP internals of VBulletin or with MySQL, turn back now. You have been warned.

(1) Uncompress YAPIH-1.0.zip in the ServerRoot of your server, so that you will access the chat via http://yourhost.com/chat/

(2) Execute the SQL commands in the file 'chat.sql'. This will create the tables needed for PHPMyChat as well as modify your user table. Altering your user table is dangerous, so be sure to have backups handy.

(3) Modify your VB templates:

ADD these two variables to your 'phpinclude' template:
PHP Code:
$chatname str_replace(" ""%20"$bbuserinfo[username]);
$chatpass $bbuserinfo[password]; 
This will replace any space in a username with spaces, as PHPMyChat does not accept spaces in names, and assign it to the variable $chatname. The users hashed password is assigned to $chatpass, for convenience.

(4) Edit the /chat/config/config.lib.php3 to match your server/configuation/preference.

(5) Now, the last (and tricky) part. What you have now is a working PHPMyChat installation that will authenticate on the VBulletin user table, if you followed the instructions faithfully and received no errors. What must be done now is provide your users with a way to access the chatrooms that you have created. I do this via a DHTML/PHP4 menu panel that lists the available chatrooms, and opens the chatroom in a 600x400 java popup box. You can do this anyway you want, so long as the link is provided via a template in VBulletin, or if you know how to pass variables to custom PHP scripts from within the 'phpinclude' template (which is what I do). The URL you must use is in this format:

Code:
/chat/index.php3?U=$chatname&PWD_Hash=$chatpass&Ver=H&L=english&R0=$chatroom&T=1&D=10&N=200&EN=1
Where $chatname and $chatpass are provided by the 'phpinclude' template, and $chatroom is provided by however you choose to assign that variable. It's up to you to figure out how you wish to do so, because everyone structures their site navigation in a different way.

To see the end-user representation of this hack, go to http://www.enterthemuse.com/ and login as 'test', password 'test'. On the left side of the site is a panel-based menu that will include a section 'Chat'. Take a look around, pay attention to where the URLs point and try it out.

It might work for you, it might not, it's totally dependent on your understanding of how to pass variables from your VB templates (in particular 'phpinclude'). Try it, and if all else fails, post your experiences on vb.org.

Download it HERE.

Good luck,

Joshua McNeese

Show Your Support

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

Comments
  #32  
Old 01-17-2003, 05:23 AM
rstark rstark is offline
 
Join Date: May 2002
Location: Honolulu, HI
Posts: 25
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by ixian
Last (guess this is 3 questions )

Where do you change the default text users see when they first enter a room?

Still haven't got the answer to this one....yet

Thanks!
It's in the welcome.lib.php3 file located in the \chat\lib folder
Reply With Quote
  #33  
Old 01-17-2003, 12:29 PM
svoec svoec is offline
 
Join Date: Mar 2002
Location: KY
Posts: 45
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

it's in the phpmychat docs..(probably why you didn't get a answer)

it is in the /chat/lib/welcome.lib.php3
Reply With Quote
  #34  
Old 01-18-2003, 03:10 AM
:Judge:'s Avatar
:Judge: :Judge: is offline
 
Join Date: Jan 2003
Location: USA ~ MD
Posts: 230
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Is this my best option to intergrate the two?
Reply With Quote
  #35  
Old 01-20-2003, 08:59 PM
rstark rstark is offline
 
Join Date: May 2002
Location: Honolulu, HI
Posts: 25
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by version
ixian, the phpinclude template is always parsed, even for the front page of the site, if you include("$forumpath/global.php").

here's the chatstuff in my phpinclude template:
PHP Code:
if ($bbuserinfo[userid] != "0") {
  
$chatname str_replace(" ""%20"$bbuserinfo[username]);
  
$chatpass $bbuserinfo[password];

  
$db=mysql_connect($servername,$dbusername,$dbpassword) or die("Can't open connection to MySQL");
  
mysql_select_db($dbname) or die("Can't select database");

  
mysql_query("DELETE from chat_users where u_time < ".(time() - 240)." and u_time > 0");
  
$num_chatters_query mysql_query("SELECT DISTINCT username FROM chat_users WHERE room != \"PRIVATE_ROOM\"");
  
$num_chatters mysql_num_rows($num_chatters_query);

  if (
$num_chatters == "0") {
    
$chatextra "";
  } elseif (
$num_chatters == "1") {
    
$chatextra "(1 user)";
    
$istext "is";
    
$membertext "member";
  } else {
    
$chatextra "($num_chatters users)";
    
$istext "are";
    
$membertext "members";
  }

  
$who_chatters_query mysql_query("SELECT DISTINCT username FROM chat_users");

  while (
$chatters mysql_fetch_array($who_chatters_query)) {
    
$who_chatters .= "&nbsp;$chatters[username]&nbsp;";
  }
  
  eval(
"\$chatinfo = \"".gettemplate("forumhome_chatinfo")."\";"); 

as you can see, i pass variables to my subscripts variables in the URLs, i.e. $chatname as $username, $bbuserinfo[userid] as $userid.

here is the contents of the "menu_chat.php" script mentioned above:
PHP Code:
print "<a href=\"/chat/index.php3?U=$username&PWD_Hash=$password&Ver=H&L=english&R0=General&T=1&D=10&N=200&EN=1\">General Chat</a><br>
 <a href=\"/chat/index.php3?U=
$username&PWD_Hash=$password&Ver=H&L=english&R0=Poetry+Slam&T=1&D=10&N=200&EN=1\">Poetry Slam</a><br>"
i am also attaching the template for the forumhome_chatinfo. let me know if there is more questions, and if someone wants to add more (or better) instructions to my package, send me the changes and i will give you credit. (busy life right now, got twins on the way )
When I try to add this, I get:
Warning: Access denied for user: 'user_com@localhost' (Using password: NO) in /home/oursite/public_html/forums/global.php(302) : eval()'d code on line 23

Warning: MySQL Connection Failed: Access denied for user: 'user_com@localhost' (Using password: NO) in /home/oursite/public_html/forums/global.php(302) : eval()'d code on line 23
Can't open connection to MySQL
Reply With Quote
  #36  
Old 01-20-2003, 10:18 PM
svoec svoec is offline
 
Join Date: Mar 2002
Location: KY
Posts: 45
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

somewhere in there, you need to include either global.php, or admin/config.php

your variables for the username and password are not getting set.
Reply With Quote
  #37  
Old 01-20-2003, 10:29 PM
rstark rstark is offline
 
Join Date: May 2002
Location: Honolulu, HI
Posts: 25
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by svoec
somewhere in there, you need to include either global.php, or admin/config.php


your variables for the username and password are not getting set.
Thanks svoec, but can you be a little more specific on where to include this? In the phpinclude template?
Reply With Quote
  #38  
Old 01-20-2003, 10:49 PM
rstark rstark is offline
 
Join Date: May 2002
Location: Honolulu, HI
Posts: 25
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Nevermind, I got it to work. Thanks!
Reply With Quote
  #39  
Old 01-29-2003, 07:06 PM
TalkHardRandy's Avatar
TalkHardRandy TalkHardRandy is offline
 
Join Date: Jan 2002
Posts: 69
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Though version hasn't been on in a while, I wanted to say that despite looking like a difficult hack to install, it went in rather smoothly.

Very cool hack!!!
Reply With Quote
  #40  
Old 02-27-2003, 12:31 PM
speedway's Avatar
speedway speedway is offline
 
Join Date: Nov 2001
Location: Sydney, Australia
Posts: 87
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ummm...anyone know where I can get this hack...the download link doesn't seem to work.

Cheers
Reply With Quote
  #41  
Old 04-27-2003, 05:28 AM
dotagious dotagious is offline
 
Join Date: Oct 2001
Posts: 222
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
02-27-03 at 10:31 AM speedway said this in Post #39
Ummm...anyone know where I can get this hack...the download link doesn't seem to work.

Cheers

Same here. =(
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 09:21 AM.


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.14581 seconds
  • Memory Usage 2,328KB
  • Queries Executed 25 (?)
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_code
  • (3)bbcode_php
  • (4)bbcode_quote
  • (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
  • (3)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)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
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete