__( 'Draws and animates multiple 3D tag cloud. Generates a Shortcode for each instance.', 'text_domain' ), ) // Args
);
// register Shortcode
if (!shortcode_exists('tc-m')) {
add_shortcode('tc-m', array($this, 'shortcode_handler'));
}
}
// Shortcode handler
function shortcode_handler( $attributes ) {
if (!isset($attributes['id']) || empty($attributes['id']) || !is_numeric($attributes['id'])) {
return '';
}
$widget_options = get_option('widget_wptagcanvaswidgetm');
$widget_id = $attributes['id'];
if (isset($widget_options[$widget_id]) && !empty($widget_options[$widget_id])) {
ob_start();
$this->widget(array(),$widget_options[$widget_id] );
$content = ob_get_clean();
return $content;
}
return '';
}
// ===
function widget($args, $instance) {
extract($args);
$inst_id = mt_rand(0,999999);
// Registration of TagCanvas.js & including an external file
wp_register_script('jq-tagcloud', plugin_dir_url( __FILE__ ) . 'js/3D.WP.tagcanvas.js', array('jquery'), '2.8',true);
wp_enqueue_script('jq-tagcloud');
include 'm.variables.php';
echo $before_widget;
// ===
?>
";
}
?>
';
$arch_args = array ('type' => 'monthly', 'limit' => $all_archives_limit, 'format' => 'custom', 'before' => '', 'after' => '', 'show_post_count' => true);
wp_get_archives( $arch_args );
echo '';
}
if( $auth_menu_item == 'on'){
echo '
';
$auto_args = array('number' => $all_authors_limit, 'exclude' => $all_exclude);
$users = get_users($auto_args);
foreach( $users as $user ){
$userAvatar = get_avatar($user->ID);
$userFName = $user->first_name;
$userLName = $user->last_name;
$userPosts = count_user_posts($user->ID);
$userPostsURL = get_author_posts_url($user->ID);
echo '
'.$userAvatar, $userFName.'
'.$userLName.'
('.$userPosts.')';
};
echo '
';
}
if( $cat_menu_item == 'on'){
echo '';
$cat_args = array ('number' => $all_categories_limit, 'taxonomy' => 'category');
wp_tag_cloud($cat_args);
echo '
';
}
if( $lin_menu_item == 'on'){
echo '';
}
if( $men_menu_item == 'on'){
echo '';
}
if( $pag_menu_item == 'on'){
echo '';
$page_args = array ('number' => $pages_limit); $pages = get_pages($page_args);
foreach( $pages as $page ){
echo '
' . get_the_post_thumbnail( $page->ID, 'thumbnail' ), $page->post_title . '';
}
echo '
';
}
if( $pos_menu_item == 'on'){
echo '';
$post_args = array ('number' => $all_post_tags_limit, 'taxonomy' => 'post_tag');
wp_tag_cloud($post_args);
echo '
';
}
if( $rec_menu_item == 'on'){
echo '';
$recent_posts = abs($recent_posts);
$count=0;
$bigest=$weight_size*3;
if($recent_posts>0){
$increment=($bigest-3)/$recent_posts;};
$rp_args= array ('numberposts' => $all_recent_posts_limit, 'category' => $all_recent_posts_category);
$recent_posts = wp_get_recent_posts($rp_args);
foreach( $recent_posts as $recent ){
$count=$count+1; $font_size=round($bigest-$increment*$count);
if($weight_mode != "none") { echo '
' . get_the_post_thumbnail( $recent["ID"], 'thumbnail' ), $recent["post_title"].' ';}
else {echo '
' . get_the_post_thumbnail( $recent["ID"], 'thumbnail' ), $recent["post_title"].' ';};
};
echo '
';
}
if( $ppl_menu_item == 'on'){
echo '';
}
?>
id);
return $tag_option;
}
function form($instance) {
$instance = wp_parse_args( (array) $instance, array(
// Basic Options
'all_bg_colour_cf' => 'fff',
'all_border_cf' => '000',
'all_cf_image_loc' => '',
'all_cf_name' => '',
'all_cf_opacity' => '1',
'all_cf_rotation' => '0',
'all_cf_url' => '',
'all_cont_border' => '0',
'all_font_cf' => 'Special Elite',
'all_font_h' => '16',
'all_font_w' => 'normal',
'all_img_reduction' => '0.25',
'all_text_color_cf' => '000',
'all_text_line_1' => 'Fill up',
'all_text_line_2' => 'these lines',
'all_text_line_3' => 'with your',
'all_text_line_4' => 'text or',
'all_text_line_5' => 'leave empty.',
'all_text_cont' => 'square',
'all_text_zoom' => '1.2',
'height' => '260',
'taxonomy' => 'post_tag',
'title' => 'My 3D WP Tag Cloud',
'tooltip_status' => 'on',
'width' => '260',
// Multiple menu options
'active_bg_color' => '00ffcc',
'all_menu_font' => 'Arial',
'all_menu_height' => '42',
'all_menu_type' => 'dynamic',
'all_m_bgcolor' => 'fff',
'all_m_bordercolor' => '222',
'all_m_borderwidth' => '0',
'all_m_fontcolor' => '000',
'all_m_fontsize' => '9',
'all_m_outlcolor' => '369d88',
'all_m_radius_x' => '5.5',
'all_m_radius_y' => '5.5',
'all_m_radius_z' => '5.5',
'all_m_shadow' => '000',
'all_m_shadowoff' => '0',
'all_m_tooltip' => 'on',
'all_taxonomy' => 'post_tags',
'rotation' => 'l2r',
'arch_menu_item' => 'on',
'auth_menu_item' => 'on',
'cat_menu_item' => 'on',
'lin_menu_item' => 'on',
'men_menu_item' => 'on',
'menu_label' => 'Menu',
'pag_menu_item' => 'on',
'pos_menu_item' => 'on',
'ppl_menu_item' => 'on',
'rec_menu_item' => 'on',
// Archives Cloud Options
'all_archives_limit' => '',
'arc_img_url' => '',
'arch_bg_color' => '',
'arch_bg_outline' => '',
'arch_borderwidth' => '0',
'arch_brightness' => '0.1',
'arch_click_to_front' => '1000',
'arch_drag_ctrl' => 'false',
'arch_fontsize' => '10',
'arch_google_font' => '',
'arch_initial_x' => '0',
'arch_initial_y' => '0',
'arch_initial_z' => '0',
'arch_lock' => 'none',
'arch_max_speed' => '0.05',
'arch_min_speed' => '0',
'arch_min_tags' => '0',
'arch_outline_color' => '369d88',
'arch_outline_dash' => '0',
'arch_outline_dash_space' => '10',
'arch_outline_dash_speed' => '3',
'arch_outline_method' => 'block',
'arch_pulsate_to' => '0',
'arch_radius_x' => '1',
'arch_radius_y' => '1',
'arch_radius_z' => '1',
'arch_shadow' => '000',
'arch_shadowblur' => '0',
'arch_shadowoff_x' => '0',
'arch_shadowoff_y' => '0',
'arch_shape' => 'cube',
'arch_split_width' => '100',
'arch_target' => '_self',
'arch_text_color' => '000',
'arch_text_font' => 'Arial',
'arch_tooltip' => '',
'arch_weight' => 'false',
'arch_weight_mode' => 'both',
'arch_weightsizemax' => '20',
'arch_weightsizemin' => '6',
'arch_weight_size' => '1',
'arch_weight_gradient_1' => 'f00',
'arch_weight_gradient_2' => 'ff0',
'arch_weight_gradient_3' => '0f0',
'arch_weight_gradient_4' => '00f',
// Authors Cloud Options
'all_authors_limit' => '',
'all_exclude' => '',
'aut_img_url' => '',
'auth_bg_color' => '',
'auth_bg_outline' => '',
'auth_borderwidth' => '0',
'auth_brightness' => '0.1',
'auth_click_to_front' => '1000',
'auth_drag_ctrl' => 'false',
'auth_fontsize' => '10',
'auth_google_font' => '',
'auth_image_align' => 'centre',
'auth_image_mode' => '',
'auth_image_padding' => '2',
'auth_image_position' => 'left',
'auth_image_radius' => '0',
'auth_image_scale' => '0.325',
'auth_image_valign' => 'middle',
'auth_initial_x' => '0',
'auth_initial_y' => '0',
'auth_initial_z' => '0',
'auth_lock' => 'none',
'auth_max_speed' => '0.05',
'auth_min_speed' => '0',
'auth_min_tags' => '0',
'auth_outline_color' => '369d88',
'auth_outline_dash' => '0',
'auth_outline_dash_space' => '10',
'auth_outline_dash_speed' => '3',
'auth_outline_method' => 'block',
'auth_pulsate_to' => '0',
'auth_radius_x' => '1',
'auth_radius_y' => '1',
'auth_radius_z' => '1',
'auth_shadow' => '000',
'auth_shadowblur' => '0',
'auth_shadowoff_x' => '0',
'auth_shadowoff_y' => '0',
'auth_shape' => 'cube',
'auth_split_width' => '100',
'auth_target' => '_self',
'auth_text_align' => 'centre',
'auth_text_color' => '000',
'auth_text_font' => 'Arial',
'auth_text_valign' => 'middle',
'auth_tooltip' => '',
'auth_weight' => 'false',
'auth_weight_mode' => 'both',
'auth_weightsizemax' => '20',
'auth_weightsizemin' => '6',
'auth_weight_size' => '1',
'auth_weight_gradient_1' => 'f00',
'auth_weight_gradient_2' => 'ff0',
'auth_weight_gradient_3' => '0f0',
'auth_weight_gradient_4' => '00f',
// Categories Cloud Options
'all_categories_limit' => '',
'cat_bg_color' => '',
'cat_bg_outline' => '',
'cat_borderwidth' => '0',
'cat_brightness' => '0.1',
'cat_click_to_front' => '1000',
'cat_drag_ctrl' => 'false',
'cat_fontsize' => '10',
'cat_google_font' => '',
'cat_img_url' => '',
'cat_initial_x' => '0',
'cat_initial_y' => '0',
'cat_initial_z' => '0',
'cat_lock' => 'none',
'cat_max_speed' => '0.05',
'cat_min_speed' => '0',
'cat_min_tags' => '0',
'cat_numberop' => 'true',
'cat_outline_color' => '369d88',
'cat_outline_dash' => '0',
'cat_outline_dash_space' => '10',
'cat_outline_dash_speed' => '3',
'cat_outline_method' => 'block',
'cat_pulsate_to' => '0',
'cat_radius_x' => '1',
'cat_radius_y' => '1',
'cat_radius_z' => '1',
'cat_shadow' => '000',
'cat_shadowblur' => '0',
'cat_shadowoff_x' => '0',
'cat_shadowoff_y' => '0',
'cat_shape' => 'cube',
'cat_split_width' => '100',
'cat_target' => '_self',
'cat_tooltip' => '',
'cat_text_color' => '000',
'cat_text_font' => 'Arial',
'cat_weight' => 'false',
'cat_weight_mode' => 'both',
'cat_weightsizemax' => '20',
'cat_weightsizemin' => '6',
'cat_weight_size' => '1',
'cat_weight_gradient_1' => 'f00',
'cat_weight_gradient_2' => 'ff0',
'cat_weight_gradient_3' => '0f0',
'cat_weight_gradient_4' => '00f',
// Links Cloud Options
'all_links_limit' => '-1',
'all_links_category' => '',
'lin_bg_color' => '',
'lin_bg_outline' => '',
'lin_borderwidth' => '0',
'lin_brightness' => '0.1',
'lin_click_to_front' => '1000',
'lin_drag_ctrl' => 'false',
'lin_fontsize' => '10',
'lin_google_font' => '',
'lin_image_scale' => '1',
'lin_img_url' => '',
'lin_image_align' => 'centre',
'lin_image_mode' => '',
'lin_image_padding' => '2',
'lin_image_position' => 'top',
'lin_image_radius' => '0',
'lin_image_scale' => '0.5',
'lin_image_valign' => 'middle',
'lin_initial_x' => '0',
'lin_initial_y' => '0',
'lin_initial_z' => '0',
'lin_lock' => 'none',
'lin_max_speed' => '0.05',
'lin_min_speed' => '0',
'lin_min_tags' => '0',
'lin_outline_color' => '369d88',
'lin_outline_dash' => '0',
'lin_outline_dash_space' => '10',
'lin_outline_dash_speed' => '3',
'lin_outline_method' => 'block',
'lin_pulsate_to' => '0',
'lin_radius_x' => '1',
'lin_radius_y' => '1',
'lin_radius_z' => '1',
'lin_shadow' => '000',
'lin_shadowblur' => '0',
'lin_shadowoff_x' => '0',
'lin_shadowoff_y' => '0',
'lin_shape' => 'cube',
'lin_split_width' => '100',
'lin_target' => '_self',
'lin_text_align' => 'centre',
'lin_text_color' => '000',
'lin_text_font' => 'Arial',
'lin_text_valign' => 'middle',
'lin_tooltip' => '',
'lin_weight' => 'false',
'lin_weight_mode' => 'both',
'lin_weightsizemax' => '20',
'lin_weightsizemin' => '6',
'lin_weight_size' => '1',
'lin_weight_gradient_1' => 'f00',
'lin_weight_gradient_2' => 'ff0',
'lin_weight_gradient_3' => '0f0',
'lin_weight_gradient_4' => '00f',
// Menu Cloud Options
'all_menu_name' => '',
'men_bg_color' => '',
'men_bg_outline' => '',
'men_borderwidth' => '0',
'men_brightness' => '0.1',
'men_click_to_front' => '1000',
'men_drag_ctrl' => 'false',
'men_fontsize' => '10',
'men_google_font' => '',
'men_img_url' => '',
'men_image_align' => 'centre',
'men_image_mode' => '',
'men_image_padding' => '2',
'men_image_position' => 'left',
'men_image_radius' => '0',
'men_image_scale' => '0.75',
'men_image_valign' => 'middle',
'men_initial_x' => '0',
'men_initial_y' => '0',
'men_initial_z' => '0',
'men_lock' => 'none',
'men_max_speed' => '0.05',
'men_min_speed' => '0',
'men_min_tags' => '0',
'men_outline_color' => '369d88',
'men_outline_dash' => '0',
'men_outline_dash_space' => '10',
'men_outline_dash_speed' => '3',
'men_outline_method' => 'block',
'men_pulsate_to' => '0',
'men_radius_x' => '1',
'men_radius_y' => '1',
'men_radius_z' => '1',
'men_shadow' => '000',
'men_shadowblur' => '0',
'men_shadowoff_x' => '0',
'men_shadowoff_y' => '0',
'men_shape' => 'cube',
'men_split_width' => '100',
'men_target' => '_self',
'men_text_align' => 'centre',
'men_text_color' => '000',
'men_text_font' => 'Arial',
'men_text_valign' => 'middle',
'men_tooltip' => '',
// Pages Cloud Options
'all_pages_limit' => '',
'pag_bg_color' => '',
'pag_bg_outline' => '',
'pag_borderwidth' => '0',
'pag_brightness' => '0.1',
'pag_click_to_front' => '1000',
'pag_drag_ctrl' => 'false',
'pag_fontsize' => '10',
'pag_google_font' => '',
'pag_img_url' => '',
'pag_image_align' => 'centre',
'pag_image_mode' => '',
'pag_image_padding' => '2',
'pag_image_position' => 'left',
'pag_image_radius' => '0',
'pag_image_scale' => '0.5',
'pag_image_valign' => 'middle',
'pag_initial_x' => '0',
'pag_initial_y' => '0',
'pag_initial_z' => '0',
'pag_lock' => 'none',
'pag_max_speed' => '0.05',
'pag_min_speed' => '0',
'pag_min_tags' => '0',
'pag_outline_color' => '369d88',
'pag_outline_dash' => '0',
'pag_outline_dash_space' => '10',
'pag_outline_dash_speed' => '3',
'pag_outline_method' => 'block',
'pag_pulsate_to' => '0',
'pag_radius_x' => '1',
'pag_radius_y' => '1',
'pag_radius_z' => '1',
'pag_shadow' => '000',
'pag_shadowblur' => '0',
'pag_shadowoff_x' => '0',
'pag_shadowoff_y' => '0',
'pag_shape' => 'cube',
'pag_split_width' => '100',
'pag_target' => '_self',
'pag_text_align' => 'centre',
'pag_text_color' => '000',
'pag_text_font' => 'Arial',
'pag_text_valign' => 'middle',
'pag_tooltip' => '',
// Post Tags Cloud Options
'all_post_tags_limit' => '45',
'pos_bg_color' => '',
'pos_bg_outline' => '',
'pos_borderwidth' => '0',
'pos_brightness' => '0.1',
'pos_click_to_front' => '1000',
'pos_drag_ctrl' => 'false',
'pos_fontsize' => '10',
'pos_google_font' => '',
'pos_img_url' => '',
'pos_initial_x' => '0',
'pos_initial_y' => '0',
'pos_initial_z' => '0',
'pos_lock' => 'none',
'pos_max_speed' => '0.05',
'pos_min_speed' => '0',
'pos_min_tags' => '0',
'pos_numberot' => 'true',
'pos_outline_color' => '369d88',
'pos_outline_dash' => '0',
'pos_outline_dash_space' => '10',
'pos_outline_dash_speed' => '3',
'pos_outline_method' => 'block',
'pos_pulsate_to' => '0',
'pos_radius_x' => '1',
'pos_radius_y' => '1',
'pos_radius_z' => '1',
'pos_shadow' => '000',
'pos_shadowblur' => '0',
'pos_shadowoff_x' => '0',
'pos_shadowoff_y' => '0',
'pos_shape' => 'cube',
'pos_split_width' => '100',
'pos_target' => '_self',
'pos_text_color' => '000',
'pos_text_font' => 'Arial',
'pos_tooltip' => '',
'pos_weight' => 'false',
'pos_weight_mode' => 'both',
'pos_weightsizemax' => '20',
'pos_weightsizemin' => '6',
'pos_weight_size' => '1',
'pos_weight_gradient_1' => 'f00',
'pos_weight_gradient_2' => 'ff0',
'pos_weight_gradient_3' => '0f0',
'pos_weight_gradient_4' => '00f',
// Recent Posts Cloud Options
'all_recent_posts_limit' => '10',
'all_recent_posts_category' => '',
'rec_bg_color' => '',
'rec_bg_outline' => '',
'rec_borderwidth' => '0',
'rec_brightness' => '0.1',
'rec_click_to_front' => '1000',
'rec_drag_ctrl' => 'false',
'rec_fontsize' => '10',
'rec_google_font' => '',
'rec_img_url' => '',
'rec_image_align' => 'centre',
'rec_image_mode' => '',
'rec_image_padding' => '2',
'rec_image_position' => 'left',
'rec_image_radius' => '0',
'rec_image_scale' => '0.5',
'rec_image_valign' => 'middle',
'rec_initial_x' => '0',
'rec_initial_y' => '0',
'rec_initial_z' => '0',
'rec_lock' => 'none',
'rec_max_speed' => '0.05',
'rec_min_speed' => '0',
'rec_min_tags' => '0',
'rec_outline_color' => '369d88',
'rec_outline_dash' => '0',
'rec_outline_dash_space' => '10',
'rec_outline_dash_speed' => '3',
'rec_outline_method' => 'block',
'rec_pulsate_to' => '0',
'rec_radius_x' => '1',
'rec_radius_y' => '1',
'rec_radius_z' => '1',
'rec_shadow' => '000',
'rec_shadowblur' => '0',
'rec_shadowoff_x' => '0',
'rec_shadowoff_y' => '0',
'rec_shape' => 'cube',
'rec_split_width' => '100',
'rec_target' => '_self',
'rec_text_align' => 'centre',
'rec_text_color' => '000',
'rec_text_font' => 'Arial',
'rec_text_valign' => 'middle',
'rec_tooltip' => '',
'rec_weight' => 'false',
'rec_weight_mode' => 'both',
'rec_weightsizemax' => '20',
'rec_weightsizemin' => '6',
'rec_weight_size' => '1.0',
'rec_weight_gradient_1' => 'f00',
'rec_weight_gradient_2' => 'ff0',
'rec_weight_gradient_3' => '0f0',
'rec_weight_gradient_4' => '00f',
// Page/Post Links Cloud Options
'all_ppl_id' => '',
'ppl_bg_color' => '',
'ppl_bg_outline' => '',
'ppl_borderwidth' => '0',
'ppl_brightness' => '0.1',
'ppl_click_to_front' => '1000',
'ppl_drag_ctrl' => 'false',
'ppl_fontsize' => '10',
'ppl_google_font' => '',
'ppl_img_url' => '',
'ppl_image_align' => 'centre',
'ppl_image_mode' => '',
'ppl_image_padding' => '2',
'ppl_image_position' => 'left',
'ppl_image_radius' => '0',
'ppl_image_scale' => '0.5',
'ppl_image_valign' => 'middle',
'ppl_initial_x' => '0',
'ppl_initial_y' => '0',
'ppl_initial_z' => '0',
'ppl_lock' => 'none',
'ppl_max_speed' => '0.05',
'ppl_min_speed' => '0',
'ppl_min_tags' => '0',
'ppl_outline_color' => '369d88',
'ppl_outline_dash' => '0',
'ppl_outline_dash_space' => '10',
'ppl_outline_dash_speed' => '3',
'ppl_outline_method' => 'block',
'ppl_pulsate_to' => '0',
'ppl_radius_x' => '1',
'ppl_radius_y' => '1',
'ppl_radius_z' => '1',
'ppl_shadow' => '000',
'ppl_shadowblur' => '0',
'ppl_shadowoff_x' => '0',
'ppl_shadowoff_y' => '0',
'ppl_shape' => 'cube',
'ppl_split_width' => '100',
'ppl_target' => '_self',
'ppl_text_align' => 'centre',
'ppl_text_color' => '000',
'ppl_text_font' => 'Arial',
'ppl_text_valign' => 'middle',
'ppl_tooltip' => '',
'ppl_weight' => 'false',
'ppl_weight_mode' => 'both',
'ppl_weightsizemax' => '20',
'ppl_weightsizemin' => '6',
'ppl_weight_size' => '1.0',
'ppl_weight_gradient_1' => 'f00',
'ppl_weight_gradient_2' => 'ff0',
'ppl_weight_gradient_3' => '0f0',
'ppl_weight_gradient_4' => '00f'
));
include 'm.variables.php';
include 'm.CP.php';
?>
" . $plugin_m_data['Name'] . ":
Dear users, this is the last version of the plugin. Starting from 17 Jan. 2018 it will no longer be supported. I'd like to thank you all who trusted and used it. Good luck!";
$display_info = false;
$local_version = get_option('plugin_m_version');
if ($local_version && $local_version !== PLUGIN_M_VERSION) {
$display_info = true;
update_option('plugin_m_version', PLUGIN_M_VERSION);
}
elseif (!$local_version) {update_option('plugin_m_version', PLUGIN_M_VERSION);}
if ($display_info === true) {
echo"";
}
if($_SERVER["REQUEST_URI"]==="/wp-admin/widgets.php?message=0"){
wp_register_script( 'mshortcode_script', plugin_dir_url( __FILE__ ) . 'js/m.shortcode.js' );
$mopt = get_option("3dwptagcloud-m-widget-instance");
$mshortcode_id = preg_replace('!^[^\d]+!uis','',$mopt);
$mshortcode_array = array(
'mshortcode_id' => $mshortcode_id,
'mplugin_name' => $plugin_m_data['Name']
);
wp_localize_script( 'mshortcode_script', 'mshortcode', $mshortcode_array );
wp_enqueue_script( 'mshortcode_script' );
}
else{
if ($mopt) {delete_option("3dwptagcloud-m-widget-instance");};
}
}
add_action( 'admin_notices', 'my_m_admin_notice' );
// ===
// Registering Widget
function wpTagCanvasMLoad() {
register_widget( 'wpTagCanvasWidgetM' );
}
add_action('widgets_init', 'wpTagCanvasMLoad');
// Enabling link manager for users of WP 3.5+
add_filter( 'pre_option_link_manager_enabled', '__return_true' );
// ===