PDA

View Full Version : Digichat Hack for different user levels


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.DigiChatMas terApplet"
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.

BigSjedow
10-30-2001, 09:06 AM
i sill get the message:

Error

The siteID you entered is invalid. Please re-enter this information.

GeorgeofCS
10-30-2001, 09:28 AM
You gotta change the xxxx in the template to your digichat site ID

|DarkManX|
11-04-2001, 02:02 PM
a demo anywhere?

GeorgeofCS
11-04-2001, 02:13 PM
Yup my room is for users only but enter demo/demo as the login info and go here Customers Suck Chat Room (http://www.customerssuck.com/forums/chat.php3)

|DarkManX|
11-04-2001, 03:00 PM
coool thanks, someone else is using the demo username right now, but i'll keep checkin to see if i can get in, thanks :)

pgowder
11-27-2001, 02:14 PM
Do you have to purchase DigiChat?

Which version of DigiChat is this using?

TheHideoutGuy
11-28-2001, 10:41 PM
You have to purchase it... It's currently $500 for 100 concurrent users... Believe me it's worth it.. I've got it up and running on my site, and I'm just about to open it up to all members.

I've got some nice integration scripts written and have managed 2-way integration between the DigiChat and vBulletin buddy lists.

I'll report back when I get mine open.

pgowder
11-28-2001, 10:43 PM
Is it easy to install on your server?

Is it server intensive?

Do you moderators have control over the chatroom?

GeorgeofCS
12-26-2001, 09:17 PM
:confused: ok now I'm irked

grumpy
03-07-2002, 12:42 AM
I'm using this hack and it works great for most people. However, AOL users are not able to get in with it. Has anyone else experienced this, and is there a fix?

Thanks

alexwriting
03-07-2002, 03:20 PM
Please can you post the location of the demo again?

pgowder
05-24-2002, 02:14 PM
How can I use more than one user group as mods? I have Mods, Admins, and Senior Mods??

Ron ? DCS
09-16-2002, 05:52 AM
This isn't working for me right now...well, it sort of is...

However, my user name keeps getting literal: when I enter chat, It says that $bbuserinfo[username] has just entered chat.

It's not picking up the variable nickname; I have double-, triple-, and quadruple-checked the language, and all apears to be fine.

Anyone else have this problem; a solution maybe?

BTW, I am using DigiChat 4.0; brand new release...don't know if this might be the problem or not.

grrlburn
02-21-2003, 03:47 PM
I attempted to install this but I keep getting a parse error. Here is what I have. Any help would be greatly appreciated. I can't seem to find where the error is.

<?php

include("./global.php");

if (!$bbuserinfo[usergroupid]==6 || $bbuserinfo[usergroupid]==6 || $bbuserinfo[usergroupid]==6 ||

$bbuserinfo[usergroupid]==6) {
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

?>

Chris M
02-22-2003, 10:40 AM
Change include to require;)

Satan