vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=251)
-   -   How can I define a vb:raw? (https://vborg.vbsupport.ru/showthread.php?t=252562)

Lynne 10-29-2010 02:21 AM

Yeah, the function is called render_navbar_template. You'll need that code. Put it into your file only rename it (render_navbar_template2 perhaps) and then change your other line:
PHP Code:

$navbar2 render_navbar_template2($navbits); 

Something like that.

Duncan 10-29-2010 07:55 AM

Eek. Still can't figure it out. Getting this error:

Parse error: syntax error, unexpected T_VARIABLE, expecting '( in "mywebsitestructure" on line 39. Here is the code:

Code:

<?php

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

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

define('THIS_SCRIPT', 'ncsu');
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('ncsu',
);

// 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/college/public_html');
require_once('./global.php');

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

$navbits = construct_navbits(array('' => 'NCSU'));
$navbar = render_navbar_template($navbits);

function render_navbar_template2
$navbar2 = render_navbar_template2($navbits); 


// ###### YOUR CUSTOM CODE GOES HERE #####
$pagetitle = 'NCSU';

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

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

?>

I guess I just don't understand how it knows to render the navbar2 template??

Lynne 10-29-2010 01:57 PM

You didn't create a new function. You need to copy the *whole* function and then change the name of it.

Duncan 10-29-2010 09:24 PM

Lynn, thanks for your help. I got it working, miraculously!

Lynne 10-29-2010 10:37 PM

Glad you did. :)

kurv 11-04-2010 07:26 PM

Lynne,

Thanks for the help!

Okay so I created a new template navbar2, then I need to place the rendering code INTO that new template?

:/

Sorry, again, I am not a coder :(

Lynne 11-04-2010 09:35 PM

You put all your html into the new template. The rendering code is going to go into a plugin - most likely some global_* hook location (or into the page if it is a custom page).


All times are GMT. The time now is 03:04 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.01035 seconds
  • Memory Usage 1,728KB
  • 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
  • (1)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
  • (7)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