'', 'qrcode' => 'true', 'users' => '0', 'name' => ''), $atts));
if ($qrcode == 'false'){
$qrcode_text = '';
}else{
$qrcode_text = 'data-qrcode="true"';
}
$users_text = '';
if (intval($users) > 0){
$users_text = 'data-users="' . $users . '"';
}
if ($name == ''){
$name = 'Android App ' . $pname . ' on Playboard';
}else{
$name .= ' on AppAware';
}
if ($pname != ''){
return '
';
}else{
return "";
}
}
static function add_pb_app_list($atts) {
self::$add_pb_script = true;
extract(shortcode_atts(array('pnames' => '', 'lang' => 'en', 'title' => '', 'author' => '', 'width' => 'auto'), $atts));
if ($lang != ''){
$lang_text = 'data-lang="' . $lang . '"';
}else{
$lang_text = '';
}
if ($title != ''){
$title_text = 'data-list-title="' . $title . '"';
}else{
$title_text = '';
}
if ($author != ''){
$author_text = 'data-list-author="' . $author . '"';
}else{
$author_text = '';
}
if (!is_numeric($width)){
$width_text = "";
}else{
$width_text = "style='width: " . $width . "px !important'";
}
$pnames_array = explode(',',$pnames);
$html = '';
return $html;
}
static function add_pb_app_box($atts) {
self::$add_pb_script = true;
extract(shortcode_atts(array('pname' => '', 'theme' => 'light', 'lang' => 'en'), $atts));
if ($theme != ''){
$theme_text = 'data-theme="' . $theme . '"';
}else{
$theme_text = '';
}
if ($lang != ''){
$lang_text = 'data-lang="' . $lang . '"';
}else{
$lang_text = '';
}
if ($name == ''){
$name = 'Android App ' . $pname . ' on Playboard';
}else{
$name .= ' on Playboard';
}
if ($pname != ''){
return '';
}else{
return "";
}
}
static function pb_options_box() {
add_meta_box('pb_options_box', 'Playboard App Widget', array(__CLASS__, 'pb_options_box_display'), 'post', 'side', 'high');
}
static function pb_options_box_display() {
$example = "[pb-app-box pname='com.whatsapp' name='WhatsApp' theme='light' lang='en']";
$example_mt = "[pb-app-list pnames='com.whatsapp,com.p1.chompsms,com.viber.voip' title='Best Communication Apps' author='Android Blog' lang='en' width='auto']";
echo 'How to use the Playboard App Widget:
Single App:
Examples
Multiple Apps:
Examples
Need more widgets or even a custom one? Visithttp://playboard.me/widgets ';
}
static function register_script() {
wp_register_script('aa-js','http://appaware.com/widgets/aa.js', null, null, false);
wp_register_script('pb-app-box-js','http://playboard.me/widgets/pb-app-box/1/pb_load_app_box_wp.js', null, null, false);
}
static function print_script() {
if (self::$add_aa_script ){
wp_print_scripts('aa-js');
}
if (self::$add_pb_script ){
wp_print_scripts('pb-app-box-js');
}
}
}
PlayboardAppShortcode::init();
?>