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 05-20-2003, 06:38 PM
Boeman Boeman is offline
 
Join Date: Apr 2003
Posts: 32
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Today at 08:31 PM filburt1 said this in Post #10
You can't without rewriting a significant chunk of gettemplate() to:

1. See if a flag is set
2. If not, eval phpinclude and set it
3. Continue with normal gettemplate functions

...also removing it from (IIRC) global.php.

:disappointed:
Reply With Quote
  #12  
Old 05-20-2003, 06:59 PM
Logician's Avatar
Logician Logician is offline
 
Join Date: Nov 2001
Location: inside vb code
Posts: 4,449
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Today at 10:28 PM Boeman said this in Post #11
So in basic terms, what do I need to do to get my phpinclude functions to evaluate along with the formbit_level_1 template? I looked around various hacks listed here but could not find one that allows this.
Why don't you post your code that fails (together with your template modification) so that we can all see which variables you are trying to parse and where exactly?
Reply With Quote
  #13  
Old 05-20-2003, 08:46 PM
Boeman Boeman is offline
 
Join Date: Apr 2003
Posts: 32
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Today at 08:59 PM Logician said this in Post #12
Why don't you post your code that fails (together with your template modification) so that we can all see which variables you are trying to parse and where exactly?
To make this as simple as possible, here are the contents of my external php file, test.php:

<?
echo "TEST TEST TEST<br><br>";
?>

Here is what I added to the PHPInclude Template:

ob_start();
require("../test.php");
$testing = ob_get_contents();
ob_end_clean();

At the forumhome_forumbit_level1_nopost template, I simply added this at the top:

$testing

All this does is echo out TEST TEST TEST above the categories. The problem is that the $test variable does not display in any of the formbit templates when viewed on a web browser. According to Filburt, I have to do some extensive modification in one of the php files included with VBulletin just to get this one simple feature working.
Reply With Quote
  #14  
Old 05-20-2003, 09:28 PM
filburt1 filburt1 is offline
 
Join Date: Feb 2002
Location: Maryland, US
Posts: 6,144
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I thought we were talking about a variable scope problem here...
Reply With Quote
  #15  
Old 05-20-2003, 09:32 PM
Boeman Boeman is offline
 
Join Date: Apr 2003
Posts: 32
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Today at 11:28 PM filburt1 said this in Post #14
I thought we were talking about a variable scope problem here...

I apologize if I somehow misrepresented my problem. Did my above example help to clear things up? Let me know...
Reply With Quote
  #16  
Old 05-20-2003, 09:39 PM
Logician's Avatar
Logician Logician is offline
 
Join Date: Nov 2001
Location: inside vb code
Posts: 4,449
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Your problem is related to your code in phpinclude. If you add $testing = "Test 1 Test 2 Test 3"; to phpinclude template then use $testing in the forumhome_forumbit_level*.* templates you'll be fine. So it is not phpinclude variable not showing in forumhome_forumbit_level* templates, it is your variable not getting a approprite value in the phpinclude.
Reply With Quote
  #17  
Old 05-21-2003, 12:23 AM
Boeman Boeman is offline
 
Join Date: Apr 2003
Posts: 32
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Yesterday at 11:39 PM Logician said this in Post #16
Your problem is related to your code in phpinclude. If you add $testing = "Test 1 Test 2 Test 3"; to phpinclude template then use $testing in the forumhome_forumbit_level*.* templates you'll be fine. So it is not phpinclude variable not showing in forumhome_forumbit_level* templates, it is your variable not getting a approprite value in the phpinclude.

I'm trying out your above example but having a little trouble. Here is what I put into the phpinclude template:

ob_start();
$testing = "TESTING 1 2 3";
ob_end_clean();

With my limited knowledge of php, I'm sure it is just syntax issues or some other problem that is right under my nose.

Thanks for your help.
Reply With Quote
  #18  
Old 05-21-2003, 05:14 AM
Logician's Avatar
Logician Logician is offline
 
Join Date: Nov 2001
Location: inside vb code
Posts: 4,449
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Today at 04:23 AM Boeman said this in Post #20
I'm trying out your above example but having a little trouble. Here is what I put into the phpinclude template:

ob_start();
$testing = "TESTING 1 2 3";
ob_end_clean();

With my limited knowledge of php, I'm sure it is just syntax issues or some other problem that is right under my nose.

Thanks for your help.
You don't need ob_start(); ob_end_clean(); part. Simply putting this line:

PHP Code:
$testing "TESTING 1 2 3"
will do the trick.

If you can't get value of $testing variable displayed, this would be because you put it in the wrong template. Please notice that there are 4 of forumhome_forumbit_level*.* templates and not all of them are parsed in your forum home. Which one or ones are used depends on different conditions so try to to put the variable in each or one by one to understand how and when they are displayed.

Also if you want a advise, considering the fact that you use this variable in only forumhome_forumbit_level*.* templates, you don't need to put it in phpinclude template. Just put your variable in index.php right after require('./global.php'); I personally do not fancy phpinclude solutions much as they waste unnecessary server power/memory.
Reply With Quote
  #19  
Old 05-21-2003, 10:35 AM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

forumhome_forumbit_level*.*

Pal, these templates are just called by function makeforumbits in index.php, so as i stated in my first post, he has to add
global $testing;
to that function, but i think nobody listens to me....
Reply With Quote
  #20  
Old 05-21-2003, 11:47 AM
Logician's Avatar
Logician Logician is offline
 
Join Date: Nov 2001
Location: inside vb code
Posts: 4,449
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
but i think nobody listens to me....
ok before Xenon gets angry let's listen to him: :glasses: So edit index.php, find:

PHP Code:
global $bbforumview
After that add:
PHP Code:
global $testing
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 05:15 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.04499 seconds
  • Memory Usage 2,268KB
  • 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
  • (3)bbcode_php
  • (7)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
  • (2)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