vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   How to Insert Code Above <html> and <head> tags? (https://vborg.vbsupport.ru/showthread.php?t=151317)

BigDaveyDD 07-04-2007 02:42 AM

How to Insert Code Above <html> and <head> tags?
 
I'm trying to make it so I can call a few Wordpress php functions from within VBulletin, but in order to do so, they say I need to add the following code ABOVE the <html> and <head> tags. I don't seem to be able to do this in either the head template or headinclude template. Anyone know where I can?

HTML Code:

<?php include_once('/path/to/wordpress/wp-blog-header.php'); ?>
<html>
<head>
<title>Title Of Your Page</title>
<?php wp_head(); ?>
</head>
<body>
<?php get_poll(); ?>
</body>
</html>

I've been searching through here, vb.com, and wp.com, and can't seem to find how to do this. Thanks in advance for anyone here who can help.

Dismounted 07-04-2007 04:52 AM

You can't include raw PHP in templates.

http://www.vbulletin.com/docs/html/t..._externalfiles

BigDaveyDD 07-04-2007 12:17 PM

Thanks for the reply, and yes I'm familiar with plugins as I have a few working right now, but that still leaves me with the problem of posting the plugin code ABOVE the <html> and <head> tags.

Any idea how or where to do this?

Thanks again.

Dismounted 07-04-2007 12:43 PM

I just told you with the link, use the object buffer functions to fetch the data and place the variable in the template instead.

BigDaveyDD 07-04-2007 12:51 PM

That link just talks about how to use plugins to place external files and php includes, etc. in templates right? I know how to do that, but I need to know which template to put the plugin code in, so that the plugin code is ABOVE the <html> and <head> tags.

I've looked in the "head" and "headinclude" templates, but neither will allow me to view or post ABOVE the <html> and <head> tags.

See what I mean, is this possible?

Paul M 07-04-2007 08:27 PM

The html and head tags are contained in each pages root template (e.g. FORUMHOME, SHOWTHREAD). Normally the HTML Doctype stylevar is output first (above them).

BigDaveyDD 07-04-2007 08:33 PM

Perfect, that's exactly what I was looking for Paul. Now, it will be very interesting to try a few combinations of plugins/php to see if I can get it to do what I want.

Thanks!


All times are GMT. The time now is 01:24 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.00952 seconds
  • Memory Usage 1,720KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_html_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (7)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete