Go Back   vb.org Archive > vBulletin 5 Connect Discussion > vB5 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 03-28-2014, 03:01 PM
DigoAlmino DigoAlmino is offline
 
Join Date: Sep 2013
Posts: 7
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default New page added, set permissions for registered users only?

Hey guys,

I created a new page on my site and I like to set permissions for only registered users can access not unregistered. How ever it doesn't show any permissions for the new page in Channel Management/Usergroup -> Channel Permissions on the site.

How do I add this new page I made to Channel Management to set the users that I wish to look at this page?

Hope you guys can help.

Many thanks,

DigoAlmino
Reply With Quote
  #2  
Old 03-28-2014, 06:05 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Can put your new content into a PHP Module and use PHP to give a No Permission to usergroups that have no permission?
Reply With Quote
  #3  
Old 03-29-2014, 12:38 AM
DigoAlmino DigoAlmino is offline
 
Join Date: Sep 2013
Posts: 7
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hey Lynne,

How will I do this sorry? Because I'm still new to PHP and I'm learning things as I go. Because what I want is the page to be blocked by guest due to it's a application form for different areas of the community.

So I'm trying to figure out with the Channel Management is there a way I can add this new page in or like you said Lynne make a script to block that usergroup ID.

If you have instructions for the PHP block content Lynne that will be fantastic.

Thank you.

DigoAlmino
Reply With Quote
  #4  
Old 03-29-2014, 05:26 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Something like....

PHP Code:
if (vB5_User::get('usergroupid') ==1) { 
echo 
'You do not have permission to see this page';
} else {  
/* This is the PHP you want to show to your logged in users. */

Reply With Quote
  #5  
Old 06-22-2014, 06:08 AM
Dan321 Dan321 is offline
 
Join Date: Oct 2008
Posts: 37
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I need it in HTML pls
Reply With Quote
  #6  
Old 06-22-2014, 06:38 AM
tbworld tbworld is offline
 
Join Date: Oct 2008
Posts: 2,126
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Dan321 View Post
I need it in HTML pls
I am not sure I understand your reply. You asked for PHP originally and that is what @Lynne provided. Please clarify.
Reply With Quote
  #7  
Old 06-22-2014, 06:51 AM
Dan321 Dan321 is offline
 
Join Date: Oct 2008
Posts: 37
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I didn't ?? ... Digo asked for PHP, I need HTML
Reply With Quote
  #8  
Old 06-22-2014, 07:21 AM
tbworld tbworld is offline
 
Join Date: Oct 2008
Posts: 2,126
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Dan321 View Post
I didn't ?? ... Digo asked for PHP, I need HTML
My mistake, thanks for clarifying.

Code:
<vb:if condition="$userinfo['usergroupid'] == 1">
   <!-- Unregistered Users HTML Code -->
<vb:else />
   <!-- Your Logged in Users HTML Code -->
</vb:if>
Reply With Quote
  #9  
Old 06-22-2014, 08:16 AM
Dan321 Dan321 is offline
 
Join Date: Oct 2008
Posts: 37
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Tried it, but this happens .. You are not logged in. Welcome

My code is as follows.

<vb:if condition="$bbuserinfo['usergroupid'] == 1">
<!-- Unregistered Users HTML Code -->
You are not logged in.
<vb:else />
<!-- Your Logged in Users HTML Code -->
Welcome
</vb:if>
Reply With Quote
  #10  
Old 06-22-2014, 08:45 AM
tbworld tbworld is offline
 
Join Date: Oct 2008
Posts: 2,126
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Oops, I am not at home where I could test the code. At a hotel bar at the moment, during a business stay. I pulled the reference $bbuserinfo from the vb5 manual. If the variable did not exist it should be 'NULL' and 'NULL does not equal 1, so either way you should not have executed that branch.

Try:
Code:
<vb:if condition="$userinfo['usergroupid'] == 1">
--------------- Added 22 Jun 2014 at 03:04 ---------------

Where are you placing that code? What template?
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 08:26 PM.


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.05295 seconds
  • Memory Usage 2,256KB
  • 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
  • (2)bbcode_code
  • (1)bbcode_php
  • (2)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
  • (10)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