User Tracking Interface v1.1
8It’s mainly bug fix release. Update is STRONGLY recommended.
Changelog:
- Changed file name of includes/auto_loaders/config.utis.php.php to includes/auto_loaders/config.utis.php
- uti_install.sql missed some inserts
- Fix to: [DELETE FROM uti_attributes WHERE uti_row_id = ? AND name IN () ]
- UTI tables now use DB_PREFIX
You can download it from: UTI v1.1

Instead of displaying the contents of the cookie in sideboxes, how can you display it at the bottom of the page, right above the footer area?
UTI does not store any information in cookies besides UTI session ids. All information that is gathered by UTI is stored in store database.
Now, back to your question. Let’s assume that You want to display list of recently viewed products. Edit includes/templates/YOUR_TEMPLATE/common/tpl_footer.php (or copy it from template_default if Your template does not yet have this file). Put following code where You want to display recently viewed products:
$content = “”;
foreach ($recently_viewed_products as $rpid) {
$rpprice = zen_get_products_display_price($rpid);;
$content .= ”;
//$content .= zen_image(DIR_WS_IMAGES . zen_get_products_image($rpid), $rpid, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT);
$img = $db->Execute(“SELECT * FROM ” . TABLE_PRODUCTS . ” WHERE products_id = ‘” . (int)$rpid . “‘”);
$img = $img->fields['products_image'];
$content .= ‘‘ . zen_image(DIR_WS_IMAGES . $img, $rpid, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT);
$content .= ” . zen_get_products_name($rpid) . ‘‘;
$content .= ” . $rpprice . ”;
$content .= ”;
}
echo $content;
You’ll have to format the divs with css – I really suck at HTML&CSS. If You wish to not show sidebox You’ll have to either comment out whole includes/templates/YOUR_TAMPLATE/sideboxes/tpl_recently_viewed_products.php file. Disabling the sidebox in Admin panel will also disable logic behind it and $recently_viewed_products variable will be empty then.
Sorry about the long delay in response. Thanks for the code, however, when I put it in my includes/templates/YOUR_TEMPLATE/common/tpl_footer.php file – it breaks the page (the whole footer area gets cut off.
I did place tags around the code. Any suggestions. Thanks again.
As you asked for on the forum post, I left the code in my file, just commented it out.
Execute(”SELECT * FROM ” . TABLE_PRODUCTS . ” WHERE products_id = ‘” . (int)$rpid . “‘”);
$img = $img->fields['products_image'];
$content .= ‘‘ . zen_image(DIR_WS_IMAGES . $img, $rpid, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT);
$content .= ” . zen_get_products_name($rpid) . ‘‘;
$content .= ” . $rpprice . ”;
$content .= ”};
}
echo $content;*/ ?>
I left the code in my tpl_footer, just commented it out. First post, some of the code got cut off.
/*$content = “”;
foreach ($recently_viewed_products as $rpid) {
$rpprice = zen_get_products_display_price($rpid);
$content .= ”;
$content .= zen_image(DIR_WS_IMAGES . zen_get_products_image($rpid), $rpid, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT);
$img = $db->Execute(”SELECT * FROM ” . TABLE_PRODUCTS . ” WHERE products_id = ‘” . (int)$rpid . “‘”);
$img = $img->fields['products_image'];
$content .= ‘‘ . zen_image(DIR_WS_IMAGES . $img, $rpid, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT);
$content .= ” . zen_get_products_name($rpid) . ‘‘;
$content .= ” . $rpprice . ”;
$content .= ”};
}
echo $content;*/
Perhaps you should consider:
1. storing ip as int instead of varchar
http://daipratt.co.uk/mysql-store-ip-address/
2. use unix time instead?
3. I dont know how you track recent view/search etc since i havent looked into the code in more details, but the table structure seems to suggest it’s highly costly since you are using varchar to store att values in there, and primary key for varchar is also costly
Im thinking of using UTI to track recent views and such, but perhaps I will only use the part of code to recognize users and have a custom table to keep track of the recently viewed products.
Storing IP as int – good idea and I know that it can be done
I should have done so, but in early releases of UTI I was more concerned about bugs and ease of debugging then space. I’ll keep that in mind for future release of UTI.
UTI already stores date and time in TIMESTAMP field.
As for storing attribute value as varchar… I couldn’t use other field type as it’s general purpose field. User should be able to store int, long, string, date, array, js, json data in that field. Therefore I’ve used VARCHAR instead of INT, BIGINT. There are some performance consequences of using BLOB or TEXT fields so I didn’t used them either. In retrospective I could have used VARBINARY instead of VARCHAR but in most cases it doesn’t matter.
Note: UTI does not use VARCHAR column as primary key. tsid field in uti table has just unique constraint on it.
As for the size of uti tables… On one site with 200 000 visits/month uti takes about 0,5 gb of space and performance is not an issue. Note: it’s not bare uti module, there’s also randomized tests, recently viewed products, recent searches, default currency, persistent shopping cart between user sessions and few others – so uti_attributes takes more space.
Thank You for Your suggestions, I really appreciate them. I’ll try to release new UTI within week or two – with few new features:
IP as INT
custom uti attribute merge functions
many bug fixes
I love this mod and have been using it successfully – until I installed an SEO mod that utilizes a 301 redirect. After installing the SEO mod, the “Recently Viewed” products sidebox recognizes that there is a recently viewed product (ie there is a blank product showing in the sidebox with no pic or product info), but doesn’t display the product info.
Any ideas of what I can change (other than uninstalling the SEO mod) to make the two play nice?
Thanks in advance.