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 05-02-2010 01:59 PM

Quote:

Originally Posted by FCS-Webmaster (Post 2030519)
How do I include Widgets to my own vBulletin page?

You'd have to write the code to include them. I do not have that code - you will have to go look through the files yourself.

aaronater 05-02-2010 02:21 PM

Hey :)

What if I wanted to just clone the Home page? Meaning the first tab on the navbar 'Home' when you click it it takes you to the Home page where you can add articles. If I want a new page, lets call it 'Zome' I can make the new navbar tab called 'Zome' but what about the content page to go with it?

Thanks

caciocode 05-02-2010 02:56 PM

The next part has become complicated for me. I even have no idea where to place those scripts.

aaronater 05-02-2010 04:45 PM

OK I worked it out, thanks.

firefoxx 05-09-2010 07:17 PM

Hi,

I have a flatcast radio. So I added the following code to the php file.

Code:

$HTML .='<div align="center"><IFRAME height="500">.......</IFRAME></div>'
So when I go to radio.php I see nothing.

Davidinh 05-10-2010 03:23 PM

1 Attachment(s)
How to view a item from database
i have create a test page that followed this tutorial
it work fine but i want to connect some item into the database

the test.php
Code:

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

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

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

// 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 ('/path/to/your/forums');
require_once('./global.php');

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

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

// ###### YOUR CUSTOM CODE GOES HERE #####
$pagetitle = 'My Page Title';

// ##### Initialize categories connection ####
$category = $db->query_read("SELECT * FROM " . TABLE_PREFIX . "testing order by name DESC");
                while ($categories = $db->fetch_array($film))
        // initialize each item { }
$db->free_result($category);

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

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

?>

the template is exactly as the first post

within data table i dunno how to put (variable of item) into the template page and they will show in the page

any help will be appriciated

also help create the xml file for this test if you guy needed
i create it on local machine therefore i don't have a link

Lynne 05-10-2010 07:43 PM

If your variable name is $categories, then register it for use in the template:
PHP Code:

$templater->register('categories'$categories); 

and then use it in the template like this:
HTML Code:

{vb:raw categories.whatever}

Davidinh 05-10-2010 09:10 PM

thanks Lynne

I tried it but nothing show
Code:

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

seem to be not array

Lynne 05-10-2010 09:31 PM

Well, you never did anything with $categories, so nothing is going to show up from it. You just have an empty while loop (and not even really that).

Davidinh 05-11-2010 12:12 AM

thanks for reply Lynne but i still dunno what is exactly your point and this is a point i'm not really got it
so, i'm going to put something in while loop like
Code:

// ##### Initialize categories connection ####
$category = $db->query_read("SELECT * FROM " . TABLE_PREFIX . "testing order by name DESC");
                while ($categories = $db->fetch_array($category))
        // initialize each item
        {
            $name = $categories['name'];
            $des = $categories['des'];
        }
$db->free_result($category);

and the code line in template
{vb:raw categories.name}
do i have register the varialbe ($name, $des) for template?

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

and i tried to register them under $categories :
Code:

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

$templater = vB_Template::create('TEST');
$templater->register_page_templates();
$templater->register('navbar', $navbar);
$templater->register('pagetitle', $pagetitle);
$templater->register('categories', $categories);
$templater->register('categories', $name);
$templater->register('categories', $des);
print_output($templater->render());

it shows the first letter of the first item in database only
the first item name: testing 1
it shows "t" only :confused:


All times are GMT. The time now is 05:38 AM.

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.04475 seconds
  • Memory Usage 1,752KB
  • 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
  • (5)bbcode_code_printable
  • (1)bbcode_html_printable
  • (1)bbcode_php_printable
  • (1)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