Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #11  
Old 01-04-2010, 07:35 PM
Tom McConnell Tom McConnell is offline
 
Join Date: Aug 2008
Location: 3DMypage & Lipllies.com
Posts: 26
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Example above:
Code:
{vb:raw globalHeader}
This is put in the vb "footer" template:
Code:
{vb:raw myname_footer}
Plugin code above:
PHP Code:
ob_start();
  include(
"../header.php");
  
$globalHeader ob_get_contents();
ob_end_clean();
 
$preRegister['globalHeader'] = $globalHeader;
vB_Template::preRegister('header'$preRegister); 
Plugin code in my plugin named "myname_footer":
PHP Code:
ob_start();
  include(
"../header.php");
  
$myname_footer ob_get_contents();
ob_end_clean();
 
$preRegister['myname_footer'] = $myname_footer;
vB_Template::preRegister('footer'$preRegister); 
Notice last line template name change.
Change "myname_footer" to what you like.
Reply With Quote
  #12  
Old 01-04-2010, 08:02 PM
Red Spider's Avatar
Red Spider Red Spider is offline
 
Join Date: Jan 2006
Posts: 141
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

hi tom, i'm confused by your post - i'm trying to do a header include
Reply With Quote
  #13  
Old 03-01-2010, 07:11 PM
grimwolge grimwolge is offline
 
Join Date: Apr 2009
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

HTML Code:
ob_start();
  include("../header.php");
  $myname_footer = ob_get_contents();
ob_end_clean();
 
$preRegister['myname_footer'] = $myname_footer;
vB_Template::preRegister('footer', $preRegister);
What file, or where? does this get inserted into?

When I was running vBulletin 3.x it went into global.php

But now that i've upgraded to vBulletin 4, I don't know where that code goes.

Thanks

Nick
Reply With Quote
  #14  
Old 03-24-2010, 12:07 AM
manuel.ho manuel.ho is offline
 
Join Date: Jun 2008
Posts: 7
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

intente con todas las variaciones señaladas aquí. Alguien ha logrado hacer esto con exito?
Reply With Quote
  #15  
Old 03-28-2010, 12:30 AM
Jamie G Jamie G is offline
 
Join Date: May 2007
Posts: 63
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi guys.

Trying to get some php code into my forum to get it to display the frontpage slider.

I've done this.

PHP Code:
ob_start();
   include(
'ss.php');
   
$slider ob_get_contents();
ob_end_clean();

$preRegister['slider'] = $slider;
vB_Template::preRegister('forumhome'$preRegister); 
Still can't get it to display at all!

What am i doing wrong?
Reply With Quote
  #16  
Old 03-28-2010, 01:40 AM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Just noticing the obvious error, but the name of the template is not forumhome, it is FORUMHOME.
Reply With Quote
  #17  
Old 03-28-2010, 01:58 AM
Jamie G Jamie G is offline
 
Join Date: May 2007
Posts: 63
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Still doesn't work.... Ok,

So let's start from scratch.

I have this.

PHP Code:
?php
// START of "Frontpage Slideshow" settings
    
$nameOfSlideshowToDisplay "myslideshow";                     // Enter the name of your slideshow. Slideshows are in folders inside /fpss/slideshows/.
    
$URLofyoursite "http://www.******.com";                         // Enter your site's URL.
    
$AbsoluteServerPathofyoursite "/***/***/public_html";        // Enter the root path of your site on the server.
    
    // do not edit below this line
    
include_once($AbsoluteServerPathofyoursite."/fpss/mod_fpslideshow.php");
// END of "Frontpage Slideshow" settings
?> 
It tells me I should put this where I wish for it to call for the frontpage slideshow. I'd like it just below the navbar. But I can't put PHP in the template. So I've taken that above code and saved it as ss.php.

So I've gone into add plugin, and done the following.

PHP Code:
ob_start();
   include(
'ss.php');
   
$slider ob_get_contents();
ob_end_clean();

$preRegister['slider'] = $slider;
vB_Template::preRegister('FORUMHOME'$preRegister); 
I've then saved the plugin and gone into FORUMHOME and entered

PHP Code:
{vb:raw slider
I still have nothing appear. Hopefully with this full view of what I've done, you may be able to assist me in getting this working as It's getting annoying now!
Reply With Quote
  #18  
Old 05-05-2010, 08:33 PM
hydn hydn is offline
 
Join Date: Oct 2005
Posts: 180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This works perfectly! Thanks!

Quote:
Originally Posted by Tom McConnell View Post
Example above:
Code:
{vb:raw globalHeader}
This is put in the vb "footer" template:
Code:
{vb:raw myname_footer}
Plugin code above:
PHP Code:
ob_start();
  include(
"../header.php");
  
$globalHeader ob_get_contents();
ob_end_clean();
 
$preRegister['globalHeader'] = $globalHeader;
vB_Template::preRegister('header'$preRegister); 
Plugin code in my plugin named "myname_footer":
PHP Code:
ob_start();
  include(
"../header.php");
  
$myname_footer ob_get_contents();
ob_end_clean();
 
$preRegister['myname_footer'] = $myname_footer;
vB_Template::preRegister('footer'$preRegister); 
Notice last line template name change.
Change "myname_footer" to what you like.
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 06:31 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.10401 seconds
  • Memory Usage 2,269KB
  • 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
  • (4)bbcode_code
  • (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
  • (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_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