vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4 Articles (https://vborg.vbsupport.ru/forumdisplay.php?f=242)
-   -   [HOW TO - vB4] Create your own vBulletin page (https://vborg.vbsupport.ru/showthread.php?t=228112)

Lynne 10-07-2010 08:40 PM

A custom site? You mean in the template for this page? You can use {vb:raw bbuserinfo.username} in a template.

ceho 10-08-2010 07:30 AM

Yes, this was exactly it. Very easy ;-). Thanks a lot!

Duncan 10-18-2010 04:31 AM

My forum is forum.com. However, I want to make a page at forum.com/pages/default.php

How do I go about doing this? I tried a couple of changes but no success.

Wilfred1 10-18-2010 04:46 AM

Quote:

Originally Posted by Duncan (Post 2111186)
My forum is forum.com. However, I want to make a page at forum.com/pages/default.php

How do I go about doing this? I tried a couple of changes but no success.

Duncan
All my pages are in a folder called pages so here is one of mine as an example. It is a page called "About This Site" and what you need to be aware of is the line that starts with "chdir" as this is where you will need to insert your site details so it changes the directory to where your forums are.
Code:

<?php

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

// #################### DEFINE IMPORTANT CONSTANTS #######################

define('THIS_SCRIPT', 'about');
define('CSRF_PROTECTION', true); 
// 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('About',
);

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

// ######################### REQUIRE BACK-END ############################
// if your page is outside of your normal vb forums directory, you should change directories by uncommenting the next line
chdir ('/home/MYSITE/public_html');
require_once('./global.php');

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

$navbits = construct_navbits(array('' => 'About This Site'));
$navbar = render_navbar_template($navbits);

// ###### YOUR CUSTOM CODE GOES HERE #####
$pagetitle = 'About This Site';

// ###### NOW YOUR TEMPLATE IS BEING RENDERED ######

$templater = vB_Template::create('About');
$templater->register_page_templates();
$templater->register('navbar', $navbar);
$templater->register('pagetitle', $pagetitle);
print_output($templater->render());

?>

Hope it helps

Duncan 10-18-2010 04:52 AM

Thank you so much!! I will work on this now. I really appreciate it.

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

My forums are located at forums.com however, I want the pages to be in forums.com/pages/ - however, when I change the location to home/ACCOUNT/public_html/pages it doesn't work.

I get this error:

Fatal error: require_once() [function.require]: Failed opening required './global.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/ACCOUNT/public_html/PAGES/mypage.php

When I install on the forum root, however, without any modifications it works like a charm. How can I get it to work in this directory?

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

Nevermind, I got it to work. Thank you!

ubcforums 10-24-2010 04:55 PM

Hi, can I use $_GET from the test.php ?

cellarius 10-24-2010 07:10 PM

Of course. You can use any php code. But you should use the vB input cleaning mechanisms: https://vborg.vbsupport.ru/showthread.php?t=119372

Dusty Miller 10-29-2010 12:54 PM

I've got a custom page that shows a search form, it then posts the result back to the same page. This works well if nobody is logged in.

If logged in you get the error:
Quote:

Your submission could not be processed because a security token was missing
I've followed and used this template anyone got an ideas what I'm doing wrong?

Lynne 10-29-2010 01:38 PM

You forgot to put the securitytoken into the form. Do a Search in Templates to find it used in other forms and use that code.

Dusty Miller 10-29-2010 05:48 PM

I've coded the form within the php page, not the template. Should the form be coded within the template page instead?


All times are GMT. The time now is 08:08 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.04431 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
  • (1)bbcode_code_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (3)pagenav_pagelinkrel
  • (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