vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.6 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=194)
-   -   Major Additions - vB Ad Management 4 (https://vborg.vbsupport.ru/showthread.php?t=131150)

RedTyger 03-26-2007 03:28 PM

How to add your own custom adcode blocks in 3 minutes

Download the zip file and open the named php files using a plain text editor (something like MSWord which uses formatting will break the code). Follow the simple instructions below then save, upload and overwrite your existing files. Your new custom adcode block will be at the bottom of the header/footer section of your vB Ad Management settings.

You can add as many custom blocks as you like as long as you give each one a different name. They'll work on any page, obey all permissions and work with all features including Ad-Sharing.

To name a custom adcode block, just find/replace every instance of the word "custom" in the code below with the new name of your choice.


IN FILE vb_ad_management_310.xml, FIND:
PHP Code:

<template name="footer_advertisement" templatetype="template"><![CDATA[
        <
div align="center">
            
$footer_adcode
        
</div>
]]></
template


ADD BELOW:

PHP Code:

<template name="custom_advertisement" templatetype="template"><![CDATA[
        <
div>
            
$custom_adcode
        
</div>
]]></
template




IN FILE includes/vb_ad_management/cache_templates.php, FIND:
PHP Code:

if ($vbulletin->options['adintegrate_footer_onoff'])
{
    
$adtemplates[] = 'footer_advertisement';


ADD ABOVE:
PHP Code:


if ($vbulletin->options['adintegrate_custom_onoff'])
{
    
$adtemplates[] = 'custom_advertisement';





IN FILE includes/vb_ad_management/global_start.php,FIND:
PHP Code:

if ($vbulletin->options['adintegrate_footer_onoff']) 

ADD ABOVE:
PHP Code:

if ($vbulletin->options['adintegrate_custom_onoff'])
{    
    if (
$vbulletin->options['adintegrate_custom_adcode'])
    {
        
$custom_split explode("$adshared"$vbulletin->options['adintegrate_custom_adcode']);
        
$custom_adcode $custom_split[0];
        if (
$custom_split[1])
        {
            
$custom_adcode $custom_split[0] . $GLOBALS['adcode_shared'] . $custom_split[1];
        }
        eval(
'$custom_advertisement = "' fetch_template('' custom_advertisement '') . '";');
    }
    else if (
$vbulletin->options['adintegrate_custom_adcode_rand'])
    {
        
$custom_adcode explode("$addelimiter"$vbulletin->options['adintegrate_custom_adcode_rand']);
        
$custom_rand array_rand($custom_adcode);
        
$custom_adcode $custom_adcode["$custom_rand"];
        
$custom_split explode("$adshared"$custom_adcode);
        
$custom_adcode $custom_split[0];
        if (
$custom_split[1])
        {
            
$custom_adcode $custom_split[0] . $GLOBALS['adcode_shared'] . $custom_split[1];
        }
        eval(
'$custom_advertisement = "' fetch_template('' custom_advertisement '') . '";');
    }    





IN FILE includes/vb_ad_management/global_start.php,FIND:
PHP Code:

<setting varname="adintegrate_footer_adcode_rand" displayorder="45">
    <
datatype>free</datatype>
    <
optioncode>textarea</optioncode>
</
setting


ADD BELOW:

PHP Code:

<setting varname="adintegrate_custom_onoff" displayorder="991">
    <
datatype>boolean</datatype>
    <
optioncode>yesno</optioncode>
    <
defaultvalue>0</defaultvalue>
</
setting>
<
setting varname="adintegrate_custom_adcode" displayorder="992">
    <
datatype>free</datatype>
    <
optioncode>textarea</optioncode>
</
setting>
<
setting varname="adintegrate_custom_adcode_rand" displayorder="993">
    <
datatype>free</datatype>
    <
optioncode>textarea</optioncode>
</
setting


DementedMindz 03-27-2007 07:44 PM

how do we update? any instructions on that?

RedTyger 03-27-2007 07:47 PM

It was in the update, titled "Instructions"

Quote:

INSTRUCTIONS:
As this is no longer purely plugin-based to speed things up, there are now files to upload. It's very easy, just find your forum's includes directory and load the vb_ad_management folder to there. Do NOT include the includes folder in the zip file, that is just included to demonstrate where it goes on your server. The file's final location should be forum index/includes/vb_ad_management/vb ad management files/. Then upload the plugin, overwriting the one you already have installed.

DementedMindz 03-27-2007 07:48 PM

opps :o now I see it. Thank you again.

DementedMindz 03-27-2007 07:53 PM

im getting uncached templates postbit_advertisement which is the only one I use for now so I cant tell if the others are showing not cached.

RedTyger 03-27-2007 08:04 PM

Did you upload all the vb_ad_management files?

DementedMindz 03-27-2007 08:07 PM

yes I did im using vBMicroStats and right at the bottom it shows that template as uncached.

RedTyger 03-27-2007 08:19 PM

If it's installed correctly there should be no problem, I'm using vBulletin's built-in function that displays uncached templates and there are none. I suppose it's possible that modification runs before the templates for this modification are cached? I don't know.

Add this line to your includes/config.php file along with the rest of the settings then save the file and overwrite the existing config.php file on your setting.

Code:

$config['Misc']['debug'] = true;
Does the default vBulletin information say that templates are uncached? It lists templates in the footer.

DementedMindz 03-27-2007 08:25 PM

strange it dont say it there but it does on his... Do you have the older version of this until he or you can fix it?

RedTyger 03-27-2007 08:28 PM

Well as far as I can see, the problem is with his modification not mine. So there's no reason to use an older version.


All times are GMT. The time now is 03:21 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.03637 seconds
  • Memory Usage 1,780KB
  • 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_code_printable
  • (8)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (5)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete