Archive for the ‘web 2.0’ Category

How to implement Google Analytics in your Simple Machines Forum

Sunday, April 26th, 2009

Simple Machines Forum is today’s trend in bulletin boards.

It’s almost the same implementation of wordpress, here’s the quick and dirty way of implementing your google analytics, woopra, sitemeter or whatever you use to check your Simple Machines Forum’s web statistics.

Step 1: Create an include file for your Google Code.

Paste the following code in an empty text file and save it in /smf/Sources as /smf/Sources/analytics.php (.html or .htm will do)

Replace UA-#######-# with your Web Property ID from your web analytics account.

Step 2: Find the  index.template.php

Find your theme directory. Typically it will be the theme folder beneath /smf/Themes.

Open the file /smf/Themes//index.template.php

Step 3: Insert on line of code before the closing tag
Open index.template.php in a text editor.

Search for with </body>
You will find the following lines of code:

echo ‘
<div id=”ajax_in_progress” style=”display: none;’, $context['browser']['is_ie'] && !$context['browser']['is_ie7'] ? ‘position: absolute;’ : ”, ‘”>’, $txt['ajax_in_progress'], ‘</div></body></html>’;

Break the last </div> like this:

</div>’;

require_once’analytics.php’;
echo ‘</body></html>’;

Save the file and you’re done.

Testing.

View source your site, check if there’s google analytics before </body>

Enjoy!

Popularity: 9% [?]

Can’t edit category slug problem

Monday, April 6th, 2009

If you are new to wordpress and by chance you need to edit a category post slug, after doing so and checking the category link. You realize that the category slug you just changed didn’t change to the way you wanted it to be.

For example, I wanted the sub-category mmo-pc changed to mmo-games but instead it changed itself to mmo-games-pc. What could be the problem?

This problem occurs if you have the exact slug named to tags. Before, I have a tag named “mmo-games” in which causing the problem. After searching for that particular tag “mmo-games” and deleted it. I go back editing the sub-category slug “mmo-pc” to “mmo-games”. Viola, problem solved.

So make sure you don’t have identical name for tags and categories.

Popularity: 4% [?]