vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Programming Articles (https://vborg.vbsupport.ru/forumdisplay.php?f=188)
-   -   Create easy way to manage Ads across multiple pages. (https://vborg.vbsupport.ru/showthread.php?t=106761)

LincolnForums 01-30-2006 10:00 PM

Create easy way to manage Ads across multiple pages.
 
If this has already been discussed then i didnt see it :nervous:

Start by creating a template named "ads"
AdminCP - Style Manager - Add Template

Then add your Advertising code, such as google or yahoo. Should look similar to this(This is a made up one, dont use it)
HTML Code:

<script type="text/javascript"><!--
google_ad_client = "pub-2111864921856687";
google_ad_width = 728;
google_ad_height = 90;
google_ad_format = "728x90_as";
google_ad_type = "text";
google_ad_channel ="";
//-->
</script>
<script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js">

</script>

Next create a plugin.(wooo hoo big time stuff now :rolleyes: )
AdminCP - Plugin System - Add New Plugin
Give it any name you please, I Used Easy Google Ads
Location: global_start
Active: Yes (unless you dont want it to be, but then why are you reading this far?)
Plugin Code:
PHP Code:

 eval('$ads= "' fetch_template('ads') . '";'); 

Now you're ready to add $ads any where you wish your ads(or anything you put in the ads template) to appear.

I simply added mine in the navbar code, at the very bottom of it, for them to appear on everypage the navbar does :D

this is much easier then adding the ads to every page, then having to change it around, or different colors. Now you just update the ads template for your skin and you're done.

punchbowl 02-01-2007 09:52 AM

cool - I was using a slightly clunkier way of doing this - cheers


All times are GMT. The time now is 02:15 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.03316 seconds
  • Memory Usage 1,709KB
  • 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)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (2)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