Hi
I have just signed up to WURFL Cloud and I have downloaded the php files and created the quick example below.
<?php
// Include the WURFL Cloud Client
// You'll need to edit this path
require_once '../Client/Client.php'; What do I need to place here
// Create a configuration object
$config = new WurflCloud_Client_Config();
// Set your WURFL Cloud API Key
$config->api_key = 'xxxxxx:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx';
// Create the WURFL Cloud Client
$client = new WurflCloud_Client_Client($config);
// Detect your device
$client->detectDevice();
// Use the capabilities
if ($client->getDeviceCapability('is_wireless_device')) {
echo "This is a mobile device";
} else {
echo "This is a desktop device";
}
?>
Newbie - Silly Question
Re: Newbie - Silly Question
Hi,
In the code sample you've posted, this line:
Would need to be changed to the path to the WURFL Cloud Client's "/Client/Client.php" file. So, let's say your website content looks something like this:
In that example, your code sample is inside wurfl.php, and so the require_once statement would need to be adjusted to the path of the Client.php file:
Does this answer your question?
In the code sample you've posted, this line:
Code: Select all
require_once '../Client/Client.php';
Code: Select all
css/
images/
index.php
anotherpage.php
wurfl.php <-- this is the file that contains your code sample
WurflCloudClient/ <-- this is the WURFL Cloud Client code that you downloaded
|- Cache/
|- Client/
|- Client.php <-- this is the file you need to include
|- examples/
|- HttpClient/
Code: Select all
require_once 'WurflCloudClient/Client/Client.php';
Thanks,
Steve Kamerman
ScientiaMobile
Make sure you check out our WURFL Cloud, WURFL InSight and WURFL InFuze products!
Steve Kamerman
ScientiaMobile
Make sure you check out our WURFL Cloud, WURFL InSight and WURFL InFuze products!
Re: Newbie - Silly Question
Hi Steve
Yes, I think it does, I will try to work on from here, thank you.
EDIT: Sorry, I am using an Artisteer template within Joomla, I assume I place this in the template directory?
Yes, I think it does, I will try to work on from here, thank you.
EDIT: Sorry, I am using an Artisteer template within Joomla, I assume I place this in the template directory?
Re: Newbie - Silly Question
Ok, no problem. One thing I didn't mention is that, if you are just running the example, you will not need to modify that path, since it's already correct. It only needs to be modified if you put this code in a different file, or move this file.
Thanks,
Steve Kamerman
ScientiaMobile
Make sure you check out our WURFL Cloud, WURFL InSight and WURFL InFuze products!
Steve Kamerman
ScientiaMobile
Make sure you check out our WURFL Cloud, WURFL InSight and WURFL InFuze products!
Re: Newbie - Silly Question
You can indeed use the WURFL Cloud Client from a Joomla template, and you can place the client code in the templates directory if you wish.
Thanks,
Steve Kamerman
ScientiaMobile
Make sure you check out our WURFL Cloud, WURFL InSight and WURFL InFuze products!
Steve Kamerman
ScientiaMobile
Make sure you check out our WURFL Cloud, WURFL InSight and WURFL InFuze products!
Re: Newbie - Silly Question
Steve
Thanks again, I am using my server to try out the system.
thanks for your help.
bye
Thanks again, I am using my server to try out the system.
thanks for your help.
bye
Who is online
Users browsing this forum: No registered users and 88 guests