vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Creating vb pages on 3.6.5 (https://vborg.vbsupport.ru/showthread.php?t=146120)

tidy_boy 04-30-2007 06:55 PM

Creating vb pages on 3.6.5
 
I am looking for the best tutorial on how to create custom vb pages for 3.5.6

Many Thanks

HMBeaty 04-30-2007 07:43 PM

<a href="https://vborg.vbsupport.ru/showthread.php?t=62164&highlight=create+another+vb ulletin+page" target="_blank">https://vborg.vbsupport.ru/showt...vbulletin+page</a>

tidy_boy 04-30-2007 08:00 PM

Thankyou. I have now created a page but i want to add some php

I want the page to only show if the member is logged in. If they are not logged in then it will say

You are not a member and interviews are for members only please log in or REGISTER for free.



I have this code

Code:

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

$navbar


<if condition="is_member_of($bbuserinfo, 1)">
you are not a member and interviews are for members only please log in or REGISTER for free.


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

<tr>
        <td class="tcat">Cally Gage Interview</td>
</tr>
<tr>
        <td class="alt1">Cally Gage Interview Cally Gage Interview Cally Gage Interview Cally Gage Interview Cally Gage Interview Cally Gage Interview Cally Gage Interview Cally Gage Interview Cally Gage Interview Cally Gage Interview Cally Gage Interview Cally Gage Interview Cally Gage Interview </td>
</tr>
</table>


</if>

$footer
</body>
</html>


HMBeaty 04-30-2007 08:19 PM

You wouldn't add that to the template, you would add that to the php file you create for your new page

But what you are talking about, you should add
PHP Code:

// Check Perms
if ($show['guest'])
{
 
print_no_permission();


to your php file

tidy_boy 04-30-2007 08:22 PM

Hi thanks for the reply I added your cade and when I logged out I could still see the info as if I was logged in.

HMBeaty 04-30-2007 08:26 PM

Did you add the code to the php file or the template? If you added it to the template, you can't do that as the templates don't recognize php

tidy_boy 04-30-2007 08:26 PM

I added it to the php file

HMBeaty 04-30-2007 08:27 PM

Can you post the contents of your file here?

tidy_boy 04-30-2007 08:28 PM

Code:

<?php

define('VBA_PORTAL', true);
define('VBA_PAGE', 'forumhome');



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

// #################### DEFINE IMPORTANT CONSTANTS #######################
define('NO_REGISTER_GLOBALS', 1);
define('THIS_SCRIPT', 'callygageInterview'); // 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(
    'site_callygageInterview',
);

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

);

// Check Perms
if ($show['guest'])
{
 print_no_permission();


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

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

$navbits = array();
$navbits[$parent] = 'Cally Gage Interview';

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

?>


HMBeaty 04-30-2007 08:29 PM

Ok, try this
PHP Code:

<?php

define
('VBA_PORTAL'true);
define('VBA_PAGE''forumhome');



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

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

// Check Perms
if ($show['guest'])
{
print_no_permission();
}

// ################### 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(
    
'site_callygageInterview',
);

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

);

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

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

$navbits = array();
$navbits[$parent] = 'Cally Gage Interview';

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

?>



All times are GMT. The time now is 03:21 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.01102 seconds
  • Memory Usage 1,747KB
  • 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
  • (2)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete