vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   Members Only Access Page (https://vborg.vbsupport.ru/showthread.php?t=60548)

RobAC 01-21-2004 03:44 PM

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?

Xenon 01-21-2004 03:54 PM

it works the same way.

you have to include forum's global.php and check if bbuserinfo[userid] > 0

RobAC 01-22-2004 11:54 AM

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 
?>


Xenon 01-22-2004 02:38 PM

PHP Code:

<? 
require( "./global.php" ); 

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

eval("dooutput(\"".gettemplate('chat_hack')."\");"); 
} else { 
eval("dooutput(\"".show_nopermission()."\");"); 
} // end if 
?>


RobAC 01-22-2004 02:49 PM

Fatal error: Call to undefined function: gettemplate() in /home/public_html/forums/chat.php on line 6

iceman-x 01-22-2004 04:50 PM

PHP Code:

<? 
require( "./global.php" ); 

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


?>

Cant you just use this code.

mvh iceman-x

Zachery 01-22-2004 05:01 PM

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();
}
?>


RobAC 01-22-2004 05:15 PM

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??

Zachery 01-22-2004 05:41 PM

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


All times are GMT. The time now is 09:04 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.01280 seconds
  • Memory Usage 1,735KB
  • 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
  • (5)bbcode_php_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (9)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete