晋太元中,武陵人捕鱼为业。缘溪行,忘路之远近。忽逢桃花林,夹岸数百步,中无杂树,芳草鲜美,落英缤纷。渔人甚异之,复前行,欲穷其林。 林尽水源,便得一山,山有小口,仿佛若有光。便舍船,从口入。初极狭,才通人。复行数十步,豁然开朗。土地平旷,屋舍俨然,有良田、美池、桑竹之属。阡陌交通,鸡犬相闻。其中往来种作,男女衣着,悉如外人。黄发垂髫,并怡然自乐。 见渔人,乃大惊,问所从来。具答之。便要还家,设酒杀鸡作食。村中闻有此人,咸来问讯。自云先世避秦时乱,率妻子邑人来此绝境,不复出焉,遂与外人间隔。问今是何世,乃不知有汉,无论魏晋。此人一一为具言所闻,皆叹惋。余人各复延至其家,皆出酒食。停数日,辞去。此中人语云:“不足为外人道也。”(间隔 一作:隔绝) 既出,得其船,便扶向路,处处志之。及郡下,诣太守,说如此。太守即遣人随其往,寻向所志,遂迷,不复得路。 南阳刘子骥,高尚士也,闻之,欣然规往。未果,寻病终。后遂无问津者。
| DIR:/home/salvufkx/www/wp-contentmmm/themes/vega/lib/ |
| Current File : /home/salvufkx/www/wp-contentmmm/themes/vega/lib/contentbuilder.shortcode.lib.php |
<?php
//Get all galleries
$args = array(
'numberposts' => -1,
'post_type' => array('galleries'),
);
$galleries_arr = get_posts($args);
$galleries_select = array();
$galleries_select[''] = '';
foreach($galleries_arr as $gallery)
{
$galleries_select[$gallery->ID] = $gallery->post_title;
}
//Get all categories
$categories_arr = get_categories();
$categories_select = array();
$categories_select[''] = '';
foreach ($categories_arr as $cat) {
$categories_select[$cat->cat_ID] = $cat->cat_name;
}
//Get all gallery categories
$gallery_cats_arr = get_terms('gallerycat', 'hide_empty=0&hierarchical=0&parent=0&orderby=menu_order');
$gallery_cats_select = array();
$gallery_cats_select[''] = '';
foreach ($gallery_cats_arr as $gallery_cat) {
$gallery_cats_select[$gallery_cat->slug] = $gallery_cat->name;
}
//Get all portfolio categories
$portfolio_cats_arr = get_terms('portfoliosets', 'hide_empty=0&hierarchical=0&parent=0&orderby=menu_order');
$portfolio_cats_select = array();
$portfolio_cats_select[''] = '';
foreach ($portfolio_cats_arr as $portfolio_cat) {
$portfolio_cats_select[$portfolio_cat->slug] = $portfolio_cat->name;
}
//Get order options
$order_select = array(
'default' => 'By Default',
'newest' => 'By Newest',
'oldest' => 'By Oldest',
'title' => 'By Title',
'random' => 'By Random',
);
//Get parallax type options
$parallax_select = array(
'' => 'None',
'scroll_pos' => 'Scroll Position',
);
$ppb_shortcodes = array(
'ppb_divider' => array(
'title' => 'Paragraph Break',
'icon' => 'divider.png',
'attr' => array(),
'desc' => array(),
'content' => FALSE
),
'ppb_text' => array(
'title' => 'Text, HTML and shortcode Content',
'icon' => 'text.png',
'attr' => array(
'custom_css' => array(
'title' => 'Custom CSS',
'type' => 'text',
'desc' => 'You can add custom CSS style for this block (advanced user only)',
),
),
'desc' => array(),
'content' => TRUE
),
'ppb_galleries' => array(
'title' => 'Gallery Archive',
'icon' => 'galleries.png',
'attr' => array(
'cat' => array(
'title' => 'Gallery Category',
'type' => 'select',
'options' => $gallery_cats_select,
'desc' => 'Select the gallery category (optional)',
),
'items' => array(
'title' => 'Items',
'type' => 'text',
'desc' => 'Enter number of items to display (number only)',
),
'custom_css' => array(
'title' => 'Custom CSS',
'type' => 'text',
'desc' => 'You can add custom CSS style for this block (advanced user only)',
),
),
'desc' => array(),
'content' => FALSE
),
'ppb_gallery_slider' => array(
'title' => 'Gallery Slider Fullwidth',
'icon' => 'gallery_slider_full.png',
'attr' => array(
'gallery' => array(
'title' => 'Gallery',
'type' => 'select',
'options' => $galleries_select,
'desc' => 'Select the gallery you want to display',
),
'autoplay' => array(
'title' => 'Auto Play',
'type' => 'select',
'options' => array(
1 => 'Yes',
0 => 'No'
),
'desc' => 'Auto play gallery image slider',
),
'timer' => array(
'title' => 'Timer',
'type' => 'text',
'desc' => 'Enter number of seconds for slider timer (number only)',
),
'caption' => array(
'title' => 'Display Image Caption',
'type' => 'select',
'options' => array(
1 => 'Yes',
0 => 'No'
),
'desc' => 'Display gallery image caption',
),
'custom_css' => array(
'title' => 'Custom CSS',
'type' => 'text',
'desc' => 'You can add custom CSS style for this block (advanced user only)',
),
),
'desc' => array(),
'content' => FALSE
),
'ppb_gallery_slider_fixed_width' => array(
'title' => 'Gallery Slider Fixed Width',
'icon' => 'gallery_slider_fixed.png',
'attr' => array(
'gallery' => array(
'title' => 'Gallery',
'type' => 'select',
'options' => $galleries_select,
'desc' => 'Select the gallery you want to display',
),
'autoplay' => array(
'title' => 'Auto Play',
'type' => 'select',
'options' => array(
1 => 'Yes',
0 => 'No'
),
'desc' => 'Auto play gallery image slider',
),
'timer' => array(
'title' => 'Timer',
'type' => 'text',
'desc' => 'Enter number of seconds for slider timer (number only)',
),
'caption' => array(
'title' => 'Display Image Caption',
'type' => 'select',
'options' => array(
1 => 'Yes',
0 => 'No'
),
'desc' => 'Display gallery image caption',
),
'custom_css' => array(
'title' => 'Custom CSS',
'type' => 'text',
'desc' => 'You can add custom CSS style for this block (advanced user only)',
),
),
'desc' => array(),
'content' => FALSE
),
'ppb_gallery_horizontal' => array(
'title' => 'Gallery Horizontal',
'icon' => 'horizontal.png',
'attr' => array(
'gallery' => array(
'title' => 'Gallery',
'type' => 'select',
'options' => $galleries_select,
'desc' => 'Select the gallery you want to display',
),
'custom_css' => array(
'title' => 'Custom CSS',
'type' => 'text',
'desc' => 'You can add custom CSS style for this block (advanced user only)',
),
),
'desc' => array(),
'content' => FALSE
),
'ppb_gallery_wall' => array(
'title' => 'Gallery Wall',
'icon' => 'wall.png',
'attr' => array(
'gallery' => array(
'title' => 'Gallery',
'type' => 'select',
'options' => $galleries_select,
'desc' => 'Select the gallery you want to display',
),
'items' => array(
'title' => 'Items',
'type' => 'text',
'desc' => 'Enter number of items to display (number only)',
),
'layout' => array(
'title' => 'Select photowall layout',
'type' => 'select',
'options' => array(
'fullwidth' => 'Fullwidth',
'fixed_width' => 'Fixed Width'
),
'desc' => '',
),
'custom_css' => array(
'title' => 'Custom CSS',
'type' => 'text',
'desc' => 'You can add custom CSS style for this block (advanced user only)',
),
),
'desc' => array(),
'content' => FALSE
),
'ppb_image_fullwidth' => array(
'title' => 'Image Fullwidth',
'icon' => 'image_full.png',
'attr' => array(
'image' => array(
'title' => 'Image',
'type' => 'file',
'desc' => 'Upload image you want to display for this content',
),
'height' => array(
'type' => 'text',
'desc' => 'Enter number of height for this content (in pixel)',
),
'display_caption' => array(
'title' => 'Display caption',
'type' => 'select',
'options' => array(
1 => 'Yes',
0 => 'No'
),
'desc' => '',
),
'custom_css' => array(
'title' => 'Custom CSS',
'type' => 'text',
'desc' => 'You can add custom CSS style for this block (advanced user only)',
),
),
'desc' => array(),
'content' => FALSE
),
'ppb_image_fixed_width' => array(
'title' => 'Image Fixed Width',
'icon' => 'image_fixed.png',
'attr' => array(
'image' => array(
'title' => 'Image',
'type' => 'file',
'desc' => 'Upload image you want to display for this content',
),
'display_caption' => array(
'title' => 'Display caption and description',
'type' => 'select',
'options' => array(
1 => 'Yes',
0 => 'No'
),
'desc' => '',
),
'custom_css' => array(
'title' => 'Custom CSS',
'type' => 'text',
'desc' => 'You can add custom CSS style for this block (advanced user only)',
),
),
'desc' => array(),
'content' => FALSE
),
'ppb_image_half_fixed_width' => array(
'title' => 'Image One Half Width',
'icon' => 'image_half_fixed.png',
'attr' => array(
'image' => array(
'title' => 'Image',
'type' => 'file',
'desc' => 'Upload image you want to display for this content',
),
'align' => array(
'title' => 'Image alignment',
'type' => 'select',
'options' => array(
'left' => 'Left',
'right' => 'Right'
),
'desc' => 'Select the alignment for image',
),
'custom_css' => array(
'title' => 'Custom CSS',
'type' => 'text',
'desc' => 'You can add custom CSS style for this block (advanced user only)',
),
),
'desc' => array(),
'content' => TRUE
),
'ppb_image_half_fullwidth' => array(
'title' => 'Image One Half Fullwidth',
'icon' => 'image_half_full.png',
'attr' => array(
'image' => array(
'title' => 'Image',
'type' => 'file',
'desc' => 'Upload image you want to display for this content',
),
'height' => array(
'type' => 'text',
'desc' => 'Enter number of height for this content (in pixel)',
),
'align' => array(
'title' => 'Image alignment',
'type' => 'select',
'options' => array(
'left' => 'Left',
'right' => 'Right'
),
'desc' => 'Select the alignment for image',
),
'custom_css' => array(
'title' => 'Custom CSS',
'type' => 'text',
'desc' => 'You can add custom CSS style for this block (advanced user only)',
),
),
'desc' => array(),
'content' => TRUE
),
'ppb_two_cols_images' => array(
'title' => 'Images Two Columns',
'icon' => 'images_two_cols.png',
'attr' => array(
'image1' => array(
'title' => 'Image 1',
'type' => 'file',
'desc' => 'Upload image you want to display for this content',
),
'image2' => array(
'title' => 'Image 2',
'type' => 'file',
'desc' => 'Upload image you want to display for this content',
),
'display_caption' => array(
'title' => 'Display caption and description',
'type' => 'select',
'options' => array(
1 => 'Yes',
0 => 'No'
),
'desc' => '',
),
'custom_css' => array(
'title' => 'Custom CSS',
'type' => 'text',
'desc' => 'You can add custom CSS style for this block (advanced user only)',
),
),
'desc' => array(),
'content' => TRUE
),
'ppb_three_cols_images' => array(
'title' => 'Images Three Columns',
'icon' => 'images_three_cols.png',
'attr' => array(
'image1' => array(
'title' => 'Image 1',
'type' => 'file',
'desc' => 'Upload image you want to display for this content',
),
'image2' => array(
'title' => 'Image 2',
'type' => 'file',
'desc' => 'Upload image you want to display for this content',
),
'image3' => array(
'title' => 'Image 3',
'type' => 'file',
'desc' => 'Upload image you want to display for this content',
),
'display_caption' => array(
'title' => 'Display caption and description',
'type' => 'select',
'options' => array(
1 => 'Yes',
0 => 'No'
),
'desc' => '',
),
'custom_css' => array(
'title' => 'Custom CSS',
'type' => 'text',
'desc' => 'You can add custom CSS style for this block (advanced user only)',
),
),
'desc' => array(),
'content' => TRUE
),
'ppb_three_images_block' => array(
'title' => 'Images Three blocks',
'icon' => 'images_three_block.png',
'attr' => array(
'image_portrait' => array(
'title' => 'Image Portrait',
'type' => 'file',
'desc' => 'Upload image you want to display for this content (Portrait image size)',
),
'image_portrait_align' => array(
'title' => 'Image Portrait alignment',
'type' => 'select',
'options' => array(
'left' => 'Left',
'right' => 'Right'
),
'desc' => 'Select the alignment for image portrait size',
),
'image2' => array(
'title' => 'Image 2',
'type' => 'file',
'desc' => 'Upload image you want to display for this content',
),
'image3' => array(
'title' => 'Image 3',
'type' => 'file',
'desc' => 'Upload image you want to display for this content',
),
'display_caption' => array(
'title' => 'Display caption and description',
'type' => 'select',
'options' => array(
1 => 'Yes',
0 => 'No'
),
'desc' => '',
),
'custom_css' => array(
'title' => 'Custom CSS',
'type' => 'text',
'desc' => 'You can add custom CSS style for this block (advanced user only)',
),
),
'desc' => array(),
'content' => TRUE
),
'ppb_four_images_block' => array(
'title' => 'Images Four blocks',
'icon' => 'images_four_block.png',
'attr' => array(
'image1' => array(
'title' => 'Image 1',
'type' => 'file',
'desc' => 'Upload image you want to display for this content',
),
'image2' => array(
'title' => 'Image 2',
'type' => 'file',
'desc' => 'Upload image you want to display for this content',
),
'image3' => array(
'title' => 'Image 3',
'type' => 'file',
'desc' => 'Upload image you want to display for this content',
),
'image4' => array(
'title' => 'Image 4',
'type' => 'file',
'desc' => 'Upload image you want to display for this content',
),
'display_caption' => array(
'title' => 'Display caption and description',
'type' => 'select',
'options' => array(
1 => 'Yes',
0 => 'No'
),
'desc' => '',
),
'custom_css' => array(
'title' => 'Custom CSS',
'type' => 'text',
'desc' => 'You can add custom CSS style for this block (advanced user only)',
),
),
'desc' => array(),
'content' => TRUE
),
'ppb_blog' => array(
'title' => 'Blog Grid',
'icon' => 'blog.png',
'attr' => array(
'cat' => array(
'title' => 'Post Category',
'type' => 'select',
'options' => $categories_select,
'desc' => 'Select the post category (optional)',
),
'items' => array(
'title' => 'Items',
'type' => 'text',
'desc' => 'Enter number of items to display (number only)',
),
'custom_css' => array(
'title' => 'Custom CSS',
'type' => 'text',
'desc' => 'You can add custom CSS style for this block (advanced user only)',
),
),
'desc' => array(),
'content' => TRUE
),
'ppb_portfolio' => array(
'title' => 'Portfolio Grid',
'icon' => 'portfolio_grid.png',
'attr' => array(
'cat' => array(
'title' => 'Portfolio Category',
'type' => 'select',
'options' => $portfolio_cats_select,
'desc' => 'Select the portfolio category (optional)',
),
'items' => array(
'title' => 'Items',
'type' => 'text',
'desc' => 'Enter number of items to display (number only)',
),
'custom_css' => array(
'title' => 'Custom CSS',
'type' => 'text',
'desc' => 'You can add custom CSS style for this block (advanced user only)',
),
),
'desc' => array(),
'content' => TRUE
),
'ppb_portfolio_masonry' => array(
'title' => 'Portfolio Masonry',
'icon' => 'portfolio_masonry.png',
'attr' => array(
'cat' => array(
'title' => 'Portfolio Category',
'type' => 'select',
'options' => $portfolio_cats_select,
'desc' => 'Select the portfolio category (optional)',
),
'items' => array(
'title' => 'Items',
'type' => 'text',
'desc' => 'Enter number of items to display (number only)',
),
'custom_css' => array(
'title' => 'Custom CSS',
'type' => 'text',
'desc' => 'You can add custom CSS style for this block (advanced user only)',
),
),
'desc' => array(),
'content' => TRUE
),
);
//Check if Layer slider is installed
$revslider = ABSPATH . '/wp-content/plugins/revslider/revslider.php';
// Check if the file is available to prevent warnings
$pp_revslider_activated = file_exists($revslider);
if($pp_revslider_activated)
{
//Get WPDB Object
global $wpdb;
// Get Rev Sliders
include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
$is_revslider_active = is_plugin_active('revslider/revslider.php');
$wp_revsliders = array();
if($is_revslider_active)
{
$wp_revsliders = array(
-1 => "Choose a slider",
);
$revslider_objs = new RevSlider();
$revslider_obj_arr = $revslider_objs->getArrSliders();
foreach($revslider_obj_arr as $revslider_obj)
{
$wp_revsliders[$revslider_obj->getAlias()] = $revslider_obj->getTitle();
}
}
$ppb_shortcodes['ppb_rev_slider'] = array(
'title' => 'Revolution Slider',
'icon' => 'revslider.png',
'attr' => array(
'slider' => array(
'title' => 'Slider',
'type' => 'select',
'options' => $wp_revsliders,
'desc' => 'Select revolution slider you want to display',
),
'custom_css' => array(
'title' => 'Custom CSS',
'type' => 'text',
'desc' => 'You can add custom CSS style for this block (advanced user only)',
),
),
'desc' => array(),
'content' => FALSE
);
}
//ksort($ppb_shortcodes);
?> |