vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Removed No permission page with custom page? (https://vborg.vbsupport.ru/showthread.php?t=228633)

Loget 11-22-2009 07:22 PM

Removed No permission page with custom page?
 
Hello,

I'd like to remove the no permission page for guests with a custom page. Can someone please assist me on how to do it?

Many thanks.

Loget 11-25-2009 06:29 PM

Anyone, please?

Lynne 11-25-2009 08:07 PM

You have a custom page and it is giving guests a no permission message? You must have the code in the page then. Look for something like this and remove it (I don't know what your's looks like since you haven't printed out your code):
PHP Code:

if (!isset($vbulletin->userinfo['userid']) OR $vbulletin->userinfo['userid'] == 0)
{
        
print_no_permission(); 



Loget 11-26-2009 07:04 PM

Hey Lynne,

You misunderstood me, I meant that I want a custom page shown to guests instead of using a no permission page.

Thanks

kh99 11-27-2009 12:25 AM

Maybe you could try this mod: https://vborg.vbsupport.ru/showthread.php?t=172989

or you could try this plugin code:

Code:

if (!$vbulletin->userinfo['userid'])
{
  $vbulletin->url = 'custom page url';
  eval(print_standard_redirect('no permission'));
}


using the error_nopermission hook (replacing 'custom page url' with your page url of course). I did a brief test, but you'd want to test it more if you try using this.

Loget 11-27-2009 06:53 PM

Hello,

Where do I find the error_nopermission hook :$ ?

Lynne 11-27-2009 06:58 PM

Do a search in your files for "error_nopermission" and you'll find it in functions.php

Loget 11-27-2009 07:13 PM

Hello Lynne,

I don't exactly know where kh99 is asking me to put the following code:
Quote:

if (!$vbulletin->userinfo['userid'])
{
$vbulletin->url = 'custom page url';
eval(print_standard_redirect('no permission'));
Quote:

using the error_nopermission hook (replacing 'custom page url' with your page url of course). I did a brief test, but you'd want to test it more if you try using this.
Is he/she talking about the functions.php file edit or something within vbulletin admincp?

Thanks, I appreciate your help.

Lynne 11-27-2009 07:18 PM

He's talking about creating a plugin using the error_nopermission hook location. Take a look at this in the manual - Plugin System

Brandon_R 11-27-2009 07:24 PM

You could edit the STANDARD_ERROR templates and replace it with your custom code.

Loget 11-27-2009 07:42 PM

Quote:

Originally Posted by Lynne (Post 1921744)
He's talking about creating a plugin using the error_nopermission hook location. Take a look at this in the manual - Plugin System

I'm not that advanced, if you could guide me it would be appreciated.

Ta

kh99 11-27-2009 07:46 PM

Quote:

Originally Posted by Brandon_R (Post 1921745)
You could edit the STANDARD_ERROR templates and replace it with your custom code.

Yeah, good point - that's another way to do it. And I guess that could turn out to be easier over all depending on what the custom page is like. If it's basically the same as the error page but with more or different text, then that seems like it would be much easier.

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

Quote:

I'm not that advanced, if you could guide me it would be appreciated.
Under "Plugins & Products", select "Add New Plugin"
Next to "Hook Location", find "error_nopermission"
For "Title" enter something so you'll know what it is later, like "Guest No Permission Redirect" or whatever you want.
Paste the code in the big text box.
Select "Yes" next to "Plugin Active"
Save

If you want to disable it later, you can just go to "Plugin Manager" and uncheck the "Active" checkbox and save. (Or delete it completely if you want).

You really should read that part of the manual if you get a chance, it's not really very long.

Loget 11-27-2009 08:57 PM

Hello,

It doesn't redirect to the custom page I put in the code, instead it shows a error.

Parse error: syntax error, unexpected $end in /home/xxxx/public_html/includes/functions.php(2458) : eval()'d code on line 5

kh99 11-27-2009 09:01 PM

When you pasted the code did you get the '}' character on the last line? When you quoted it a few posts ago it's missing the last line.

Lynne 11-27-2009 09:01 PM

Please post *exactly* what you put in your plugin.

Loget 11-27-2009 09:03 PM

if (!$vbulletin->userinfo['1'])
{
$vbulletin->url = 'http://google.com';
eval(print_standard_redirect('no permission')); }

Using google as a test.

kh99 11-27-2009 09:23 PM

That code works for me. Did you change it to userinfo['1'] for testing? That was the part that did it only for guests.

It's getting confusing and I don't know what to tell you, so I'll leave it to Lynne...

Loget 11-27-2009 09:51 PM

Hey,

No, I want guests to be redirected to the custom page.

Thanks

kh99 11-27-2009 10:55 PM

Well - probably Lynne had the same thought.

So - sorry, I didn't really understand your last post - is it working now?

Lynne 11-27-2009 11:21 PM

Try this:
PHP Code:

if (!isset($vbulletin->userinfo['userid']) OR $vbulletin->userinfo['userid'] == 0)
    {
    
$vbulletin->url 'http://google.com';
    eval(
print_standard_redirect('no permission')); 




All times are GMT. The time now is 02:16 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.01136 seconds
  • Memory Usage 1,759KB
  • 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
  • (1)bbcode_code_printable
  • (2)bbcode_php_printable
  • (5)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (20)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