vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=251)
-   -   Need to add some code but do not know where (https://vborg.vbsupport.ru/showthread.php?t=262931)

Diablotic 05-01-2011 07:43 AM

Need to add some code but do not know where
 
I have received following instructions in order to add link exchange script but I do not know how to add it to vB:

1. Add this code to your script (in bootstrap or in each php file):
Code:

<?php include_once('prolink.php'); ?>
2. Add this code to your template (under menu or in footer)
Code:

<?php prolink_getLinks(); ?>
Point 2 is easy, I will add it to the footer or something but what do I do with number 1?

Disasterpiece 05-01-2011 01:57 PM

1) Easiest way would be to create a plugin with hook @ global start (or similar, not sure how it's exactly called) and insert the code there, so you could make sure that the inclusion is available throughout the whole script call.

2) This code won't work in template files, you can't use php code. A plugin which works with template-hooks seems to be the easiest way to realize this without modifying vb core files.

Diablotic 05-02-2011 08:29 AM

I was also given this instructions:

In includes/class_bootstrap.php after:
Code:

$templater = vB_Template::create("footer");
add
Code:

ob_start(); 
include("prolink.php"); 
prolink_getLinks(); 
$prolink = ob_get_clean(); 
$templater->register("prolink", $prolink);

And in footer add:
Code:

{vb:raw prolink}
It appears to work only on my main page but it does not work on any of the thread pages nor forum lists.

Does this code look OK?


All times are GMT. The time now is 11:44 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.00904 seconds
  • Memory Usage 1,710KB
  • 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
  • (5)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (3)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