vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.5 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=113)
-   -   Yet Another vB Login on non-vB Page (https://vborg.vbsupport.ru/showthread.php?t=91129)

calorie 06-25-2005 10:00 PM

Yet Another vB Login on non-vB Page
 
This is not a plugin, nor is it a code modification. It is a separate script, so just configure the attached script, FTP it to wherever, and then call it from your browser. Once you test it out, you can edit the script to show whatever content you desire. Look at the code to see where to set your content. If you don't like this script, try mcahill's vB login on a non-vB page here.

If you use this script, click the install button. This allows you to receive update notices, should any be sent. It is also a nice way to say thanks!

Fine Print: Obviously, use at your own risk. Support is not guaranteed. This script may not be redistributed!

25 Jul 2005: added $session to make_page_content global list

CyberRanger 07-08-2005 12:07 PM

Neat, I like how access is so easily controlled by the user group. I did notice that I had to slightly modify how I setup the path to my forums. My forum is in a folder called forums just below my docroot. If my example file is in the docroot (ie, above the forums folder) I had to set the full path as:

PHP Code:

define('FWD','forums/'); 

That's running Suse with Apache2.

CyberRanger 07-08-2005 07:49 PM

One question on setting the usergroups. I can only seem to get it to work if that is the user's primary usergroup. Can it also check "Additional Usergroups"?

Thanks!

calorie 07-09-2005 12:46 AM

@westpointer: try the attached...

CyberRanger 07-11-2005 07:44 PM

Quote:

Originally Posted by calorie
@westpointer: try the attached...

Thanks! That works great.

I've modified the code a little, setting a variable depending on whether or not the user is a member of the group:

PHP Code:

if (!in_array($usergroup_id,$user_groups) AND empty($result_groups))
// RESTRICTED PAGE SETTINGS
    
$restricted 0;
    eval(
'$navbar = "' fetch_template('navbar') . '";');
    
$src_output make_page_content();


Then when the page is output:

PHP Code:

$header
$navbar
END
;
if (
$restricted == 1) {
    
$morestuff "You can see everything!";
}
$src_output .= <<<END
$morestuff
$footer 

That gives me very nice granular control for what is displayed based on the forum groups. Thanks!

Snetty 07-25-2005 10:56 AM

k, i like the look of this script. My problem is 2 fold, I don't need (or want) any usergroup support at the moment, I assume if i remove lines 95 -> 110 then this will solve that problem.

My 2nd problem is a touch more complex. I only want to display the welcome box (and be able to style it as I see fit). Looking at the code though it's calling the whole $header variable which is already made up by vb. What would I replace that with to meet my needs?

calorie 07-25-2005 02:52 PM

@Snetty: You could just set UGS to all usergroup IDs to bypass the login page. As for what you want to display, just set $src_output as shown in the script.

FASherman 07-25-2005 08:05 PM

How difficult would it be to expand this to something a little more complex?

What I'd like to see is something that:
  1. Writes the forum header
  2. Writes the breadcrumbs
  3. Runs any PHP script, capturing its oputput as a variable via ob_start/ob_capture/ob_stop - thus avoiding header already sent/redefinition errors
  4. Writes the script output
  5. Writes the forum footer.

calorie 08-01-2005 12:01 AM

@FASherman: you can do all of that. I was writing another example to show but haven't finished it yet. Thought I'd better fill in this post though. :speechless:

Mimoun 08-02-2005 09:33 AM

Is it possible to only show the small box that is on the right side of the navbar.
I want to extract data from the $navbar who do I do that?


All times are GMT. The time now is 02:29 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.00991 seconds
  • Memory Usage 1,739KB
  • 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
  • (3)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete