vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3 Articles (https://vborg.vbsupport.ru/forumdisplay.php?f=187)
-   -   How to create your own vBulletin-powered page! (uses vB templates) (https://vborg.vbsupport.ru/showthread.php?t=62164)

Lynne 02-25-2009 07:06 PM

Quote:

Originally Posted by RrCoX22 (Post 1754520)
i don't understand why I would need to make another template? I though I was simple placing a file in the forums root?

Reread the article. You make a page for your site that uses a template. That template is what is responsible for making the page look like the rest of your vbulletin site (it will have the header and navbar and footer).

RrCoX22 02-26-2009 04:50 AM

Quote:

Originally Posted by ragtek (Post 1753611)
Here's a tutorial how to create a template:
http://www.vbulletin.com/docs/html/s...edit_templates

Quote:

Originally Posted by Lynne (Post 1754545)
Reread the article. You make a page for your site that uses a template. That template is what is responsible for making the page look like the rest of your vbulletin site (it will have the header and navbar and footer).

ok got it now... thanks guys, a lot easier than I thought it was... now I just need to learn HTML haha :D

never created a new template before... so it's just basically a code to communicate with the file?

atmo5ph3r 02-26-2009 06:21 PM

wow, thanks its work fine.

how to use bb codes ? :D like post in the forum ?

JamesAB 02-26-2009 10:07 PM

Quote:

Originally Posted by ragtek (Post 1661036)
Not if you make this:
PHP Code:

if (THIS_SCRIPT == 'yourscript)
{
    $vbulletin->options['
bbactive'] = true;
    $vbulletin->options['
banning'] = false;
    $servertoobusy = 0;
    $vbulletin->userinfo['
permissions']['forumpermissions'] |= $vbulletin->bf_ugp_forumpermissions['canview'];



I finally got around to testing this out. My custom page works fine when the forums are turned on, but I want it to also be displayed when the forums are turned off. I tried adding the code above, but no luck yet. I still get the standard 'Forums are closed' page.

Any ideas on how to make this work while the forums are turned off?

Thanks,
James

ragtek 02-27-2009 05:06 AM

you added it at hook global_start

Adem GEN? 02-27-2009 09:01 AM

1 Attachment(s)
Hello,

Please you help?

test.php
PHP Code:

<?php

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

// #################### DEFINE IMPORTANT CONSTANTS #######################
define('NO_REGISTER_GLOBALS'1);
define('THIS_SCRIPT''test'); // 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 ############################
require_once('./global.php');

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




$navbits = array();
$navbits[$parent] = 'Test Page';

$navbits construct_navbits($navbits);





             
$sorgulamysql_query("SELECT * FROM telefon_listesi ORDER BY telefon_id DESC");
            {
             while(
$tel_list_al=mysql_fetch_object($sorgula)) 

      
$satirlar '</tr><tr><td class="alt1">'.$tel_list_al->telefon_sahibi_adi.' '.$tel_list_al->telefon_sahibi_soyadi.'&nbsp;</td><td class="alt1">'.$tel_list_al->cep_tel_kodu.' '.$tel_list_al->cep_tel_numara.'&nbsp;</td><td class="alt1">'.$tel_list_al->ev_tel_kodu.' '.$tel_list_al->ev_tel_numara.'&nbsp;</td><td class="alt1">'.$tel_list_al->is_tel_kodu.' '.$tel_list_al->is_tel_numara.'&nbsp;</td><td class="alt1">'.$tel_list_al->aciklama.'&nbsp;</td><td class="alt1">'.$tel_list_al->kullanici_adi.'&nbsp;</td>';

            }




eval(
'$navbar = "' fetch_template('navbar') . '";');
eval(
'print_output("' fetch_template('test') . '");');

?>

test template
PHP Code:

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

$navbar

<table class="tborder" cellpadding="$stylevar[cellpadding]cellspacing="$stylevar[cellspacing]border="0" width="100%" align="center">
<
tr>
        <
td width="135" class="thead">Ad&#305; Soyadı</td>
        
<td width="120" class="thead">Cep Telefon</td>
        <
td width="120" class="thead">Ev Telefon</td>
        <
td width="120" class="thead">&#304;ş Telefon</td>
        
<td width="350" class="thead">A?&#305;klama</td>
        
<td width="129" class="thead">Ekleyen</td>
                

$satirlar


</table>

$footer
</body>
</
html

Problem:
No Listed

Results: 1
Existing records: 85

Why does not list?





Screen results
Attachment 95557


Thanks

Lynne 02-27-2009 03:05 PM

templates are case-sensitive. You need to call it either "TEST" or "test" in both $globaltemplates and the eval statement.

Adem GEN? 02-27-2009 04:23 PM

I do not understand,
Request,
you show a quote?

Lynne 02-27-2009 05:42 PM

Code:

// pre-cache templates used by all actions
$globaltemplates = array(
    'TEST',
);

......

eval('print_output("' . fetch_template('test') . '");');

?>

The two items in red must be exactly the same - either TEST or test.

Adem GEN? 02-27-2009 07:17 PM

Ok same fixed,

My problem, I can not list only the database data
data is only one line
I want to list all of the data

1. line
2. line
3. line
like




All times are GMT. The time now is 02:37 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.02785 seconds
  • Memory Usage 1,778KB
  • 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
  • (3)bbcode_php_printable
  • (4)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