Version Description
- New feature added for widget, create mutiple widget instance with different settings
- New feature added for shortcode, use mutiple shortcode in page/post with different settings
- New feature added for PHP template tag, use mutiple PHP template tag in PHP themes files with different settings
- New feature added for shortcode generate
- Plugin's settings & instructions page layout is updated
- "How to use?" section is added in plugin's settings & instructions page
- ID column is added to manage icons page
- Button is updated throughout the plugin setup pages
- Layout is updated in sort icons page
- Screenshot updated
- CSS updated
- Javascript updated
Download this release
Release Info
Developer | cybernetikz |
Plugin | Easy Social Icons |
Version | 2.0 |
Comparing to | |
See all releases |
Code changes from version 1.2.4.1 to 2.0
- css/cnss.css +1 -1
- easy-social-icons.php +339 -45
- images/icon/1368459524_facebook.png +0 -0
- images/icon/1368459556_twitter.png +0 -0
- images/icon/1368459641_flicker.png +0 -0
- images/icon/1368459699_in.png +0 -0
- images/icon/1368459724_youtube.png +0 -0
- images/icon/Facebook.png +0 -0
- images/icon/Google-Plus.png +0 -0
- images/icon/Toutube.png +0 -0
- images/icon/Twitter.png +0 -0
- images/icon/Viber.png +0 -0
- images/icon/flickr.png +0 -0
- images/icon/instagram.png +0 -0
- images/icon/linkedIn.png +0 -0
- images/icon/pinterest.png +0 -0
- images/icon/skype.png +0 -0
- images/icon/whatsup.png +0 -0
- images/icon/wordpress.png +0 -0
- js/cnss.js +3 -3
- readme.txt +37 -15
- screenshot-1.png +0 -0
- screenshot-2.png +0 -0
- screenshot-3.png +0 -0
- screenshot-4.png +0 -0
- screenshot-5.png +0 -0
- screenshot-6.png +0 -0
- screenshot-7.png +0 -0
- screenshot-8.png +0 -0
css/cnss.css
CHANGED
@@ -12,4 +12,4 @@ ul.cnss-social-icon{margin:0; padding:0;list-style-type:none}
|
|
12 |
ul.cnss-social-icon li a img{display:inherit!important;}
|
13 |
ul.cnss-social-icon li a{border:none!important;text-decoration:none!important;}
|
14 |
ul.cnss-social-icon li:after, ul.cnss-social-icon li:before{display:none!important;content:inherit!important;}
|
15 |
-
ul.cnss-social-icon li{ float:none!important; width:auto!important;}
|
12 |
ul.cnss-social-icon li a img{display:inherit!important;}
|
13 |
ul.cnss-social-icon li a{border:none!important;text-decoration:none!important;}
|
14 |
ul.cnss-social-icon li:after, ul.cnss-social-icon li:before{display:none!important;content:inherit!important;}
|
15 |
+
ul.cnss-social-icon li{ float:none!important; width:auto!important; margin:0!important; list-style-type:none!important;}
|
easy-social-icons.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: Easy Social Icons
|
4 |
Plugin URI: http://www.cybernetikz.com
|
5 |
Description: You can upload your own social icon, set your social URL, choose weather you want to display vertical or horizontal. You can use the shortcode <strong>[cn-social-icon]</strong> in page/post, template tag for php file <strong><?php if ( function_exists('cn_social_icon') ) echo cn_social_icon(); ?></strong> also you can use the widget <strong>"Easy Social Icons"</strong> for sidebar.
|
6 |
-
Version:
|
7 |
Author: cybernetikz
|
8 |
Author URI: http://www.cybernetikz.com
|
9 |
License: GPL2
|
@@ -48,8 +48,7 @@ function cnss_admin_sidebar() {
|
|
48 |
<?php
|
49 |
}
|
50 |
|
51 |
-
function
|
52 |
-
{
|
53 |
$chars = "234567890abcdefghijkmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
54 |
$i = 0;
|
55 |
$url = "";
|
@@ -67,7 +66,7 @@ function cnss_admin_style() {
|
|
67 |
}
|
68 |
add_action( 'admin_enqueue_scripts', 'cnss_admin_style' );
|
69 |
|
70 |
-
function
|
71 |
global $pluginsURI;
|
72 |
wp_enqueue_script( 'jquery' );
|
73 |
wp_enqueue_script('jquery-ui-sortable');
|
@@ -91,12 +90,12 @@ if( isset($_GET['page']) ) {
|
|
91 |
}
|
92 |
}
|
93 |
|
94 |
-
add_action('init', '
|
95 |
add_action('wp_ajax_update-social-icon-order', 'cnss_save_ajax_order' );
|
96 |
add_action('admin_menu', 'cnss_add_menu_pages');
|
97 |
|
98 |
function cnss_add_menu_pages() {
|
99 |
-
add_menu_page('Easy Social
|
100 |
|
101 |
add_submenu_page('cnss_social_icon_page', 'Manage Icons', 'Manage Icons', 'manage_options', 'cnss_social_icon_page', 'cnss_social_icon_page_fn');
|
102 |
|
@@ -104,7 +103,7 @@ function cnss_add_menu_pages() {
|
|
104 |
|
105 |
add_submenu_page('cnss_social_icon_page', 'Sort Icons', 'Sort Icons', 'manage_options', 'cnss_social_icon_sort', 'cnss_social_icon_sort_fn');
|
106 |
|
107 |
-
add_submenu_page('cnss_social_icon_page', '
|
108 |
|
109 |
add_action( 'admin_init', 'register_cnss_settings' );
|
110 |
|
@@ -141,8 +140,22 @@ function cnss_social_icon_option_fn() {
|
|
141 |
if($text_align=='right') $right = 'checked="checked"';
|
142 |
|
143 |
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
144 |
<div class="wrap">
|
145 |
-
<h2>
|
146 |
<div class="content_wrapper">
|
147 |
<div class="left">
|
148 |
<form method="post" action="options.php" enctype="multipart/form-data">
|
@@ -176,10 +189,132 @@ function cnss_social_icon_option_fn() {
|
|
176 |
<input <?php echo $right ?> type="radio" name="cnss-text-align" id="right" value="right" /> <label for="right">Right</label></td>
|
177 |
</tr>
|
178 |
</table>
|
179 |
-
<p class="submit">
|
180 |
-
<input type="submit" class="button-primary" value="<?php _e('Save Changes') ?>" />
|
181 |
-
</p>
|
182 |
</form>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
183 |
</div>
|
184 |
<div class="right">
|
185 |
<?php cnss_admin_sidebar(); ?>
|
@@ -226,7 +361,7 @@ if (isset($_GET['delete'])) {
|
|
226 |
$table_name = $wpdb->prefix . "cn_social_icon";
|
227 |
$image_file_path = $baseDir;
|
228 |
$wpdb->delete( $table_name, array( 'id' => $_GET['id'] ), array( '%d' ) );
|
229 |
-
$msg = "Delete
|
230 |
}
|
231 |
}
|
232 |
|
@@ -350,7 +485,7 @@ function cnss_social_icon_sort_fn() {
|
|
350 |
</div>
|
351 |
</noscript>
|
352 |
|
353 |
-
<div id="order-post-type">
|
354 |
<ul id="sortable">
|
355 |
<?php
|
356 |
foreach($video_info as $vdoinfo) {
|
@@ -363,8 +498,9 @@ function cnss_social_icon_sort_fn() {
|
|
363 |
<li id="item_<?php echo $vdoinfo->id ?>">
|
364 |
<table width="100%" border="0" cellspacing="0" cellpadding="0">
|
365 |
<tr style="background:#f7f7f7">
|
366 |
-
<td width="
|
367 |
-
<td><span><?php echo $vdoinfo->title;?></span></td>
|
|
|
368 |
</tr>
|
369 |
</table>
|
370 |
</li>
|
@@ -374,9 +510,7 @@ function cnss_social_icon_sort_fn() {
|
|
374 |
<div class="clear"></div>
|
375 |
</div>
|
376 |
|
377 |
-
<p class="submit">
|
378 |
-
<a href="#" id="save-order" class="button-primary">Update</a>
|
379 |
-
</p>
|
380 |
|
381 |
<script type="text/javascript">
|
382 |
jQuery(document).ready(function() {
|
@@ -405,8 +539,7 @@ function cnss_social_icon_sort_fn() {
|
|
405 |
<?php
|
406 |
}
|
407 |
|
408 |
-
function cnss_save_ajax_order()
|
409 |
-
{
|
410 |
global $wpdb;
|
411 |
$table_name = $wpdb->prefix . "cn_social_icon";
|
412 |
parse_str($_POST['order'], $data);
|
@@ -529,9 +662,7 @@ if($err!='') echo '<div id="message" class="error fade">'.$err.'</div>';
|
|
529 |
<input type="hidden" name="action" value="update" />
|
530 |
<?php } ?>
|
531 |
|
532 |
-
<p class="submit">
|
533 |
-
<input type="submit" id="submit_button" name="submit_button" class="button-primary" value="<?php _e('Save Changes') ?>" />
|
534 |
-
</p>
|
535 |
</form>
|
536 |
</div>
|
537 |
<div class="right">
|
@@ -575,6 +706,7 @@ function cnss_social_icon_page_fn() {
|
|
575 |
<table class="widefat page fixed" cellspacing="0">
|
576 |
<thead>
|
577 |
<tr valign="top">
|
|
|
578 |
<th class="manage-column column-title" scope="col">Title</th>
|
579 |
<th class="manage-column column-title" scope="col">URL</th>
|
580 |
<th class="manage-column column-title" scope="col" width="100">Open In</th>
|
@@ -594,6 +726,9 @@ function cnss_social_icon_page_fn() {
|
|
594 |
$image_url = $vdoinfo->image_url;
|
595 |
?>
|
596 |
<tr valign="top">
|
|
|
|
|
|
|
597 |
<td>
|
598 |
<?php echo $vdoinfo->title;?>
|
599 |
</td>
|
@@ -622,7 +757,8 @@ function cnss_social_icon_page_fn() {
|
|
622 |
</tbody>
|
623 |
<tfoot>
|
624 |
<tr valign="top">
|
625 |
-
<th class="manage-column column-title" scope="col">
|
|
|
626 |
<th class="manage-column column-title" scope="col">URL</th>
|
627 |
<th class="manage-column column-title" scope="col" width="100">Open In</th>
|
628 |
<th class="manage-column column-title" scope="col" width="100">Icon</th>
|
@@ -690,34 +826,52 @@ function cn_social_icon_table() {
|
|
690 |
return $out;
|
691 |
}
|
692 |
|
693 |
-
function
|
694 |
$pattern = '/[^a-zA-Z0-9]/';
|
695 |
return preg_replace($pattern,'-',$str);
|
696 |
}
|
697 |
|
698 |
-
function cn_social_icon() {
|
699 |
-
|
700 |
-
$
|
701 |
-
$
|
702 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
703 |
$cnss_rows = get_option('cnss-row-count');
|
704 |
-
$vorh = get_option('cnss-vertical-horizontal');
|
705 |
-
$text_align = get_option('cnss-text-align');
|
706 |
|
707 |
global $wpdb,$baseURL;
|
708 |
$table_name = $wpdb->prefix . "cn_social_icon";
|
709 |
$image_file_path = $baseURL;
|
710 |
-
$sql = "SELECT * FROM ".$table_name." WHERE image_url<>'' AND url<>'' ORDER BY sortorder";
|
711 |
$video_info = $wpdb->get_results($sql);
|
712 |
$icon_count = count($video_info);
|
713 |
-
|
714 |
-
$_collectionSize = count($video_info);
|
715 |
-
$_rowCount = $cnss_rows ? $cnss_rows : 1;
|
716 |
-
$_columnCount = ceil($_collectionSize/$_rowCount);
|
717 |
$li_margin = round($cnss_margin/2);
|
718 |
|
719 |
ob_start();
|
720 |
-
echo '<ul class="cnss-social-icon" style="text-align:'.$text_align.';">';
|
721 |
$i=0;
|
722 |
foreach($video_info as $icon)
|
723 |
{
|
@@ -726,8 +880,15 @@ function cn_social_icon() {
|
|
726 |
$image_url = $image_file_path.'/'.$icon->image_url;
|
727 |
else
|
728 |
$image_url = $icon->image_url;
|
729 |
-
|
730 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
731 |
$i++;
|
732 |
}
|
733 |
echo '</ul>';
|
@@ -736,6 +897,41 @@ function cn_social_icon() {
|
|
736 |
return $out;
|
737 |
}
|
738 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
739 |
class Cnss_Widget extends WP_Widget {
|
740 |
|
741 |
public function __construct() {
|
@@ -753,31 +949,129 @@ class Cnss_Widget extends WP_Widget {
|
|
753 |
echo $before_widget;
|
754 |
if ( ! empty( $title ) )
|
755 |
echo $before_title . $title . $after_title;
|
756 |
-
echo cn_social_icon();
|
757 |
echo $after_widget;
|
758 |
}
|
759 |
|
760 |
public function update( $new_instance, $old_instance ) {
|
|
|
761 |
$instance = array();
|
762 |
$instance['title'] = strip_tags( $new_instance['title'] );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
763 |
return $instance;
|
764 |
}
|
765 |
|
766 |
public function form( $instance ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
767 |
if ( isset( $instance[ 'title' ] ) ) {
|
768 |
$title = $instance[ 'title' ];
|
769 |
}
|
770 |
else {
|
771 |
-
$title = __( '
|
772 |
}
|
|
|
|
|
773 |
?>
|
774 |
<p>
|
775 |
<label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:' ); ?></label>
|
776 |
<input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>" />
|
777 |
</p>
|
778 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
779 |
}
|
780 |
-
|
781 |
} // class Cnss_Widget
|
782 |
add_action( 'widgets_init', create_function( '', 'register_widget( "Cnss_Widget" );' ) );
|
783 |
-
add_shortcode('cn-social-icon', 'cn_social_icon');
|
3 |
Plugin Name: Easy Social Icons
|
4 |
Plugin URI: http://www.cybernetikz.com
|
5 |
Description: You can upload your own social icon, set your social URL, choose weather you want to display vertical or horizontal. You can use the shortcode <strong>[cn-social-icon]</strong> in page/post, template tag for php file <strong><?php if ( function_exists('cn_social_icon') ) echo cn_social_icon(); ?></strong> also you can use the widget <strong>"Easy Social Icons"</strong> for sidebar.
|
6 |
+
Version: 2.0
|
7 |
Author: cybernetikz
|
8 |
Author URI: http://www.cybernetikz.com
|
9 |
License: GPL2
|
48 |
<?php
|
49 |
}
|
50 |
|
51 |
+
function cnss_generate_random_code($length) {
|
|
|
52 |
$chars = "234567890abcdefghijkmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
53 |
$i = 0;
|
54 |
$url = "";
|
66 |
}
|
67 |
add_action( 'admin_enqueue_scripts', 'cnss_admin_style' );
|
68 |
|
69 |
+
function cnss_init_script() {
|
70 |
global $pluginsURI;
|
71 |
wp_enqueue_script( 'jquery' );
|
72 |
wp_enqueue_script('jquery-ui-sortable');
|
90 |
}
|
91 |
}
|
92 |
|
93 |
+
add_action('init', 'cnss_init_script');
|
94 |
add_action('wp_ajax_update-social-icon-order', 'cnss_save_ajax_order' );
|
95 |
add_action('admin_menu', 'cnss_add_menu_pages');
|
96 |
|
97 |
function cnss_add_menu_pages() {
|
98 |
+
add_menu_page('Easy Social Icons', 'Easy Social Icons', 'manage_options', 'cnss_social_icon_page', 'cnss_social_icon_page_fn',plugins_url('/images/scc-sc.png', __FILE__) );
|
99 |
|
100 |
add_submenu_page('cnss_social_icon_page', 'Manage Icons', 'Manage Icons', 'manage_options', 'cnss_social_icon_page', 'cnss_social_icon_page_fn');
|
101 |
|
103 |
|
104 |
add_submenu_page('cnss_social_icon_page', 'Sort Icons', 'Sort Icons', 'manage_options', 'cnss_social_icon_sort', 'cnss_social_icon_sort_fn');
|
105 |
|
106 |
+
add_submenu_page('cnss_social_icon_page', 'Settings & Instructions', 'Settings & Instructions', 'manage_options', 'cnss_social_icon_option', 'cnss_social_icon_option_fn');
|
107 |
|
108 |
add_action( 'admin_init', 'register_cnss_settings' );
|
109 |
|
140 |
if($text_align=='right') $right = 'checked="checked"';
|
141 |
|
142 |
?>
|
143 |
+
<style type="text/css">
|
144 |
+
.shadow{
|
145 |
+
border:1px solid #ebebeb; padding:5px 20px; background:#fff; margin-bottom:40px;
|
146 |
+
-webkit-box-shadow: 4px 4px 10px 0px rgba(50, 50, 50, 0.1);
|
147 |
+
-moz-box-shadow: 4px 4px 10px 0px rgba(50, 50, 50, 0.1);
|
148 |
+
box-shadow: 4px 4px 10px 0px rgba(50, 50, 50, 0.1);
|
149 |
+
}
|
150 |
+
.sec-title{
|
151 |
+
border: 1px solid #ebebeb;
|
152 |
+
background: #fff;
|
153 |
+
color: #d54e21;
|
154 |
+
padding: 2px 4px;
|
155 |
+
}
|
156 |
+
</style>
|
157 |
<div class="wrap">
|
158 |
+
<h2>Icon Settings</h2>
|
159 |
<div class="content_wrapper">
|
160 |
<div class="left">
|
161 |
<form method="post" action="options.php" enctype="multipart/form-data">
|
189 |
<input <?php echo $right ?> type="radio" name="cnss-text-align" id="right" value="right" /> <label for="right">Right</label></td>
|
190 |
</tr>
|
191 |
</table>
|
192 |
+
<p class="submit" style="text-align:center"><input type="submit" class="button-primary" value="<?php _e('Save Changes') ?>" /> <a href="admin.php?page=cnss_social_icon_page"><input type="button" class="button-secondary" value="Manage Icons" /></a><small> ←Back to</small></p>
|
|
|
|
|
193 |
</form>
|
194 |
+
|
195 |
+
<h2 id="shortcode">How to use</h2>
|
196 |
+
<fieldset class="shadow">
|
197 |
+
<legend><h4 class="sec-title">Using Widget</h4></legend>
|
198 |
+
<p>Simply go to <strong>Appearance -> <a href="widgets.php">Widgets</a></strong>
|
199 |
+
then drag drop <code>Easy Social Icon</code> widget to <strong>Widget Area</strong></p>
|
200 |
+
</fieldset>
|
201 |
+
|
202 |
+
|
203 |
+
<fieldset class="shadow">
|
204 |
+
<legend><h4 class="sec-title">Using Shortcode</h4></legend>
|
205 |
+
<?php
|
206 |
+
$shortcode = '[cn-social-icon';
|
207 |
+
if( isset($_POST['generate_shortcode']) && check_admin_referer('cn_gen_sc') )
|
208 |
+
{
|
209 |
+
if(is_numeric($_POST['_width']) && $cnss_width != $_POST['_width']){
|
210 |
+
$shortcode .= ' width="'.$_POST['_width'].'"';
|
211 |
+
}
|
212 |
+
if(is_numeric($_POST['_height']) && $cnss_height != $_POST['_height'] ){
|
213 |
+
$shortcode .= ' height="'.$_POST['_height'].'"';
|
214 |
+
}
|
215 |
+
if(is_numeric($_POST['_margin']) && $cnss_margin != $_POST['_margin'] ){
|
216 |
+
$shortcode .= ' margin="'.$_POST['_margin'].'"';
|
217 |
+
}
|
218 |
+
if(isset($_POST['_alignment']) && $text_align != $_POST['_alignment'] ){
|
219 |
+
$shortcode .= ' alignment="'.$_POST['_alignment'].'"';
|
220 |
+
$text_align = $_POST['_alignment'];
|
221 |
+
}
|
222 |
+
if(isset($_POST['_display']) && $vorh != $_POST['_display'] ){
|
223 |
+
$shortcode .= ' display="'.$_POST['_display'].'"';
|
224 |
+
$vorh = $_POST['_display'];
|
225 |
+
}
|
226 |
+
if(isset($_POST['_attr_id']) && $_POST['_attr_id']!=''){
|
227 |
+
$shortcode .= ' attr_id="'.$_POST['_attr_id'].'"';
|
228 |
+
}
|
229 |
+
if(isset($_POST['_attr_class']) && $_POST['_attr_class']!=''){
|
230 |
+
$shortcode .= ' attr_class="'.$_POST['_attr_class'].'"';
|
231 |
+
}
|
232 |
+
if( isset($_POST['_selected_icons']) ) {
|
233 |
+
if(is_array($_POST['_selected_icons'])) {
|
234 |
+
$ids = "";
|
235 |
+
foreach($_POST['_selected_icons'] as $icon) {
|
236 |
+
$ids .= $icon.",";
|
237 |
+
}
|
238 |
+
$ids = rtrim($ids,",");
|
239 |
+
$shortcode .= ' selected_icons="'.$ids .'"';
|
240 |
+
}
|
241 |
+
}
|
242 |
+
}
|
243 |
+
$shortcode .= ']';
|
244 |
+
?>
|
245 |
+
<p>Copy and paste following shortcode to any <strong>Page</strong> or <strong>Post</strong>.<p>
|
246 |
+
|
247 |
+
<p><input onclick="this.select();" readonly="readonly" type="text" value="<?php echo $shortcode; ?>" class="large-text" /></p>
|
248 |
+
<p>Or you can change following icon settings and click <strong>Generate Shortcode</strong> button to get updated shortcode.</p>
|
249 |
+
<form method="post" action="admin.php?page=cnss_social_icon_option#shortcode" enctype="application/x-www-form-urlencoded">
|
250 |
+
<?php wp_nonce_field('cn_gen_sc'); ?>
|
251 |
+
<input type="hidden" name="generate_shortcode" value="1" />
|
252 |
+
<table width="100%" border="0">
|
253 |
+
<tr>
|
254 |
+
<td width="110"><label><?php _e( 'Icon Width <em>(px)</em>:' ); ?></label>
|
255 |
+
<input class="widefat" name="_width" type="number" value="<?php echo isset($_POST['_width'])?$_POST['_width']:$cnss_width; ?>" /></td>
|
256 |
+
<td> </td>
|
257 |
+
<td width="110"><label><?php _e( 'Icon Height <em>(px)</em>:' ); ?></label>
|
258 |
+
<input class="widefat" name="_height" type="number" value="<?php echo isset($_POST['_height'])?$_POST['_height']:$cnss_height; ?>" /></td>
|
259 |
+
<td> </td>
|
260 |
+
<td><label><?php _e( 'Margin <em>(px)</em>:' ); ?></label><br />
|
261 |
+
<input class="widefat" name="_margin" type="number" value="<?php echo isset($_POST['_margin'])?$_POST['_margin']:$cnss_margin; ?>" /></td>
|
262 |
+
<td> </td>
|
263 |
+
<td><label><?php _e( 'Alignment:' ); ?></label><br />
|
264 |
+
<select name="_alignment">
|
265 |
+
<option <?php if($text_align=='center')echo 'selected="selected"'; ?> value="center">Center</option>
|
266 |
+
<option <?php if($text_align=='left')echo 'selected="selected"'; ?> value="left">Left</option>
|
267 |
+
<option <?php if($text_align=='right')echo 'selected="selected"'; ?> value="right">Right</option>
|
268 |
+
</select></td>
|
269 |
+
<td> </td>
|
270 |
+
<td><label><?php _e( 'Display:' ); ?></label><br />
|
271 |
+
<select name="_display">
|
272 |
+
<option <?php if($vorh=='horizontal')echo 'selected="selected"'; ?> value="horizontal">Horizontally</option>
|
273 |
+
<option <?php if($vorh=='vertical')echo 'selected="selected"'; ?> value="vertical">Vertically</option>
|
274 |
+
</select></td>
|
275 |
+
<td> </td>
|
276 |
+
<td><label><?php _e( 'Custom ID:' ); ?></label>
|
277 |
+
<input class="widefat" placeholder="ID" name="_attr_id" type="text" value="<?php echo isset($_POST['_attr_id'])?$_POST['_attr_id']:''; ?>" /></td>
|
278 |
+
<td> </td>
|
279 |
+
<td><label><?php _e( 'Custom Class:' ); ?></label>
|
280 |
+
<input class="widefat" placeholder="Class" name="_attr_class" type="text" value="<?php echo isset($_POST['_attr_class'])?$_POST['_attr_class']:''; ?>" /></td>
|
281 |
+
</tr>
|
282 |
+
</table>
|
283 |
+
<p></p>
|
284 |
+
<?php echo _cn_social_icon_sc( isset($_POST['_selected_icons'])?$_POST['_selected_icons']:array() ); ?>
|
285 |
+
<p><label><?php _e( 'Select Social Icons:' ); ?></label> <em>(If select none all icons will be displayed)</em></p>
|
286 |
+
<p>
|
287 |
+
<input type="submit" class="button-primary" value="<?php _e('Generate Shortcode') ?>" />
|
288 |
+
</p>
|
289 |
+
</form>
|
290 |
+
<p><strong>Note</strong>: You can also add shortcode to <strong>Text Widget</strong> but this code <code>add_filter('widget_text', 'do_shortcode');</code> needs to be added to your themes <strong>functions.php</strong> file.</p>
|
291 |
+
</fieldset>
|
292 |
+
|
293 |
+
<fieldset class="shadow" style="margin-bottom:0px;">
|
294 |
+
<legend><h4 class="sec-title">Using PHP Template Tag</h4></legend>
|
295 |
+
<p><strong>Simple Use</strong></p>
|
296 |
+
<p>If you are familiar with PHP code, then you can use PHP Template Tag</p>
|
297 |
+
<p><code><?php if ( function_exists('cn_social_icon') ) echo cn_social_icon(); ?></code></p>
|
298 |
+
|
299 |
+
<p><strong>Advanced Use</strong></p>
|
300 |
+
<pre>
|
301 |
+
<?php
|
302 |
+
$attr = array (
|
303 |
+
'width' => '32', //<em>input only number, in pixel</em>
|
304 |
+
'height' => '32', //<em>input only number, in pixel</em>
|
305 |
+
'margin' => '4', //<em>input only number, in pixel</em>
|
306 |
+
'display' => 'horizontal', //<em>horizontal | vertical</em>
|
307 |
+
'alignment' => 'center', //<em>center | left | right</em>
|
308 |
+
'attr_id' => 'custom_icon_id_1', //<em>add custom id to <ul> wraper</em>
|
309 |
+
'attr_class' => 'custom_icon_class', //<em>add custom class to <ul> wraper</em>
|
310 |
+
'selected_icons' => array ( '1', '3', '5', '6' )
|
311 |
+
//<em>you can get the icon ID form <strong><a href="admin.php?page=cnss_social_icon_page">Manage Icons</a></strong> page</em>
|
312 |
+
);
|
313 |
+
if ( function_exists('cn_social_icon') ) echo cn_social_icon( $attr );
|
314 |
+
?>
|
315 |
+
</pre>
|
316 |
+
</fieldset>
|
317 |
+
|
318 |
</div>
|
319 |
<div class="right">
|
320 |
<?php cnss_admin_sidebar(); ?>
|
361 |
$table_name = $wpdb->prefix . "cn_social_icon";
|
362 |
$image_file_path = $baseDir;
|
363 |
$wpdb->delete( $table_name, array( 'id' => $_GET['id'] ), array( '%d' ) );
|
364 |
+
$msg = "Delete Successful !"."<br />";
|
365 |
}
|
366 |
}
|
367 |
|
485 |
</div>
|
486 |
</noscript>
|
487 |
|
488 |
+
<div id="order-post-type" style="padding:15px 20px 20px; background:#fff; border:1px solid #ebebeb;">
|
489 |
<ul id="sortable">
|
490 |
<?php
|
491 |
foreach($video_info as $vdoinfo) {
|
498 |
<li id="item_<?php echo $vdoinfo->id ?>">
|
499 |
<table width="100%" border="0" cellspacing="0" cellpadding="0">
|
500 |
<tr style="background:#f7f7f7">
|
501 |
+
<td width="64"> <img src="<?php echo $image_url;?>" border="0" width="<?php echo $cnss_width ?>" height="<?php echo $cnss_height ?>" alt="<?php echo $vdoinfo->title;?>" /></td>
|
502 |
+
<td width="200"><span><?php echo $vdoinfo->title;?></span></td>
|
503 |
+
<td align="left" style="text-align:left;"><span><?php echo $vdoinfo->url;?></span></td>
|
504 |
</tr>
|
505 |
</table>
|
506 |
</li>
|
510 |
<div class="clear"></div>
|
511 |
</div>
|
512 |
|
513 |
+
<p class="submit" style="text-align:center"><input type="submit" id="save-order" class="button-primary" value="<?php _e('Save Changes') ?>" /> <a href="admin.php?page=cnss_social_icon_page"><input type="button" class="button-secondary" value="Manage Icons" /></a><small> ←Back to</small></p>
|
|
|
|
|
514 |
|
515 |
<script type="text/javascript">
|
516 |
jQuery(document).ready(function() {
|
539 |
<?php
|
540 |
}
|
541 |
|
542 |
+
function cnss_save_ajax_order() {
|
|
|
543 |
global $wpdb;
|
544 |
$table_name = $wpdb->prefix . "cn_social_icon";
|
545 |
parse_str($_POST['order'], $data);
|
662 |
<input type="hidden" name="action" value="update" />
|
663 |
<?php } ?>
|
664 |
|
665 |
+
<p class="submit" style="text-align:center"><input id="submit_button" name="submit_button" type="submit" class="button-primary" value="<?php _e('Save Changes') ?>" /> <a href="admin.php?page=cnss_social_icon_page"><input type="button" class="button-secondary" value="Manage Icons" /></a><small> ←Back to</small></p>
|
|
|
|
|
666 |
</form>
|
667 |
</div>
|
668 |
<div class="right">
|
706 |
<table class="widefat page fixed" cellspacing="0">
|
707 |
<thead>
|
708 |
<tr valign="top">
|
709 |
+
<th class="manage-column column-title" scope="col" width="50">ID</th>
|
710 |
<th class="manage-column column-title" scope="col">Title</th>
|
711 |
<th class="manage-column column-title" scope="col">URL</th>
|
712 |
<th class="manage-column column-title" scope="col" width="100">Open In</th>
|
726 |
$image_url = $vdoinfo->image_url;
|
727 |
?>
|
728 |
<tr valign="top">
|
729 |
+
<td>
|
730 |
+
<?php echo $vdoinfo->id;?>
|
731 |
+
</td>
|
732 |
<td>
|
733 |
<?php echo $vdoinfo->title;?>
|
734 |
</td>
|
757 |
</tbody>
|
758 |
<tfoot>
|
759 |
<tr valign="top">
|
760 |
+
<th class="manage-column column-title" scope="col" width="50">ID</th>
|
761 |
+
<th class="manage-column column-title" scope="col">Title</th>
|
762 |
<th class="manage-column column-title" scope="col">URL</th>
|
763 |
<th class="manage-column column-title" scope="col" width="100">Open In</th>
|
764 |
<th class="manage-column column-title" scope="col" width="100">Icon</th>
|
826 |
return $out;
|
827 |
}
|
828 |
|
829 |
+
function cnss_format_title($str) {
|
830 |
$pattern = '/[^a-zA-Z0-9]/';
|
831 |
return preg_replace($pattern,'-',$str);
|
832 |
}
|
833 |
|
834 |
+
function cn_social_icon($attr = array(), $call_from_widget = NULL) {
|
835 |
+
|
836 |
+
$where_sql = "";
|
837 |
+
$attr_id = isset($attr['attr_id'])?$attr['attr_id']:'';
|
838 |
+
$attr_class = isset($attr['attr_class'])?$attr['attr_class']:'';
|
839 |
+
|
840 |
+
if(isset($attr['selected_icons']))
|
841 |
+
{
|
842 |
+
if(is_string($attr['selected_icons'])) {
|
843 |
+
$attr['selected_icons'] = preg_replace('/[^0-9,]/','',$attr['selected_icons']);
|
844 |
+
$attr['selected_icons'] = explode(',', $attr['selected_icons']);
|
845 |
+
}
|
846 |
+
|
847 |
+
if(is_array($attr['selected_icons'])) {
|
848 |
+
$where_sql .= ' AND `id` IN(';
|
849 |
+
foreach($attr['selected_icons'] as $iid)
|
850 |
+
{
|
851 |
+
$where_sql .= $iid.',';
|
852 |
+
}
|
853 |
+
$where_sql = rtrim($where_sql,',');
|
854 |
+
$where_sql .= ') ';
|
855 |
+
}
|
856 |
+
}
|
857 |
+
|
858 |
+
$cnss_width = isset($attr['width'])?$attr['width']:get_option('cnss-width');
|
859 |
+
$cnss_height = isset($attr['height'])?$attr['height']:get_option('cnss-height');
|
860 |
+
$cnss_margin = isset($attr['margin'])?$attr['margin']:get_option('cnss-margin');
|
861 |
$cnss_rows = get_option('cnss-row-count');
|
862 |
+
$vorh = isset($attr['display'])?$attr['display']:get_option('cnss-vertical-horizontal');
|
863 |
+
$text_align = isset($attr['alignment'])?$attr['alignment']:get_option('cnss-text-align');
|
864 |
|
865 |
global $wpdb,$baseURL;
|
866 |
$table_name = $wpdb->prefix . "cn_social_icon";
|
867 |
$image_file_path = $baseURL;
|
868 |
+
$sql = "SELECT * FROM ".$table_name." WHERE image_url<>'' AND url<>'' $where_sql ORDER BY sortorder";
|
869 |
$video_info = $wpdb->get_results($sql);
|
870 |
$icon_count = count($video_info);
|
|
|
|
|
|
|
|
|
871 |
$li_margin = round($cnss_margin/2);
|
872 |
|
873 |
ob_start();
|
874 |
+
echo '<ul id="'.$attr_id.'" class="cnss-social-icon '.$attr_class.'" style="text-align:'.$text_align.';">';
|
875 |
$i=0;
|
876 |
foreach($video_info as $icon)
|
877 |
{
|
880 |
$image_url = $image_file_path.'/'.$icon->image_url;
|
881 |
else
|
882 |
$image_url = $icon->image_url;
|
883 |
+
|
884 |
+
$style_img = "";
|
885 |
+
if($li_margin != ''){
|
886 |
+
$style_img .= 'margin:'.$li_margin.'px;';
|
887 |
+
}
|
888 |
+
if($cnss_width != $cnss_height) {
|
889 |
+
$style_img .= 'height:'.$cnss_height.'px;';
|
890 |
+
}
|
891 |
+
?><li class="<?php echo cnss_format_title($icon->title); ?>" style=" <?php echo $vorh=='horizontal'?'display:inline-block;':''; ?>"><a <?php echo ($icon->target==1)?'target="_blank"':'' ?> title="<?php echo $icon->title ?>" href="<?php echo $icon->url ?>"><img src="<?php echo $image_url; ?>" border="0" width="<?php echo $cnss_width; ?>" alt="<?php echo $icon->title; ?>" style=" <?php echo $style_img; ?>" /></a></li><?php
|
892 |
$i++;
|
893 |
}
|
894 |
echo '</ul>';
|
897 |
return $out;
|
898 |
}
|
899 |
|
900 |
+
function _cn_social_icon_sc( $selected_icons_array = array() ) {
|
901 |
+
|
902 |
+
$cnss_width = get_option('cnss-width');
|
903 |
+
$cnss_height = get_option('cnss-height');
|
904 |
+
|
905 |
+
global $wpdb,$baseURL;
|
906 |
+
$table_name = $wpdb->prefix . "cn_social_icon";
|
907 |
+
$image_file_path = $baseURL;
|
908 |
+
$sql = "SELECT * FROM ".$table_name." WHERE image_url<>'' AND url<>'' ORDER BY sortorder";
|
909 |
+
$video_info = $wpdb->get_results($sql);
|
910 |
+
$icon_count = count($video_info);
|
911 |
+
|
912 |
+
ob_start();
|
913 |
+
echo '<ul class="cnss-social-icon" style="text-align:left;">'."\r\n";
|
914 |
+
$i=0;
|
915 |
+
foreach($video_info as $icon)
|
916 |
+
{
|
917 |
+
if(strpos($icon->image_url,'/')===false)
|
918 |
+
$image_url = $image_file_path.'/'.$icon->image_url;
|
919 |
+
else
|
920 |
+
$image_url = $icon->image_url;
|
921 |
+
|
922 |
+
?><li style="display:inline-block; padding:2px 8px; border:1px dotted #ccc;">
|
923 |
+
<div align="center"><label for="icon<?php echo $icon->id; ?>"><img src="<?php echo $image_url?>" border="0" width="<?php echo $cnss_width ?>" height="<?php echo $cnss_height ?>" alt="<?php echo $icon->title ?>" title="<?php echo $icon->title ?>" /></label></div>
|
924 |
+
<div align="center"><input <?php if( in_array($icon->id, $selected_icons_array ) ) echo 'checked="checked"'; ?> style="margin:0;" type="checkbox" name="_selected_icons[]" id="icon<?php echo $icon->id; ?>" value="<?php echo $icon->id; ?>" /></div>
|
925 |
+
</li>
|
926 |
+
<?php
|
927 |
+
$i++;
|
928 |
+
}
|
929 |
+
echo '</ul>'."\r\n";
|
930 |
+
$out = ob_get_contents();
|
931 |
+
ob_end_clean();
|
932 |
+
return $out;
|
933 |
+
}
|
934 |
+
|
935 |
class Cnss_Widget extends WP_Widget {
|
936 |
|
937 |
public function __construct() {
|
949 |
echo $before_widget;
|
950 |
if ( ! empty( $title ) )
|
951 |
echo $before_title . $title . $after_title;
|
952 |
+
echo cn_social_icon($instance, 1);
|
953 |
echo $after_widget;
|
954 |
}
|
955 |
|
956 |
public function update( $new_instance, $old_instance ) {
|
957 |
+
|
958 |
$instance = array();
|
959 |
$instance['title'] = strip_tags( $new_instance['title'] );
|
960 |
+
$instance['attr_id'] = strip_tags( $new_instance['attr_id'] );
|
961 |
+
$instance['attr_class'] = strip_tags( $new_instance['attr_class'] );
|
962 |
+
$instance['width'] = strip_tags( $new_instance['width'] );
|
963 |
+
$instance['height'] = strip_tags( $new_instance['height'] );
|
964 |
+
$instance['margin'] = strip_tags( $new_instance['margin'] );
|
965 |
+
$instance['display'] = strip_tags( $new_instance['display'] );
|
966 |
+
$instance['alignment'] = strip_tags( $new_instance['alignment'] );
|
967 |
+
$instance['selected_icons'] = $new_instance['selected_icons'];
|
968 |
return $instance;
|
969 |
}
|
970 |
|
971 |
public function form( $instance ) {
|
972 |
+
|
973 |
+
$cnss_width = get_option('cnss-width');
|
974 |
+
$cnss_height = get_option('cnss-height');
|
975 |
+
$cnss_margin = get_option('cnss-margin');
|
976 |
+
$cnss_rows = get_option('cnss-row-count');
|
977 |
+
$vorh = get_option('cnss-vertical-horizontal');
|
978 |
+
$text_align = get_option('cnss-text-align');
|
979 |
+
|
980 |
if ( isset( $instance[ 'title' ] ) ) {
|
981 |
$title = $instance[ 'title' ];
|
982 |
}
|
983 |
else {
|
984 |
+
$title = __( 'Follow Us' );
|
985 |
}
|
986 |
+
$instance[ 'alignment' ] = isset($instance[ 'alignment' ])?$instance[ 'alignment' ]:$text_align;
|
987 |
+
$instance[ 'display' ] = isset($instance[ 'display' ])?$instance[ 'display' ]:$vorh;
|
988 |
?>
|
989 |
<p>
|
990 |
<label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:' ); ?></label>
|
991 |
<input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>" />
|
992 |
</p>
|
993 |
+
<p><em>Following settings will override the default <a href="admin.php?page=cnss_social_icon_option">Icon Settings</a></em></p>
|
994 |
+
<table width="100%" border="0">
|
995 |
+
<tr>
|
996 |
+
<td><label for="<?php echo $this->get_field_id( 'width' ); ?>"><?php _e( 'Icon Width <em>(px)</em>:' ); ?></label>
|
997 |
+
<input class="widefat" id="<?php echo $this->get_field_id( 'width' ); ?>" name="<?php echo $this->get_field_name( 'width' ); ?>" type="number" value="<?php echo esc_attr( isset($instance[ 'width' ])?$instance[ 'width' ]:$cnss_width ); ?>" /></td>
|
998 |
+
<td> </td>
|
999 |
+
<td><label for="<?php echo $this->get_field_id( 'height' ); ?>"><?php _e( 'Icon Height <em>(px)</em>:' ); ?></label>
|
1000 |
+
<input class="widefat" id="<?php echo $this->get_field_id( 'height' ); ?>" name="<?php echo $this->get_field_name( 'height' ); ?>" type="number" value="<?php echo esc_attr( isset($instance[ 'height' ])?$instance[ 'height' ]:$cnss_height ); ?>" /></td>
|
1001 |
+
</tr>
|
1002 |
+
</table>
|
1003 |
+
|
1004 |
+
<table width="100%" border="0">
|
1005 |
+
<tr>
|
1006 |
+
<td><label for="<?php echo $this->get_field_id( 'alignment' ); ?>"><?php _e( 'Alignment:' ); ?></label><br />
|
1007 |
+
<select id="<?php echo $this->get_field_id( 'alignment' ); ?>" name="<?php echo $this->get_field_name( 'alignment' ); ?>">
|
1008 |
+
<option <?php selected( $instance[ 'alignment' ], 'center' ); ?> value="center">Center</option>
|
1009 |
+
<option <?php selected( $instance[ 'alignment' ], 'left' ); ?> value="left">Left</option>
|
1010 |
+
<option <?php selected( $instance[ 'alignment' ], 'right' ); ?> value="right">Right</option>
|
1011 |
+
</select></td>
|
1012 |
+
<td> </td>
|
1013 |
+
<td><label for="<?php echo $this->get_field_id( 'display' ); ?>"><?php _e( 'Display:' ); ?></label><br />
|
1014 |
+
<select id="<?php echo $this->get_field_id( 'display' ); ?>" name="<?php echo $this->get_field_name( 'display' ); ?>">
|
1015 |
+
<option <?php selected( $instance[ 'display' ], 'horizontal' ); ?> value="horizontal">Horizontally</option>
|
1016 |
+
<option <?php selected( $instance[ 'display' ], 'vertical' ); ?> value="vertical">Vertically</option>
|
1017 |
+
</select></td>
|
1018 |
+
<td> </td>
|
1019 |
+
<td><label for="<?php echo $this->get_field_id( 'margin' ); ?>"><?php _e( 'Margin <em>(px)</em>:' ); ?></label><br />
|
1020 |
+
<input maxlength="3" class="widefat" id="<?php echo $this->get_field_id( 'margin' ); ?>" name="<?php echo $this->get_field_name( 'margin' ); ?>" type="number" value="<?php echo esc_attr( isset($instance[ 'margin' ])?$instance[ 'margin' ]:$cnss_margin ); ?>" /></td>
|
1021 |
+
</tr>
|
1022 |
+
</table>
|
1023 |
+
|
1024 |
+
<p>
|
1025 |
+
<label><?php _e( 'Select Social Icons:' ); ?></label> <em>(If select none all icons will be displayed)</em><br />
|
1026 |
+
<?php echo $this->_cn_social_icon_widget( isset($instance['selected_icons'])?$instance['selected_icons']:array() ); ?>
|
1027 |
+
</p>
|
1028 |
+
|
1029 |
+
<table style="margin-bottom:15px;" width="100%" border="0">
|
1030 |
+
<tr>
|
1031 |
+
<td><label for="<?php echo $this->get_field_id( 'attr_id' ); ?>"><?php _e( 'Add Custom ID:' ); ?></label>
|
1032 |
+
<input class="widefat" placeholder="ID" id="<?php echo $this->get_field_id( 'attr_id' ); ?>" name="<?php echo $this->get_field_name( 'attr_id' ); ?>" type="text" value="<?php echo esc_attr( isset($instance[ 'attr_id' ])?$instance[ 'attr_id' ]:'' ); ?>" /></td>
|
1033 |
+
<td> </td>
|
1034 |
+
<td><label for="<?php echo $this->get_field_id( 'attr_class' ); ?>"><?php _e( 'Add Custom Class:' ); ?></label>
|
1035 |
+
<input class="widefat" placeholder="Class" id="<?php echo $this->get_field_id( 'attr_class' ); ?>" name="<?php echo $this->get_field_name( 'attr_class' ); ?>" type="text" value="<?php echo esc_attr( isset($instance[ 'attr_class' ])?$instance[ 'attr_class' ]:'' ); ?>" /></td>
|
1036 |
+
</tr>
|
1037 |
+
</table>
|
1038 |
+
<?php
|
1039 |
+
}
|
1040 |
+
|
1041 |
+
public function _cn_social_icon_widget( $selected_icons_array = array() ) {
|
1042 |
+
|
1043 |
+
$cnss_width = get_option('cnss-width');
|
1044 |
+
$cnss_height = get_option('cnss-height');
|
1045 |
+
|
1046 |
+
global $wpdb,$baseURL;
|
1047 |
+
$table_name = $wpdb->prefix . "cn_social_icon";
|
1048 |
+
$image_file_path = $baseURL;
|
1049 |
+
$sql = "SELECT * FROM ".$table_name." WHERE image_url<>'' AND url<>'' ORDER BY sortorder";
|
1050 |
+
$video_info = $wpdb->get_results($sql);
|
1051 |
+
$icon_count = count($video_info);
|
1052 |
+
|
1053 |
+
ob_start();
|
1054 |
+
echo '<ul class="cnss-social-icon" style="text-align:left;">'."\r\n";
|
1055 |
+
$i=0;
|
1056 |
+
foreach($video_info as $icon)
|
1057 |
+
{
|
1058 |
+
if(strpos($icon->image_url,'/')===false)
|
1059 |
+
$image_url = $image_file_path.'/'.$icon->image_url;
|
1060 |
+
else
|
1061 |
+
$image_url = $icon->image_url;
|
1062 |
+
|
1063 |
+
?><li style="display:inline-block; padding:2px 8px; border:1px dashed #ccc;">
|
1064 |
+
<div align="center"><label for="<?php echo $this->get_field_id( 'selected_icons'.$icon->id ); ?>"><img src="<?php echo $image_url?>" border="0" width="<?php echo $cnss_width ?>" height="<?php echo $cnss_height ?>" alt="<?php echo $icon->title ?>" title="<?php echo $icon->title ?>" /></label></div>
|
1065 |
+
<div align="center"><input <?php if( in_array($icon->id, $selected_icons_array ) ) echo 'checked="checked"'; ?> style="margin:0;" type="checkbox" name="<?php echo $this->get_field_name( 'selected_icons' ); ?>[]" id="<?php echo $this->get_field_id( 'selected_icons'.$icon->id ); ?>" value="<?php echo $icon->id; ?>" /></div>
|
1066 |
+
</li>
|
1067 |
+
<?php
|
1068 |
+
$i++;
|
1069 |
+
}
|
1070 |
+
echo '</ul>'."\r\n";
|
1071 |
+
$out = ob_get_contents();
|
1072 |
+
ob_end_clean();
|
1073 |
+
return $out;
|
1074 |
}
|
|
|
1075 |
} // class Cnss_Widget
|
1076 |
add_action( 'widgets_init', create_function( '', 'register_widget( "Cnss_Widget" );' ) );
|
1077 |
+
add_shortcode('cn-social-icon', 'cn_social_icon');
|
images/icon/1368459524_facebook.png
DELETED
Binary file
|
images/icon/1368459556_twitter.png
DELETED
Binary file
|
images/icon/1368459641_flicker.png
DELETED
Binary file
|
images/icon/1368459699_in.png
DELETED
Binary file
|
images/icon/1368459724_youtube.png
DELETED
Binary file
|
images/icon/Facebook.png
ADDED
Binary file
|
images/icon/Google-Plus.png
ADDED
Binary file
|
images/icon/Toutube.png
ADDED
Binary file
|
images/icon/Twitter.png
ADDED
Binary file
|
images/icon/Viber.png
ADDED
Binary file
|
images/icon/flickr.png
ADDED
Binary file
|
images/icon/instagram.png
ADDED
Binary file
|
images/icon/linkedIn.png
ADDED
Binary file
|
images/icon/pinterest.png
ADDED
Binary file
|
images/icon/skype.png
ADDED
Binary file
|
images/icon/whatsup.png
ADDED
Binary file
|
images/icon/wordpress.png
ADDED
Binary file
|
js/cnss.js
CHANGED
@@ -15,11 +15,11 @@ jQuery(document).ready(function($) {
|
|
15 |
jQuery('ul.cnss-social-icon li img').hover(function() {
|
16 |
jQuery(this).animate({
|
17 |
opacity: 0.5
|
18 |
-
}, 200 );
|
19 |
},
|
20 |
function() {
|
21 |
jQuery(this).animate({
|
22 |
opacity: 1
|
23 |
-
}, 200 );
|
24 |
});
|
25 |
-
});
|
15 |
jQuery('ul.cnss-social-icon li img').hover(function() {
|
16 |
jQuery(this).animate({
|
17 |
opacity: 0.5
|
18 |
+
}, {duration:200, queue:false} );
|
19 |
},
|
20 |
function() {
|
21 |
jQuery(this).animate({
|
22 |
opacity: 1
|
23 |
+
}, {duration:200, queue:false} );
|
24 |
});
|
25 |
+
});
|
readme.txt
CHANGED
@@ -1,10 +1,10 @@
|
|
1 |
=== Easy Social Icons ===
|
2 |
Contributors: cybernetikz
|
3 |
Donate link:
|
4 |
-
Tags: easy social icon,easy social icons,social icon,social icons,social,social share,follow,followus,follow us,share,icon,custom social icons
|
5 |
Requires at least: 3.5
|
6 |
-
Tested up to: 4.5
|
7 |
-
Stable tag:
|
8 |
|
9 |
Using this social media plugin you can upload your own social icon, set your social URL, choose whether you want to display vertically or horizontally.
|
10 |
|
@@ -22,18 +22,20 @@ If you are using <strong>wordpress version lower than 3.5</strong> please use "E
|
|
22 |
>
|
23 |
> Email us if you need <strong>paid support</strong>, <a href="mailto:support@cybernetikz.com">support@cybernetikz.com</a>
|
24 |
|
25 |
-
= Key
|
26 |
|
27 |
* You can upload your own social icons, set URL for that icon with sort order, target windows etc.
|
28 |
-
*
|
29 |
-
*
|
|
|
|
|
|
|
30 |
* You can set the icon width and height to fit in your template/design perfectly
|
31 |
* You can display your social share icons vertically or horizontally to match perfectly with your template/design.
|
32 |
* You can put your social icon set in the sidebar using the widget
|
33 |
* You can insert your social icon set in pages/posts using shortcode
|
34 |
* Sort social media icons using drag drop
|
35 |
* Also if you are familiar with PHP code then you can use the template tag to place the social icon set anywhere in the PHP template file
|
36 |
-
* Responsive feature added
|
37 |
|
38 |
Please visit our site <a target="_blank" href="http://www.cybernetikz.com/blog/wordpress-plugins-easy-social-icons/">www.cybernetikz.com/</a>
|
39 |
|
@@ -42,17 +44,19 @@ Please visit our site <a target="_blank" href="http://www.cybernetikz.com/blog/w
|
|
42 |
1. Download the plugin and extract the files
|
43 |
2. Upload "easy-social-icons" to your wp-content/plugins/ directory
|
44 |
3. Activate the plugin through the 'Plugins' menu in WordPress
|
45 |
-
4.
|
46 |
|
47 |
== Frequently Asked Questions ==
|
48 |
|
49 |
-
= Ques : How use this
|
50 |
-
Ans :
|
51 |
Use this shortcode for page/post <strong>[cn-social-icon]</strong> , for php code use this template tag <strong><?php if ( function_exists('cn_social_icon') ) echo cn_social_icon(); ?></strong>
|
52 |
|
53 |
-
|
|
|
|
|
54 |
|
55 |
-
= Ques : What if my wordpress version is below 3.5? =
|
56 |
Ans :
|
57 |
If you are using wordpress version lower than 3.5 please use Easy social Icon version <a href="https://downloads.wordpress.org/plugin/easy-social-icons.1.0.zip">1.1</a>
|
58 |
|
@@ -60,15 +64,33 @@ If you are using wordpress version lower than 3.5 please use Easy social Icon ve
|
|
60 |
|
61 |
1. add new icon page layout
|
62 |
2. manage icons page layout
|
63 |
-
3.
|
64 |
4. display social icons vertically in sidebar using widget
|
65 |
5. display social icons vertically in page using shortcode [cn-social-icon]
|
66 |
6. display social icons horizontally in sidebar using widget
|
67 |
-
7.
|
68 |
-
8.
|
69 |
|
70 |
== Changelog ==
|
71 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
72 |
= 1.2.4.1 =
|
73 |
* Banner added in plugins pages
|
74 |
|
1 |
=== Easy Social Icons ===
|
2 |
Contributors: cybernetikz
|
3 |
Donate link:
|
4 |
+
Tags: easy social icon,easy social icons,social icon,social icons,social,social share,follow,followus,follow us,share,icon,custom social icons, social media icons
|
5 |
Requires at least: 3.5
|
6 |
+
Tested up to: 4.5.2
|
7 |
+
Stable tag: 2.0
|
8 |
|
9 |
Using this social media plugin you can upload your own social icon, set your social URL, choose whether you want to display vertically or horizontally.
|
10 |
|
22 |
>
|
23 |
> Email us if you need <strong>paid support</strong>, <a href="mailto:support@cybernetikz.com">support@cybernetikz.com</a>
|
24 |
|
25 |
+
= Key Features =
|
26 |
|
27 |
* You can upload your own social icons, set URL for that icon with sort order, target windows etc.
|
28 |
+
* Create mutiple widget instance with different settings
|
29 |
+
* Use mutiple shortcode in page/post with different settings
|
30 |
+
* Use mutiple PHP template tag in PHP themes files with different settings
|
31 |
+
* Works with responsive website
|
32 |
+
* You will get add/edit/delete option for icons
|
33 |
* You can set the icon width and height to fit in your template/design perfectly
|
34 |
* You can display your social share icons vertically or horizontally to match perfectly with your template/design.
|
35 |
* You can put your social icon set in the sidebar using the widget
|
36 |
* You can insert your social icon set in pages/posts using shortcode
|
37 |
* Sort social media icons using drag drop
|
38 |
* Also if you are familiar with PHP code then you can use the template tag to place the social icon set anywhere in the PHP template file
|
|
|
39 |
|
40 |
Please visit our site <a target="_blank" href="http://www.cybernetikz.com/blog/wordpress-plugins-easy-social-icons/">www.cybernetikz.com/</a>
|
41 |
|
44 |
1. Download the plugin and extract the files
|
45 |
2. Upload "easy-social-icons" to your wp-content/plugins/ directory
|
46 |
3. Activate the plugin through the 'Plugins' menu in WordPress
|
47 |
+
4. See the "Easy Social Icons" menu on the left bar for setup
|
48 |
|
49 |
== Frequently Asked Questions ==
|
50 |
|
51 |
+
= Ques : How to use this plugin ? =
|
52 |
+
Ans :
|
53 |
Use this shortcode for page/post <strong>[cn-social-icon]</strong> , for php code use this template tag <strong><?php if ( function_exists('cn_social_icon') ) echo cn_social_icon(); ?></strong>
|
54 |
|
55 |
+
You can use the "Easy Social Icons" widget for the sidebar.
|
56 |
+
|
57 |
+
For more details, please follow the instruction in this page "WP Admin Menu"->"Easy Social Icons"->"Settings & Instruction" on "How to use" section.
|
58 |
|
59 |
+
= Ques : What if my wordpress version is below 3.5 ? =
|
60 |
Ans :
|
61 |
If you are using wordpress version lower than 3.5 please use Easy social Icon version <a href="https://downloads.wordpress.org/plugin/easy-social-icons.1.0.zip">1.1</a>
|
62 |
|
64 |
|
65 |
1. add new icon page layout
|
66 |
2. manage icons page layout
|
67 |
+
3. plugins settings page layout
|
68 |
4. display social icons vertically in sidebar using widget
|
69 |
5. display social icons vertically in page using shortcode [cn-social-icon]
|
70 |
6. display social icons horizontally in sidebar using widget
|
71 |
+
7. sort icons usign drag drop
|
72 |
+
8. add Easy Social Icon widget to sidebar using drag drop
|
73 |
|
74 |
== Changelog ==
|
75 |
|
76 |
+
= 2.0.1 =
|
77 |
+
* bug fix for icon sorting feature
|
78 |
+
* screenshot update
|
79 |
+
|
80 |
+
= 2.0 =
|
81 |
+
* New feature added for widget, create mutiple widget instance with different settings
|
82 |
+
* New feature added for shortcode, use mutiple shortcode in page/post with different settings
|
83 |
+
* New feature added for PHP template tag, use mutiple PHP template tag in PHP themes files with different settings
|
84 |
+
* New feature added for shortcode generate
|
85 |
+
* Plugin's settings & instructions page layout is updated
|
86 |
+
* "How to use?" section is added in plugin's settings & instructions page
|
87 |
+
* ID column is added to manage icons page
|
88 |
+
* Button is updated throughout the plugin setup pages
|
89 |
+
* Layout is updated in sort icons page
|
90 |
+
* Screenshot updated
|
91 |
+
* CSS updated
|
92 |
+
* Javascript updated
|
93 |
+
|
94 |
= 1.2.4.1 =
|
95 |
* Banner added in plugins pages
|
96 |
|
screenshot-1.png
CHANGED
Binary file
|
screenshot-2.png
CHANGED
Binary file
|
screenshot-3.png
CHANGED
Binary file
|
screenshot-4.png
CHANGED
Binary file
|
screenshot-5.png
CHANGED
Binary file
|
screenshot-6.png
CHANGED
Binary file
|
screenshot-7.png
CHANGED
Binary file
|
screenshot-8.png
CHANGED
Binary file
|