Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions

Reply
 
Thread Tools Display Modes
  #1  
Old 06-18-2008, 02:49 PM
soundbarrierpro soundbarrierpro is offline
 
Join Date: Nov 2007
Posts: 767
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Permission based links? Is it possible?

I've created several vbpowered pages which no matter what I do, I cannot get them to use permissions.

So...........

I'd like to know if it's possible to hide the pages and just make a link to them, but make the link permission based? I'd like to make it so only registered users see the link and guests don't.
Reply With Quote
  #2  
Old 06-18-2008, 03:12 PM
King Kovifor's Avatar
King Kovifor King Kovifor is offline
 
Join Date: Nov 2004
Location: PA
Posts: 3,872
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Are you doing this in vBulletin templates?
Reply With Quote
  #3  
Old 06-18-2008, 03:48 PM
soundbarrierpro soundbarrierpro is offline
 
Join Date: Nov 2007
Posts: 767
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by King Kovifor View Post
Are you doing this in vBulletin templates?
Yes, that is correct. They are all vbulletin templates, produced with this hack. I tried over and over and over to get the usergroup perms to work on the temps, but all the pages are still viewable to guests. I am now hoping I can hide the link only and make that viewable to only certain user groups.

https://vborg.vbsupport.ru/showthrea...t=powered+page
Reply With Quote
  #4  
Old 06-18-2008, 04:03 PM
RLShare RLShare is offline
 
Join Date: Jun 2008
Posts: 499
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

If your just trying to make it where guests can't view the pages, in the php file which in that tutorial would be test.php add this code below where global.php is included

PHP Code:
if (!$vbulletin->userinfo['userid']){
//user not logged in, give no permission message.. make a new template
}
else{
//user is logged in, fetch the template for the page.

Reply With Quote
  #5  
Old 06-18-2008, 04:16 PM
soundbarrierpro soundbarrierpro is offline
 
Join Date: Nov 2007
Posts: 767
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Like this?

Code:
<?php 

// ####################### SET PHP ENVIRONMENT ########################### 
error_reporting(E_ALL & ~E_NOTICE); 

// #################### DEFINE IMPORTANT CONSTANTS ####################### 
define('NO_REGISTER_GLOBALS', 1); 
define('THIS_SCRIPT', 'downloads'); // change this depending on your filename 

// ################### PRE-CACHE TEMPLATES AND DATA ###################### 
// get special phrase groups 
$phrasegroups = array( 

); 

// get special data templates from the datastore 
$specialtemplates = array( 
     
); 

// pre-cache templates used by all actions 
$globaltemplates = array( 
    'downloads', 
); 

// pre-cache templates used by specific actions 
$actiontemplates = array( 

); 

// ######################### REQUIRE BACK-END ############################ 
require_once('./global.php');
if (!$vbulletin->userinfo['userid']){ 
//user not logged in, give no permission message.. make a new template 
} 
else{ 
//user is logged in, fetch the template for the page. 
}

// ####################################################################### 
// ######################## START MAIN SCRIPT ############################ 
// ####################################################################### 

$navbits = array(); 
$navbits[$parent] = 'downloads'; 

$navbits = construct_navbits($navbits); 
eval('$navbar = "' . fetch_template('navbar') . '";'); 
eval('print_output("' . fetch_template('downloads') . '");'); 

?>
Doesn't work.
Reply With Quote
  #6  
Old 06-18-2008, 04:20 PM
RLShare RLShare is offline
 
Join Date: Jun 2008
Posts: 499
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by soundbarrierpro View Post
Like this?

Code:
<?php 

// ####################### SET PHP ENVIRONMENT ########################### 
error_reporting(E_ALL & ~E_NOTICE); 

// #################### DEFINE IMPORTANT CONSTANTS ####################### 
define('NO_REGISTER_GLOBALS', 1); 
define('THIS_SCRIPT', 'downloads'); // change this depending on your filename 

// ################### PRE-CACHE TEMPLATES AND DATA ###################### 
// get special phrase groups 
$phrasegroups = array( 

); 

// get special data templates from the datastore 
$specialtemplates = array( 
     
); 

// pre-cache templates used by all actions 
$globaltemplates = array( 
    'downloads', 
); 

// pre-cache templates used by specific actions 
$actiontemplates = array( 

); 

// ######################### REQUIRE BACK-END ############################ 
require_once('./global.php');
if (!$vbulletin->userinfo['userid']){ 
//user not logged in, give no permission message.. make a new template 
} 
else{ 
//user is logged in, fetch the template for the page. 
}

// ####################################################################### 
// ######################## START MAIN SCRIPT ############################ 
// ####################################################################### 

$navbits = array(); 
$navbits[$parent] = 'downloads'; 

$navbits = construct_navbits($navbits); 
eval('$navbar = "' . fetch_template('navbar') . '";'); 
eval('print_output("' . fetch_template('downloads') . '");'); 

?>
Doesn't work.
NAH..... like this....I changed it a litte from what I posted before...You will need to create another template and fetch it from with-in the 'if' statement, replace where it says "//user not logged in, give no permission message.. make a new template " with another statement like this one..
eval('print_output("' . fetch_template('downloads') . '");'); except have it fetch a template you create saying they don't have permissions

PHP Code:
<?php 

// ####################### SET PHP ENVIRONMENT ########################### 
error_reporting(E_ALL & ~E_NOTICE); 

// #################### DEFINE IMPORTANT CONSTANTS ####################### 
define('NO_REGISTER_GLOBALS'1); 
define('THIS_SCRIPT''downloads'); // change this depending on your filename 

// ################### PRE-CACHE TEMPLATES AND DATA ###################### 
// get special phrase groups 
$phrasegroups = array( 

); 

// get special data templates from the datastore 
$specialtemplates = array( 
     
); 

// pre-cache templates used by all actions 
$globaltemplates = array( 
    
'downloads'
); 

// pre-cache templates used by specific actions 
$actiontemplates = array( 

); 

// ######################### REQUIRE BACK-END ############################ 
require_once('./global.php');

// ####################################################################### 
// ######################## START MAIN SCRIPT ############################ 
// ####################################################################### 

$navbits = array(); 
$navbits[$parent] = 'downloads'

$navbits construct_navbits($navbits); 

eval(
'$navbar = "' fetch_template('navbar') . '";'); 

if (!
$vbulletin->userinfo['userid']){ 

//user not logged in, give no permission message.. make a new template 



else{ 
//user is logged in, fetch the template for the page. 


eval('print_output("' fetch_template('downloads') . '");'); 


}
?>
Reply With Quote
  #7  
Old 06-18-2008, 04:43 PM
soundbarrierpro soundbarrierpro is offline
 
Join Date: Nov 2007
Posts: 767
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

like this?

Code:
<?php  

// ####################### SET PHP ENVIRONMENT ###########################  
error_reporting(E_ALL & ~E_NOTICE);  

// #################### DEFINE IMPORTANT CONSTANTS #######################  
define('NO_REGISTER_GLOBALS', 1);  
define('THIS_SCRIPT', 'downloads'); // change this depending on your filename  

// ################### PRE-CACHE TEMPLATES AND DATA ######################  
// get special phrase groups  
$phrasegroups = array(  

);  

// get special data templates from the datastore  
$specialtemplates = array(  
      
);  

// pre-cache templates used by all actions  
$globaltemplates = array(  
    'downloads',  
);  

// pre-cache templates used by specific actions  
$actiontemplates = array(  

);  

// ######################### REQUIRE BACK-END ############################  
require_once('./global.php'); 

// #######################################################################  
// ######################## START MAIN SCRIPT ############################  
// #######################################################################  

$navbits = array();  
$navbits[$parent] = 'downloads';  

$navbits = construct_navbits($navbits);  

eval('$navbar = "' . fetch_template('navbar') . '";');  

if (!$vbulletin->userinfo['userid']){  

//user not logged in, give no permission message 
eval('print_output("' . fetch_template('reg') . '");');

}  
else{  
//user is logged in, fetch the template for the page.  


eval('print_output("' . fetch_template('downloads') . '");');  


} 
?>
Reply With Quote
  #8  
Old 06-18-2008, 04:55 PM
RLShare RLShare is offline
 
Join Date: Jun 2008
Posts: 499
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Exactly...
Reply With Quote
  #9  
Old 06-18-2008, 05:05 PM
soundbarrierpro soundbarrierpro is offline
 
Join Date: Nov 2007
Posts: 767
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Doesn't work for me. Oh well. Guess I'll go back to using the cmps hide mod then. Thanks for your help.
Reply With Quote
  #10  
Old 06-18-2008, 05:10 PM
RLShare RLShare is offline
 
Join Date: Jun 2008
Posts: 499
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ive just tried exactly what you posted with 3.7 and it worked. Are you sure that your default style holds the 'reg' template?

here are some screenshots of it working on my board... the downloads template is just the code for the template from that tutorial you posted with the title part changed to 'Downloads' and the reg template is the same code except with the title changed to 'You can't view this page'
Attached Images
File Type: jpg canview.jpg (32.7 KB, 0 views)
File Type: jpg cantview.jpg (30.5 KB, 0 views)
Reply With Quote
Reply

Thread Tools
Display Modes

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:09 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.05058 seconds
  • Memory Usage 2,293KB
  • Queries Executed 12 (?)
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
  • (3)bbcode_code
  • (2)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
  • (2)postbit_attachment
  • (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_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
  • postbit_attachment
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete