Documentation

Social Options

Add a new social media service
Load the model.
The first arg is the handle, the second arg is the Name.

Loader::model(‘social’, ‘theme_options_lite’);
Social::add('rss', 'RSS');


To set a default value there is a 3rd arg,

Social::add('rss', 'RSS', 'http://site.com/link/to/rss');


Social::add() returns a Social Object.

Get a Social Object:
Load the model.
You can either get by ID or handle, (handle is usually easier).

$so = Social::getByHandle($handle);
$so = Social::getByID($cID);


Once you have the object you can do the following:

Set values:

$so->setValue($value);
$so->setHandle($handle);
$so->setName($name);



Get values:

$so->getValue();
$so->getHandle();
$so->getName();
$so->getID();



Delete Social Networks:

$so->delete();



Example Usage:

<?php
if(is_object(Loader::package('theme_options_lite'))) {
//load the model
Loader::model('social', 'theme_options_lite');
//get some social networks
$twitter = Social::getByHandle('twitter');
$facebook = Social::getByHandle('facebook');
//now we check if there is actually a network with that handle, and that its not blank
if(is_object($twitter) && $twitter->getValue() != '') {
//print it out!
echo '<a class="twitter" href="'.$twitter->getValue().'">'.$twitter->getName().'</a>';
}
if(is_object($facebook) && $facebook->getValue() != '') {
echo '<a class="facebook" href="'.$facebook->getValue().'">'.$facebook->getName().'</a>';
}
}
?>

 

Mobile Options

If Theme Options Lite detects a mobile a device, a global define will be set, and can be used as follows:

if(IS_MOBILE_DEVICE) {
//its a mobile device!
}