Newbie - Silly Question

Questions about the WURFL Cloud service.
mightec
Posts: 5
Joined: Thu Jun 07, 2012 2:10 pm

Newbie - Silly Question

Postby mightec » Fri Jun 08, 2012 10:04 am

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";
}
?>

kamermans
Posts: 393
Joined: Mon Jun 06, 2011 9:50 am

Re: Newbie - Silly Question

Postby kamermans » Fri Jun 08, 2012 10:16 am

Hi,

In the code sample you've posted, this line:

Code: Select all

require_once '../Client/Client.php';
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:

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/
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:

Code: Select all

require_once 'WurflCloudClient/Client/Client.php';
Does this answer your question?
Thanks,

Steve Kamerman
ScientiaMobile

Make sure you check out our WURFL Cloud, WURFL InSight and WURFL InFuze products!

mightec
Posts: 5
Joined: Thu Jun 07, 2012 2:10 pm

Re: Newbie - Silly Question

Postby mightec » Fri Jun 08, 2012 10:20 am

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?

kamermans
Posts: 393
Joined: Mon Jun 06, 2011 9:50 am

Re: Newbie - Silly Question

Postby kamermans » Fri Jun 08, 2012 10:25 am

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!

kamermans
Posts: 393
Joined: Mon Jun 06, 2011 9:50 am

Re: Newbie - Silly Question

Postby kamermans » Fri Jun 08, 2012 10:28 am

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!

mightec
Posts: 5
Joined: Thu Jun 07, 2012 2:10 pm

Re: Newbie - Silly Question

Postby mightec » Fri Jun 08, 2012 10:35 am

Steve
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 66 guests