- Published:
- October 19, 2010 – 4:45 pm
- Author:
- By Dave
On a website I was working on recently I added the Google Analytics tracking code to the footer of a Smarty template, like this: footer.tpl: 1234567891011121314151617<script type="text/javascript"> var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-XXXXX-XX']); _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> </body> </html> However, since the javascript used by Google Analytics includes { and } tags, also used by the Smarty template engine, it tries to interpret this code and depending on your settings will either fail silently or or with an error such as this: Smarty error: [in footer.tpl line 148]: syntax error: unrecognized tag ‘var’ The fix is simple. Enclose your Google Analytics code, or other javascript code, with {literal} and….
Categories: Code Samples,JavaScript,Webdesign
Tagged: google analytics, JavaScript, smarty
- Published:
- March 25, 2009 – 4:15 pm
- Author:
- By Dave
I just found a quick tip on the Installatron forums. By default Installatron disables all WordPress plugins when doing an upgrade. This is due to the WordPress best practices for upgrading the version of their system. When you have a lot of WordPress installs to go through this is a big pain because it usually breaks the site. According to this post, you disable the disabling of the plugins by creating a file named .dont_disable_plugins in the directory that wordpress is installed to. Via command line it is as simple as this: 1touch /path/to/wordpress/.dont_disable_plugins Execute that command on the command line (or upload an empty file via FTP/SCP) and the plugins will remain enabled. There is also an option in the installatron settings to enable this file creation upon install. Note that if you have a plugin that is not compatible with a new version of WordPress, it may break….
Categories: Configurations,Software,System Administration,Webdesign
Tagged: installatron, wordpress
- Published:
- September 11, 2007 – 10:53 pm
- Author:
- By Dave
Found an encyclopedic list of “stupid” .htaccess tricks. Includes many useful ones such as being able to stop hotlinking of images and replacing with your own, increasing speed and security and general good-to-know htaccess information. Stupid htaccess tricks
Categories: Code Samples,Configurations,PHP,Security,System Administration,Webdesign
- Published:
- August 17, 2007 – 12:05 pm
- Author:
- By Dave
Meebo, which I have recently been turned on to, yesterday released an iPhone client which is basically a web interface to their chat website (which integrates AIM, Yahoo!, MSN, gtalk, and more). It looks great, take a peek: That is great that they are developing this and I applaud them for their efforts of releasing updates on mobile devices. Now, maybe I have iPhone envy, but wouldn’t it make sense to release this for Windows Mobile since the market share that Windows Mobile has is MUCH greater than iPhone? According to Gartner, Windows Mobile shipped a little over 3 million devices in the 1st quarter of 2007 alone (and that number does not even include “Smartphone” devices). iPhone, according to their own estimates [MacNewsWorld], will sell a million units by Sept 30th. I asked Meebo about their plans for Windows Mobile. Here is the response I received from Sue: As….
Categories: Cell Phones,Other Technology,Webdesign,Windows Mobile
Tagged: Internet Explorer Mobile, microsoft, Nintendo, Opera for Wii, web app, web code, Web Interface, web interfaces, Web publishers, Yahoo!
- Published:
- July 28, 2007 – 8:09 pm
- Author:
- By Dave
I’ve joined the Twitter world. My Twitter Profile. I’ve created a small 16 x 16 mini Twitter icon. Feel free to steal it! I resized the icon from deanjrobinson. Let me know if anyone knows of a Windows Mobile application for Twitter that includes a today screen plugin, that makes it easy to post to twitter.
Categories: Webdesign,Windows Mobile
- Published:
- June 27, 2007 – 8:57 am
- Author:
- By Dave
Joomla! 1.0.12 appears to have a pathway bug. If you use a component other than com_frontpage for the “Home page” of Joomla – meaning the first link in mainmenu and the page that appears when you load the root of the Joomla! site – then when you click on an article you get a “Double pathway”, for example the pathway will state “Home > Home > Title of article”. The Home, or whatever you named this link, part will be duplicated. It isn’t a big problem but it does look unprofessional on your site! I looked for ages for a fix to this problem, and eventually found it but the site I can not find the site I originally downloaded this fix from. It is courtesy of Reinhard Hiebl – www.hieblmedia.de (whos site is in German, one reason why I’m saving it here). I thought I would throw it online….
Categories: Code Samples,Joomla,PHP,Webdesign
Tagged: PHP, Reinhard Hiebl, whos site, www.hieblmedia.de
- Published:
- May 16, 2007 – 2:25 pm
- Author:
- By Dave
I happened upon a great site for a list of names. The list is meant to be used to get pet names, however I happened across this when I was looking for a list of themed names for servers. It includes both self-hosted pages and also links to other lists of names. List of names by theme. Even if you aren’t looking for a name, this site still includes interested lists to look through, if you are a geek like me :)
Categories: System Administration,Webdesign