vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   Digichat Hack for different user levels (https://vborg.vbsupport.ru/showthread.php?t=20745)

GeorgeofCS 06-19-2001 10:00 PM

Ok I made this small little hack after seeing a few others similar to it, but not quite what I needed, Seeing that I wanted my mods to log into chat as mods as well. Hopefully this will be of some use to someone else.

There is two bugs in it, which is another reason why I'm posting it. (I'm new to this whole php coding thing) It works fine for people logged in with cookies, but not without, It also has some extra code in it that I know it shouldn't need. But again, it works :)

ok first off copy this and call it chat.php

<?php

include("./global.php");

if (!$bbuserinfo[usergroupid]==7 || $bbuserinfo[usergroupid]==6 || $bbuserinfo[usergroupid]==5 || $bbuserinfo[usergroupid]==7) {
eval("dooutput(\"".gettemplate('chatmod')."\");");
} else {
if( $bbuserid ) {

$user = $DB_site->query_first( "SELECT username
FROM user
WHERE userid = $bbuserid" );
$bbusername = $user[ username ];
eval("dooutput(\"".gettemplate('chat')."\");");
} else {
eval("dooutput(\"".show_nopermission()."\");");

} // end if

?>

Next change the $bbuserinfo[usergroupid] to the #'s of users you'd like to give mod status.

Then create template called chat

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>$bbtitle - $foruminfo[title]</title>
$headinclude
</head>
<body>
$header
<center><!-- *** START APPLET CODE *** -->
<APPLET NAME="DigiChat"
CODEBASE="http://host4.digichat.com/DigiChat/DigiClasses/"
CODE="com.diginet.digichat.client.DigiChatApplet"
WIDTH="200" HEIGHT="100" ALIGN="MIDDLE"
ARCHIVE="client.jar">

<PARAM NAME="siteID" VALUE="XXXX">
<PARAM NAME="cabbase" VALUE="Client.cab">
<PARAM NAME="background" VALUE="0099cc">
<PARAM NAME="textcolor" VALUE="000000">
<PARAM NAME="nickname" VALUE="$bbuserinfo[username]">

DigiChat requires a Java Compatible web browser to run.
</APPLET>
<!-- *** END APPLET CODE *** --></center>
$footer
</body>
</html>

Then make template chatmod

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>$bbtitle - $foruminfo[title]</title>
$headinclude
</head>
<body>
$header<center>





<!-- *** START APPLET CODE *** -->
<APPLET NAME="DigiChat"
CODEBASE="http://host4.digichat.com/DigiChat/DigiClasses/"
CODE="com.diginet.digichat.client.chatmaster.DigiC hatMasterApplet"
WIDTH="200" HEIGHT="120" ALIGN="MIDDLE"
ARCHIVE="ChatMaster.jar">

<PARAM NAME="siteID" VALUE="XXXX">
<PARAM NAME="cabbase" VALUE="ChatMaster.cab">
<PARAM NAME="background" VALUE="0099cc">
<PARAM NAME="textcolor" VALUE="000000">
<PARAM NAME="nickname" VALUE="$bbuserinfo[username]">
DigiChat requires a Java Compatible web browser to run.
</APPLET>
<!-- *** END APPLET CODE *** --></center>
$footer
</body>
</html>

Then just upload chat.php and link it in your site and you should be all set.

:)

fugzy 06-21-2001 03:39 AM

i did what you said... but when i try to access the chat.php file it says this:

Parse error: parse error in e:\inetpub\wwwroot\chat.php on line 21

i'm also trying to incorporate digichat into my vbulletin

JohnBradshaw 10-26-2001 12:40 PM

This happened to me too, can you help?

Skwowwy 10-26-2001 12:55 PM

<?php

include("./global.php");

if (!$bbuserinfo[usergroupid]==7 || $bbuserinfo[usergroupid]==6 || $bbuserinfo[usergroupid]==5 || $bbuserinfo[usergroupid]==7) {
eval("dooutput(\"".gettemplate('chatmod')."\");");
} else {
if( $bbuserid ) {

$user = $DB_site->query_first( "SELECT username
FROM user
WHERE userid = $bbuserid" );
$bbusername = $user[ username ];
eval("dooutput(\"".gettemplate('chat')."\");");
} else {
eval("dooutput(\"".show_nopermission()."\");");

} // end if
} // end else

?>

You forgot to close the else statement in line 8.

GeorgeofCS 10-26-2001 11:14 PM

Actually I caught this a while after I posted this. For some reason the code works on my site. :confused:

JohnBradshaw 10-27-2001 07:07 AM

It is an excellent piece of code, thanks!

GeorgeofCS 10-27-2001 11:03 AM

actually here is the updated coding for the chat.php piece. The other one only tells the difference between a mod and others. This piece is if you want a private chat for members only.

<?php

include("./global.php3");

if (!$bbuserinfo[usergroupid]==7 || $bbuserinfo[usergroupid]==6 || $bbuserinfo[usergroupid]==5 || $bbuserinfo[usergroupid]==7) {
eval("dooutput(\"".gettemplate('chatmod')."\");");
} else {
if (!$bbuserinfo[usergroupid]==7 || $bbuserinfo[usergroupid]==2) {
eval("dooutput(\"".gettemplate('chat')."\");");
} else {
eval("dooutput(\"".show_nopermission()."\");");

} // end if
} // end else
?>

again there's a small bug in this one I have yet to fix that required me to put a group in twice, but it works fine for me. Give me a couple more months of learning and I'm sure I'll figure out that bug. :)

almighty one 10-28-2001 03:00 AM

does this hack allow a way to show who is in the chat room on the index.php?

JJR512 10-28-2001 03:46 AM

I'm just getting started with this.

So far, the first problem I had was that it didn't like the statement to include global.php. I looked in some of the regular vBulletin files, and they all seem to require it, not include it. So I changed include("./global.php"); to require('./global.php'); and that problem went away.

GeorgeofCS 10-28-2001 10:25 AM

Yeah again I'm just a newbie and although it appears buggy to everyone else it works for me fine :)

As far as showing whose in the chat room that is the one piece I have not been able to figure out. My users want that as bad as anything else, but so far no go. The only thing I can think of that may allow something like that to work is the external buddy list thing digichat has, but I have yet to figure that point out.


All times are GMT. The time now is 01:41 AM.

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.01010 seconds
  • Memory Usage 1,737KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete