vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3 Articles (https://vborg.vbsupport.ru/forumdisplay.php?f=187)
-   -   How to create your own vBulletin-powered page! (uses vB templates) (https://vborg.vbsupport.ru/showthread.php?t=62164)

HMBeaty 08-16-2009 04:50 PM

Yes it will

--------------- Added [DATE]1250445420[/DATE] at [TIME]1250445420[/TIME] ---------------

Quote:

Originally Posted by Lynne (Post 1868623)
Try changing this:
Code:

if (!$vbulletin->userinfo['userid']) print_no_permission();
To something more like this:
Code:

if (!$vbulletin->userinfo['userid'] OR !is_member_of($bbuserinfo, 5, 6, 7)) print_no_permission();
That will give an error if the user is not logged in or if the member is not a member of usergroups 5,6, or 7.

Quote:

Originally Posted by ilrglen (Post 1868626)
Will this then send them to the 'no permission page' or another error page?

Actually, to break down the code Lynne posted a little more,

The part print_no_permission(); spits out a "No Permission" error for the user if they are not registered or in the usergroups 5,6,7 which would obviously be this part of the code: if (!$vbulletin->userinfo['userid'] OR !is_member_of($bbuserinfo, 5, 6, 7))

ilrglen 08-16-2009 04:58 PM

Quote:

Originally Posted by Lynne (Post 1868623)
Try changing this:
Code:

if (!$vbulletin->userinfo['userid']) print_no_permission();
To something more like this:
Code:

if (!$vbulletin->userinfo['userid'] OR !is_member_of($bbuserinfo, 5, 6, 7)) print_no_permission();
That will give an error if the user is not logged in or if the member is not a member of usergroups 5,6, or 7.

Okay, I tried this and it worked when I was logged out but not when I was logged in. I am in Group 5 and it said I did not have sufficient permissions. Should this phrase not be
Code:

if (!$vbulletin->userinfo['userid'] OR !is_member_of($bbuserinfo, 1, 2, 3, 4)) print_no_permission();
I want the error page for groups 1, 2, 3, 4 and people not logged in.

HMBeaty 08-16-2009 05:00 PM

so you would change the 5, 6, 7 to 1, 2, 3, 4. You need to edit the code to how you need it

Lynne 08-16-2009 05:20 PM

Quote:

Originally Posted by ilrglen (Post 1868630)
Okay, I tried this and it worked when I was logged out but not when I was logged in. I am in Group 5 and it said I did not have sufficient permissions. Should this phrase not be
Code:

if (!$vbulletin->userinfo['userid'] OR !is_member_of($bbuserinfo, 1, 2, 3, 4)) print_no_permission();
I want the error page for groups 1, 2, 3, 4 and people not logged in.

Whoops, it should have been like this ($vbulletin->userinfo, not $bbuserinfo <- changed in post above now also):
Code:

if (!$vbulletin->userinfo['userid'] OR !is_member_of($vbulletin->userinfo, 5,6,7)) print_no_permission();

ilrglen 08-16-2009 05:31 PM

Quote:

Originally Posted by Lynne (Post 1868639)
Whoops, it should have been like this ($vbulletin->userinfo, not $bbuserinfo <- changed in post above now also):
Code:

if (!$vbulletin->userinfo['userid'] OR !is_member_of($vbulletin->userinfo, 5,6,7)) print_no_permission();

I'll try this. The first 2 ways didn't allow me to view this page.

--------------- Added [DATE]1250447670[/DATE] at [TIME]1250447670[/TIME] ---------------

That worked. Thanks. Does there need to be a space between each usergroup number like you had in the first example?

Lynne 08-16-2009 05:41 PM

Quote:

Originally Posted by ilrglen (Post 1868647)
That worked. Thanks. Does there need to be a space between each usergroup number like you had in the first example?

No.

ragtek 08-16-2009 05:55 PM

The vb Codestandards say that there should be a space but it's no must^^
http://www.vbulletin.com/docs/html/m...andards_spaces

Lynne 08-16-2009 06:26 PM

Quote:

Originally Posted by ragtek (Post 1868658)
The vb Codestandards say that there should be a space^^
http://www.vbulletin.com/docs/html/m...andards_spaces

Thank you, ragtek, I didn't know that.

ilrglen 08-16-2009 10:07 PM

Quote:

Originally Posted by Lynne (Post 1868670)
Thank you, ragtek, I didn't know that.

Thanks so much for the help. This is an awesome thread. Very helpful.

cellarius 08-20-2009 11:03 PM

In firstpost, the code for the custom php should be changed:

Instead of
PHP Code:

error_reporting(E_ALL & ~E_NOTICE); 

it should read
PHP Code:

error_reporting(E_ALL & ~E_NOTICE & ~8192); 

to reflect the latest change introduced with 3.8.4 to take care of the PHP 5.3.0-related problems.
Perhaps the OP or one of the mods could take care of that.


All times are GMT. The time now is 07:10 AM.

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.02588 seconds
  • Memory Usage 1,755KB
  • 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
  • (8)bbcode_code_printable
  • (2)bbcode_php_printable
  • (8)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (4)pagenav_pagelinkrel
  • (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