Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #11  
Old 01-30-2005, 01:15 PM
miz miz is offline
 
Join Date: Mar 2003
Posts: 416
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

your problem is not in code or in templates
the problem is - you using
echo / print/print_r

this make page blank.....
instead of print put the var you want to print in template
and it will work.
Reply With Quote
  #12  
Old 01-30-2005, 01:20 PM
jackti jackti is offline
 
Join Date: Jan 2005
Posts: 9
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

No, my header.php is on a whole different domain (same box, just different users)

i tried using chdir() before and after including global.php but it still won't work, something about too many SQL connections after a short time.. (it's looping or something probably).

I just have no clue what to do about the whole $_GET-problem and I'm running out of ideas, I appreciate the help a lot though, Thanks.

I guess I'll end up print_r'ing $_GET through ~5000 lines of php code to find out where it gets lost =) Nothing like a nice relaxing Sunday afternoon..

It works on the top of global.php, but not at the bottom. I guess thats a start.

edit: MIZ, I didn't quite understand what you meant by your post, could you explain it a little more in detail?
Reply With Quote
  #13  
Old 01-30-2005, 01:23 PM
miz miz is offline
 
Join Date: Mar 2003
Posts: 416
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

if you try to echo and you use templates
that its wont show anything
not the echo and not the templates
if you included global this will happen to you

but if you will try to do something like
PHP Code:
echo "something here";
die; 
// you can user exit(); also 
then its will work,
you dont belive me ? try it.

also 1 more thing

Quote:
$brand_new_var = $_GET['whatever'];
try to do it like that :

PHP Code:
$_GET['whatever'] = "bla";
$brand_new_var $_GET['whatever']; 
then $brand_new_var will have a value.
Reply With Quote
  #14  
Old 01-30-2005, 01:43 PM
jackti jackti is offline
 
Join Date: Jan 2005
Posts: 9
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks Miz, but the problem isn't that it doesn't have a value, because it does at the top of global.php even when you do it my way as you quoted above. It's supposed to be a variable from the URL string, not a constant from within the script, and by the bottom of global.php the value is gone no matter how you set it..

And I don't want to just print it out in a template inside vb somewhere, I need it for db queries and to set cookies and stuff within my own header.php, and it's blank by the time it gets there.
Reply With Quote
  #15  
Old 01-30-2005, 01:48 PM
miz miz is offline
 
Join Date: Mar 2003
Posts: 416
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

you cant print anything when you using global.php
no metter what you will do
so right you placed it in top of global.php , after the file runned its shout its down
cuse this is the way global works
no metter what you will try to do
unless you will use the die(); function
which stop the file runing.

if you need to get all info use global
and instead of echo use template functions and put all vars in template
this is the best solution you can get
Reply With Quote
  #16  
Old 01-30-2005, 01:57 PM
jackti jackti is offline
 
Join Date: Jan 2005
Posts: 9
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

MIZ, I'm really having problems understanding how to "use the template functions to put the variables in a template"? how exactly would I do that to be able to pass the arrays $_GET, $_POST etc. to my header.php?

And the die(); thing in global makes the forum.. well.. die, and the point is for people to be able to browse the forum
Reply With Quote
  #17  
Old 01-30-2005, 02:31 PM
miz miz is offline
 
Join Date: Mar 2003
Posts: 416
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

PHP Code:
$myvar "bla bla";

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

/* or if you want to get template in variable and then show it via formhome template for exsample use :
*/
eval('$newvar= "' fetch_template('mytemplate') . '";'); 
then place $newvar in forum home template of where ever you want it to be showen.

offcurse in template 'mytemplate' place $myvar inside the template
Reply With Quote
Reply


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:50 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.04237 seconds
  • Memory Usage 2,224KB
  • Queries Executed 11 (?)
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
  • (3)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
  • (7)post_thanks_box
  • (7)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (7)post_thanks_postbit_info
  • (7)postbit
  • (7)postbit_onlinestatus
  • (7)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_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