Loading...
 
Features / Usability

Features / Usability


Statcounter / Site Meter / User Tracking

posts: 35 United States

Not sure if I'm missing a TIKI feature already (I don't know what "Use Tracker for more user information" means), but I'd like to add StatCounter (http://statcounter.com) to my site so I can track visits to the site.

How do I add javascript that will show up on all pages? I've seen the option somewhere, but I've just searched through all the admin panels and can't find it anywhere.

Thanks in advance!

posts: 31 United Kingdom

> How do I add javascript that will show up on all pages? I've seen the option somewhere, but I've just searched through all the admin panels and can't find it anywhere.

You can add javascript to the templates used to define your page layout. As an example, take a look at header.tpl in the Templates folder of your tw installation. Do a search for "script" and you should see how it can be done.

exclaimWord of warning: There's a template editor in the admin section of tw. Don't use this to edit templates containing javascript as it seems to strip out all the script tags. I've ended up editing my templates using a text editor.

rikrak

posts: 35 United States

> > How do I add javascript that will show up on all pages? I've seen the option somewhere, but I've just searched through all the admin panels and can't find it anywhere.
>
> You can add javascript to the templates used to define your page layout. As an example, take a look at header.tpl in the Templates folder of your tw installation. Do a search for "script" and you should see how it can be done.
>
> exclaimWord of warning: There's a template editor in the admin section of tw. Don't use this to edit templates containing javascript as it seems to strip out all the script tags. I've ended up editing my templates using a text editor.
>
> rikrak

Thanks! I've got it working now. My next question is, how do I upgrade when a new vesion of tikiwiki is released if I'm modifying files like that? I upgraded my site once, but only by doing as suggested and installing a fresh copy. Do I need to keep track of all the changes that I make, and re-make the changes when I need to upgrade to a newer version of tikiwiki?

posts: 31 United Kingdom

>My next question is, how do I upgrade when a new vesion of tikiwiki is released if I'm modifying files like that?

Not sureeek I've only just started making modifications to my templates, and I'm wondering the same thing. I find keeping a track of modded files is un manageable, especially in a multi-user environment. It only takes a few things to be forgotten and it all goes bang!

ideaOne way I'm thinking of trying is to keep a copy of the files I used at install time. When I come to upgrade I'll unpack the original files and do a directory comparison against the files in my site. That should identify all the changed files. These can be copied to one side, then upgrade the site with new files, then merge back the changes.

It's a crazy plan, but it might just worksmile

rikrak

posts: 113 Ireland

> >My next question is, how do I upgrade when a new vesion of tikiwiki is released if I'm modifying files like that?
>

My suggestion is to create a new theme (like mytheme) that is a copy of the theme that you are currently using. Then make all your mods in templates/styles/mytheme to override the defaults. Now when you upgrade, you have a single folder that has all of your template customizations. This is not workable if you allow all of your users to select a theme.

If this is unworkable, you can use timestamps or a diff from the distribution. But these are harder to merge back in.

gary


posts: 45 United Kingdom

There is a very nice free-software (GPL) stats tool, that can be easily added to Tiki (similar to what you did).
phpmv2: http://www.phpmyvisites.net/phpmv2

I think this software looks good. I am keen to use it, but what is the best way to incorporate it into Tiki?