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.
:)
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.
:)