The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#11
|
||||
|
||||
Best thing to do is to study a mod from here that does something similar.
|
#12
|
|||
|
|||
Try this: create a plugin using hook location forumhome_start and code like this:
Code:
ob_start(); // insert code here without <?php or ?> $backlinks = ob_get_contents(); ob_end_clean(); vB_Template::preRegister('FORUMHOME', array('backlinks' => $backlinks)); Next, edit the FORUMHOME template and insert {vb:raw backlinks} where you want it to appear. Edit: if you want step by step instructions for creating a plugin, see the vbulletin manual here: http://www.vbulletin.com/en/manual/ . First select your vb version from the dropdown menu, then search for "plugin" and select "Adding or Editing a Plugin" from the results. It's pretty easy, you just have to paste the code I posted, then paste yours in at the comment and remove the <?php and ?>, then fill in the other form fields as needed (see the manual page for that). If you don't know what to put for something, you can probably leave the default. |
Благодарность от: | ||
Black Snow |
#13
|
|||
|
|||
Quote:
|
#14
|
|||
|
|||
Yeah, sorry, it's just that the manual pages show in a frame so the browser url just goes to the manual home page. But I think this will work: http://www.vbulletin.com/docs/html/main/add_plugin
|
#15
|
||||
|
||||
As most of other users said, you can't add PHP code to the template. But you can easily add templates in a PHP file. The results will be exactly what you want.
1.- Create 2 templates. One for header and one for footer: a] For Header (is just as example): HTML Code:
<template name="php_header" templatetype="template" date="" username="" version=""> <![CDATA[ {vb:stylevar htmldoctype} <html xmlns="http://www.w3.org/1999/xhtml" dir="{vb:stylevar textdirection}" lang="{vb:stylevar languagecode}" id="vbulletin_html"> <head> <title>Your Title</title> {vb:raw headinclude} <vb:if condition="$vboptions['storecssasfile']"> {vb:cssfile forumhome.css, options.css, vbcms.css, widgets.css, sidebar.css, forumhome-rollup.css, usercp.css, additional.css} <vb:else /> {vb:cssfile forumhome.css, options.css, vbcms.css, widgets.css, sidebar.css, forumhome-rollup.css, usercp.css, additional.css} </vb:if> <script type="text/javascript"> <!-- document.write('<script type="text/javascript" src="' + yuipath + '/animation/animation-min.js?v={vb:raw vboptions.simpleversion}"></script>'); var sidebar_align = 'right'; var content_container_margin = parseInt('{vb:math {vb:stylevar forum_sidebar_width}+{vb:math {vb:stylevar padding}*2}}'); var sidebar_width = parseInt('{vb:stylevar forum_sidebar_width}'); //--> </script> <script type="text/javascript" src="{vb:raw vboptions.bburl}/clientscript/vbulletin-sidebar.js?v={vb:raw vboptions.simpleversion}"></script> </head> <body> {vb:raw header} {vb:raw navbar} <div class="blockbody"> ]]></template> HTML Code:
<template name="php_footer" templatetype="template" date="" username="" version=""> <![CDATA[ </div> {vb:raw footer} </body> </html> ]]></template> Code:
// Header Block $templater = vB_Template::create('php_header'); $templater->register_page_templates(); $navbits = construct_navbits(array("torget.php?" . $vbulletin->session->vars['sessionurl'] . ""=> "My Page")); $navbar = render_navbar_template($navbits); $templater->register('navbar', $navbar); $header_block = $templater->render(); echo $header_block; Code:
// Footer Block $templater = vB_Template::create(php_footer'); $templater->register_page_templates(); $footer_block = $templater->render(); echo $footer_block; Nick |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|