logo-dw

Go Back   Dreamweaver Club Forums > Hand Coders Forum > CMS (wordpress,Drupal,joomla etc)
Register FAQ Members List Search Today's Posts Mark Forums Read

Closed Thread
 
Thread Tools Display Modes
Old 06-01-2012, 03:57 PM   #1
johnMoss
johnMoss's Avatar
 
Join Date: Dec 2010
Location: Dallas
Posts: 867
Default Install Google Analytics to Joomla Modified PHP Template

This site is a Joomla 1.5. Normal access to modify html is to go into extensions, choose the template & simply modify from there. In this case, the site has had some overwrites done to the template and instead of seeing HTML there is a php script. Can anyone have a looksee at this script & possibly derive what file to go to and add code to the head? I'm digging around in the files, and honestly shooting in the dark here. I found some files in the layout directory that looked like possibles, but adding code into the head was inneffective. Here is the php file one sees when accessing the code in the normal manner in the admin panel:
Code:
<?php
/*
#------------------------------------------------------------------------
  JA Purity II for Joomla 1.5
#------------------------------------------------------------------------
#Copyright (C) 2004-2009 J.O.O.M Solutions Co., Ltd. All Rights Reserved.
#@license - GNU/GPL, http://www.gnu.org/copyleft/gpl.html
#Author: J.O.O.M Solutions Co., Ltd
#Websites: http://www.joomlart.com - http://www.joomlancers.com
#------------------------------------------------------------------------
*/

// no direct access
defined( '_JEXEC' ) or die( 'Restricted access' );
include_once (dirname(__FILE__).DS.'libs'.DS.'ja.template.helper.php');
$tmplTools = JATemplateHelper::getInstance($this, array('ui', JA_TOOL_SCREEN, JA_TOOL_MENU, 'main_layout', 'direction'));
//Calculate the width of template
$tmplWidth = '';
$tmplWrapMin = '100%';
switch ($tmplTools->getParam(JA_TOOL_SCREEN)){
 case 'auto':
  $tmplWidth = '97%';
  break;
 case 'fluid':
  $tmplWidth = intval($tmplTools->getParam('ja_screen-fluid-fix-ja_screen_width'));
  $tmplWidth = $tmplWidth ? $tmplWidth.'%' : '90%';
  break;
 case 'fix':
  $tmplWidth = intval($tmplTools->getParam('ja_screen-fluid-fix-ja_screen_width'));
  $tmplWrapMin = $tmplWidth ? ($tmplWidth+1).'px' : '771px';
  $tmplWidth = $tmplWidth ? $tmplWidth.'px' : '770px';
  break;
 default:
  $tmplWidth = intval($tmplTools->getParam(JA_TOOL_SCREEN));
  $tmplWrapMin = $tmplWidth ? ($tmplWidth+1).'px' : '981px';
  $tmplWidth = $tmplWidth ? $tmplWidth.'px' : '980px';
  break;
}
$tmplTools->setParam ('tmplWidth', $tmplWidth);
$tmplTools->setParam ('tmplWrapMin', $tmplWrapMin);
//Main navigation
$ja_menutype = $tmplTools->getMenuType();
$jamenu = null;
if ($ja_menutype && $ja_menutype != 'none') {
 $japarams = new JParameter('');
 $japarams->set( 'menutype', $tmplTools->getParam('menutype', 'mainmenu') );
 $japarams->set( 'menu_images_align', 'left' );
 $japarams->set( 'menupath', $tmplTools->templateurl() .'/ja_menus');
 $japarams->set('menu_images', 1); //0: not show image, 1: show image which set in menu item
 $japarams->set('menu_background', 1); //0: image, 1: background
 $japarams->set('mega-colwidth', 200); //Megamenu only: Default column width
 $japarams->set('mega-style', 1); //Megamenu only: Menu style. 
 $japarams->set('rtl',($tmplTools->getParam('direction')=='rtl' || $tmplTools->direction == 'rtl'));
 $jamenu = $tmplTools->loadMenu($japarams, $ja_menutype); 
} 
//End for main navigation
$layout = $tmplTools->getLayout ();
if ($layout) {
 $tmplTools->display ($layout);
}
__________________
LinkedIn: jM
johnMoss is offline  
Old 06-01-2012, 04:09 PM   #2
johnMoss
johnMoss's Avatar
 
Join Date: Dec 2010
Location: Dallas
Posts: 867
Default

I guess I should add to see the live page:
www.networkingeventfinders.com/subdomain/
__________________
LinkedIn: jM
johnMoss is offline  
Old 06-01-2012, 04:52 PM   #3
johnMoss
johnMoss's Avatar
 
Join Date: Dec 2010
Location: Dallas
Posts: 867
Default

I installed code on this layout/default.php page. The active page above would assumedly show the code (I uploaded it). It doesn't...
HTML Code:
<?php
/*
#------------------------------------------------------------------------
  JA Purity II for Joomla 1.5
#------------------------------------------------------------------------
#Copyright (C) 2004-2009 J.O.O.M Solutions Co., Ltd. All Rights Reserved.
#@license - GNU/GPL, http://www.gnu.org/copyleft/gpl.html
#Author: J.O.O.M Solutions Co., Ltd
#Websites: http://www.joomlart.com - http://www.joomlancers.com
#------------------------------------------------------------------------
*/

// no direct access
defined( '_JEXEC' ) or die( 'Restricted access' );
$this->_basewidth = 20;
$positions = array (
 'welcomebox'   =>'welcomebox',
 'left1'     =>'left',
 'left2'     =>'left2',
 'left-mass-top'   =>'left_top',
 'left-mass-bottom'  =>'left_bottom',
 'right1'    =>'right',
 'right2'    =>'right2',
 'right-mass-top'  =>'right_top',
 'right-mass-bottom'  =>'right_bottom',
 'content-mass-top'  =>'top',
 'content-mass-bottom' =>'bottom',
 'content-top'   =>'adv_top',
 'content-bottom'  =>'adv_bottom',
 'inset1'    =>'inset1',
 'inset2'    =>'inset2'
);
$this->customwidth('right1', 22);
$this->customwidth('left1', 22);
//$this->customwidth('right1', 25); <== override right1 column width to 25%. Must call before call definePosition. Can call many time to override many columns.
$this->definePosition ($positions);
?>
<?php if ($this->isIE() && ($this->getParam('direction')=='rtl' || $this->direction == 'rtl')) { ?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<?php } else { ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<?php } ?>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $this->language; ?>" lang="<?php echo $this->language; ?>">
<head>
<?php $this->loadBlock('head') ?>
<script type="text/javascript">
  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-32246848-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 s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();
</script>
</head>
<?php 
$document =& JFactory::getDocument();
if (@$_REQUEST['task'] == 'month.calendar') 
{
 $document->setTitle("Events Calendar");
}
elseif (@$_REQUEST['task'] == 'icalevent.edit') 
{
 if(@$_REQUEST['evid'])
  $document->setTitle("Edit Event");
 else
  $document->setTitle("Add Event");
}
?>
<body id="bd" class="fs<?php echo $this->getParam(JA_TOOL_FONT);?> <?php echo $this->browser();?> <?php if($this->getParam(ca_colorVariation)){ echo $this->getParam(ca_colorVariation); } ?>">
 <div id="ja-wrapper">
  <a name="Top" id="Top"></a>
 
  <!-- HEADER -->
  <?php $this->loadBlock('header') ?>
  <!-- //HEADER -->
 
  <!-- MAIN NAVIGATION -->
  <?php $this->loadBlock('mainnav') ?>
  <!-- //MAIN NAVIGATION -->
  <?php $this->loadBlock('showcase') ?>
  <?php $this->loadBlock('welcome') ?>  
  
  <?php $this->loadBlock('topsl') ?>
  
   <jdoc:include type="message" />
 
  <!-- MAIN CONTAINER -->
  <div id="ja-container" class="wrap <?php echo $this->getColumnWidth('cls_w'); ?>">
  <div class="main clearfix">
   
   <div id="ja-mainbody" style="width:<?php echo $this->getColumnWidth('mw'); ?>%">
    <?php $this->loadBlock('user2') ?>
    <?php $this->loadBlock('main') ?>
    <?php $this->loadBlock('left') ?>
   </div>
    <?php $this->loadBlock('right') ?>
  </div>
  </div>
  <!-- //MAIN CONTAINER -->
 
  <?php $this->loadBlock('botsl') ?>
 
  <!-- FOOTER -->
  <?php $this->loadBlock('footer') ?>
  <!-- //FOOTER -->
  
  
 
 </div>
 <!-- COPYRIGHT BLOCK -->
  <?php $this->loadBlock('copyrights') ?>
  <!-- //COPYRIGHT BLOCK -->
<jdoc:include type="modules" name="debug" />
<?php if ($this->isIE6()) : ?>
 <?php $this->loadBlock('ie6/ie6warning') ?>
<?php endif; ?>
</body>
</html>
__________________
LinkedIn: jM
johnMoss is offline  
Old 06-02-2012, 02:10 AM   #4
edbr
edbr's Avatar
 
Join Date: Aug 2005
Location: Bali
Posts: 11,176
Default

havent looked at joomla for yonks but do they use .tpl files?
__________________
If you're happy and you know it shake your meds!
different style links examples

Flight / Hotel search
Free script download
Bali Villas
edbr is offline  
Old 06-02-2012, 06:34 AM   #5
johnMoss
johnMoss's Avatar
 
Join Date: Dec 2010
Location: Dallas
Posts: 867
Default

Quote:
Originally Posted by edbr View Post
havent looked at joomla for yonks but do they use .tpl files?
Yes

I also discovered my site management is flawed in DW. Manana I will try a direct load to the root with the above page. I also put in a request to the team who modified the template in the first place to get the low down... I'll report the answer...
__________________
LinkedIn: jM
johnMoss is offline  
Old 06-02-2012, 06:44 AM   #6
edbr
edbr's Avatar
 
Join Date: Aug 2005
Location: Bali
Posts: 11,176
Default

right , i usually go strait for the tpl files when modifying templates
__________________
If you're happy and you know it shake your meds!
different style links examples

Flight / Hotel search
Free script download
Bali Villas
edbr is offline  
Old 06-02-2012, 06:47 AM   #7
johnMoss
johnMoss's Avatar
 
Join Date: Dec 2010
Location: Dallas
Posts: 867
Default

To do that locally I need a server app on my comp, yes?
__________________
LinkedIn: jM
johnMoss is offline  
Old 06-02-2012, 06:50 AM   #8
edbr
edbr's Avatar
 
Join Date: Aug 2005
Location: Bali
Posts: 11,176
Default

yes thats easy peasy though. i put a few links in the php section i use wamp. also the code lobster link gives you a 30 day joomla plugin but i have never used it so cant coment
__________________
If you're happy and you know it shake your meds!
different style links examples

Flight / Hotel search
Free script download
Bali Villas
edbr is offline  
Old 06-02-2012, 06:53 AM   #9
edbr
edbr's Avatar
 
Join Date: Aug 2005
Location: Bali
Posts: 11,176
Default

http://www.dreamweaverclub.com/forum...ad.php?t=42953
__________________
If you're happy and you know it shake your meds!
different style links examples

Flight / Hotel search
Free script download
Bali Villas
edbr is offline  
Old 06-02-2012, 04:38 PM   #10
johnMoss
johnMoss's Avatar
 
Join Date: Dec 2010
Location: Dallas
Posts: 867
Default

Google Analytics resolved:
I did it right the first time, my site definitions are off. Loaded directly via filezilla all check good.
__________________
LinkedIn: jM
johnMoss is offline  
Closed Thread


Thread Tools
Display Modes

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:04 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Copyright 2006 DreamweaverClub.com