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

Reply
 
Thread Tools Display Modes
  #1  
Old 07-12-2009, 02:49 PM
vbronald vbronald is offline
 
Join Date: May 2009
Posts: 7
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Include php

- Plugin
I have made and activated a Plugin with the flowing information:
Hook Location: global_start
Title: btnSolvedPHP
Execution Order: 5
Plugin PHP Code:
ob_start();
include('customcode/btnSolved.php');
$includedphp = ob_get_contents();
ob_end_clean();

- Template
Then in the default template I've set the $includedphp at the right place:
So in 'postbit' right under '$template_hook[postbit_userinfo_right]' I add the line '$includedphp'

- File
In the file 'customcode/btnSolved.php' I put the folowing testing-code:
PHP Code:
<?php
echo 'qqq';
?>
- Result must be that in a post header right under the postcount there has to be a line 'qqq'.
But that is not the case fortunately.

When I change the plugin-code to:
$includedphp = 'qqq';
there is olso no line shown.

Plugin-system is enabled and the plugin is also enabled. File and folder rights are 666.
What can be the problem here?
Reply With Quote
  #2  
Old 07-12-2009, 03:01 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Maybe a stupid question, but, are you sure you are using the postbit template on your site and not the postbit_legacy template? And, are you changing the correct style templates?
Reply With Quote
  #3  
Old 07-12-2009, 03:25 PM
vbronald vbronald is offline
 
Join Date: May 2009
Posts: 7
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi Lynne

If I put some text direct into the 'postbit' right under '$template_hook[postbit_userinfo_right]' then the text is shown at the right place.

I think that awsers your'e reaction
Reply With Quote
  #4  
Old 07-12-2009, 03:28 PM
Andy Andy is offline
 
Join Date: Sep 2003
Location: San Francisco
Posts: 138
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by vbronald View Post

When I change the plugin-code to:
$includedphp = 'qqq';
there is also no line shown.
Try putting $includedphp on the last line of the ad_header_logo templete.

You should see 'qqq' under the header.
Reply With Quote
  #5  
Old 07-12-2009, 03:47 PM
vbronald vbronald is offline
 
Join Date: May 2009
Posts: 7
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

That's correct Andy.

ad_header_logo is empty in my case.
But yes when I put $includedphp into ad_header_logo then I see 'qqq' in the right of the header.
Do you know why 'qqq' is not being shown in the postbit and is being shown in the ad_header_logo?

I think it is remarkable that direct text is shown in postbit and a include not.

EDIT: I think it is remarkable that direct text is shown in postbit and a include not or only the content of a variable.
Reply With Quote
  #6  
Old 07-12-2009, 06:37 PM
Andy Andy is offline
 
Join Date: Sep 2003
Location: San Francisco
Posts: 138
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by vbronald View Post
Do you know why 'qqq' is not being shown in the postbit and is being shown in the ad_header_logo?
The problem might be the placement of the variable. Try placing the variable directly below this part of the template.

Code:
<if condition="$post['joindate']"><div>$vbphrase[join_date]: $post[joindate]</div></if>
Does 'qqq' show?
Reply With Quote
  #7  
Old 07-12-2009, 08:06 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

echo will spit out the text as soon as the code it run - which is in the global_start plugin. If you want to put the code somewhere specific, you need to save the result to a variable and then spit the variable out where you want it (no echo statements in this method).
Reply With Quote
  #8  
Old 07-13-2009, 06:53 PM
vbronald vbronald is offline
 
Join Date: May 2009
Posts: 7
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Andy:
I did what you asked and unfortunately there is no text shown anywhere on the page.
Man this is my fist time editing vbulletin and that makes thinking to a solution difficult.

Lynne:
Indeed. The global_start plugin runs the plugin.
The plugin runs the php-file and set the result in the variable $includedphp.

I put the variable in the right place with the Style Manager.
Now..
When I put the variable in the style-template ad_header_logo then the value of the variable is shown correctly>
But when I put the same variable in the style-template postbit then the value of the variable is not shown.
Remarkable is that when I put direct text in the style-template then it is shown correctly.
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 07:52 PM.


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.04058 seconds
  • Memory Usage 2,231KB
  • 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_code
  • (1)bbcode_php
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (8)post_thanks_box
  • (8)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (8)post_thanks_postbit_info
  • (8)postbit
  • (8)postbit_onlinestatus
  • (8)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
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete