';
return $RAT;
}
function generate_icon_button($params){
$label = $this->get_value($params,'label');
$title = $this->get_value($params,'title');
$icon = $this->get_value($params,'icon');
$size = $this->get_value($params,'size');
$class = $this->get_value($params,'class');
$style = $this->get_value($params,'style');
$click = $this->get_value($params,'click');
$stize = '';if($size!=''){$stize = ' style="font-size:'.$size.'px;"';}
$cls = 'icnbtn';if($class!=''){$cls .= ' '.$class;}
$ttl = '';if($title!=''){$ttl = 'title="'.$title.'"';}
$RAT = '';
$RAT .= '
';
if($icon!=''){$RAT .= ' ';}
if($label!=''){$RAT .= ''.$label.' ';}
$RAT .= ' ';
return $RAT;
}
function generate_live_checkbox($id,$val,$flag=''){
$chk = '';
if($val=='1' or $val=='true' or $val===true){$chk = ' checked';}
return '
';
}
function generate_live_color_picker($id,$val,$ttl=''){
$RAT = '';
$rgb = '';
$hex = '';
if($this->isRGB($val)){$hex = $this->rgbToHex($val);$rgb = $this->rgbToArray($val);}
if($this->isHex($val)){$rgb = $this->hexToRGB($val);$hex = $val;}
$RAT .= '
';
$RAT .= '
';
$RAT .= '
';
if($ttl!=''){$RAT .= '
'.$ttl.'
';}
if($ttl!=''){$RAT .= '
';}
$RAT .= '
';
$RAT .= '
';
$RAT .= '
';
$RAT .= '
';
$RAT .= '
';
$RAT .= '
';
$RAT .= '
';
$RAT .= '
';
$RAT .= '';
return $RAT;
}
function generate_live_editor(){
$editors = array();
$editors['sitewide_editor'] = 'Site Layout / Options';
$editors['sitewide_style'] = 'Sitewide Styling';
$editors['banner'] = 'Header - Banner / Logo';
$editors['titlebar'] = 'Header - Title Bar';
$editors['sub-header'] = 'Navigation Bar';
$editors['social_editor'] = 'Custom Button Bar';
$editors['footer'] = 'Footer Styling';
$editors['seo'] = 'SEO Enhancements';
if($this->is_advanced()){
$editors['script_editor'] = 'Script / CSS Includes';
$editors['analytics'] = 'Analytics';
$editors['sitewide_settings'] = 'Backup / Restore';//'Settings / Tools';
if($this->is_api()){$editors['amptools'] = 'WP AMP Tools API';}
}
$docdata = $this->get_document_data();
$pageid = $docdata['pageid'];
echo '
';
echo '';
$comclass = '';if($this->is_advanced()){$comclass = ' class="advison"';}
echo '
';
echo '
';
if(is_single() or is_page() or is_category() or $pageid==0){
echo '
';
}
echo '
';
echo '
';
}
function generate_live_select($id,$val,$opts,$flag=''){
$RAT = '';
$RAT .= '
';
foreach($opts as $dex=>$vex){
$chk = '';
if($val==$dex){$chk = ' selected';}
$RAT .= ''.$vex.' ';
}
$RAT .= ' ';
return $RAT;
}
function generate_live_textarea($id,$val,$flag=''){
//return '
';
return '
';
}
function generate_live_textfield($id,$val,$filter='safe',$flag=''){
if($filter==''){$filter = 'safe';}
$keydown = ' onkeydown="return inputfilter_'.$filter.'(event);"';
if($filter=='none'){$keydown = '';}
return '
';
}
function generate_mobile_menu_block($params=array()){
$RAT = '';
$block = $this->get_customizer_setting('mobilemenu_block','post');
$type = $this->get_value($params,'type',$block);
if($type=='post' or $type=='page'){
$atts = shortcode_atts(array('number'=>3,'excerpt_words'=>50,'post_type'=>$type),array());
$RAT .= $this->generate_mobile_menu_latest($atts);
}else{
if($type=='custom'){
$content = $this->get_customizer_setting('mobilemenu_custom');
$content = $this->htmlout($content);
$content = $this->content_filter($content,true);
$RAT .= $content;
}
}
return $RAT;
}
function generate_mobile_menu_latest($atts){
$RAT = '';
$type = $this->get_value($atts,'post_type','post');
$limit = $this->get_value($atts,'number',2);
$exc = $this->get_value($atts,'excerpt_words',20);
global $wpdb;
$homeid = $wpdb->get_var("SELECT ID FROM $wpdb->posts WHERE post_name = 'home'");
$args = array(
'numberposts' => $limit,
'offset' => 0,
'category' => 0,
'orderby' => 'post_date',
'order' => 'DESC',
'include' => '',
'exclude' => $homeid,
'meta_key' => '',
'meta_value' =>'',
'post_type' => $type,
'post_status' => 'publish',
'suppress_filters' => true );
$recent_posts = wp_get_recent_posts( $args, $output = ARRAY_A );
$list = array();
foreach($recent_posts as $dex=>$data){
$post_id = $this->get_value($data,'ID');
if($post_id!=''){
$ttl = $this->get_value($data,'post_title');
$url = esc_url(get_permalink($post_id));
$txt = $this->get_excerpt_by_id($post_id,20);
$RAT .= '
';
}
}
return $RAT;
}
function generate_object_page_query($pageid,$pagetype,$ands=NULL){
$and = '';
if($ands!=NULL){
if(is_string($ands)){
if($ands!=''){$and = $ands;}
}else{
if(count($ands)>0){
foreach($ands as $dex=>$vex){
$and = $this->delimitit($and,' AND ',"`$dex`='$vex'");
}
}
}
}
if($and!=''){$and = ' AND '.$and;}
return "WHERE ((`pid`='$pageid' AND `PageType`='$pagetype') OR `pid`='0')".$and;
}
function generate_page_content($content='',$pageid=NULL,$pagetype=NULL){
$RAT = '';
$barred = '';
$bar = $this->is_sidebar($pageid,$pagetype);
if($bar!='' and $bar!='na'){$barred = ' sidebarred';}
$RAT .= '
';
$RAT .= '
';
$RAT .= $content;
$RAT .= '
';
$RAT .= ' ';
$this->theme_template('sidebar');
$RAT .= '
';
return $RAT;
}
function generate_placeholder($mod,$pass='',$over=''){
$RAT = '';
if($mod=='ad'){$mod = 'AD';}
$RAT .= '
';
$RAT .= '
AMP '.$this->ucwords_undash($mod).' Module
';
if($pass!=''){$RAT .= '
'.$pass.'
';}
$RAT .= '
';
return $RAT;
}
function generate_post($data,$how='',$ampd=false){
$post_id = $this->get_value($data,'ID');
$ttl = $this->get_value($data,'post_title');
$date = $this->get_value($data,'post_date');
$height = $this->get_value($data,'height',300);
$twid = $this->get_value($data,'thumbwidth',150);
$thit = $this->get_value($data,'thumbheight','auto');
$display = $this->get_value($data,'display','article');
$url = esc_url(get_permalink($post_id));
$txt = $this->get_excerpt_by_id($post_id,30);
$img = $this->get_default_image();
$imgwid = 880;
$imghit = 557;
if(has_post_thumbnail($post_id)){
$imgid = get_post_thumbnail_id($post_id);
$img = wp_get_attachment_url($imgid);
$imgdata = wp_get_attachment_metadata($imgid,true);
$iwid = $this->get_value($imgdata,'width');
$ihit = $this->get_value($imgdata,'height');
if($iwid!=''){$imgwid = $iwid;}
if($ihit!=''){$imghit = $ihit;}
}
$timetxt = '';
if($date!=''){$timetxt = date("M j, Y",strtotime($date));}
$author = '';
$authorid = $this->get_value($data,'post_author');
if($authorid!=''){
$user = get_userdata($authorid);
$author = $this->get_value($user,array('data','display_name'));
}
$cats = $this->get_post_category($post_id,'all','array');
$notags = false;
$tags = array();
if(count($cats)>0){
foreach($cats as $cat){
$catid = $this->get_value($cat,'term_id');
if($catid>1 or $notags){
$catname = $this->get_value($cat,'name');
$catlink = $this->get_category_link($catid);
$tags[$catname] = $catlink;
}
}
}
if(count($tags)==0){
$thetags = wp_get_post_tags($post_id);
if(count($thetags)>0){
foreach($thetags as $term){
$catid = $this->get_value($term,'term_id');
$catname = $this->get_value($term,'name');
$catlink = get_tag_link($catid);
if($catlink!='' and $catname!=''){$tags[$catname] = $catlink;}
}
}
}
if($how=='array'){return array('title'=>$ttl,'snippet'=>$txt,'image'=>$img,'wid'=>$imgwid,'hit'=>$imghit,'link'=>$url,'tags'=>$tags,'date'=>$timetxt,'author'=>$author);}
$addhit = '';
if(substr($display,0,5)=='image'){$addhit .= ' hit-'.$height;}
if($display=='thumbnail'){$addhit .= ' wid-'.$twid;}
$RAT = '';
$RAT .= '
';
$RAT .= '
';
if(count($tags)>0){
$RAT .= '
';
}
$RAT .= '
';
$RAT .= '
';
$imgadd = '';
$imgd = '';
if($display=='thumbnail'){
if($thit=='auto'){
if($ampd){
$imgadd .= ' width="'.$imgwid.'" height="'.$imghit.'" layout="responsive" class="ampimage"';
}else{
$sthit = floor($imghit/$imgwid*$twid);
$imgadd .= ' width="'.$twid.'" height="'.$sthit.'" layout="responsive" class="ampimage"';
}
}else{
$imgadd .= ' width="'.$twid.'" height="'.$thit.'" layout="fixed" class="ampimage"';
}
}else{
if($ampd){$imgd = 'amp-';$imgadd .= ' width="'.$imgwid.'" height="'.$imghit.'" layout="responsive" class="ampimage"';}
}
if($ampd){$imgd = 'amp-';}
if($display=='thumbnail'){$RAT .= '';}
$RAT .= '<'.$imgd.'img src="'.$img.'"'.$imgadd.'>';
// placeholder and fallback if any
$RAT .= ''.$imgd.'img>';
if($display=='thumbnail'){$RAT .= ' ';}
$RAT .= ' ';
$RAT .= '
';
$RAT .= '
';
$RAT .= '
';
$RAT .= '
';
if($date!=''){$RAT .= ''.$timetxt.' ';}
if($author!=''){$RAT .= ' by '.$author.' ';}
$RAT .= '
';
$RAT .= '
';
$txt = $this->content_filter($txt,$ampd);
$RAT .= $txt;
$RAT .= '... Read More ';
$RAT .= ' ';
$RAT .= '
';
$RAT .= '
';
$RAT .= '
';
$RAT .= '
';
$RAT .= '
';
$RAT .= '
';
return $RAT;
}
function generate_posts($params=array()){
$RAT = '';
$post_type = $this->get_value($params,'post_type','post');
$limit = $this->get_value($params,'limit',4);
$display = $this->get_value($params,'display','article');
$postby = $this->get_value($params,'postby','recent');
$height = $this->get_value($params,'height',300);
$twid = $this->get_value($params,'thumbwidth',150);
$thit = $this->get_value($params,'thumbheight','auto');
$title = $this->get_value($params,'Title');
$category = 0;
$include = '';
$ampd = $this->is_amp();
$imgd = '';
if($ampd){$imgd='amp-';}
if($display=='onethree'){$limit = 4;}
global $wpdb;
$homeid = $wpdb->get_var("SELECT ID FROM $wpdb->posts WHERE post_name = 'home'");
$doc = $this->get_document_data();
$pageid = $this->get_value($doc,'pageid');
$pagetype = $this->get_value($doc,'pagetype');
$homeid = $this->delimitit($homeid,',',$pageid);
$catt = '';
$tagg = '';
$order = 'DESC';
$orderby = 'post_date';
if($postby=='popular' or $postby=='featured'){
if($postby=='featured'){
$arr = $this->queryit('select','settings',array('PageType'=>$post_type,'Var'=>'featured','Val'=>'true'),'ORDER BY `id` DESC LIMIT '.$limit);
}else{
$arr = $this->queryit('select','settings',array('PageType'=>$post_type,'Var'=>'pageviews'),'ORDER BY `Val` DESC LIMIT '.$limit);
$orderby = 'post__in';
}
$includes = array();
if($this->validsql($arr)){
foreach($arr as $data){
$pid = $this->get_value($data,'pid');
if($pid!=''){$includes[] = $pid;}
}
}
if(count($include)>0){$include = implode(',',$includes);}
}else if($postby=='related'){
if($pagetype=='category'){
$category = $pageid;
}else{
$cata = array();
$cats = $this->get_value($doc,'categories');
if($cats!=''){
foreach($cats as $cat){
$tid = $this->get_value($cat,'term_id');
if($tid!=''){$catt = $this->delimitit($catt,',',$tid);}
}
}
if($catt!=''){$category = $catt;}
$tags = wp_get_post_tags($pageid);
if(count($tags)>0){
foreach($tags as $tag){
$tid = $this->get_value($tag,'term_id');
if($tid!=''){$tagg = $this->delimitit($tagg,',',$tid);}
}
}
}
}else{
if($pagetype=='category'){$category = $pageid;}
}
$args = array(
'numberposts' => $limit,
'offset' => 0,
'category' => $category,
'orderby' => $orderby,
'order' => $order,
'include' => $include,
'exclude' => $homeid,
'post_type' => $post_type,
'post_status' => 'publish',
'suppress_filters' => true );
$arr = get_posts($args,$output=ARRAY_A);
$arrs = count($arr);
if($arrs<$limit and $tagg!=''){
$args = array(
'numberposts' => ($limit-$arrs),
'offset' => 0,
'orderby' => $orderby,
'order' => $order,
'include' => $include,
'exclude' => $homeid,
'post_type' => $post_type,
'post_status' => 'publish',
'tax_query'=>array(array('taxonomy'=>'post_tag','field'=>'term_id','terms'=>$tagg)),
'suppress_filters' => true );
$brr = get_posts($args,$output=ARRAY_A);
if(count($brr)>0){$arr = array_merge($arr,$brr);}
}
$list = array();
$pdis = $display;
if(substr($display,0,5)=='image'){$pdis = 'image posts-'.$display;}
if(substr($display,0,7)=='article' and $display!='article'){$pdis = 'article posts-'.$display;}
$ascar = array();
$carousel = false;
if($display=='slideshow' or $display=='flipper' or $display=='carousel'){$carousel = true;}
$RAT .= '
';
if(count($arr)>0){
foreach($arr as $data){
$post_id = $this->get_value($data,'ID');
if($post_id!=''){
$data->height = $height;
$data->thumbwidth = $twid;
$data->thumbheight = $thit;
$data->display = $display;
if($carousel){
$ascar[] = $this->generate_post($data,'array',$ampd);
}else{
$RAT .= $this->generate_post($data,'',$ampd);
}
}
}
}else{
$RAT .= '
No posts were found for this module ';
}
$RAT .= '';
if($carousel){
$cars = array();
$cars['height'] = $height;
$cars['display'] = $display;
$cars['ampd'] = $ampd;
$cars['id'] = 'posts';
$cars['slides'] = $ascar;
$RAT = $this->generate_carousel($cars);// WPTASK - THIS OPTION ONLY EXISTS WITH PLUGIN, BUT MUST REMAIN HERE
}
return $RAT;
}
function generate_social_bar(){
$RAT = '';
$list = $this->get_customizer_setting('social_buttonlist');
if($list!=''){
$exp = explode('[JJ]',$list);
foreach($exp as $part){
$parts = explode('[DD]',$part);
$icon = $this->get_value($parts,0);
$url = $this->get_value($parts,1);
$ttl = $this->get_value($parts,2);
$RAT .= '
';
}
}
$usefeed = $this->get_customizer_setting('social_rssfeed');
if($usefeed==''){
$feedurl = $this->get_site_base_url().'/feed';
$RAT .= '';
}
return $RAT;
}
function generate_social_button_item($data){
$icon = $this->get_value($data,'icon');
$url = $this->get_value($data,'url');
$ttl = $this->get_value($data,'title');
$RAT = '';
$RAT .= '
';
return $RAT;
}
function generate_social_button_manager(){
$RAT = '';
$RAT .= '
Choose an Icon to Create a Button ';
$list = $this->get_customizer_setting('social_buttonlist');
$RAT .= '
';
if($list!=''){
$exp = explode('[JJ]',$list);
foreach($exp as $part){
$parts = explode('[DD]',$part);
$icon = $this->get_value($parts,0);
$url = $this->get_value($parts,1);
$ttl = $this->get_value($parts,2);
$RAT .= $this->generate_social_button_item(array('icon'=>$icon,'url'=>$url,'title'=>$ttl));
}
}
$RAT .= '
';
return $RAT;
}
function generate_video_module($attrs,$ampd=false){
$RAT = '';
$provider = $this->get_value($attrs,'provider');
$source = $this->get_value($attrs,'sourcecode');
$aspect = $this->get_value($attrs,'aspectratio');
$width = 16;
$height = 9;
$layout = 'responsive';
if($layout=='responsive' and $aspect!=''){
$vals = explode('x',$aspect);
$xwid = $this->get_value($vals,0,$width);
$xhit = $this->get_value($vals,1,$height);
$width = $xwid;
$height = $xhit;
}
$atts = '';
$warn = '';
$vidttl = '';
if($provider==''){
$warn = 'You must choose a Provider';
}else{
$providers = array('reach-player'=>'Beachfront Reach','brid-player'=>'Brid.tv','dailymotion'=>'Dailymotion','facebook'=>'Facebook','vimeo'=>'Vimeo','youtube'=>'YouTube','video'=>'Local Media File');
$vars = array('reach-player'=>'embed-id','brid-player'=>'video','dailymotion'=>'videoid','facebook'=>'href','vimeo'=>'videoid','youtube'=>'videoid');
$ttls = array('reach-player'=>'Embed ID','brid-player'=>'Video ID','dailymotion'=>'Video ID','facebook'=>'Video URL','vimeo'=>'Video ID','youtube'=>'Video ID');
$pass = '
'.$this->get_value($providers,$provider).' ';
$ttl = $this->get_value($ttls,$provider);
if($provider=='brid-player'){
$partner = $this->get_value($attrs,'partner');
$player = $this->get_value($attrs,'player');
$video = $this->get_value($attrs,'video');
$playlist = $this->get_value($attrs,'playlist');
if($partner=='' or $player==''){
$warn = 'You must enter your Brid.tv "Partner ID" and "Player ID"';
}else if($video=='' and $playlist==''){
$warn = 'You must enter either a Brid.tv "Video ID" or "Playlist ID"';
}else{
$atts .= ' data-partner="'.$partner.'"';
$atts .= ' data-player="'.$player.'"';
if($play!=''){
$atts .= ' data-playlist="'.$play.'"';
$vidttl = 'Playlist ID: '.$video;
}else{
$atts .= ' data-video="'.$video.'"';
$vidttl = 'Video ID: '.$video;
}
}
}else{
$vidvar = '';
if($provider=='vimeo' or $provider=='dailymotion' or $provider=='youtube'){
$vidvar = 'videoid';
}else if($provider=='reach-player'){
$vidvar = 'embed-id';
}else if($provider=='facebook'){
$vidvar = 'href';
$atts .= ' data-embed-as="video"';
}else if($provider=='video'){
if(strstr($video,'wp-content/uploads')){
$exp = explode('wp-content/uploads',$video);
$path = $this->get_value($exp,1);
if($path!=''){
$vidvar = 'video';
$atts .= ' controls';
$atts .= ' src="../wp-content/uploads'.$path.'"';
$atts .= ' poster="'.$this->self['PATH'].'images/vidposter.jpg"';
}
}
}
if($vidvar!=''){
if($source=='shortcode'){
$video = $this->get_value($attrs,'video');
}else{
$video = $this->get_value($attrs,$vidvar);
}
$prov = $providers[$provider];
if($video==''){
$warn = 'You must enter your '.$prov.' "'.$ttl.'"';
}else{
$atts .= ' data-'.$vidvar.'="'.$video.'"';
if($provider=='facebook' or $provider=='video'){
$vidttl = $video;
}else{
$vidttl = $this->get_value($ttls,$provider).': '.$video;
}
}
}
}
}
if($ampd and $warn==''){
$RAT .= '
';
}else{
if($provider==''){
$pass = $this->generate_warning($warn);
}else{
$pass = '
'.$providers[$provider].' ';
if($warn==''){
$pass .= '
'.$vidttl.' ';
}else{
$pass .= $this->generate_warning($warn);
}
}
$over = '';
if($ampd){$over = 'amp';}
$RAT .= $this->generate_placeholder('video',$pass,$over);
}
return $RAT;
}
function generate_warning($pass){
$RAT = '';
$RAT .= '
'.$pass.' ';
return $RAT;
}
function get_attachment_id_from_url($image_url) {
global $wpdb;
$attachment = $wpdb->get_col($wpdb->prepare("SELECT ID FROM $wpdb->posts WHERE guid='%s';", $image_url ));
return $attachment[0];
}
function get_dat($var,$def=''){
return $this->htmlout($this->queryit('get','dats','Val',array('Var'=>$var)));
}
function get_default_image(){
$def = $this->get_customizer_setting('site_defaultimage');
if($def!=''){return $def;}
return $this->self['PATH'].'images/no-image-found.jpg';
}
function get_document_data(){
$jsontype = 'WebPage';
$url = $this->current_page_url();
$headline = $this->get_page_title();
$desc = '';
$contype = 'website';
$title = $headline;
$sitename = get_bloginfo('title');
if(is_home() or is_front_page()){
$headline = $sitename;
$jsontype = 'WebSite';
$desc = get_bloginfo('description');
}else{
if(is_category()){
$jsontype = 'WebSite';
}else{
if(is_single()){$jsontype = 'NewsArticle';}
$contype = 'article';
}
}
$published = '';
$modified = '';
$author = '';
$authorid = '';
if(is_category()){
$term_id = $this->get_category_id();
$data = get_category($term_id);
$pageid = $term_id;
$pagetype = 'category';
}else if(is_front_page() or is_home()){
$data = get_post();
$post_id = $this->get_value($data,'ID');
$post_type = $this->get_value($data,'post_type');
if($post_type=='page'){
$pageid = $post_id;
$pagetype = 'page';
}else{
$pageid = 0;
$pagetype = 'post';
}
}else{
$data = get_post();
$post_id = $this->get_value($data,'ID');
$authorid = $this->get_value($data,'post_author');
$published = $this->get_value($data,'post_date');
$modified = $this->get_value($data,'post_modified');
$published = str_replace(' ','T',$published);
$modified = str_replace(' ','T',$modified);
$pageid = $post_id;
$pagetype = $this->get_value($data,'post_type');
}
if($authorid!=''){$author = get_the_author_meta('nicename',$authorid);}
if($published==''){$published = date('Y-m-dTh:i:sZ',time());}
$logow = '';
$logoh = '';
$imgw = '';
$imgh = '';
$images = array();
$logo = $this->get_customizer_setting('header_logoimage');
if($logo!=''){
$logow = $this->get_image_info($logo,'width');
$logoh = $this->get_image_info($logo,'height');
}
$img = $this->get_featured_image($pageid);
if($img!=''){
$imgw = $this->get_image_info($img,'width');
$imgh = $this->get_image_info($img,'height');
}
$publisher = get_bloginfo('name');
$publishertype = 'Organization';
$category = '';
$categories = '';
if(is_single()){
$category = $this->get_post_category();
$categories = $this->get_post_category($pageid,'all','array');
}
$DAT = array();
$DAT['pagetype'] = $pagetype;
$DAT['pageid'] = $pageid;
$DAT['jsontype'] = $jsontype;
$DAT['url'] = $url;
$DAT['headline'] = $headline;
$DAT['desc'] = $desc;
$DAT['contype'] = $contype;
$DAT['title'] = $title;
$DAT['sitename'] = $sitename;
$DAT['published'] = $published;
$DAT['modified'] = $modified;
$DAT['author'] = $author;
$DAT['authorid'] = $authorid;
$DAT['publisher'] = $publisher;
$DAT['publishertype'] = $publishertype;
$DAT['logo'] = $logo;
$DAT['logow'] = $logow;
$DAT['logoh'] = $logoh;
$DAT['img'] = $img;
$DAT['imgw'] = $imgw;
$DAT['imgh'] = $imgh;
$DAT['images'] = $images;
$DAT['category'] = $category;
$DAT['categories'] = $categories;
return $DAT;
}
function get_page_setting($id,$type,$var){
return $this->htmlout($this->queryit('get','settings','Val',array('pid'=>$id,'PageType'=>$type,'Var'=>$var)));
}
function get_size_choices($how=''){
$RET = array();
$pre = substr($how,0,5);
if($how=='auto' or $how=='thumbheight'){$RET ['auto'] = 'Auto';}
$RET['100'] = '100px';
if($pre=='thumb'){
$RET['110'] = '110px';
$RET['120'] = '120px';
$RET['130'] = '130px';
$RET['140'] = '140px';
}
$RET['150'] = '150px';
if($pre=='thumb'){
$RET['160'] = '160px';
$RET['170'] = '170px';
$RET['180'] = '180px';
$RET['190'] = '190px';
}
$RET['200'] = '200px';
if($pre=='thumb'){
$RET['220'] = '220px';
$RET['240'] = '240px';
$RET['260'] = '260px';
$RET['280'] = '280px';
}
$RET['300'] = '300px';
if($pre!='thumb'){
$RET['400'] = '400px';
$RET['500'] = '500px';
$RET['600'] = '600px';
}
return $RET;
}
function get_social_network_data($network=NULL){
$RET['facebook'] = array('icon'=>'facebook','square'=>'facebook-square','color'=>'#3b5998','title'=>'Facebook');
$RET['flickr'] = array('icon'=>'flickr','color'=>'#dc4e41','title'=>'Flickr');
$RET['gplus'] = array('icon'=>'google-plus','square'=>'google-plus-square','color'=>'#D51F1E','title'=>'Google+');
$RET['instagram'] = array('icon'=>'instagram','color'=>'#F00','title'=>'Instagram');
$RET['linkedin'] = array('icon'=>'linkedin','square'=>'linkedin-square','color'=>'#0077b5','title'=>'LinkedIn');
$RET['pinterest'] = array('icon'=>'pinterest-p','square'=>'pinterest-square','color'=>'#bd081c','title'=>'Pinterest');
$RET['tumblr'] = array('icon'=>'tumblr','square'=>'tumblr-square','color'=>'#33465D','title'=>'Tumblr');
$RET['twitter'] = array('icon'=>'twitter','square'=>'twitter-square','color'=>'#55acee','title'=>'Twitter');
$RET['vimeo'] = array('icon'=>'vimeo','square'=>'vimeo-square','color'=>'#1AB7EA','title'=>'Vimeo');
$RET['youtube'] = array('icon'=>'youtube-play','square'=>'youtube-square','color'=>'#DD2623','title'=>'YouTube');
if($network!='social'){
$RET['email'] = array('icon'=>'envelope-o','square'=>'envelope-square','color'=>'#000','title'=>'Email');
$RET['rss'] = array('icon'=>'rss','square'=>'rss-square','color'=>'#F90','title'=>'RSS Feed');
}
if($network!=NULL and $network!='social'){return $this->get_value($RET,$network,array());}
return $RET;
}
function include_amp_module($mod){
echo '';
}
function include_amp_modules(){
$used = array();
$this->include_amp_module('form');$used['form'] = true;
$this->include_amp_module('sidebar');$used['sidebar'] = true;
if($this->is_advanced()){$used = $this->adv_amp_modules($used);}
}
function is_amp($com=''){
if($com!='not'){
if($this->get_value($_GET,'commenting')=='1'){return false;}
if($this->get_value($_GET,'useforms')=='1'){return false;}
}
if($this->get_value($_GET,'amp')=='1'){return true;}
if($this->is_user_admin()){return false;}
return true;
}
function is_amp_not(){
if($this->is_amp('not')){
if($this->get_value($_GET,'commenting')=='1'){return true;}
if($this->get_value($_GET,'useforms')=='1'){return true;}
}
//if($this->is_amp('not') and $this->get_value($_GET,'commenting')=='1'){return true;}
return false;
}
function is_archive_preview(){
if($this->get_value($_GET,'amp')=='1' and $this->get_value($_GET,'archivepreview')=='1' and $this->get_value($_GET,'id')!='' and $this->get_value($_GET,'aid')!='' and $this->get_value($_GET,'how')!=''){
return true;
}
return false;
}
function is_comments(){
if($this->is_comments_wp() && $this->get_value($_GET,'commenting')=='1'){return true;}
return false;
}
function is_comments_wp(){
if((!is_admin()) && is_singular() && comments_open() && get_option('thread_comments')){return true;}
return false;
}
function is_sidebar($pageid=NULL,$pagetype=NULL){
$hid = $this->get_page_setting($pageid,$pagetype,'hidesidebar');
if($hid===true or $hid==='true'){return '';}
$data = $this->get_document_data();
$pagetype = $this->get_value($data,'pagetype');
$pageid = $this->get_value($data,'pageid');
$pageurl = $this->get_value($data,'url');
$blogurl = $this->get_site_base_url();
$fhome = false;
if($pageurl!=''){
$purls = explode('?',$pageurl);
$purl = $purls[0];
$furl = str_replace($blogurl,'',$purl);
if(substr($furl,0,1)=='/'){$furl = substr($furl,1);}
if($furl==''){$fhome = true;}
}
$sid = '';
if(is_category()){
$sid = 'category';
}else if(is_home() and is_front_page()){
$sid = 'home';// default
}else if(is_front_page()){
$sid = 'home';// front
}else if(is_home()){
$sid = 'home';
if($pagetype=='post' and $pageid=='0'){
if($fhome==true){
$sid = 'home';// default
}else{
$sid = 'category';// blog
}
}
}else if(is_page()){
$sid = 'page';
}else if(is_single()){
$sid = 'post';
}else if(is_archive()){
$sid = 'archive';
}
$side = $sid.'sidebar';
if($this->get_customizer_setting('site_hide'.$side)!=''){return '';}
if(is_active_sidebar($side)){return $side;}
if($this->is_advanced()){if($this->adv_is_sidebar($pageid,$pagetype)!='na'){return $side;}}
if(is_active_sidebar('sitesidebar')){return $side;}
return 'na';
}
function page_navigation() {
global $wp_query;
$bignum = 999999999;
if ( $wp_query->max_num_pages <= 1 ){return;}
echo '