Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 06-13-2001, 11:45 AM
grumpy grumpy is offline
 
Join Date: Nov 2001
Posts: 35
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I have a login hack for my DigiChat room, and it works great. Unfortunately, it also allows users awaiting email confirmation to still access the chat. Therefore, people can get in without even providing a valid email.

So, I'd like to know if there is a way to restrict access to only members in the Registered usergroup? At this point, I have my 'awaiting email confirmation' usergroup set up to not allow access to the forum at all, preventing them from getting in the chat. But I really don't want that as a permanent option. Can I add a usergroup variable to this and if so, what should it be?

Here is my code:

PHP Code:
<?php
    
    
if( $bbuserid ) {

      
$user        $DB_site->query_first"SELECT username
                                               FROM user 
                                              WHERE userid = 
$bbuserid);
      
$bbuserinfo  $userusername ];


      
      print( 
"<APPLET align=middle code=\"com.diginet.digichat.client.DigiChatApplet\" 
codeBase=\"http://host4.digichat.com/DigiChat/DigiClasses/\"
 width=\"200\" height=\"100\" align=\"middle\" ARCHIVE=\"client.jar\" nickname=\"
$username\">
          <PARAM NAME=\"siteID\" VALUE=\"xxxx\">
          <PARAM NAME=\"cabbase\" VALUE=\"Client.cab\">
          <PARAM NAME=\"background\" VALUE=\"000000\">
          <PARAM NAME=\"textcolor\" VALUE=\"ffffff\">
          <param name=\"floodControl\" value=\"1000\">

          <PARAM NAME=\"nickname\" VALUE=\"
$bbuserinfo\">
          <PARAM NAME=\"openProfileURL\" VALUE=\"true\">
            <PARAM NAME=\"room\" VALUE=\"chat-room-name\">     
          Our Chat requires a Java Compatible web browser to run.
          </APPLET>\n" 
);

    } else { 

      print( 
"<BODY BGCOLOR=\"#000000\">
<CENTER>
<FONT FACE=\"verdana, arial\" size=\"2\" color=\"white\">
Sorry, you must be logged into the Forum to use Chat!</font><br>" 
);

    } 
// end if
    
?>

Thanks
Reply With Quote
  #2  
Old 06-13-2001, 02:32 PM
JamesUS's Avatar
JamesUS JamesUS is offline
 
Join Date: Oct 2001
Posts: 347
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Add the variable "usergroupid" to the select statement:

Quote:
SELECT username, usergroupid...
I believe the ID of the group that is awaiting email confirmation is "3" but I'd need to check.

Post back if you need example code.
Reply With Quote
  #3  
Old 06-13-2001, 02:34 PM
grumpy grumpy is offline
 
Join Date: Nov 2001
Posts: 35
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thank you! And yes, example code would be appreciated.

Reply With Quote
  #4  
Old 06-13-2001, 02:36 PM
Freddie Bingham's Avatar
Freddie Bingham Freddie Bingham is offline
 
Join Date: Oct 2001
Posts: 506
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It appears your code is for vb 1.1.x but if you want to do something with 2.0, this sort of thing would get you where you want to go:
PHP Code:
include("./global.php");
if (!
$bbuserinfo[userid] || $bbuserinfo[usergroupid]==|| $bbuserinfo[usergroupid]==3) {
    
show_nopermission();
}
eval(
"dooutput(\"".gettemplate("chat")."\");"); 
Reply With Quote
  #5  
Old 06-21-2001, 03:50 AM
fugzy
Guest
 
Posts: n/a
Default

okay that code works okay for digichat, but i get this error:

Parse error: parse error in e:\inetpub\wwwroot\vb\chat2.php(7) : eval()'d code on line 27

im using vb2.0 help me plz
Reply With Quote
  #6  
Old 06-21-2001, 04:00 AM
JohnM's Avatar
JohnM JohnM is offline
 
Join Date: Oct 2001
Posts: 31
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

PHP Code:
include("./global.php");
if (!
$bbuserinfo[userid] || $bbuserinfo[usergroupid]==|| $bbuserinfo[usergroupid]==3) {
    
show_nopermission();
}
eval(
"dooutput(\"".gettemplate("chat")."\");"); 
Reply With Quote
  #7  
Old 06-21-2001, 04:28 AM
fugzy
Guest
 
Posts: n/a
Default

k it works... here is the full code i use to incorporate digichat 3.5 into vbulletin 2.0

<?php

include("./global.php");
if (!$bbuserinfo[userid] || $bbuserinfo[usergroupid]==1 || $bbuserinfo[usergroupid]==3) {
show_nopermission();
}
eval("dooutput(\"".gettemplate("chat")."\");");

if( $bbuserid ) {

$user = $DB_site->query_first( "SELECT username
FROM user
WHERE userid = $bbuserid" );
$bbuserinfo = $user[ username ];


print( "<APPLET align=middle code=\"com.diginet.digichat.client.DigiChatApplet\ "
codeBase=\"http://www.blah.com/DigiChat/DigiClasses/\"
width=\"200\" height=\"100\" align=\"middle\" ARCHIVE=\"client.jar\" nickname=\"$username\">
<PARAM NAME=\"siteID\" VALUE=\"1000\">
<PARAM NAME=\"cabbase\" VALUE=\"Client.cab\">
<PARAM NAME=\"background\" VALUE=\"000000\">
<PARAM NAME=\"textcolor\" VALUE=\"ffffff\">
<param name=\"floodControl\" value=\"1000\">

<PARAM NAME=\"nickname\" VALUE=\"$bbuserinfo\">
<PARAM NAME=\"openProfileURL\" VALUE=\"true\">
<PARAM NAME=\"room\" VALUE=\"chat-room-name\">
Our Chat requires a Java Compatible web browser to run.
</APPLET>\n" );

} else {

print( "<BODY BGCOLOR=\"#000000\">
<CENTER>
<FONT FACE=\"verdana, arial\" size=\"2\" color=\"white\">
Sorry, you must be logged into the Forum to use Chat!</font><br>" );

} // end if

it still needs a lil cleanin up... cause it displays the connect string all weird on the page, etc... can it like close the old window when a person clicks on chat?
Reply With Quote
  #8  
Old 06-21-2001, 04:45 AM
fugzy
Guest
 
Posts: n/a
Default

it keeps bringin up a window saying the siteid you entered is invalid yet it still works... why is that? but sometimes my users can't get on... hrmm

can someone plz post a complete working hack for digichat 3.5 to work with vbulletin 2.0... complete with the chat.php and the templates that you're suppose to add...
Reply With Quote
  #9  
Old 06-23-2001, 05:22 PM
JohnM's Avatar
JohnM JohnM is offline
 
Join Date: Oct 2001
Posts: 31
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

PHP Code:
<?php

include("./global.php");
if (!
$bbuserinfo[userid] || $bbuserinfo[usergroupid]==|| $bbuserinfo[usergroupid]==3) {
    
show_nopermission();
}
eval(
"dooutput(\"".gettemplate("chat")."\");");

?>
chat template:
Code:
<APPLET align=middle code="com.diginet.digichat.client.DigiChatApplet" 
codeBase="http://www.yoursite.com/DigiChat/DigiClasses/"
 width="200" height="100" align="middle" ARCHIVE="client.jar" nickname="$bbuserinfo[username]">
          <PARAM NAME="siteID" VALUE="site id">
          <PARAM NAME="cabbase" VALUE="Client.cab">
          <PARAM NAME="background" VALUE="{ pagebgcolor}">
          <PARAM NAME="textcolor" VALUE="{ pagetextcolor}">
          <param name="floodControl" value="1000">
          <PARAM NAME="nickname" VALUE="$bbuserinfo[username]">
          <PARAM NAME="openProfileURL" VALUE="true">
          <PARAM NAME="room" VALUE="chat-room-name">     
          Our Chat requires a Java Compatible web browser to run.
          </APPLET>
Remove the spaces for the replacement variables in red above, and insert the correct values that are in blue.
Reply With Quote
  #10  
Old 06-28-2001, 05:31 PM
Mark4444
Guest
 
Posts: n/a
Default

Anyone know what the usergroup id for (COPPA) Users Awaiting Moderation is??

And i would assume all i'd have to do would be to add that into the code you have JohnM

<?php

include("./global.php");
if (!$bbuserinfo[userid] || $bbuserinfo[usergroupid]==1 || $bbuserinfo[usergroupid]==3 || $bbuserinfo[usergroupid]==?) {
show_nopermission();
}
eval("dooutput(\"".gettemplate("chat")."\");");

?>

Of course i'd replace the ? with whatever the coppa usergroup id is.

Thanks in advance
Reply With Quote
Reply


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 06:40 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.04565 seconds
  • Memory Usage 2,273KB
  • Queries Executed 13 (?)
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)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_code
  • (4)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (6)postbit_onlinestatus
  • (10)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_postinfo_query
  • fetch_postinfo
  • 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