vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   How to ban an external page? (https://vborg.vbsupport.ru/showthread.php?t=313573)

bymny 08-08-2014 11:41 PM

How to ban an external page?
 
I do not have much knowledge of php please help
my code:
Code:

<body bgcolor="#ffffff">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<center>
<?php
define("IN_vbulletin", 1);

require_once "../global.php";
if(!in_array($vbulletin->userinfo['usergroupid'], array(1,4,8))){
$a = "Welcome";
echo $a;
}
else{
if(!$vbulletin->userinfo['usergroupid']) error_no_permission();
$b = "No Permission!";
echo $b;
die();
}

//my php code

?>
</center>
</body>


final kaoss 08-09-2014 01:14 AM

Please describe in more details what your goal is.

bymny 08-09-2014 01:18 AM

extra php page to hide the guest :(

ozzy47 08-09-2014 01:25 AM

Try this:
PHP Code:

define("IN_vbulletin"1);

require_once 
"../global.php";

if (
in_array($vbulletin->userinfo['usergroupid'], array(1,4,8)))
{
    
print_no_permission();
}

if(!
in_array($vbulletin->userinfo['usergroupid'], array(1,4,8))){
$a "Welcome"
echo 
$a;



bymny 08-09-2014 02:21 AM

@ozzy47 unfortunately does not hide an extra page :confused:

ozzy47 08-09-2014 02:25 AM

Are you sure you are trying to view the page as a member of either usergroup, 1,4,8 ?

Also add this above the line define("IN_vbulletin", 1);

PHP Code:

global $vbulletin


bymny 08-09-2014 03:05 PM

yes, I'm sure, but it did not work :(

kh99 08-09-2014 03:39 PM

Try:
Code:

chdir('..');
require_once "global.php";


bymny 08-09-2014 04:07 PM

It was now, thanks

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

How do I get the user name that appears ?
Code:

Welcome $bbuserinfo[username]


All times are GMT. The time now is 10:17 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.01969 seconds
  • Memory Usage 1,727KB
  • 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
  • (3)bbcode_code_printable
  • (2)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (9)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