vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Whats the require_once file again for all vb pages? (https://vborg.vbsupport.ru/showthread.php?t=251439)

need2fart 09-30-2010 11:04 PM

Whats the require_once file again for all vb pages?
 
Was it global.php?

I'm trying to add Google analytics to my site and I don't remember the file that is used in all vB pages.

Was is global.php?

I want to do
PHP Code:

require_once('googleAnalytics.php'); 

Thanks.

--------------- Added [DATE]1285893243[/DATE] at [TIME]1285893243[/TIME] ---------------

Okay it is global.php. However when I do include my file,
PHP Code:

<script type="text/javascript">

  var 
_gaq _gaq || [];
  
_gaq.push(['_setAccount''UA-18840951-1']);
  
_gaq.push(['_trackPageview']);

  (function() {
    var 
ga document.createElement('script'); ga.type 'text/javascript'ga.async true;
    
ga.src = ('https:' == document.location.protocol 'https://ssl' 'http://www') + '.google-analytics.com/ga.js';
    var 
document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(gas);
  })();

</
script

It keeps saying my headers were already sent in VB. What do I do to make it work?

Lynne 09-30-2010 11:39 PM

The only google analytics code I know of is some javascript that looks like what you posted that you just need to put into your footer template. Why are you adding it to your global.php page?

need2fart 09-30-2010 11:55 PM

Quote:

Originally Posted by Lynne (Post 2105318)
The only google analytics code I know of is some javascript that looks like what you posted that you just need to put into your footer template. Why are you adding it to your global.php page?

Good point. I was trying to include it in global.php because that's the page that is included in the index. So all visitors would see it.

I'll add it too the footer template, I appreciate it Lynne:) I wish I thought of that, blonde moment.

--------------- Added [DATE]1285894885[/DATE] at [TIME]1285894885[/TIME] ---------------

Thanks Lynne again, you solved my problem. :)


All times are GMT. The time now is 07:22 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.01149 seconds
  • Memory Usage 1,723KB
  • 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
  • (2)bbcode_php_printable
  • (1)bbcode_quote_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