vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB5 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=262)
-   -   New page added, set permissions for registered users only? (https://vborg.vbsupport.ru/showthread.php?t=309992)

DigoAlmino 03-28-2014 03:01 PM

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

Lynne 03-28-2014 06:05 PM

Can put your new content into a PHP Module and use PHP to give a No Permission to usergroups that have no permission?

DigoAlmino 03-29-2014 12:38 AM

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

Lynne 03-29-2014 05:26 PM

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. */



Dan321 06-22-2014 06:08 AM

I need it in HTML pls

tbworld 06-22-2014 06:38 AM

Quote:

Originally Posted by Dan321 (Post 2503002)
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. :)

Dan321 06-22-2014 06:51 AM

I didn't ?? ... Digo asked for PHP, I need HTML

tbworld 06-22-2014 07:21 AM

Quote:

Originally Posted by Dan321 (Post 2503005)
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>

:)

Dan321 06-22-2014 08:16 AM

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>

tbworld 06-22-2014 08:45 AM

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?

Dan321 06-22-2014 11:50 AM

same problem. I am placing it as a new page from the vBulletin 5 page maker -- I am adding that code via HTML module

tbworld 06-22-2014 12:00 PM

Obviously, I have missed something. When I get home tomorrow I will check this out. :)

Someone should come along and save you, this is a simple problem.

Dan321 06-22-2014 12:05 PM

thank you :)

Dan321 06-28-2014 08:06 AM

????

Lynne 06-28-2014 10:40 PM

What do you need you need it in html? Are you creating an .html page or using vbulletin? If for a tmeplate, then what exact template?

Dan321 06-29-2014 07:09 AM

vBulletin page manager.

I want for example Moderators to see a post saying "Hello" but Registered Users seeing a post saying "Not Allowed"

Lynne 06-29-2014 06:41 PM

You will need to add a PHP module and use the code I already posted.

BowlingTracker 08-27-2014 03:06 AM

That's template code, right? Sounds like he's just putting in a static html page via page maker. That's doesn't execute template code, does it?


All times are GMT. The time now is 03:28 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.01027 seconds
  • Memory Usage 1,748KB
  • 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
  • (2)bbcode_code_printable
  • (1)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (18)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