Go Back   vb.org Archive > Community Discussions > Modification Requests/Questions (Unpaid)
  #1  
Old 01-21-2004, 03:44 PM
RobAC RobAC is offline
 
Join Date: Oct 2001
Posts: 314
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Members Only Access Page

I'm not sure if what I'm looking for can really be considered a hack or not, but, I am integrating a chat room into my forums. The chat room runs on an external server. All I would like to do is set up a php page that will use vBulletin's authentication system to insure that only logged in forum members can go to the chat room log in page.

I had a simple php script page set up that would recognize logged in forum members and using a custom template, send them to the page to log into the chat room. If they were not a member of the forums, they would receive the "you do not have permission to access this page" message.

This page was working prior to upgrading to vB 3.0 from 2.3.4. How can I do this again utilizing the new/updated vB3 authentication code?
Reply With Quote
  #2  
Old 01-21-2004, 03:54 PM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

it works the same way.

you have to include forum's global.php and check if bbuserinfo[userid] > 0
Reply With Quote
  #3  
Old 01-22-2004, 11:54 AM
RobAC RobAC is offline
 
Join Date: Oct 2001
Posts: 314
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Xenon
it works the same way.

you have to include forum's global.php and check if bbuserinfo[userid] > 0
I can't get it to work...

PHP Code:
<? 
require( "./global.php" ); 

if( $bbuserid ) { 

$user = $DB_site->query_first( "SELECT username 
FROM user 
WHERE userid = $bbuserid" ); 
$bbusername = $user[ username ]; 
eval("dooutput(\"".gettemplate('chat_hack')."\");"); 
} else { 
eval("dooutput(\"".show_nopermission()."\");"); 
} // end if 
?>
Reply With Quote
  #4  
Old 01-22-2004, 02:38 PM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

PHP Code:
<? 
require( "./global.php" ); 

if( $bbuserinfo['userid'] > 0 ) { 

eval("dooutput(\"".gettemplate('chat_hack')."\");"); 
} else { 
eval("dooutput(\"".show_nopermission()."\");"); 
} // end if 
?>
Reply With Quote
  #5  
Old 01-22-2004, 02:49 PM
RobAC RobAC is offline
 
Join Date: Oct 2001
Posts: 314
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Fatal error: Call to undefined function: gettemplate() in /home/public_html/forums/chat.php on line 6
Reply With Quote
  #6  
Old 01-22-2004, 04:50 PM
iceman-x iceman-x is offline
 
Join Date: Nov 2002
Location: NOrWAY
Posts: 46
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

PHP Code:
<? 
require( "./global.php" ); 

if ($bbuserinfo[userid]==0) { 
show_nopermission(); 


?>
Cant you just use this code.

mvh iceman-x
Reply With Quote
  #7  
Old 01-22-2004, 05:01 PM
Zachery's Avatar
Zachery Zachery is offline
 
Join Date: Jul 2002
Location: Ontario, Canada
Posts: 11,440
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

well this is vb3 so it should probally look somthing like this


PHP Code:
  <?php 
// ## Error Reporting ##
error_reporting(E_ALL & ~E_NOTICE);
// ## Sets Enviroment  ##
define('NO_REGISTER_GLOBALS'1);
// ## Grabs global.php ##
require_once("./global.php");
if (!
$bbuserinfo['userid'])
{
 
print_no_permission();
}
?>
Reply With Quote
  #8  
Old 01-22-2004, 05:15 PM
RobAC RobAC is offline
 
Join Date: Oct 2001
Posts: 314
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Faranth
well this is vb3 so it should probally look somthing like this


PHP Code:
  <?php 
// ## Error Reporting ##
error_reporting(E_ALL & ~E_NOTICE);
// ## Sets Enviroment  ##
define('NO_REGISTER_GLOBALS'1);
// ## Grabs global.php ##
require_once("./global.php");
if (!
$bbuserinfo['userid'])
{
 
print_no_permission();
}
?>
How do I call the template in the php file though??
Reply With Quote
  #9  
Old 01-22-2004, 05:41 PM
Zachery's Avatar
Zachery Zachery is offline
 
Join Date: Jul 2002
Location: Ontario, Canada
Posts: 11,440
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by RobAC
How do I call the template in the php file though??
check out the Basics of vB3 in my sig its a small tutorial on howto call and use the vB3 template system
Reply With Quote
Reply

Thread Tools
Display Modes

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 03:38 PM.


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.04739 seconds
  • Memory Usage 2,243KB
  • 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
  • (5)bbcode_php
  • (3)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (9)post_thanks_box
  • (9)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (9)post_thanks_postbit_info
  • (9)postbit
  • (9)postbit_onlinestatus
  • (9)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
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete