Oscommerce local search mod

Introduction
This module allows you track all of the keywords used to search you website. This can be helpful because it can give you an insight into what your customers actually need.

Installation
Step 1: Import rawseo_keyword_reports.sql into your oscommerce database.
Step 2: Upload everything in the admin directory to your oscommerce admin directory.
Step 3:
open advanced search results.php at around line 50:
add the following (make sure it is before }):
$keywordQuery = sprintf("INSERT INTO rawseo_keyword_reports (keyword,timestamp) VALUES('%s',now())",mysql_escape_string($keywords));
@mysql_query($keywordQuery);
Download
All files for this module can be download here.
September 23, 2009 No Comments
oscmax local search report mod

Introduction
This module allows you track all of the keywords used to search you website. This can be helpful because it can give you an insight into what your customers actually need.

Installation
Step 1: Import rawseo_keyword_reports.sql into your oscommerce database.
Step 2: Upload everything in the admin directory to your oscommerce admin directory.
Step 3:
open advanced search results.php at around line 50:
add the following (make sure it is before }):
$keywordQuery = sprintf("INSERT INTO rawseo_keyword_reports (keyword,timestamp) VALUES('%s',now())",mysql_escape_string($keywords));
@mysql_query($keywordQuery);
Step 4: Open admin/index.php
at line 63:
right below it add the following:
Step 5:
In the admin interface, go to Administrator->file access->reports. Click the button that says “store files” and choose “rawseo_keyword_reports.php” from the list and the click “save”.

You should now see a new item under the reports section called “search reports”.

Download
All files for this module can be download here.
September 22, 2009 No Comments
5 must-have google analytics apps
The following is a mix of commercial and free applications that can help you get more out of your google analytics account.
1) Polaris (adobe air app)
Polaris is a cross-platform adobe air app for Google Analytics.

Features
- Cross-platform and easy to setup
- Dashboard gives you an overview of total visits, pageviews, pages/visit, bounce rate, average time on site, and % of new visitors
- Switch between different date ranges with using a drag and drop date widget
- Daily visitor charts
- Google maps integration (for viewing visitor locations)
- Reports for viewing the top 25 referring sites
- Learn which pages perform best
- The keywords report shows you which keywords are used mostly on organic searches
2) Analytics app (iPhone app)

Features
- Quick Overview Reports for at-a-glance data
- More Detailed Reports for deeper analysis
- Supports Multiple Accounts, Multiple Sites, change login anytime
- Change date range, chart granularity by Day/Week/Month
- Custom Reports and Goals
3) Ego (iPhone app)

Ego gives you one central location to check web statistics that matter to you. With support for Feedburner, Google Analytics, Google PageRank, Mint, Squarespace and Twitter. You can quickly view the number of visits to your website (including daily, hourly and monthly numbers), feed subscription totals and changes, and how many people are following you on Twitter.
4) Youcalc analytics suite (web-based service)

Features
- Designed to be run on a variety of platforms (iPhone, igoogle, and embedding in your own apps)
- Key metrics (visits, page views, conversions, etc.) – see the performance of all your key metrics in one chart
- Time/day distribution analyzer (Analyze your key metrics distributed by hour of day, day of week or day of month)
- Dimension analyzer (Analyze your top performing countries, landing pages, campaigns, keywords
5) Enhanced Google Analytics (firefox plugin)

This Firefox plugin is designed to allow analysts to get more action out of what changed in the Referring Sites and Keyword Reports. The addon pulls google data for different time-periods, and discovers new and insightful information for the user.
July 27, 2009 No Comments
How to cache smarty templates
What is caching?
Caching is used to speed up a call to display() or fetch() by saving its output to a file. If a cached version of the call is available, that is displayed instead of regenerating the output. Caching can speed things up tremendously, especially templates with longer computation times. Since the output of display() or fetch() is cached, one cache file could conceivably be made up of several template files, config files, etc.
Since templates are dynamic, it is important to be careful what you are caching and for how long. For instance, if you are displaying the front page of your website that does not change its content very often, it might work well to cache this page for an hour or more. On the other hand, if you are displaying a page with a weather map containing new information by the minute, it would not make sense to cache this page.
Setting it up
The first thing to do is enable caching by setting $caching = 1 (or 2).
Example: setting up caching
$smarty->caching = true;
$smarty->display('index.tpl');
?>
With caching enabled, the function call to display(’index.tpl’) will render the template as usual, but also saves a copy of its output to a file (a cached copy) in the $cache_dir. Upon the next call to display(’index.tpl’), the cached copy will be used instead of rendering the template again.
Technical Note: The files in the $cache_dir are named similar to the template name. Although they end in the “.php” extention, they are not really executable php scripts. Do not edit these files!
Each cached page has a limited lifetime determined by $cache_lifetime. The default value is 3600 seconds, or 1 hour. After that time expires, the cache is regenerated. It is possible to give individual caches their own expiration time by setting $caching = 2. See $cache_lifetime for more details.
example: setting up cache lifetime
// set the cache_lifetime for index.tpl to 5 minutes
$smarty->cache_lifetime = 300;
$smarty->display('index.tpl');
// set the cache_lifetime for home.tpl to 1 hour
$smarty->cache_lifetime = 3600;
$smarty->display('home.tpl');
// NOTE: the following $cache_lifetime setting will not work when $caching = 2.
// The cache lifetime for home.tpl has already been set
// to 1 hour, and will no longer respect the value of $cache_lifetime.
// The home.tpl cache will still expire after 1 hour.
$smarty->cache_lifetime = 30; // 30 seconds
$smarty->display('home.tpl');
?>
Caching Tips
Smarty caching can improve performance tremendously, but it doesn’t always work the way that you think it should. In the following situation (which I have seen recently):
example: within (main.tpl) (this is a file named main.tpl)
{include file="menu1.tpl"}
{elseif some other action}
{include file="menu2.tpl"}
{/if}
If the main template file (main.tpl) is cached, the includes template files will not get called properly. My solution is to separate the main file into cached and non-cached parts:
(within the PHP file that calls your smarty templates)
$smarty->caching = true;
//the fetch command puts the output of a template file into a variable rather than //the screen
$menu1 = $smarty->fetch('menu1.tpl');
$smarty->assign('menu1',$menu1);
$menu2 = $smarty->fetch('menu2.tpl');
$smarty->assign('menu2',$menu2);
//set the main caching file to false
$smarty->caching = false;
$smarty->display('main.tpl');
(within the new main.tpl)
{$menu1}
{elseif some other action}
{$menu2}
{/if}
July 14, 2009 2 Comments
How to migrate from Microsoft access to Mysql
Why use mysql instead of access?
Cost. MySQL is free. Access is not. Mysql can also run on a variety of hardware and operating systems, which does not limit you to proprietary software.
Multiple-user access.
MySQL can handle many simultaneous users. It was designed from the ground up to run in a shared environment that is capable of taking on a large numbers of clients.
Management of large databases. MySQL can manage gigabytes of data, and more. This is possible in access, but not recommended.
Security. When Access tables are stored locally, anyone can run Access, and see your tables. It’s possible to assign a database a password, but many people forget to do this. When your tables are stored in MySQL, the MySQL server manages security. Anyonetrying to access your data must know the proper user
name and password.
Centralized backup location. If individual Access users each store their data locally, backups can be more complicated: 200 users means 200 table backups. While some sites address this problem through the use of network backups, others deal with it by making backups the responsibility of individual machine owners–which usually means no backups at all. Mysql allows you to have one centralized location that can be backed up on a regular basis by a system administrator or DBA.
Manually transferring your data
One way to transfer your data is export all the data from each table (using the file->export command) to a comma delimited text file (CSV). It can then be imported back into mysql using the following commands (from the mysql console client):
mysql> LOAD DATA LOCAL INFILE 'my_access_table.txt'
-> INTO TABLE mytable
-> FIELDS TERMINATED BY ',' ENCLOSED BY '"'
-> LINES TERMINATED BY '\r\n';
you could also use mysqlimport:
--fields-enclosed-by='"'
--lines-terminated-by='\r\n'
mydatabase my_access_table.txt
Applications
An application that can make the migration process much easier is called dbTools (free trial available here)
July 13, 2009 1 Comment