Tera-WURFL Device Images (Device Thumbnails)

A place to talk about what is going on with Tera-WURFL's development, what will be included in upcoming releases and what you would like to see added to an upcoming version.

Do you or would you use the Device Images feature?

Poll ended at Tue Jun 22, 2010 2:57 am

YES
2
25%
YES, if the device images were up-to-date
6
75%
NO
0
No votes
 
Total votes : 8

Tera-WURFL Device Images (Device Thumbnails)

Postby kamermans » Wed Mar 24, 2010 2:57 am

Those of you that have used Tera-WURFL 1.x may remember that you used to be able to display an image of the visiting device, if one was available. When I created version 2.0, I decided not to include this functionality be default since the set of device images (maintained by the WURFL group) was not actively maintained. Additionally, I wanted to spend my time improving the detection code and adding more features that would appeal to the community as a whole.

I am proud to announce that the Device Images feature is back in version 2.1.2! It comes in the form of a utility class that you can use to retrieve the device image from an instance of Tera-WURFL.

Here's a usage example:
Code: Select all
$image = new TeraWurflDeviceImage($teraWurflObj);
$image->setBaseURL("http://www.yourdomain.com/device_pix/");
$image->setImagesDirectory("/var/www/html/device_pix/");
if($image->getImage()===false){
   // There was no device image available
   echo "No image available<br/>";
}else{
   // Display the image with it's name for the title
   $title = $teraWurflObj->capabilities['product_info']['brand_name'] . " " . $teraWurflObj->capabilities['product_info']['model_name'];
   echo sprintf('<img border="0" title="%s" src="%s" />',$title,$image);
}


The TeraWurflDeviceImage class is a major improvement from the old method of determining a device image; if it is not able to find an image for the exact device, it looks for an ancestor to the device and uses a picture of that device instead (this behavior is configurable via TeraWurflDeviceImage::descend).

You can download the device images from the WURFL Project's website: http://wurfl.sourceforge.net/utilities/ ... bnails.php
Thanks,

Steve Kamerman
Tera-WURFL Author
COO of ScientiaMobile

IMPORTANT ANNOUNCEMENT! Tera-WURFL and WURFL have joined forces! We have launched ScientiaMobile to provide commercial support for our device detection solutions.

Tera-WURFL.com | Device Explorer
kamermans
Site Admin
 
Posts: 323
Joined: Wed Mar 10, 2010 12:06 pm
Location: Fort Worth, TX

Return to Improvements / Feature Requests

Who is online

Users browsing this forum: No registered users and 1 guest

cron