Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.7 > vBulletin 3.7 Add-ons

Reply
 
Thread Tools
Google Analytics Code Plugin Details »»
Google Analytics Code Plugin
Version: 1.00, by DomainArchitect DomainArchitect is offline
Developer Last Online: May 2008 Show Printable Version Email this Page

Category: Administrative and Maintenance Tools - Version: 3.7.x Rating:
Released: 05-01-2008 Last Update: Never Installs: 12
Uses Plugins Template Edits
Re-useable Code  
No support by the author.

This is my first plugin mod so its beta.

Purpose:
The purpose of this is to make it easy to add or remove your Google Analytics code or similar footer code in your vBulletin 'footer' template. This is helpful when you need to revert your footer template and want to add back your google analytics or similar footer code with ease, or quickly update the extra footer code without having to enter your admin control panel ('ACP').

Steps:
I broke the steps down into 3 easy parts.

Part 1
* - Create a folder titled custom_plugins in your forum folder;
* - In this folder, create a file titled index.html and add some text, like 'Blank' or a period '.' for example;
* - Create a file titled footercode.html and paste your Google Analytics code in it;
* - Login to your vBulletin ACP

Part 2
* - Go into your 'Style Manager' under the 'Styles & Templates' menu;
* - Click the 'Go' button next to your top-level style
* - Scroll down and double-click on the 'footer' template;
* - Scroll to the bottom of the selected 'footer' template and enter '$footercode' as the last piece of code;
* - Repeat Part 2 for all styles whose 'footer' templates have been modified or whose 'footer' template is not inherited by the top-level 'footer' template modified above(most people will only have one top-level 'footer' template inherited by all subsidiary styles);

Part 3
* - Create a new plugin by looking for 'Add New Plugin' under the 'Plugins & Products' menu;
* - Select 'vBulletin' for the Product;
* - Select 'global_start' for the Hook Location;
* - Enter a title. I used 'Footer Code';
* - Insert the following code in the PHP field:

PHP Code:
$footercode implode(''file('/enter/the/path/to/your/file.html')); 
***Be sure to update the above code with the actual path to the footercode.html file you created above***


Feel free to comment or critique. Support will be provided on vBulletin Domain Architects

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #12  
Old 05-15-2008, 04:08 PM
siliconfinance siliconfinance is offline
 
Join Date: Mar 2007
Posts: 125
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by KURTZ View Post
i don't understand one thing, the $footercode must be placed after this (in the footer template)?

PHP Code:
<script type="text/javascript">
<!--
    
// Main vBulletin Javascript Initialization
    
vBulletin_init();
//-->
</script
also i put this code in the php field:

PHP Code:
$footercode implode(''file('/board/custom_plugins/footercode.html')); 
but it doesn't run ...
The only thing that goes in the footer template is:

PHP Code:
$footercode 
The php field is located on the add new plugin page.

Does that make sense?
Reply With Quote
  #13  
Old 01-02-2009, 07:24 PM
River_rush River_rush is offline
 
Join Date: Mar 2004
Location: Basingstoke
Posts: 82
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

thanks installed and working
Reply With Quote
  #14  
Old 01-02-2009, 07:33 PM
steven s's Avatar
steven s steven s is offline
 
Join Date: Aug 2004
Location: Greenville, SC
Posts: 572
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Doesn't the ad_footer templates accomplish this except not requiring an external file?
And you still need to edit the footer template after reverting.
Reply With Quote
  #15  
Old 01-02-2009, 08:08 PM
Dean C's Avatar
Dean C Dean C is offline
 
Join Date: Jan 2002
Location: England
Posts: 9,071
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by 1996 328ti View Post
Doesn't the ad_footer templates accomplish this except not requiring an external file?
And you still need to edit the footer template after reverting.
Yep, but at the time of this mod, that hook wasn't available
Reply With Quote
  #16  
Old 01-02-2009, 08:18 PM
steven s's Avatar
steven s steven s is offline
 
Join Date: Aug 2004
Location: Greenville, SC
Posts: 572
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Dean C View Post
Yep, but at the time of this mod, that hook wasn't available
Thanks. But it was included in 3.7, wasn't it?
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 12:20 AM.


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.09836 seconds
  • Memory Usage 2,260KB
  • Queries Executed 22 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (4)bbcode_php
  • (3)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (6)post_thanks_box
  • (6)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (6)post_thanks_postbit_info
  • (5)postbit
  • (6)postbit_onlinestatus
  • (6)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete