Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions

Reply
 
Thread Tools Display Modes
  #1  
Old 01-11-2009, 10:33 PM
gtrts gtrts is offline
 
Join Date: Jan 2009
Posts: 16
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Getting trouble in making vbb powered custom page

I did all the things follow to this thread:https://vborg.vbsupport.ru/showthread.php?t=62164

and i got a blank page,here is the code in 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); 
eval(
'$navbar = "' fetch_template('navbar') . '";'); 
eval(
'print_output("' fetch_template('TEST') . '");'); 
?>
here is the code in template "TEST"
HTML 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 class="tcat">Title</td>
</tr>
<tr>
	<td class="alt1">Text</td>
</tr>
</table>

$footer
</body>
</html>
the "TEST" template works fine in index.php,when I put
PHP Code:
eval('print_output("' fetch_template('TEST') . '");'); 
in it.It just wont work in test.php.

how can I solve this problem?

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

ps: vbb version is 3.8.0
Reply With Quote
  #2  
Old 01-11-2009, 10:51 PM
Bellardia Bellardia is offline
 
Join Date: Jul 2007
Location: Hamilton, Ontario
Posts: 378
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Are you sure if the page has access to global.php?
Reply With Quote
  #3  
Old 01-11-2009, 10:59 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Is the page in the same directory as all the other vbulletin forum pages?
Reply With Quote
  #4  
Old 01-11-2009, 11:56 PM
gtrts gtrts is offline
 
Join Date: Jan 2009
Posts: 16
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

yes,it's in the same path as index.php is.
I tried to rename test.php to index.php or other existing vbb files, it works. It seems vbb is preventing me to use custom file, is there a setting doing such stuff?(prevent using custom file)
Reply With Quote
  #5  
Old 01-12-2009, 03:29 AM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You shouldn't need this line in the file (try removing it):
PHP Code:
define('NO_REGISTER_GLOBALS'1); 
Reply With Quote
  #6  
Old 01-12-2009, 04:18 AM
gtrts gtrts is offline
 
Join Date: Jan 2009
Posts: 16
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Dismounted View Post
You shouldn't need this line in the file (try removing it):
PHP Code:
define('NO_REGISTER_GLOBALS'1); 
I removed it, but still got a blank page

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

I changed the last part of code FROM
PHP Code:
$navbits construct_navbits($navbits);  
eval(
'$navbar = "' fetch_template('navbar') . '";');  
eval(
'print_output("' fetch_template('TEST') . '");'); 
TO

PHP Code:
$navbits construct_navbits($navbits); 
eval(
'$navbar = "' fetch_template('navbar') . '";'); 
eval(
'$output = "' fetch_template('TEST') . '";'); 
echo 
$output;
//eval('print_output("' . fetch_template('TEST') . '");'); 
then the result shows exactly as what it should be. Anyone can tell me what is going on?
Reply With Quote
  #7  
Old 01-12-2009, 05:27 AM
vbplusme vbplusme is offline
 
Join Date: Sep 2008
Location: CyberSpace
Posts: 332
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Seems I read somewhere that this code needs to be in all pages now?

PHP Code:
define('CSRF_PROTECTION'true); 
Reply With Quote
  #8  
Old 01-12-2009, 07:59 AM
gtrts gtrts is offline
 
Join Date: Jan 2009
Posts: 16
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks bro. But, it doesn't help. I added that code, and still, a blank page.It seems I can't use print_output?

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

ok I tried to dig in the print_output function, and found the script stopped at fetch_gzipped_text()'s
PHP Code:
header('Content-Encoding: ' $encoding); 
,after this code the browser got unrecognized string instead of html codes,that's why IE6 returned a blank page and firefox returned an error message says the page is corrupted.

so anyone please help me

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

btw $encoding is "gzip"

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

when I save test.php in utf-8 without BOM, all trouble gone... anyone can tell me whta is BOM ?
Reply With Quote
  #9  
Old 01-12-2009, 10:34 AM
Digital Jedi's Avatar
Digital Jedi Digital Jedi is offline
 
Join Date: Oct 2006
Location: PopCulturalReferenceLand
Posts: 5,171
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Are you sure you're visiting the page in the style you created the template in? That's usually why you'll get a blank page.
Reply With Quote
  #10  
Old 01-15-2009, 06:40 PM
leftie leftie is offline
 
Join Date: Nov 2004
Posts: 64
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'm having this problem too, so i need a solution as well.
EDIT. I'm a fool.
I ftp'd the php file before i saved what i copied and pasted. All is well now.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 08:03 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.02409 seconds
  • Memory Usage 2,276KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_html
  • (8)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete