vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Custom script login with guest. (https://vborg.vbsupport.ru/showthread.php?t=265848)

nquang 06-27-2011 04:27 AM

Custom script login with guest.
 
Hi,

I have a forum and require login to view forum. But i have a custom page and i want guest can view it without login. I tried but i can't. Can you help me?

Thank you very much.

BirdOPrey5 06-27-2011 09:56 AM

Can you post the template code you are using with your custom page, and a link to it?

nquang 06-27-2011 10:15 AM

here is my code.

PHP Code:

<?php

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

// ##################### DEFINE IMPORTANT CONSTANTS #######################
// change the line below to the actual filename without ".php" extention.
// the reason for using actual filename without extention as a value of this constant is to ensure uniqueness of the value throughout every PHP file of any given vBulletin installation.

define('THIS_SCRIPT''addmoney-success'); 
define('firewall''off'); 

// #################### 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(
        
// change the lines below to the list of actual templates used in the script
        
'addmoney-success',
        
'test_mytesttemplate22',
);

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

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

// #################### HARD CODE JAVASCRIPT PATHS ########################
$headinclude str_replace('clientscript'$vbulletin->options['bburl'] . '/clientscript'$headinclude);

// ########################################################################
// ######################### START MAIN SCRIPT ############################
// ########################################################################
$money $_REQUEST["lr_amnt"];
$userid $_REQUEST["userid"];
$lrtime $_REQUEST["lr_timestamp"];
$navbits = array(); 
// change the line below to contain whatever you want to show in the navbar (title of your custom page)
$navbits[$parent] = 'AAA';

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

// change the line below to contain the name of the actual main output template used in your script
eval('print_output("' fetch_template('addmoney-success') . '");');

?>


BirdOPrey5 06-27-2011 10:39 AM

We need to see the code of the addmoney-success template. There's nothing in the code above that would stop guests from viewing the page.

nquang 06-27-2011 10:49 AM

here
PHP Code:

$stylevar[htmldoctype]
<
html dir="$stylevar[textdirection]lang="$stylevar[languagecode]">
<
head>
$headinclude
<title>$vboptions[bbtitle]</title>
</
head>
<
body>

$header
$navbar

<table class="tborder" cellpadding="$stylevar[cellpadding]cellspacing="$stylevar[cellspacing]border="0" width="100%" 

align="center">
<
tr>
<
td class="tcat">AAA</td>
</
tr>
<
tr>
<
td class="alt1"><center><b>Transaction Completed!</b>
<
br><i>You have just added <b><font color=yellow>$money$</font></bat AAA</i>
<
br><i>LR Time <span class="time">$lrtime</span></i>


</
center>
</
td>

</
tr>
</
table>

$footer
</body>
</
html


BirdOPrey5 06-27-2011 12:26 PM

From what I'm seeing it looks like this is a page someone would be directed to after making a transaction... So I don't see how someone could browse to this page without logging in- they need to be logged in to complete the transaction, no?


All times are GMT. The time now is 01:27 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.00965 seconds
  • Memory Usage 1,744KB
  • 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_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (6)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