Our Team Showcase - Version 2.0

Version Description

  1. Major appearance and functionality changes
  2. updated pro version
Download this release

Release Info

Developer smartcat
Plugin Icon 128x128 Our Team Showcase
Version 2.0
Comparing to
See all releases

Code changes from version 1.3 to 2.0

admin/options.php ADDED
@@ -0,0 +1,214 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php include_once 'setting.php'; extract( get_option('smartcat_team_options')); ?>
2
+ <div class="width70 left">
3
+ <p>To display the Team, copy and paste this shortcode into the page or widget where you want to show it.
4
+ <input type="text" readonly="readonly" value="[our-team]" style="width: 100px" onfocus="this.select()"/>
5
+ </p>
6
+ <p><iframe src="//www.facebook.com/plugins/like.php?href=https%3A%2F%2Fwww.facebook.com%2FSmartcatDesign&amp;width&amp;layout=standard&amp;action=like&amp;show_faces=false&amp;share=false&amp;height=35&amp;appId=233286813420319" scrolling="no" frameborder="0" style="border:none; overflow:hidden; height:35px;" allowTransparency="true"></iframe></p>
7
+
8
+ <form name="sc_our_team_post_form" method="post" action="" enctype="multipart/form-data">
9
+ <table class="widefat">
10
+ <thead>
11
+ <tr>
12
+ <th colspan="2"><b>Team View Settings</b></th>
13
+ </tr>
14
+ </thead>
15
+ <tbody>
16
+ <tr>
17
+ <td>Template</td>
18
+ <td>
19
+ <select name="smartcat_team_options[template]" id="sc_our_team_template">
20
+ <option>Select Template</option>
21
+ <option value="grid" <?php echo 'grid' == esc_attr( $template ) ? 'selected=selected' : ''; ?>>Grid - Boxes</option>
22
+ <option value="grid_circles" <?php echo 'grid_circles' == esc_attr( $template ) ? 'selected=selected' : ''; ?>>Grid - Circles</option>
23
+ <option disabled="disabled">List - Stacked (pro version)</option>
24
+ <option disabled="disabled">Honey Comb (pro version)</option>
25
+ </select>
26
+ </td>
27
+ </tr>
28
+
29
+ <tr id="columns-row">
30
+ <td>Grid Columns</td>
31
+ <td>
32
+ <select name="smartcat_team_options[columns]">
33
+ <option value="2" <?php echo '2' == esc_attr ( $columns ) ? 'selected=selected' : ''; ?>>2</option>
34
+ <option value="3" <?php echo '3' == esc_attr ( $columns ) ? 'selected=selected' : ''; ?>>3</option>
35
+ <option value="4" <?php echo '4' == esc_attr( $columns ) ? 'selected=selected' : ''; ?>>4</option>
36
+ <option value="5" <?php echo '5' == esc_attr( $columns ) ? 'selected=selected' : ''; ?>>5</option>
37
+ <option value="10" <?php echo '10' == esc_attr( $columns ) ? 'selected=selected' : ''; ?>>10</option>
38
+ </select>
39
+ </td>
40
+ </tr>
41
+
42
+ <tr id="height-row">
43
+ <td>Row Height</td>
44
+ <td>
45
+ <input type="text" name="smartcat_team_options[height]" value="<?php echo esc_attr( $height ); ?>" class="width25"/>px
46
+ </td>
47
+ </tr>
48
+
49
+ <tr id="margin-row">
50
+ <td>Margin</td>
51
+ <td>
52
+ <select name="smartcat_team_options[margin]">
53
+ <option value="0" <?php echo '0' == esc_attr( $margin ) ? 'selected=selected' : ''; ?>>No margin</option>
54
+ <option value="5" <?php echo '5' == esc_attr( $margin ) ? 'selected=selected' : ''; ?>>5</option>
55
+ <option value="10" <?php echo '10' == esc_attr( $margin ) ? 'selected=selected' : ''; ?>>10</option>
56
+ <option value="15" <?php echo '15' == esc_attr( $margin ) ? 'selected=selected' : ''; ?>>15</option>
57
+ </select>px
58
+ </td>
59
+ </tr>
60
+
61
+ <tr id="social_icons_row">
62
+ <td>Display Social Icons</td>
63
+ <td>
64
+ <select name="smartcat_team_options[social]">
65
+ <option value="yes" <?php echo 'yes' == esc_attr( $social ) ? 'selected=selected' : ''; ?>>Yes</option>
66
+ <option value="no" <?php echo 'no' == esc_attr( $social ) ? 'selected=selected' : ''; ?>>No</option>
67
+ </select>
68
+ </td>
69
+ </tr>
70
+
71
+ <tr id="">
72
+ <td>Display Name</td>
73
+ <td>
74
+ <select name="smartcat_team_options[name]">
75
+ <option value="yes" <?php echo 'yes' == esc_attr( $name ) ? 'selected=selected' : ''; ?>>Yes</option>
76
+ <option value="no" <?php echo 'no' == esc_attr( $name ) ? 'selected=selected' : ''; ?>>No</option>
77
+ </select>
78
+ </td>
79
+ </tr>
80
+
81
+ <tr id="">
82
+ <td>Display Title</td>
83
+ <td>
84
+ <select name="smartcat_team_options[title]">
85
+ <option value="yes" <?php echo 'yes' == esc_attr( $title )? 'selected=selected' : ''; ?>>Yes</option>
86
+ <option value="no" <?php echo 'no' == esc_attr( $title ) ? 'selected=selected' : ''; ?>>No</option>
87
+ </select>
88
+ </td>
89
+ </tr>
90
+ <tr>
91
+ <td>Number of members to display</td>
92
+ <td>
93
+ <input type="text" value="<?php echo esc_attr( $member_count ); ?>" name="smartcat_team_options[member_count]" placeholder="number of members to show"/><br>
94
+ <em>Set to -1 to display all members</em>
95
+ </td>
96
+ </tr>
97
+ <tr>
98
+ <td>Main Color</td>
99
+ <td>
100
+ <input class="wp_popup_color width25" type="text" value="<?php echo esc_attr( $text_color ); ?>" name="smartcat_team_options[text_color]"/>
101
+ </td>
102
+ </tr>
103
+ <tr id="honey-comb-row">
104
+ <td>Honey Comb Color</td>
105
+ <td>
106
+ <input class="wp_popup_color width25" type="text" value="<?php echo esc_attr( $honeycomb_color ) ; ?>" name="smartcat_team_options[honeycomb_color]"/>
107
+ </td>
108
+ </tr>
109
+ </tbody>
110
+ </table>
111
+
112
+ <table class="widefat">
113
+ <thead>
114
+ <tr>
115
+ <th colspan="2"><b>Single Member View Settings</b></th>
116
+ </tr>
117
+ <tr>
118
+ <td>Template</td>
119
+ <td>
120
+ <select name="smartcat_team_options[single_template]">
121
+ <option>Select Template</option>
122
+ <option value="standard" <?php echo 'standard' == esc_attr( $single_template ) ? 'selected=selected' : ''; ?>>Theme Default (single post)</option>
123
+ <option disabled="disabled">Custom Template (pro version)</option>
124
+ <option disabled="disabled">Popup Card (pro version)</option>
125
+ </select>
126
+ </td>
127
+ </tr>
128
+
129
+ <tr id="">
130
+ <td>Display Social Icons</td>
131
+ <td>
132
+ <select name="smartcat_team_options[single_social]">
133
+ <option value="yes" <?php echo 'yes' == esc_attr( $single_social ) ? 'selected=selected' : ''; ?>>Yes</option>
134
+ <option value="no" <?php echo 'no' == esc_attr( $single_social ) ? 'selected=selected' : ''; ?>>No</option>
135
+ </select>
136
+ </td>
137
+ </tr>
138
+
139
+ <tr id="">
140
+ <td>Display Skills</td>
141
+ <td>
142
+ <em class="red">Pro Version</em>
143
+ </td>
144
+ </tr>
145
+
146
+
147
+ <tr>
148
+ <td>Image Style</td>
149
+ <td>
150
+ <em class="red">Pro Version</em>
151
+ </td>
152
+ </tr>
153
+
154
+ </thead>
155
+ </table>
156
+
157
+ <input type="hidden" name="smartcat_team_options[redirect]" value=""/>
158
+ <input type="submit" name="sc_our_team_save" value="Update" class="button button-primary" />
159
+
160
+ </form>
161
+
162
+ <div class="clear"></div>
163
+
164
+ <table class="widefat">
165
+ <thead>
166
+ <tr>
167
+ <th colspan="4">Demo</th>
168
+ </tr>
169
+ <tr>
170
+ <td>
171
+ Grid Boxes &amp; Grid Circles Demo<br>
172
+ <img src="<?php echo SC_TEAM_URL ?>screenshot-1.png" width="100%">
173
+ </td>
174
+ <td>
175
+ Honeycomb Demo<br>
176
+ <img src="<?php echo SC_TEAM_URL ?>screenshot-4.jpg" width="100%">
177
+ </td>
178
+ <td>
179
+ Stacked List Demo<br>
180
+ <img src="<?php echo SC_TEAM_URL ?>screenshot-5.jpg" width="100%">
181
+ </td>
182
+ <td>
183
+ Popup Card Demo<br>
184
+ <img src="<?php echo SC_TEAM_URL ?>capture.JPG" width="100%">
185
+ </td>
186
+ <td></td>
187
+ </tr>
188
+ </thead>
189
+ </table>
190
+
191
+
192
+ </div>
193
+
194
+
195
+ </div>
196
+
197
+ <script>
198
+ function confirm_reset() {
199
+ if (confirm("Are you sure you want to reset to defaults ?")) {
200
+ return true;
201
+ } else {
202
+ return false;
203
+ }
204
+ }
205
+ jQuery(document).ready(function($) {
206
+ $("#sc_popup_shortcode").focusout(function() {
207
+ var shortcode = jQuery(this).val();
208
+ shortcode = shortcode.replace(/"/g, "").replace(/'/g, "");
209
+ jQuery(this).val(shortcode);
210
+ });
211
+
212
+ });
213
+
214
+ </script>
{inc → admin}/reorder.php RENAMED
@@ -12,7 +12,7 @@
12
  <td>
13
  <ul class="sortable grid" data-action="<?php echo SC_TEAM_PATH; ?>">
14
  <?php
15
- $args = array(
16
  'post_type' => 'team_member',
17
  'meta_key' => 'sc_member_order',
18
  'orderby' => 'meta_value_num',
@@ -24,12 +24,13 @@
24
  while ($members->have_posts()) {
25
  $members->the_post();
26
  $id = get_the_ID();
 
27
  if (has_post_thumbnail())
28
  $thumb_url = wp_get_attachment_url(get_post_thumbnail_id($id));
29
  else
30
  $thumb_url = SC_TEAM_PATH . 'img/noprofile.jpg';
31
  ?>
32
- <li id="<?php echo $id; ?>" itemscope itemtype="http://schema.org/Person" class="sc_team_member ui-state-default">
33
  <div class="sc_team_member_inner">
34
  <img src="<?php echo $thumb_url; ?>" />
35
  <div class="sc_team_member_overlay">
12
  <td>
13
  <ul class="sortable grid" data-action="<?php echo SC_TEAM_PATH; ?>">
14
  <?php
15
+ $args = array(
16
  'post_type' => 'team_member',
17
  'meta_key' => 'sc_member_order',
18
  'orderby' => 'meta_value_num',
24
  while ($members->have_posts()) {
25
  $members->the_post();
26
  $id = get_the_ID();
27
+ $order = get_post_meta($id, 'sc_member_order', true);
28
  if (has_post_thumbnail())
29
  $thumb_url = wp_get_attachment_url(get_post_thumbnail_id($id));
30
  else
31
  $thumb_url = SC_TEAM_PATH . 'img/noprofile.jpg';
32
  ?>
33
+ <li id="<?php echo $id; ?>" itemscope itemtype="http://schema.org/Person" class="sc_team_member ui-state-default" data-order="<?php echo $order; ?>">
34
  <div class="sc_team_member_inner">
35
  <img src="<?php echo $thumb_url; ?>" />
36
  <div class="sc_team_member_overlay">
{inc → admin}/setting.php RENAMED
@@ -84,74 +84,59 @@
84
  .larger{ font-size: larger;}
85
  .bold{ font-weight: bold;}
86
  .editcursor{ cursor: text}
87
- .red{ color: #CC0000; }
88
  </style>
89
 
90
  <div id="wrapper">
91
  <div id="gopro">
92
  <div class="left">
93
  <h1><b>Our Team Settings</b></h1>
94
- <div><em>Why go pro ?</em> 2 additional templates: Stacked and Honeycomb. As well as color customization, and the option to add different team groups/departments</div>
95
  </div>
96
  <div class="right">
97
- <a href="http://smartcatdesign.net/product/our-team-showcase-pro/" target="_blank" class="button-primary" style="padding: 40px;line-height: 0;font-size: 20px">GO PRO NOW</a>
 
 
 
98
  </div>
99
  </div>
100
  <div class="width25 right">
101
- <table class="widefat">
102
- <thead>
103
- <tr>
104
- <th><b>Pro version features</b></th>
105
- </tr>
106
- <tr>
107
- <td>
108
- <ul>
109
- <li>2 very appealing additional display templates</li>
110
- <li>Easy Color customization with a color picker</li>
111
- <li>Assign team members to groups or departments</li>
112
- <li>Control which groups to show, or show all members</li>
113
- </ul>
114
- </td>
115
- </tr>
116
- </thead>
117
- </table>
118
  <table class="widefat">
119
  <thead>
120
  <tr>
121
- <th><b>Looking for Support?</b> </th>
122
  </tr>
123
  <tr>
124
  <td>
125
- <p>For plugin setup instructions and FAQ's <a href="http://smartcatdesign.net/our-team-showcase/" target="_blank">Click Here</a></p>
126
- <p>If you come across any bugs or issues, please <a href="http://smartcatdesign.net/contact" target="_blank">contact us</a> and let us know</p>
 
 
 
 
 
 
 
127
  </td>
128
  </tr>
129
- <!-- <tr>
130
- <td class='center'>
131
- <a href='http://smartcatdesign.net/under-construction-maintenance-mode-free-wordpress-plugin/' target='_blank' class='button-primary'>Support</a>
132
- <a href='http://smartcatdesign.net/under-construction-maintenance-mode-free-wordpress-plugin/' target='_blank' class='button-primary'>Go Pro</a>
133
- </td>
134
- </tr>-->
135
  </thead>
136
- </table>
 
137
  <table class="widefat">
138
  <thead>
139
  <tr>
140
- <th>
141
- <b>Show your appreciation</b>
142
- </th>
143
  </tr>
144
  <tr>
145
  <td>
146
- <ul>
147
- <li>- <a href="http://wordpress.org/support/view/plugin-reviews/our-team-enhanced" target="_blank">Leave ★★★★★ rating on WordPress.org</a></li>
148
- <li>- Write a comment on the <a href="https://www.facebook.com/SmartcatDesign" target="_blank">Facebook Page</a></li>
149
- </ul>
150
-
151
  </td>
152
  </tr>
153
  </thead>
154
  </table>
 
 
155
  <table class="widefat">
156
  <thead>
157
  <tr>
84
  .larger{ font-size: larger;}
85
  .bold{ font-weight: bold;}
86
  .editcursor{ cursor: text}
87
+ .red{ color: #CC0000; font-size: 12px;}
88
  </style>
89
 
90
  <div id="wrapper">
91
  <div id="gopro">
92
  <div class="left">
93
  <h1><b>Our Team Settings</b></h1>
94
+ <div><em>Why go pro?</em> More templates, more features, and more control! <br>Professional, sleek and easily customizable Team page & widget with extra options!</div>
95
  </div>
96
  <div class="right">
97
+ <a href="http://smartcatdesign.net/our-team-showcase-demo/" target="_blank" class="button-secondary" style="padding: 40px;line-height: 0;font-size: 20px">View Demo</a>
98
+ </div>
99
+ <div class="right" style="margin-right: 20px">
100
+ <a href="http://smartcatdesign.net/downloads/our-team-showcase/" target="_blank" class="button-primary" style="padding: 40px;line-height: 0;font-size: 20px">GO PRO NOW</a>
101
  </div>
102
  </div>
103
  <div class="width25 right">
104
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
105
  <table class="widefat">
106
  <thead>
107
  <tr>
108
+ <th><b>Read Me</b> </th>
109
  </tr>
110
  <tr>
111
  <td>
112
+ <ul>
113
+ <li>- To display the team members, add <b>[our-team]</b> shortcode in a widget, post or page</li>
114
+ <li>- To display members from a specific group, add <b>[our-team group="name of your group"]</b></li>
115
+ <li>- To override the template choice from the shortcode, add <b>[our-team template="grid"]</b> . Template Options: <em>grid, grid_circles, hc, stacked</em> (Pro Version)</li>
116
+ <li>- Click on Re-order to arrange the order of the team members</li>
117
+ <li>- Click on Groups to create groups (example: department, team names)</li>
118
+ <li>- <b>Custom Template: </b>Customize your own single member page template, simply copy <b>/inc/template/team_members_template.php</b> into your theme root directory and edit it any way you want(Pro Version)</li>
119
+ </ul>
120
+
121
  </td>
122
  </tr>
 
 
 
 
 
 
123
  </thead>
124
+ </table>
125
+
126
  <table class="widefat">
127
  <thead>
128
  <tr>
129
+ <th><b>Looking for Support?</b> </th>
 
 
130
  </tr>
131
  <tr>
132
  <td>
133
+ <p>If you come across any bugs or issues, please <a href="http://smartcatdesign.net/contact" target="_blank">contact us</a> and let us know</p>
 
 
 
 
134
  </td>
135
  </tr>
136
  </thead>
137
  </table>
138
+
139
+
140
  <table class="widefat">
141
  <thead>
142
  <tr>
capture.JPG ADDED
Binary file
inc/class/class.smartcat-team.php ADDED
@@ -0,0 +1,486 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+
4
+ function sc_team_update_order() {
5
+ $post_id = $_POST['id'];
6
+ $sc_member_order = $_POST['sc_member_order'];
7
+ update_post_meta($post_id, 'sc_member_order', $sc_member_order);
8
+ exit();
9
+ }
10
+ add_action('wp_ajax_sc_team_update_order', 'sc_team_update_order');
11
+ add_action('wp_ajax_sc_team_update_order', 'sc_team_update_order');
12
+
13
+
14
+ class SmartcatTeamPlugin {
15
+
16
+ const VERSION = '1.1';
17
+
18
+ private static $instance;
19
+ private $options;
20
+
21
+ public static function instance() {
22
+ if ( !self::$instance ) :
23
+ self::$instance = new self;
24
+ self::$instance->get_options();
25
+ self::$instance->add_hooks();
26
+ endif;
27
+ }
28
+
29
+ public static function activate() {
30
+
31
+ $options = array(
32
+ 'template' => 'grid',
33
+ 'social' => 'yes',
34
+ 'single_social' => 'yes',
35
+ 'name' => 'yes',
36
+ 'title' => 'yes',
37
+ 'profile_link' => 'yes',
38
+ 'member_count' => -1,
39
+ 'text_color' => '1F7DCF',
40
+ 'columns' => '3',
41
+ 'margin' => 5,
42
+ 'height' => 170,
43
+ 'single_template' => 'standard',
44
+ 'redirect' => true,
45
+ 'single_image_size' => 'small',
46
+ 'single_skills' => 'yes'
47
+ );
48
+
49
+ if ( !get_option( 'smartcat_team_options' ) ) {
50
+ add_option( 'smartcat_team_options', $options );
51
+ }
52
+
53
+ $options[ 'redirect' ] = true;
54
+ update_option( 'smartcat_team_options', $options );
55
+ }
56
+
57
+ public static function deactivate() {
58
+
59
+ }
60
+
61
+ private function add_hooks() {
62
+ add_action( 'init', array( $this, 'team_members' ) );
63
+ add_action( 'init', array( $this, 'team_member_positions' ), 0 );
64
+ add_action( 'admin_init', array( $this, 'smartcat_team_activation_redirect' ) );
65
+ add_action( 'admin_menu', array( $this, 'smartcat_team_menu' ) );
66
+ add_action( 'admin_enqueue_scripts', array( $this, 'smartcat_team_load_admin_styles_scripts' ) );
67
+ add_action( 'wp_enqueue_scripts', array( $this, 'smartcat_team_load_styles_scripts' ) );
68
+ add_shortcode( 'our-team', array( $this, 'set_our_team' ) );
69
+ add_action( 'add_meta_boxes', array( $this, 'smartcat_team_member_info_box' ) );
70
+ add_action( 'save_post', array( $this, 'team_member_box_save' ) );
71
+ add_action( 'widgets_init', array( $this, 'wpb_load_widget' ) );
72
+ add_filter( 'manage_posts_columns', array( $this, 'posts_columns' ), 5 );
73
+ add_action( 'manage_posts_custom_column', array( $this, 'posts_custom_columns' ), 5, 2 );
74
+ add_action( 'wp_ajax_smartcat_team_update_pm', array( $this, 'smartcat_team_update_order' ) );
75
+ add_action( 'wp_head', array( $this, 'sc_custom_styles' ) );
76
+ add_filter( 'the_content', array( $this, 'smartcat_set_single_content' ) );
77
+ add_filter( 'single_template', array( $this, 'smartcat_team_get_single_template' ) );
78
+ }
79
+
80
+ private function get_options() {
81
+ if ( get_option( 'smartcat_team_options' ) ) :
82
+ $this->options = get_option( 'smartcat_team_options' );
83
+ endif;
84
+ }
85
+
86
+ /**
87
+ * @todo check if redirect option is set and redirect
88
+ */
89
+ public function smartcat_team_activation_redirect() {
90
+ if ( $this->options[ 'redirect' ] ) :
91
+ $old_val = $this->options;
92
+ $old_val[ 'redirect' ] = false;
93
+ update_option( 'smartcat_team_options', $old_val );
94
+ wp_safe_redirect( admin_url( 'edit.php?post_type=team_member&page=smartcat_team_settings' ) );
95
+ endif;
96
+ }
97
+
98
+ public function smartcat_team_menu() {
99
+
100
+ add_submenu_page( 'edit.php?post_type=team_member', 'Settings', 'Settings', 'administrator', 'smartcat_team_settings', array( $this, 'smartcat_team_settings' ) );
101
+ add_submenu_page( 'edit.php?post_type=team_member', 'Re-Order Members', 'Re-Order Members', 'administrator', 'smartcat_team_reorder', array( $this, 'smartcat_team_reorder' ) );
102
+ }
103
+
104
+ public function smartcat_team_reorder() {
105
+ include_once SC_TEAM_PATH . 'admin/reorder.php';
106
+ }
107
+
108
+ public function smartcat_team_settings() {
109
+
110
+ if ( isset( $_REQUEST[ 'sc_our_team_save' ] ) && $_REQUEST[ 'sc_our_team_save' ] == 'Update' ) :
111
+ update_option( 'smartcat_team_options', $_REQUEST[ 'smartcat_team_options' ] );
112
+ endif;
113
+
114
+ include_once SC_TEAM_PATH . 'admin/options.php';
115
+ }
116
+
117
+ public function smartcat_team_load_admin_styles_scripts( $hook ) {
118
+ wp_enqueue_style( 'smartcat_team_admin_style', SC_TEAM_URL . 'inc/style/sc_our_team_admin.css' );
119
+ wp_enqueue_script( 'smartcat_team_color_script', SC_TEAM_URL . 'inc/script/jscolor/jscolor.js', array( 'jquery' ) );
120
+ wp_enqueue_script( 'smartcat_team_script', SC_TEAM_URL . 'inc/script/sc_our_team_admin.js', array( 'jquery' ) );
121
+ }
122
+
123
+ function smartcat_team_load_styles_scripts() {
124
+
125
+ // plugin main style
126
+ wp_enqueue_style( 'smartcat_team_default_style', SC_TEAM_URL . 'inc/style/sc_our_team.css', false, '1.0' );
127
+
128
+ // plugin main script
129
+ wp_enqueue_script( 'smartcat_team_default_script', SC_TEAM_URL . 'inc/script/sc_our_team.js', array( 'jquery' ), '1.0' );
130
+ }
131
+
132
+ function set_our_team( $atts ) {
133
+ extract( shortcode_atts( array(
134
+ 'group' => '',
135
+
136
+ ), $atts ) );
137
+ global $content;
138
+
139
+ ob_start();
140
+
141
+ $template = '';
142
+
143
+ if( $template == '' ) :
144
+ if ( $this->options[ 'template' ] === false or $this->options[ 'template' ] == '' ) :
145
+ include SC_TEAM_PATH . 'inc/template/grid.php';
146
+ else :
147
+ include SC_TEAM_PATH . 'inc/template/' . $this->options[ 'template' ] . '.php';
148
+ endif;
149
+ else :
150
+ include SC_TEAM_PATH . 'inc/template/grid.php';
151
+ endif;
152
+
153
+ $output = ob_get_clean();
154
+ return $output;
155
+ }
156
+
157
+ function team_members() {
158
+ $labels = array(
159
+ 'name' => _x( 'Team', 'post type general name' ),
160
+ 'singular_name' => _x( 'Team Member', 'post type singular name' ),
161
+ 'add_new' => _x( 'Add New', 'book' ),
162
+ 'add_new_item' => __( 'Add New Member' ),
163
+ 'edit_item' => __( 'Edit Member' ),
164
+ 'new_item' => __( 'New Team Member' ),
165
+ 'all_items' => __( 'All Team Members' ),
166
+ 'view_item' => __( 'View Team Member' ),
167
+ 'search_items' => __( 'Search Team Members' ),
168
+ 'not_found' => __( 'No member found' ),
169
+ 'not_found_in_trash' => __( 'No member found in the Trash' ),
170
+ 'parent_item_colon' => '',
171
+ 'menu_name' => 'Our Team'
172
+ );
173
+ $args = array(
174
+ 'labels' => $labels,
175
+ 'description' => 'Holds our team members specific data',
176
+ 'public' => true,
177
+ 'menu_icon' => SC_TEAM_URL . 'inc/img/icon.png',
178
+ 'supports' => array( 'title', 'editor', 'thumbnail' ),
179
+ 'has_archive' => true,
180
+ );
181
+ register_post_type( 'team_member', $args );
182
+ flush_rewrite_rules();
183
+ }
184
+
185
+ public function team_member_positions() {
186
+ $labels = array(
187
+ 'name' => _x( 'Groups', 'taxonomy general name' ),
188
+ 'singular_name' => _x( 'Group', 'taxonomy singular name' ),
189
+ 'search_items' => __( 'Search Groups' ),
190
+ 'all_items' => __( 'All Groups' ),
191
+ 'parent_item' => __( 'Parent Group' ),
192
+ 'parent_item_colon' => __( 'Parent Group:' ),
193
+ 'edit_item' => __( 'Edit Group' ),
194
+ 'update_item' => __( 'Update Group' ),
195
+ 'add_new_item' => __( 'Add New Group' ),
196
+ 'new_item_name' => __( 'New Group' ),
197
+ 'menu_name' => __( 'Groups' ),
198
+ );
199
+ $args = array(
200
+ 'labels' => $labels,
201
+ 'hierarchical' => true,
202
+ );
203
+ register_taxonomy( 'team_member_position', 'team_member', $args );
204
+ }
205
+
206
+ public function smartcat_team_member_info_box() {
207
+
208
+ add_meta_box(
209
+ 'smartcat_team_member_info_box', __( 'Additional Information', 'myplugin_textdomain' ), array( $this, 'smartcat_team_member_info_box_content' ), 'team_member', 'normal', 'high'
210
+ );
211
+ }
212
+
213
+ public function smartcat_team_member_info_box_content( $post ) {
214
+ //nonce
215
+ wp_nonce_field( plugin_basename( __FILE__ ), 'smartcat_team_member_info_box_content_nonce' );
216
+
217
+ //social
218
+
219
+ echo '<p><em>Fields that are left blank, will simply not display any output</em></p>';
220
+
221
+ echo '<div class="sc_options_table">';
222
+
223
+ echo '<table>';
224
+
225
+ echo '<tr><td><lablel for="team_member_title">Job Title</lablel></td>';
226
+ echo '<td><input type="text" value="' . get_post_meta( $post->ID, 'team_member_title', true ) . '" id="team_member_title" name="team_member_title" placeholder="Enter Job Title"/></td></tr>';
227
+
228
+ echo '<tr><td><lablel for="team_member_email"><img src="' . SC_TEAM_URL . 'inc/img/email.png" width="20px"/></lablel></td>';
229
+ echo '<td><input type="text" value="' . get_post_meta( $post->ID, 'team_member_email', true ) . '" id="team_member_email" name="team_member_email" placeholder="Enter Email Address"/></td></tr>';
230
+
231
+ echo '<tr><td><lablel for="team_member_facebook"><img src="' . SC_TEAM_URL . 'inc/img/fb.png" width="20px"/></lablel></td>';
232
+ echo '<td><input type="text" value="' . get_post_meta( $post->ID, 'team_member_facebook', true ) . '" id="team_member_facebook" name="team_member_facebook" placeholder="Enter Facebook URL"/></td></tr>';
233
+
234
+ echo '<tr><td><label for="team_member_twitter"><img src="' . SC_TEAM_URL . 'inc/img/twitter.png" width="20px"/></lablel></td>';
235
+ echo '<td><input type="text" value="' . get_post_meta( $post->ID, 'team_member_twitter', true ) . '" id="team_member_twitter" name="team_member_twitter" placeholder="Enter Twitter URL"/></td></tr>';
236
+
237
+ echo '<tr><td><lablel for="team_member_linkedin"><img src="' . SC_TEAM_URL . 'inc/img/linkedin.png" width="20px"/></lablel></td>';
238
+ echo '<td><input type="text" value="' . get_post_meta( $post->ID, 'team_member_linkedin', true ) . '" id="team_member_linkedin" name="team_member_linkedin" placeholder="Enter Linkedin URL"/></td></tr>';
239
+
240
+ echo '<tr><td><lablel for="team_member_gplus"><img src="' . SC_TEAM_URL . 'inc/img/google.png" width="20px"/></lablel></td>';
241
+ echo '<td><input type="text" value="' . get_post_meta( $post->ID, 'team_member_gplus', true ) . '" id="team_member_gplus" name="team_member_gplus" placeholder="Enter Google Plus URL"/></td></tr>';
242
+
243
+ echo '</table>';
244
+ echo '</div>';
245
+
246
+
247
+ echo '<div class="sc_options_table">'
248
+ . '<h2>Skills</h2>'
249
+ . '<p><strong><em>Pro Version</em></strong></p>';
250
+
251
+ echo '</div>'
252
+ . '<div class="clear"></div>';
253
+
254
+ }
255
+
256
+ public function team_member_box_save( $post_id ) {
257
+
258
+ $slug = 'team_member';
259
+
260
+ if ( isset( $_POST[ 'post_type' ] ) ) {
261
+ if ( $slug != $_POST[ 'post_type' ] ) {
262
+ return;
263
+ }
264
+ }
265
+
266
+ // get var values
267
+ if ( get_post_meta( $post_id, 'sc_member_order', true ) == '' || get_post_meta( $post_id, 'sc_member_order', true ) === FALSE )
268
+ update_post_meta( $post_id, 'sc_member_order', 0 );
269
+
270
+
271
+ if ( isset( $_REQUEST[ 'team_member_title' ] ) ) {
272
+ $facebook_url = $_POST[ 'team_member_title' ];
273
+ update_post_meta( $post_id, 'team_member_title', $facebook_url );
274
+ }
275
+
276
+ if ( isset( $_REQUEST[ 'team_member_email' ] ) ) {
277
+ $facebook_url = $_POST[ 'team_member_email' ];
278
+ update_post_meta( $post_id, 'team_member_email', $facebook_url );
279
+ }
280
+
281
+
282
+ if ( isset( $_REQUEST[ 'team_member_facebook' ] ) ) {
283
+ $facebook_url = $_POST[ 'team_member_facebook' ];
284
+ update_post_meta( $post_id, 'team_member_facebook', $facebook_url );
285
+ }
286
+
287
+ if ( isset( $_REQUEST[ 'team_member_twitter' ] ) ) {
288
+ $twitter_url = $_POST[ 'team_member_twitter' ];
289
+ update_post_meta( $post_id, 'team_member_twitter', $twitter_url );
290
+ }
291
+
292
+ if ( isset( $_REQUEST[ 'team_member_linkedin' ] ) ) {
293
+ $linkedin_url = $_POST[ 'team_member_linkedin' ];
294
+ update_post_meta( $post_id, 'team_member_linkedin', $linkedin_url );
295
+ }
296
+
297
+ if ( isset( $_REQUEST[ 'team_member_gplus' ] ) ) {
298
+ $gplus_url = $_POST[ 'team_member_gplus' ];
299
+ update_post_meta( $post_id, 'team_member_gplus', $gplus_url );
300
+ }
301
+ }
302
+
303
+ public function sc_team_switch_skill( $value ){
304
+ if( $value < 0 )
305
+ return 0;
306
+ elseif( $value > 10 )
307
+ return 10;
308
+ else
309
+ return $value;
310
+
311
+ }
312
+
313
+ public function wpb_load_widget() {
314
+ register_widget( 'smartcat_team_widget' );
315
+ }
316
+
317
+ public function posts_columns( $defaults ) {
318
+ $defaults[ 'riv_post_thumbs' ] = __( 'Profile Picture' );
319
+ return $defaults;
320
+ }
321
+
322
+ public function posts_custom_columns( $column_name, $id ) {
323
+ if ( $column_name === 'riv_post_thumbs' ) {
324
+ echo the_post_thumbnail( 'thumbnail' );
325
+ }
326
+ }
327
+
328
+ public function smartcat_team_update_order() {
329
+ $post_id = $_POST[ 'id' ];
330
+ $sc_member_order = $_POST[ 'sc_member_order' ];
331
+ update_post_meta( $post_id, 'sc_member_order', $sc_member_order );
332
+ }
333
+
334
+ public function sc_custom_styles() {
335
+ ?>
336
+ <style>
337
+ #sc_our_team a,
338
+ .sc_our_team_lightbox .name{ color: #<?php echo $this->options['text_color']; ?>; }
339
+ .grid#sc_our_team .sc_team_member .sc_team_member_name,
340
+ .grid#sc_our_team .sc_team_member .sc_team_member_jobtitle,
341
+ .grid_circles#sc_our_team .sc_team_member .sc_team_member_jobtitle,
342
+ .grid_circles#sc_our_team .sc_team_member .sc_team_member_name,
343
+ #sc_our_team_lightbox .progress{ background: #<?php echo $this->options[ 'text_color' ]; ?>;}
344
+ .stacked#sc_our_team .smartcat_team_member{ border-color: #<?php echo $this->options[ 'text_color' ]; ?>;}
345
+ .grid#sc_our_team .sc_team_member_inner{ height: <?php echo $this->options[ 'height' ]; ?>px; }
346
+ .grid#sc_our_team .sc_team_member{ padding: <?php echo $this->options['margin']; ?>px;}
347
+
348
+ </style>
349
+ <?php
350
+ }
351
+
352
+ public function smartcat_set_single_content( $content ) {
353
+ global $post;
354
+
355
+ if( is_single() ) :
356
+ if ( $post->post_type == 'team_member' &&
357
+ $this->options['single_template'] == 'standard' &&
358
+ $this->options['single_social'] == 'yes'
359
+ ) :
360
+ $facebook = get_post_meta( get_the_ID(), 'team_member_facebook', true );
361
+ $twitter = get_post_meta( get_the_ID(), 'team_member_twitter', true );
362
+ $linkedin = get_post_meta( get_the_ID(), 'team_member_linkedin', true );
363
+ $gplus = get_post_meta( get_the_ID(), 'team_member_gplus', true );
364
+ $email = get_post_meta( get_the_ID(), 'team_member_email', true );
365
+
366
+ $content .= '<div class="clear"></div>'
367
+ . '<div class="smartcat_team_single_icons">';
368
+ $content .= $this->smartcat_get_social_content( $facebook, $twitter, $linkedin, $gplus, $email );
369
+ $content .= '</div>';
370
+ endif;
371
+ else :
372
+
373
+ endif;
374
+
375
+ return $content;
376
+ }
377
+
378
+ public function get_social( $facebook, $twitter, $linkedin, $gplus, $email ) {
379
+ if ( $facebook != '' )
380
+ echo '<a href="' . $facebook . '"><img src="' . SC_TEAM_URL . 'inc/img/fb.png" class="sc-social"/></a>';
381
+ if ( $twitter != '' )
382
+ echo '<a href="' . $twitter . '"><img src="' . SC_TEAM_URL . 'inc/img/twitter.png" class="sc-social"/></a>';
383
+ if ( $linkedin != '' )
384
+ echo '<a href="' . $linkedin . '"><img src="' . SC_TEAM_URL . 'inc/img/linkedin.png" class="sc-social"/></a>';
385
+ if ( $gplus != '' )
386
+ echo '<a href="' . $gplus . '"><img src="' . SC_TEAM_URL . 'inc/img/google.png" class="sc-social"/></a>';
387
+ if ( $email != '' )
388
+ echo '<a href=mailto:"' . $email . '"><img src="' . SC_TEAM_URL . 'inc/img/email.png" class="sc-social"/></a>';
389
+ }
390
+
391
+ public function smartcat_get_social_content( $facebook, $twitter, $linkedin, $gplus, $email ){
392
+
393
+ $content = null;
394
+
395
+ if ( 'yes' == $this->options[ 'social' ] ) {
396
+ if ( $facebook != '' )
397
+ $content .= '<a href="' . $facebook . '"><img src="' . SC_TEAM_URL . 'inc/img/fb.png" class="sc-social"/></a>';
398
+ if ( $twitter != '' )
399
+ $content .= '<a href="' . $twitter . '"><img src="' . SC_TEAM_URL . 'inc/img/twitter.png" class="sc-social"/></a>';
400
+ if ( $linkedin != '' )
401
+ $content .= '<a href="' . $linkedin . '"><img src="' . SC_TEAM_URL . 'inc/img/linkedin.png" class="sc-social"/></a>';
402
+ if ( $gplus != '' )
403
+ $content .= '<a href="' . $gplus . '"><img src="' . SC_TEAM_URL . 'inc/img/google.png" class="sc-social"/></a>';
404
+ if ( $email != '' )
405
+ $content .= '<a href=mailto:"' . $email . '"><img src="' . SC_TEAM_URL . 'inc/img/email.png" class="sc-social"/></a>';
406
+ }
407
+ return $content;
408
+ }
409
+
410
+ public function get_single_social( $social ) {
411
+ if ( 'yes' == $this->options[ 'social' ] ) :
412
+ if ( $social != '' )
413
+ echo '<li><a href="' . $social . '"><img src="' . SC_TEAM_URL . 'inc/img/fb.png" class="sc-social"/></a></li>';
414
+
415
+ endif;
416
+ }
417
+
418
+ public function sc_get_args( $group ) {
419
+ $args = array(
420
+ 'post_type' => 'team_member',
421
+ 'meta_key' => 'sc_member_order',
422
+ 'orderby' => 'meta_value_num',
423
+ 'order' => 'ASC',
424
+ 'team_member_position' => $group,
425
+ 'posts_per_page' => $this->options[ 'member_count' ],
426
+ );
427
+ return $args;
428
+ }
429
+
430
+ public function smartcat_team_get_single_template( $single_template ) {
431
+
432
+ global $post;
433
+
434
+
435
+ return $single_template;
436
+ }
437
+
438
+ }
439
+
440
+ class smartcat_team_widget extends WP_Widget {
441
+
442
+ function __construct() {
443
+ parent::__construct(
444
+ 'smartcat_team_widget', __( 'Our Team Widget', 'smartcat_team_widget_domain' ), array( 'description' => __( 'Use this widget to display the Our Team anywhere on the site.', 'smartcat_team_widget_domain' ), )
445
+ );
446
+ }
447
+
448
+ // Creating widget front-end
449
+ // This is where the action happens
450
+ public function widget( $args, $instance ) {
451
+ $title = apply_filters( 'widget_title', $instance[ 'title' ] );
452
+
453
+ // before and after widget arguments are defined by themes
454
+ echo $args[ 'before_widget' ];
455
+ if ( !empty( $title ) )
456
+ echo $args[ 'before_title' ] . $title . $args[ 'after_title' ];
457
+
458
+ // This is where you run the code and display the output
459
+ include 'inc/widget.php';
460
+ // echo $args['after_title'];
461
+ }
462
+
463
+ // Widget Backend
464
+ public function form( $instance ) {
465
+ if ( isset( $instance[ 'title' ] ) ) {
466
+ $title = $instance[ 'title' ];
467
+ } else {
468
+ $title = __( 'Meet Our Team', 'smartcat_team_widget_domain' );
469
+ }
470
+ // Widget admin form
471
+ ?>
472
+ <p>
473
+ <label for="////<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:' ); ?></label>
474
+ <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 ); ?>" />
475
+ </p>
476
+ <?php
477
+ }
478
+
479
+ // Updating widget replacing old instances with new
480
+ public function update( $new_instance, $old_instance ) {
481
+ $instance = array();
482
+ $instance[ 'title' ] = (!empty( $new_instance[ 'title' ] ) ) ? strip_tags( $new_instance[ 'title' ] ) : '';
483
+ return $instance;
484
+ }
485
+
486
+ }
inc/grid.php DELETED
@@ -1,62 +0,0 @@
1
- <?php
2
- /*
3
- * Short description
4
- * @author bilal hassan <info@smartcatdesign.net>
5
- *
6
- */
7
- $args = sc_get_args();
8
- $members = new WP_Query($args);
9
- ?>
10
- <div id="sc_our_team" class="<?php echo esc_html( get_option('sc_our_team_template') ); ?>">
11
- <div class="clear"></div>
12
- <?php
13
- if ($members->have_posts()) {
14
- while ($members->have_posts()) {
15
- $members->the_post();
16
- ?>
17
- <div itemscope itemtype="http://schema.org/Person" class="sc_team_member">
18
- <div class="sc_team_member_inner">
19
- <?php
20
-
21
- if (has_post_thumbnail())
22
- echo the_post_thumbnail('medium');
23
- else {
24
- echo '<img src="' . SC_TEAM_PATH . 'img/noprofile.jpg" class="attachment-medium wp-post-image"/>';
25
- }
26
- ?>
27
- <div class="sc_team_member_overlay">
28
- <div itemprop="name" class="sc_team_member_name">
29
- <a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title_attribute(); ?>">
30
- <?php the_title() ?>
31
- </a>
32
- </div>
33
- <div itemprop="jobtitle" class="sc_team_member_jobtitle">
34
- <?php echo get_post_meta(get_the_ID(), 'team_member_title', true); ?>
35
- </div>
36
- <div class='icons'>
37
-
38
- <?php // the_content(); ?>
39
- <?php
40
- $facebook = get_post_meta(get_the_ID(), 'team_member_facebook', true);
41
- $twitter = get_post_meta(get_the_ID(), 'team_member_twitter', true);
42
- $linkedin = get_post_meta(get_the_ID(), 'team_member_linkedin', true);
43
- $gplus = get_post_meta(get_the_ID(), 'team_member_gplus', true);
44
- $email = get_post_meta(get_the_ID(), 'team_member_email', true);
45
-
46
- get_social($facebook, $twitter, $linkedin, $gplus, $email);
47
- ?>
48
-
49
- </div>
50
- </div>
51
-
52
- </div>
53
-
54
- </div>
55
- <?php
56
- }
57
- } else {
58
- echo 'There are no team members to display';
59
- }
60
- ?>
61
- <div class="clear"></div>
62
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/grid_circles.php DELETED
@@ -1,56 +0,0 @@
1
- <?php
2
- /**
3
- * Created by Bilal Hassan.
4
- * Date: 2014-06-26
5
- * Time: 11:04 AM
6
- */
7
- $args = sc_get_args();
8
- $members = new WP_Query($args);
9
- ?>
10
- <div id="sc_our_team" class="<?php echo esc_html( get_option('sc_our_team_template') ); ?>">
11
- <div class="clear"></div>
12
- <?php
13
- if ($members->have_posts()) {
14
- while ($members->have_posts()) {
15
- $members->the_post();
16
- // echo wp_get_attachment_url( get_post_thumbnail_id(get_the_ID() ));
17
- ?>
18
- <div itemscope itemtype="http://schema.org/Person" class="sc_team_member">
19
- <?php
20
- if (has_post_thumbnail())
21
- echo the_post_thumbnail('medium');
22
- else
23
- echo '<img src="' . SC_TEAM_PATH . 'img/noprofile.jpg" class="attachment-medium wp-post-image"/>';
24
- ?>
25
- <div class="sc_team_member_overlay">
26
- <div itemprop="name" class="sc_team_member_name">
27
- <a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title_attribute(); ?>">
28
- <?php the_title() ?>
29
- </a>
30
- </div>
31
- <div itemprop="jobtitle" class="sc_team_member_jobtitle">
32
- <?php echo get_post_meta(get_the_ID(), 'team_member_title', true); ?>
33
- </div>
34
- <div class='icons'>
35
-
36
- <?php // the_content(); ?>
37
- <?php
38
- $facebook = get_post_meta(get_the_ID(), 'team_member_facebook', true);
39
- $twitter = get_post_meta(get_the_ID(), 'team_member_twitter', true);
40
- $linkedin = get_post_meta(get_the_ID(), 'team_member_linkedin', true);
41
- $gplus = get_post_meta(get_the_ID(), 'team_member_gplus', true);
42
- $email = get_post_meta(get_the_ID(), 'team_member_email', true);
43
-
44
- get_social($facebook, $twitter, $linkedin, $gplus, $email);
45
- ?>
46
- </div>
47
- </div>
48
- </div>
49
- <?php
50
- }
51
- } else {
52
- echo 'There are no team members to display';
53
- }
54
- ?>
55
- <div class="clear"></div>
56
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/img/check.png ADDED
Binary file
inc/img/email.png ADDED
Binary file
inc/img/fb.png ADDED
Binary file
inc/img/google.png ADDED
Binary file
inc/img/icon.png ADDED
Binary file
inc/img/linkedin.png ADDED
Binary file
inc/img/more.png ADDED
Binary file
inc/img/noprofile.jpg ADDED
Binary file
inc/img/spinner.gif ADDED
Binary file
inc/img/twitter.png ADDED
Binary file
inc/list.php DELETED
@@ -1,8 +0,0 @@
1
- <?php
2
-
3
- /*
4
- * Short description
5
- * @author bilal hassan <info@smartcatdesign.net>
6
- *
7
- */
8
- ?>
 
 
 
 
 
 
 
 
inc/options.php DELETED
@@ -1,112 +0,0 @@
1
- <?php include_once 'setting.php'; ?>
2
- <div class="width70 left">
3
- <p>To display the Team, copy and paste this shortcode into the page or widget where you want it to show <b class="larger bold editcursor">[our-team]</b></p>
4
- <p><iframe src="//www.facebook.com/plugins/like.php?href=https%3A%2F%2Fwww.facebook.com%2FSmartcatDesign&amp;width&amp;layout=standard&amp;action=like&amp;show_faces=false&amp;share=false&amp;height=35&amp;appId=233286813420319" scrolling="no" frameborder="0" style="border:none; overflow:hidden; height:35px;" allowTransparency="true"></iframe></p>
5
- <form name="sc_our_team_post_form" method="post" action="" enctype="multipart/form-data">
6
- <table class="widefat">
7
- <thead>
8
- <tr>
9
- <th colspan="2"><b>General Settings</b></th>
10
- </tr>
11
- </thead>
12
- <tbody>
13
- <tr>
14
- <td>Template</td>
15
- <td>
16
- <select name="sc_our_team_template">
17
- <option value="grid" <?php echo 'grid' == get_option('sc_our_team_template') ? 'selected=selected' : ''; ?>>Grid - Boxes</option>
18
- <option value="grid_circles" <?php echo 'grid_circles' == get_option('sc_our_team_template') ? 'selected=selected' : ''; ?>>Grid - Circles</option>
19
- <option disabled="disabled">List - Stacked (pro version)</option>
20
- <option disabled="disabled">Honey Comb (pro version)</option>
21
- </select>
22
- </td>
23
- </tr>
24
- <tr>
25
- <td>Display Social Icons</td>
26
- <td>
27
- <select name="sc_our_team_social">
28
- <option value="yes" <?php echo 'yes' == get_option('sc_our_team_social') ? 'selected=selected' : ''; ?>>Yes</option>
29
- <option value="no" <?php echo 'no' == get_option('sc_our_team_social') ? 'selected=selected' : ''; ?>>No</option>
30
- </select>
31
- </td>
32
- </tr>
33
- <tr>
34
- <td>Max Number of members to display</td>
35
- <td>
36
- <input type="text" value="<?php echo esc_html( get_option('sc_our_team_member_count') ); ?>" name="sc_our_team_member_count" placeholder="number of members to show"/><br>
37
- <em>Set to -1 to display all members</em>
38
- </td>
39
- </tr>
40
- <tr>
41
- <td>Text Color</td>
42
- <td>
43
- <em class="red">Pro version</em>
44
- </td>
45
- </tr>
46
- <tr>
47
- <td>Honeycomb Color</td>
48
- <td>
49
- <em class="red">Pro version</em>
50
- </td>
51
- </tr>
52
- <tr>
53
- <td>Member Groups</td>
54
- <td>
55
- <em class="red">Pro version</em>
56
- </td>
57
- </tr>
58
- <tr>
59
- <!-- <td>Link to Bio page</td>
60
- <td>
61
- <select name="sc_our_team_social">
62
- <option value="yes" <?php echo 'yes' == get_option('sc_our_team_profile_link') ? 'selected=selected' : ''; ?>>Yes</option>
63
- <option value="no" <?php echo 'no' == get_option('sc_our_team_profile_link') ? 'selected=selected' : ''; ?>>No</option>
64
- </select>
65
- </td> -->
66
- </tr>
67
- </tbody>
68
- </table>
69
- <table class="widefat">
70
- <thead>
71
- <tr>
72
- <th colspan="4">Demo</th>
73
- </tr>
74
- <tr>
75
- <td>
76
- Grid Boxes & Grid Circles Demo<br>
77
- <img src="<?php echo SC_TEAM_PATH; ?>/screenshot-1.png" width="100%"/>
78
- </td>
79
- <td>
80
- Honeycomb Demo<br>
81
- <img src="<?php echo SC_TEAM_PATH; ?>/screenshot-4.jpg" width="100%"/>
82
- </td>
83
- <td>
84
- Stacked List Demo<br>
85
- <img src="<?php echo SC_TEAM_PATH; ?>/screenshot-5.jpg" width="100%"/>
86
- </td>
87
- <td></td>
88
- </tr>
89
- </thead>
90
- </table>
91
- <input type="submit" name="sc_our_team_save" value="Update" class="button button-primary" />
92
- </form>
93
- </div>
94
- </div>
95
- <script>
96
- function confirm_reset() {
97
- if (confirm("Are you sure you want to reset to defaults ?")) {
98
- return true;
99
- } else {
100
- return false;
101
- }
102
- }
103
- jQuery(document).ready(function($) {
104
- $("#sc_popup_shortcode").focusout(function() {
105
- var shortcode = jQuery(this).val();
106
- shortcode = shortcode.replace(/"/g, "").replace(/'/g, "");
107
- jQuery(this).val(shortcode);
108
- });
109
-
110
- });
111
-
112
- </script>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/sc_team_update_order.php DELETED
@@ -1,21 +0,0 @@
1
- <?php
2
-
3
- /*
4
- * Short description
5
- * @author bilal hassan <info@smartcatdesign.net>
6
- *
7
- */
8
- //global $post;
9
- //
10
- //$post_id = $_GET['post_id'];
11
- //$sc_member_order = $_GET['sc_member_order'];
12
- //
13
- ////update_post_meta($post_id, $meta_key, $sc_member_order)
14
- //
15
- //update_post_meta($post_id, 'sc_member_order', $sc_member_order);
16
- //
17
- //echo 'test';
18
-
19
-
20
-
21
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/script/jscolor/arrow.gif ADDED
Binary file
inc/script/jscolor/cross.gif ADDED
Binary file
inc/script/jscolor/hs.png ADDED
Binary file
inc/script/jscolor/hv.png ADDED
Binary file
inc/script/jscolor/jscolor.js ADDED
@@ -0,0 +1,996 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * jscolor, JavaScript Color Picker
3
+ *
4
+ * @version 1.4.2
5
+ * @license GNU Lesser General Public License, http://www.gnu.org/copyleft/lesser.html
6
+ * @author Jan Odvarko, http://odvarko.cz
7
+ * @created 2008-06-15
8
+ * @updated 2013-11-25
9
+ * @link http://jscolor.com
10
+ */
11
+
12
+
13
+ var jscolor = {
14
+
15
+ dir : '', // location of jscolor directory (leave empty to autodetect)
16
+ bindClass : 'wp_popup_color', // class name
17
+ binding : true, // automatic binding via <input class="...">
18
+ preloading : true, // use image preloading?
19
+
20
+
21
+ install : function() {
22
+ jscolor.addEvent(window, 'load', jscolor.init);
23
+ },
24
+
25
+
26
+ init : function() {
27
+ if(jscolor.binding) {
28
+ jscolor.bind();
29
+ }
30
+ if(jscolor.preloading) {
31
+ jscolor.preload();
32
+ }
33
+ },
34
+
35
+
36
+ getDir : function() {
37
+ if(!jscolor.dir) {
38
+ var detected = jscolor.detectDir();
39
+ jscolor.dir = detected!==false ? detected : 'jscolor/';
40
+ }
41
+ return jscolor.dir;
42
+ },
43
+
44
+
45
+ detectDir : function() {
46
+ var base = location.href;
47
+
48
+ var e = document.getElementsByTagName('base');
49
+ for(var i=0; i<e.length; i+=1) {
50
+ if(e[i].href) { base = e[i].href; }
51
+ }
52
+
53
+ var e = document.getElementsByTagName('script');
54
+ for(var i=0; i<e.length; i+=1) {
55
+ if(e[i].src && /(^|\/)jscolor\.js([?#].*)?$/i.test(e[i].src)) {
56
+ var src = new jscolor.URI(e[i].src);
57
+ var srcAbs = src.toAbsolute(base);
58
+ srcAbs.path = srcAbs.path.replace(/[^\/]+$/, ''); // remove filename
59
+ srcAbs.query = null;
60
+ srcAbs.fragment = null;
61
+ return srcAbs.toString();
62
+ }
63
+ }
64
+ return false;
65
+ },
66
+
67
+
68
+ bind : function() {
69
+ var matchClass = new RegExp('(^|\\s)('+jscolor.bindClass+')\\s*(\\{[^}]*\\})?', 'i');
70
+ var e = document.getElementsByTagName('input');
71
+ for(var i=0; i<e.length; i+=1) {
72
+ var m;
73
+ if(!e[i].color && e[i].className && (m = e[i].className.match(matchClass))) {
74
+ var prop = {};
75
+ if(m[3]) {
76
+ try {
77
+ prop = (new Function ('return (' + m[3] + ')'))();
78
+ } catch(eInvalidProp) {}
79
+ }
80
+ e[i].color = new jscolor.color(e[i], prop);
81
+ }
82
+ }
83
+ },
84
+
85
+
86
+ preload : function() {
87
+ for(var fn in jscolor.imgRequire) {
88
+ if(jscolor.imgRequire.hasOwnProperty(fn)) {
89
+ jscolor.loadImage(fn);
90
+ }
91
+ }
92
+ },
93
+
94
+
95
+ images : {
96
+ pad : [ 181, 101 ],
97
+ sld : [ 16, 101 ],
98
+ cross : [ 15, 15 ],
99
+ arrow : [ 7, 11 ]
100
+ },
101
+
102
+
103
+ imgRequire : {},
104
+ imgLoaded : {},
105
+
106
+
107
+ requireImage : function(filename) {
108
+ jscolor.imgRequire[filename] = true;
109
+ },
110
+
111
+
112
+ loadImage : function(filename) {
113
+ if(!jscolor.imgLoaded[filename]) {
114
+ jscolor.imgLoaded[filename] = new Image();
115
+ jscolor.imgLoaded[filename].src = jscolor.getDir()+filename;
116
+ }
117
+ },
118
+
119
+
120
+ fetchElement : function(mixed) {
121
+ return typeof mixed === 'string' ? document.getElementById(mixed) : mixed;
122
+ },
123
+
124
+
125
+ addEvent : function(el, evnt, func) {
126
+ if(el.addEventListener) {
127
+ el.addEventListener(evnt, func, false);
128
+ } else if(el.attachEvent) {
129
+ el.attachEvent('on'+evnt, func);
130
+ }
131
+ },
132
+
133
+
134
+ fireEvent : function(el, evnt) {
135
+ if(!el) {
136
+ return;
137
+ }
138
+ if(document.createEvent) {
139
+ var ev = document.createEvent('HTMLEvents');
140
+ ev.initEvent(evnt, true, true);
141
+ el.dispatchEvent(ev);
142
+ } else if(document.createEventObject) {
143
+ var ev = document.createEventObject();
144
+ el.fireEvent('on'+evnt, ev);
145
+ } else if(el['on'+evnt]) { // alternatively use the traditional event model (IE5)
146
+ el['on'+evnt]();
147
+ }
148
+ },
149
+
150
+
151
+ getElementPos : function(e) {
152
+ var e1=e, e2=e;
153
+ var x=0, y=0;
154
+ if(e1.offsetParent) {
155
+ do {
156
+ x += e1.offsetLeft;
157
+ y += e1.offsetTop;
158
+ } while(e1 = e1.offsetParent);
159
+ }
160
+ while((e2 = e2.parentNode) && e2.nodeName.toUpperCase() !== 'BODY') {
161
+ x -= e2.scrollLeft;
162
+ y -= e2.scrollTop;
163
+ }
164
+ return [x, y];
165
+ },
166
+
167
+
168
+ getElementSize : function(e) {
169
+ return [e.offsetWidth, e.offsetHeight];
170
+ },
171
+
172
+
173
+ getRelMousePos : function(e) {
174
+ var x = 0, y = 0;
175
+ if (!e) { e = window.event; }
176
+ if (typeof e.offsetX === 'number') {
177
+ x = e.offsetX;
178
+ y = e.offsetY;
179
+ } else if (typeof e.layerX === 'number') {
180
+ x = e.layerX;
181
+ y = e.layerY;
182
+ }
183
+ return { x: x, y: y };
184
+ },
185
+
186
+
187
+ getViewPos : function() {
188
+ if(typeof window.pageYOffset === 'number') {
189
+ return [window.pageXOffset, window.pageYOffset];
190
+ } else if(document.body && (document.body.scrollLeft || document.body.scrollTop)) {
191
+ return [document.body.scrollLeft, document.body.scrollTop];
192
+ } else if(document.documentElement && (document.documentElement.scrollLeft || document.documentElement.scrollTop)) {
193
+ return [document.documentElement.scrollLeft, document.documentElement.scrollTop];
194
+ } else {
195
+ return [0, 0];
196
+ }
197
+ },
198
+
199
+
200
+ getViewSize : function() {
201
+ if(typeof window.innerWidth === 'number') {
202
+ return [window.innerWidth, window.innerHeight];
203
+ } else if(document.body && (document.body.clientWidth || document.body.clientHeight)) {
204
+ return [document.body.clientWidth, document.body.clientHeight];
205
+ } else if(document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight)) {
206
+ return [document.documentElement.clientWidth, document.documentElement.clientHeight];
207
+ } else {
208
+ return [0, 0];
209
+ }
210
+ },
211
+
212
+
213
+ URI : function(uri) { // See RFC3986
214
+
215
+ this.scheme = null;
216
+ this.authority = null;
217
+ this.path = '';
218
+ this.query = null;
219
+ this.fragment = null;
220
+
221
+ this.parse = function(uri) {
222
+ var m = uri.match(/^(([A-Za-z][0-9A-Za-z+.-]*)(:))?((\/\/)([^\/?#]*))?([^?#]*)((\?)([^#]*))?((#)(.*))?/);
223
+ this.scheme = m[3] ? m[2] : null;
224
+ this.authority = m[5] ? m[6] : null;
225
+ this.path = m[7];
226
+ this.query = m[9] ? m[10] : null;
227
+ this.fragment = m[12] ? m[13] : null;
228
+ return this;
229
+ };
230
+
231
+ this.toString = function() {
232
+ var result = '';
233
+ if(this.scheme !== null) { result = result + this.scheme + ':'; }
234
+ if(this.authority !== null) { result = result + '//' + this.authority; }
235
+ if(this.path !== null) { result = result + this.path; }
236
+ if(this.query !== null) { result = result + '?' + this.query; }
237
+ if(this.fragment !== null) { result = result + '#' + this.fragment; }
238
+ return result;
239
+ };
240
+
241
+ this.toAbsolute = function(base) {
242
+ var base = new jscolor.URI(base);
243
+ var r = this;
244
+ var t = new jscolor.URI;
245
+
246
+ if(base.scheme === null) { return false; }
247
+
248
+ if(r.scheme !== null && r.scheme.toLowerCase() === base.scheme.toLowerCase()) {
249
+ r.scheme = null;
250
+ }
251
+
252
+ if(r.scheme !== null) {
253
+ t.scheme = r.scheme;
254
+ t.authority = r.authority;
255
+ t.path = removeDotSegments(r.path);
256
+ t.query = r.query;
257
+ } else {
258
+ if(r.authority !== null) {
259
+ t.authority = r.authority;
260
+ t.path = removeDotSegments(r.path);
261
+ t.query = r.query;
262
+ } else {
263
+ if(r.path === '') {
264
+ t.path = base.path;
265
+ if(r.query !== null) {
266
+ t.query = r.query;
267
+ } else {
268
+ t.query = base.query;
269
+ }
270
+ } else {
271
+ if(r.path.substr(0,1) === '/') {
272
+ t.path = removeDotSegments(r.path);
273
+ } else {
274
+ if(base.authority !== null && base.path === '') {
275
+ t.path = '/'+r.path;
276
+ } else {
277
+ t.path = base.path.replace(/[^\/]+$/,'')+r.path;
278
+ }
279
+ t.path = removeDotSegments(t.path);
280
+ }
281
+ t.query = r.query;
282
+ }
283
+ t.authority = base.authority;
284
+ }
285
+ t.scheme = base.scheme;
286
+ }
287
+ t.fragment = r.fragment;
288
+
289
+ return t;
290
+ };
291
+
292
+ function removeDotSegments(path) {
293
+ var out = '';
294
+ while(path) {
295
+ if(path.substr(0,3)==='../' || path.substr(0,2)==='./') {
296
+ path = path.replace(/^\.+/,'').substr(1);
297
+ } else if(path.substr(0,3)==='/./' || path==='/.') {
298
+ path = '/'+path.substr(3);
299
+ } else if(path.substr(0,4)==='/../' || path==='/..') {
300
+ path = '/'+path.substr(4);
301
+ out = out.replace(/\/?[^\/]*$/, '');
302
+ } else if(path==='.' || path==='..') {
303
+ path = '';
304
+ } else {
305
+ var rm = path.match(/^\/?[^\/]*/)[0];
306
+ path = path.substr(rm.length);
307
+ out = out + rm;
308
+ }
309
+ }
310
+ return out;
311
+ }
312
+
313
+ if(uri) {
314
+ this.parse(uri);
315
+ }
316
+
317
+ },
318
+
319
+
320
+ //
321
+ // Usage example:
322
+ // var myColor = new jscolor.color(myInputElement)
323
+ //
324
+
325
+ color : function(target, prop) {
326
+
327
+
328
+ this.required = true; // refuse empty values?
329
+ this.adjust = true; // adjust value to uniform notation?
330
+ this.hash = false; // prefix color with # symbol?
331
+ this.caps = true; // uppercase?
332
+ this.slider = true; // show the value/saturation slider?
333
+ this.valueElement = target; // value holder
334
+ this.styleElement = target; // where to reflect current color
335
+ this.onImmediateChange = null; // onchange callback (can be either string or function)
336
+ this.hsv = [0, 0, 1]; // read-only 0-6, 0-1, 0-1
337
+ this.rgb = [1, 1, 1]; // read-only 0-1, 0-1, 0-1
338
+ this.minH = 0; // read-only 0-6
339
+ this.maxH = 6; // read-only 0-6
340
+ this.minS = 0; // read-only 0-1
341
+ this.maxS = 1; // read-only 0-1
342
+ this.minV = 0; // read-only 0-1
343
+ this.maxV = 1; // read-only 0-1
344
+
345
+ this.pickerOnfocus = true; // display picker on focus?
346
+ this.pickerMode = 'HSV'; // HSV | HVS
347
+ this.pickerPosition = 'bottom'; // left | right | top | bottom
348
+ this.pickerSmartPosition = true; // automatically adjust picker position when necessary
349
+ this.pickerButtonHeight = 20; // px
350
+ this.pickerClosable = false;
351
+ this.pickerCloseText = 'Close';
352
+ this.pickerButtonColor = 'ButtonText'; // px
353
+ this.pickerFace = 10; // px
354
+ this.pickerFaceColor = 'ThreeDFace'; // CSS color
355
+ this.pickerBorder = 1; // px
356
+ this.pickerBorderColor = 'ThreeDHighlight ThreeDShadow ThreeDShadow ThreeDHighlight'; // CSS color
357
+ this.pickerInset = 1; // px
358
+ this.pickerInsetColor = 'ThreeDShadow ThreeDHighlight ThreeDHighlight ThreeDShadow'; // CSS color
359
+ this.pickerZIndex = 10000;
360
+
361
+
362
+ for(var p in prop) {
363
+ if(prop.hasOwnProperty(p)) {
364
+ this[p] = prop[p];
365
+ }
366
+ }
367
+
368
+
369
+ this.hidePicker = function() {
370
+ if(isPickerOwner()) {
371
+ removePicker();
372
+ }
373
+ };
374
+
375
+
376
+ this.showPicker = function() {
377
+ if(!isPickerOwner()) {
378
+ var tp = jscolor.getElementPos(target); // target pos
379
+ var ts = jscolor.getElementSize(target); // target size
380
+ var vp = jscolor.getViewPos(); // view pos
381
+ var vs = jscolor.getViewSize(); // view size
382
+ var ps = getPickerDims(this); // picker size
383
+ var a, b, c;
384
+ switch(this.pickerPosition.toLowerCase()) {
385
+ case 'left': a=1; b=0; c=-1; break;
386
+ case 'right':a=1; b=0; c=1; break;
387
+ case 'top': a=0; b=1; c=-1; break;
388
+ default: a=0; b=1; c=1; break;
389
+ }
390
+ var l = (ts[b]+ps[b])/2;
391
+
392
+ // picker pos
393
+ if (!this.pickerSmartPosition) {
394
+ var pp = [
395
+ tp[a],
396
+ tp[b]+ts[b]-l+l*c
397
+ ];
398
+ } else {
399
+ var pp = [
400
+ -vp[a]+tp[a]+ps[a] > vs[a] ?
401
+ (-vp[a]+tp[a]+ts[a]/2 > vs[a]/2 && tp[a]+ts[a]-ps[a] >= 0 ? tp[a]+ts[a]-ps[a] : tp[a]) :
402
+ tp[a],
403
+ -vp[b]+tp[b]+ts[b]+ps[b]-l+l*c > vs[b] ?
404
+ (-vp[b]+tp[b]+ts[b]/2 > vs[b]/2 && tp[b]+ts[b]-l-l*c >= 0 ? tp[b]+ts[b]-l-l*c : tp[b]+ts[b]-l+l*c) :
405
+ (tp[b]+ts[b]-l+l*c >= 0 ? tp[b]+ts[b]-l+l*c : tp[b]+ts[b]-l-l*c)
406
+ ];
407
+ }
408
+ drawPicker(pp[a], pp[b]);
409
+ }
410
+ };
411
+
412
+
413
+ this.importColor = function() {
414
+ if(!valueElement) {
415
+ this.exportColor();
416
+ } else {
417
+ if(!this.adjust) {
418
+ if(!this.fromString(valueElement.value, leaveValue)) {
419
+ styleElement.style.backgroundImage = styleElement.jscStyle.backgroundImage;
420
+ styleElement.style.backgroundColor = styleElement.jscStyle.backgroundColor;
421
+ styleElement.style.color = styleElement.jscStyle.color;
422
+ this.exportColor(leaveValue | leaveStyle);
423
+ }
424
+ } else if(!this.required && /^\s*$/.test(valueElement.value)) {
425
+ valueElement.value = '';
426
+ styleElement.style.backgroundImage = styleElement.jscStyle.backgroundImage;
427
+ styleElement.style.backgroundColor = styleElement.jscStyle.backgroundColor;
428
+ styleElement.style.color = styleElement.jscStyle.color;
429
+ this.exportColor(leaveValue | leaveStyle);
430
+
431
+ } else if(this.fromString(valueElement.value)) {
432
+ // OK
433
+ } else {
434
+ this.exportColor();
435
+ }
436
+ }
437
+ };
438
+
439
+
440
+ this.exportColor = function(flags) {
441
+ if(!(flags & leaveValue) && valueElement) {
442
+ var value = this.toString();
443
+ if(this.caps) { value = value.toUpperCase(); }
444
+ if(this.hash) { value = '#'+value; }
445
+ valueElement.value = value;
446
+ }
447
+ if(!(flags & leaveStyle) && styleElement) {
448
+ styleElement.style.backgroundImage = "none";
449
+ styleElement.style.backgroundColor =
450
+ '#'+this.toString();
451
+ styleElement.style.color =
452
+ 0.213 * this.rgb[0] +
453
+ 0.715 * this.rgb[1] +
454
+ 0.072 * this.rgb[2]
455
+ < 0.5 ? '#FFF' : '#000';
456
+ }
457
+ if(!(flags & leavePad) && isPickerOwner()) {
458
+ redrawPad();
459
+ }
460
+ if(!(flags & leaveSld) && isPickerOwner()) {
461
+ redrawSld();
462
+ }
463
+ };
464
+
465
+
466
+ this.fromHSV = function(h, s, v, flags) { // null = don't change
467
+ if(h !== null) { h = Math.max(0.0, this.minH, Math.min(6.0, this.maxH, h)); }
468
+ if(s !== null) { s = Math.max(0.0, this.minS, Math.min(1.0, this.maxS, s)); }
469
+ if(v !== null) { v = Math.max(0.0, this.minV, Math.min(1.0, this.maxV, v)); }
470
+
471
+ this.rgb = HSV_RGB(
472
+ h===null ? this.hsv[0] : (this.hsv[0]=h),
473
+ s===null ? this.hsv[1] : (this.hsv[1]=s),
474
+ v===null ? this.hsv[2] : (this.hsv[2]=v)
475
+ );
476
+
477
+ this.exportColor(flags);
478
+ };
479
+
480
+
481
+ this.fromRGB = function(r, g, b, flags) { // null = don't change
482
+ if(r !== null) { r = Math.max(0.0, Math.min(1.0, r)); }
483
+ if(g !== null) { g = Math.max(0.0, Math.min(1.0, g)); }
484
+ if(b !== null) { b = Math.max(0.0, Math.min(1.0, b)); }
485
+
486
+ var hsv = RGB_HSV(
487
+ r===null ? this.rgb[0] : r,
488
+ g===null ? this.rgb[1] : g,
489
+ b===null ? this.rgb[2] : b
490
+ );
491
+ if(hsv[0] !== null) {
492
+ this.hsv[0] = Math.max(0.0, this.minH, Math.min(6.0, this.maxH, hsv[0]));
493
+ }
494
+ if(hsv[2] !== 0) {
495
+ this.hsv[1] = hsv[1]===null ? null : Math.max(0.0, this.minS, Math.min(1.0, this.maxS, hsv[1]));
496
+ }
497
+ this.hsv[2] = hsv[2]===null ? null : Math.max(0.0, this.minV, Math.min(1.0, this.maxV, hsv[2]));
498
+
499
+ // update RGB according to final HSV, as some values might be trimmed
500
+ var rgb = HSV_RGB(this.hsv[0], this.hsv[1], this.hsv[2]);
501
+ this.rgb[0] = rgb[0];
502
+ this.rgb[1] = rgb[1];
503
+ this.rgb[2] = rgb[2];
504
+
505
+ this.exportColor(flags);
506
+ };
507
+
508
+
509
+ this.fromString = function(hex, flags) {
510
+ var m = hex.match(/^\W*([0-9A-F]{3}([0-9A-F]{3})?)\W*$/i);
511
+ if(!m) {
512
+ return false;
513
+ } else {
514
+ if(m[1].length === 6) { // 6-char notation
515
+ this.fromRGB(
516
+ parseInt(m[1].substr(0,2),16) / 255,
517
+ parseInt(m[1].substr(2,2),16) / 255,
518
+ parseInt(m[1].substr(4,2),16) / 255,
519
+ flags
520
+ );
521
+ } else { // 3-char notation
522
+ this.fromRGB(
523
+ parseInt(m[1].charAt(0)+m[1].charAt(0),16) / 255,
524
+ parseInt(m[1].charAt(1)+m[1].charAt(1),16) / 255,
525
+ parseInt(m[1].charAt(2)+m[1].charAt(2),16) / 255,
526
+ flags
527
+ );
528
+ }
529
+ return true;
530
+ }
531
+ };
532
+
533
+
534
+ this.toString = function() {
535
+ return (
536
+ (0x100 | Math.round(255*this.rgb[0])).toString(16).substr(1) +
537
+ (0x100 | Math.round(255*this.rgb[1])).toString(16).substr(1) +
538
+ (0x100 | Math.round(255*this.rgb[2])).toString(16).substr(1)
539
+ );
540
+ };
541
+
542
+
543
+ function RGB_HSV(r, g, b) {
544
+ var n = Math.min(Math.min(r,g),b);
545
+ var v = Math.max(Math.max(r,g),b);
546
+ var m = v - n;
547
+ if(m === 0) { return [ null, 0, v ]; }
548
+ var h = r===n ? 3+(b-g)/m : (g===n ? 5+(r-b)/m : 1+(g-r)/m);
549
+ return [ h===6?0:h, m/v, v ];
550
+ }
551
+
552
+
553
+ function HSV_RGB(h, s, v) {
554
+ if(h === null) { return [ v, v, v ]; }
555
+ var i = Math.floor(h);
556
+ var f = i%2 ? h-i : 1-(h-i);
557
+ var m = v * (1 - s);
558
+ var n = v * (1 - s*f);
559
+ switch(i) {
560
+ case 6:
561
+ case 0: return [v,n,m];
562
+ case 1: return [n,v,m];
563
+ case 2: return [m,v,n];
564
+ case 3: return [m,n,v];
565
+ case 4: return [n,m,v];
566
+ case 5: return [v,m,n];
567
+ }
568
+ }
569
+
570
+
571
+ function removePicker() {
572
+ delete jscolor.picker.owner;
573
+ document.getElementsByTagName('body')[0].removeChild(jscolor.picker.boxB);
574
+ }
575
+
576
+
577
+ function drawPicker(x, y) {
578
+ if(!jscolor.picker) {
579
+ jscolor.picker = {
580
+ box : document.createElement('div'),
581
+ boxB : document.createElement('div'),
582
+ pad : document.createElement('div'),
583
+ padB : document.createElement('div'),
584
+ padM : document.createElement('div'),
585
+ sld : document.createElement('div'),
586
+ sldB : document.createElement('div'),
587
+ sldM : document.createElement('div'),
588
+ btn : document.createElement('div'),
589
+ btnS : document.createElement('span'),
590
+ btnT : document.createTextNode(THIS.pickerCloseText)
591
+ };
592
+ for(var i=0,segSize=4; i<jscolor.images.sld[1]; i+=segSize) {
593
+ var seg = document.createElement('div');
594
+ seg.style.height = segSize+'px';
595
+ seg.style.fontSize = '1px';
596
+ seg.style.lineHeight = '0';
597
+ jscolor.picker.sld.appendChild(seg);
598
+ }
599
+ jscolor.picker.sldB.appendChild(jscolor.picker.sld);
600
+ jscolor.picker.box.appendChild(jscolor.picker.sldB);
601
+ jscolor.picker.box.appendChild(jscolor.picker.sldM);
602
+ jscolor.picker.padB.appendChild(jscolor.picker.pad);
603
+ jscolor.picker.box.appendChild(jscolor.picker.padB);
604
+ jscolor.picker.box.appendChild(jscolor.picker.padM);
605
+ jscolor.picker.btnS.appendChild(jscolor.picker.btnT);
606
+ jscolor.picker.btn.appendChild(jscolor.picker.btnS);
607
+ jscolor.picker.box.appendChild(jscolor.picker.btn);
608
+ jscolor.picker.boxB.appendChild(jscolor.picker.box);
609
+ }
610
+
611
+ var p = jscolor.picker;
612
+
613
+ // controls interaction
614
+ p.box.onmouseup =
615
+ p.box.onmouseout = function() { target.focus(); };
616
+ p.box.onmousedown = function() { abortBlur=true; };
617
+ p.box.onmousemove = function(e) {
618
+ if (holdPad || holdSld) {
619
+ holdPad && setPad(e);
620
+ holdSld && setSld(e);
621
+ if (document.selection) {
622
+ document.selection.empty();
623
+ } else if (window.getSelection) {
624
+ window.getSelection().removeAllRanges();
625
+ }
626
+ dispatchImmediateChange();
627
+ }
628
+ };
629
+ if('ontouchstart' in window) { // if touch device
630
+ var handle_touchmove = function(e) {
631
+ var event={
632
+ 'offsetX': e.touches[0].pageX-touchOffset.X,
633
+ 'offsetY': e.touches[0].pageY-touchOffset.Y
634
+ };
635
+ if (holdPad || holdSld) {
636
+ holdPad && setPad(event);
637
+ holdSld && setSld(event);
638
+ dispatchImmediateChange();
639
+ }
640
+ e.stopPropagation(); // prevent move "view" on broswer
641
+ e.preventDefault(); // prevent Default - Android Fix (else android generated only 1-2 touchmove events)
642
+ };
643
+ p.box.removeEventListener('touchmove', handle_touchmove, false)
644
+ p.box.addEventListener('touchmove', handle_touchmove, false)
645
+ }
646
+ p.padM.onmouseup =
647
+ p.padM.onmouseout = function() { if(holdPad) { holdPad=false; jscolor.fireEvent(valueElement,'change'); } };
648
+ p.padM.onmousedown = function(e) {
649
+ // if the slider is at the bottom, move it up
650
+ switch(modeID) {
651
+ case 0: if (THIS.hsv[2] === 0) { THIS.fromHSV(null, null, 1.0); }; break;
652
+ case 1: if (THIS.hsv[1] === 0) { THIS.fromHSV(null, 1.0, null); }; break;
653
+ }
654
+ holdSld=false;
655
+ holdPad=true;
656
+ setPad(e);
657
+ dispatchImmediateChange();
658
+ };
659
+ if('ontouchstart' in window) {
660
+ p.padM.addEventListener('touchstart', function(e) {
661
+ touchOffset={
662
+ 'X': e.target.offsetParent.offsetLeft,
663
+ 'Y': e.target.offsetParent.offsetTop
664
+ };
665
+ this.onmousedown({
666
+ 'offsetX':e.touches[0].pageX-touchOffset.X,
667
+ 'offsetY':e.touches[0].pageY-touchOffset.Y
668
+ });
669
+ });
670
+ }
671
+ p.sldM.onmouseup =
672
+ p.sldM.onmouseout = function() { if(holdSld) { holdSld=false; jscolor.fireEvent(valueElement,'change'); } };
673
+ p.sldM.onmousedown = function(e) {
674
+ holdPad=false;
675
+ holdSld=true;
676
+ setSld(e);
677
+ dispatchImmediateChange();
678
+ };
679
+ if('ontouchstart' in window) {
680
+ p.sldM.addEventListener('touchstart', function(e) {
681
+ touchOffset={
682
+ 'X': e.target.offsetParent.offsetLeft,
683
+ 'Y': e.target.offsetParent.offsetTop
684
+ };
685
+ this.onmousedown({
686
+ 'offsetX':e.touches[0].pageX-touchOffset.X,
687
+ 'offsetY':e.touches[0].pageY-touchOffset.Y
688
+ });
689
+ });
690
+ }
691
+
692
+ // picker
693
+ var dims = getPickerDims(THIS);
694
+ p.box.style.width = dims[0] + 'px';
695
+ p.box.style.height = dims[1] + 'px';
696
+
697
+ // picker border
698
+ p.boxB.style.position = 'absolute';
699
+ p.boxB.style.clear = 'both';
700
+ p.boxB.style.left = x+'px';
701
+ p.boxB.style.top = y+'px';
702
+ p.boxB.style.zIndex = THIS.pickerZIndex;
703
+ p.boxB.style.border = THIS.pickerBorder+'px solid';
704
+ p.boxB.style.borderColor = THIS.pickerBorderColor;
705
+ p.boxB.style.background = THIS.pickerFaceColor;
706
+
707
+ // pad image
708
+ p.pad.style.width = jscolor.images.pad[0]+'px';
709
+ p.pad.style.height = jscolor.images.pad[1]+'px';
710
+
711
+ // pad border
712
+ p.padB.style.position = 'absolute';
713
+ p.padB.style.left = THIS.pickerFace+'px';
714
+ p.padB.style.top = THIS.pickerFace+'px';
715
+ p.padB.style.border = THIS.pickerInset+'px solid';
716
+ p.padB.style.borderColor = THIS.pickerInsetColor;
717
+
718
+ // pad mouse area
719
+ p.padM.style.position = 'absolute';
720
+ p.padM.style.left = '0';
721
+ p.padM.style.top = '0';
722
+ p.padM.style.width = THIS.pickerFace + 2*THIS.pickerInset + jscolor.images.pad[0] + jscolor.images.arrow[0] + 'px';
723
+ p.padM.style.height = p.box.style.height;
724
+ p.padM.style.cursor = 'crosshair';
725
+
726
+ // slider image
727
+ p.sld.style.overflow = 'hidden';
728
+ p.sld.style.width = jscolor.images.sld[0]+'px';
729
+ p.sld.style.height = jscolor.images.sld[1]+'px';
730
+
731
+ // slider border
732
+ p.sldB.style.display = THIS.slider ? 'block' : 'none';
733
+ p.sldB.style.position = 'absolute';
734
+ p.sldB.style.right = THIS.pickerFace+'px';
735
+ p.sldB.style.top = THIS.pickerFace+'px';
736
+ p.sldB.style.border = THIS.pickerInset+'px solid';
737
+ p.sldB.style.borderColor = THIS.pickerInsetColor;
738
+
739
+ // slider mouse area
740
+ p.sldM.style.display = THIS.slider ? 'block' : 'none';
741
+ p.sldM.style.position = 'absolute';
742
+ p.sldM.style.right = '0';
743
+ p.sldM.style.top = '0';
744
+ p.sldM.style.width = jscolor.images.sld[0] + jscolor.images.arrow[0] + THIS.pickerFace + 2*THIS.pickerInset + 'px';
745
+ p.sldM.style.height = p.box.style.height;
746
+ try {
747
+ p.sldM.style.cursor = 'pointer';
748
+ } catch(eOldIE) {
749
+ p.sldM.style.cursor = 'hand';
750
+ }
751
+
752
+ // "close" button
753
+ function setBtnBorder() {
754
+ var insetColors = THIS.pickerInsetColor.split(/\s+/);
755
+ var pickerOutsetColor = insetColors.length < 2 ? insetColors[0] : insetColors[1] + ' ' + insetColors[0] + ' ' + insetColors[0] + ' ' + insetColors[1];
756
+ p.btn.style.borderColor = pickerOutsetColor;
757
+ }
758
+ p.btn.style.display = THIS.pickerClosable ? 'block' : 'none';
759
+ p.btn.style.position = 'absolute';
760
+ p.btn.style.left = THIS.pickerFace + 'px';
761
+ p.btn.style.bottom = THIS.pickerFace + 'px';
762
+ p.btn.style.padding = '0 15px';
763
+ p.btn.style.height = '18px';
764
+ p.btn.style.border = THIS.pickerInset + 'px solid';
765
+ setBtnBorder();
766
+ p.btn.style.color = THIS.pickerButtonColor;
767
+ p.btn.style.font = '12px sans-serif';
768
+ p.btn.style.textAlign = 'center';
769
+ try {
770
+ p.btn.style.cursor = 'pointer';
771
+ } catch(eOldIE) {
772
+ p.btn.style.cursor = 'hand';
773
+ }
774
+ p.btn.onmousedown = function () {
775
+ THIS.hidePicker();
776
+ };
777
+ p.btnS.style.lineHeight = p.btn.style.height;
778
+
779
+ // load images in optimal order
780
+ switch(modeID) {
781
+ case 0: var padImg = 'hs.png'; break;
782
+ case 1: var padImg = 'hv.png'; break;
783
+ }
784
+ p.padM.style.backgroundImage = "url('"+jscolor.getDir()+"cross.gif')";
785
+ p.padM.style.backgroundRepeat = "no-repeat";
786
+ p.sldM.style.backgroundImage = "url('"+jscolor.getDir()+"arrow.gif')";
787
+ p.sldM.style.backgroundRepeat = "no-repeat";
788
+ p.pad.style.backgroundImage = "url('"+jscolor.getDir()+padImg+"')";
789
+ p.pad.style.backgroundRepeat = "no-repeat";
790
+ p.pad.style.backgroundPosition = "0 0";
791
+
792
+ // place pointers
793
+ redrawPad();
794
+ redrawSld();
795
+
796
+ jscolor.picker.owner = THIS;
797
+ document.getElementsByTagName('body')[0].appendChild(p.boxB);
798
+ }
799
+
800
+
801
+ function getPickerDims(o) {
802
+ var dims = [
803
+ 2*o.pickerInset + 2*o.pickerFace + jscolor.images.pad[0] +
804
+ (o.slider ? 2*o.pickerInset + 2*jscolor.images.arrow[0] + jscolor.images.sld[0] : 0),
805
+ o.pickerClosable ?
806
+ 4*o.pickerInset + 3*o.pickerFace + jscolor.images.pad[1] + o.pickerButtonHeight :
807
+ 2*o.pickerInset + 2*o.pickerFace + jscolor.images.pad[1]
808
+ ];
809
+ return dims;
810
+ }
811
+
812
+
813
+ function redrawPad() {
814
+ // redraw the pad pointer
815
+ switch(modeID) {
816
+ case 0: var yComponent = 1; break;
817
+ case 1: var yComponent = 2; break;
818
+ }
819
+ var x = Math.round((THIS.hsv[0]/6) * (jscolor.images.pad[0]-1));
820
+ var y = Math.round((1-THIS.hsv[yComponent]) * (jscolor.images.pad[1]-1));
821
+ jscolor.picker.padM.style.backgroundPosition =
822
+ (THIS.pickerFace+THIS.pickerInset+x - Math.floor(jscolor.images.cross[0]/2)) + 'px ' +
823
+ (THIS.pickerFace+THIS.pickerInset+y - Math.floor(jscolor.images.cross[1]/2)) + 'px';
824
+
825
+ // redraw the slider image
826
+ var seg = jscolor.picker.sld.childNodes;
827
+
828
+ switch(modeID) {
829
+ case 0:
830
+ var rgb = HSV_RGB(THIS.hsv[0], THIS.hsv[1], 1);
831
+ for(var i=0; i<seg.length; i+=1) {
832
+ seg[i].style.backgroundColor = 'rgb('+
833
+ (rgb[0]*(1-i/seg.length)*100)+'%,'+
834
+ (rgb[1]*(1-i/seg.length)*100)+'%,'+
835
+ (rgb[2]*(1-i/seg.length)*100)+'%)';
836
+ }
837
+ break;
838
+ case 1:
839
+ var rgb, s, c = [ THIS.hsv[2], 0, 0 ];
840
+ var i = Math.floor(THIS.hsv[0]);
841
+ var f = i%2 ? THIS.hsv[0]-i : 1-(THIS.hsv[0]-i);
842
+ switch(i) {
843
+ case 6:
844
+ case 0: rgb=[0,1,2]; break;
845
+ case 1: rgb=[1,0,2]; break;
846
+ case 2: rgb=[2,0,1]; break;
847
+ case 3: rgb=[2,1,0]; break;
848
+ case 4: rgb=[1,2,0]; break;
849
+ case 5: rgb=[0,2,1]; break;
850
+ }
851
+ for(var i=0; i<seg.length; i+=1) {
852
+ s = 1 - 1/(seg.length-1)*i;
853
+ c[1] = c[0] * (1 - s*f);
854
+ c[2] = c[0] * (1 - s);
855
+ seg[i].style.backgroundColor = 'rgb('+
856
+ (c[rgb[0]]*100)+'%,'+
857
+ (c[rgb[1]]*100)+'%,'+
858
+ (c[rgb[2]]*100)+'%)';
859
+ }
860
+ break;
861
+ }
862
+ }
863
+
864
+
865
+ function redrawSld() {
866
+ // redraw the slider pointer
867
+ switch(modeID) {
868
+ case 0: var yComponent = 2; break;
869
+ case 1: var yComponent = 1; break;
870
+ }
871
+ var y = Math.round((1-THIS.hsv[yComponent]) * (jscolor.images.sld[1]-1));
872
+ jscolor.picker.sldM.style.backgroundPosition =
873
+ '0 ' + (THIS.pickerFace+THIS.pickerInset+y - Math.floor(jscolor.images.arrow[1]/2)) + 'px';
874
+ }
875
+
876
+
877
+ function isPickerOwner() {
878
+ return jscolor.picker && jscolor.picker.owner === THIS;
879
+ }
880
+
881
+
882
+ function blurTarget() {
883
+ if(valueElement === target) {
884
+ THIS.importColor();
885
+ }
886
+ if(THIS.pickerOnfocus) {
887
+ THIS.hidePicker();
888
+ }
889
+ }
890
+
891
+
892
+ function blurValue() {
893
+ if(valueElement !== target) {
894
+ THIS.importColor();
895
+ }
896
+ }
897
+
898
+
899
+ function setPad(e) {
900
+ var mpos = jscolor.getRelMousePos(e);
901
+ var x = mpos.x - THIS.pickerFace - THIS.pickerInset;
902
+ var y = mpos.y - THIS.pickerFace - THIS.pickerInset;
903
+ switch(modeID) {
904
+ case 0: THIS.fromHSV(x*(6/(jscolor.images.pad[0]-1)), 1 - y/(jscolor.images.pad[1]-1), null, leaveSld); break;
905
+ case 1: THIS.fromHSV(x*(6/(jscolor.images.pad[0]-1)), null, 1 - y/(jscolor.images.pad[1]-1), leaveSld); break;
906
+ }
907
+ }
908
+
909
+
910
+ function setSld(e) {
911
+ var mpos = jscolor.getRelMousePos(e);
912
+ var y = mpos.y - THIS.pickerFace - THIS.pickerInset;
913
+ switch(modeID) {
914
+ case 0: THIS.fromHSV(null, null, 1 - y/(jscolor.images.sld[1]-1), leavePad); break;
915
+ case 1: THIS.fromHSV(null, 1 - y/(jscolor.images.sld[1]-1), null, leavePad); break;
916
+ }
917
+ }
918
+
919
+
920
+ function dispatchImmediateChange() {
921
+ if (THIS.onImmediateChange) {
922
+ var callback;
923
+ if (typeof THIS.onImmediateChange === 'string') {
924
+ callback = new Function (THIS.onImmediateChange);
925
+ } else {
926
+ callback = THIS.onImmediateChange;
927
+ }
928
+ callback.call(THIS);
929
+ }
930
+ }
931
+
932
+
933
+ var THIS = this;
934
+ var modeID = this.pickerMode.toLowerCase()==='hvs' ? 1 : 0;
935
+ var abortBlur = false;
936
+ var
937
+ valueElement = jscolor.fetchElement(this.valueElement),
938
+ styleElement = jscolor.fetchElement(this.styleElement);
939
+ var
940
+ holdPad = false,
941
+ holdSld = false,
942
+ touchOffset = {};
943
+ var
944
+ leaveValue = 1<<0,
945
+ leaveStyle = 1<<1,
946
+ leavePad = 1<<2,
947
+ leaveSld = 1<<3;
948
+
949
+ // target
950
+ jscolor.addEvent(target, 'focus', function() {
951
+ if(THIS.pickerOnfocus) { THIS.showPicker(); }
952
+ });
953
+ jscolor.addEvent(target, 'blur', function() {
954
+ if(!abortBlur) {
955
+ window.setTimeout(function(){ abortBlur || blurTarget(); abortBlur=false; }, 0);
956
+ } else {
957
+ abortBlur = false;
958
+ }
959
+ });
960
+
961
+ // valueElement
962
+ if(valueElement) {
963
+ var updateField = function() {
964
+ THIS.fromString(valueElement.value, leaveValue);
965
+ dispatchImmediateChange();
966
+ };
967
+ jscolor.addEvent(valueElement, 'keyup', updateField);
968
+ jscolor.addEvent(valueElement, 'input', updateField);
969
+ jscolor.addEvent(valueElement, 'blur', blurValue);
970
+ valueElement.setAttribute('autocomplete', 'off');
971
+ }
972
+
973
+ // styleElement
974
+ if(styleElement) {
975
+ styleElement.jscStyle = {
976
+ backgroundImage : styleElement.style.backgroundImage,
977
+ backgroundColor : styleElement.style.backgroundColor,
978
+ color : styleElement.style.color
979
+ };
980
+ }
981
+
982
+ // require images
983
+ switch(modeID) {
984
+ case 0: jscolor.requireImage('hs.png'); break;
985
+ case 1: jscolor.requireImage('hv.png'); break;
986
+ }
987
+ jscolor.requireImage('cross.gif');
988
+ jscolor.requireImage('arrow.gif');
989
+
990
+ this.importColor();
991
+ }
992
+
993
+ };
994
+
995
+
996
+ jscolor.install();
inc/script/sc_our_team.js ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ *
3
+ * @author Smartcat Jan 21, 2015
4
+ */
5
+ jQuery( document ).ready(function($){
6
+
7
+ var member_height = $('#sc_our_team.grid_circles .sc_team_member').width();
8
+ $('#sc_our_team.grid_circles .sc_team_member').each(function(){
9
+ $(this).css({
10
+ height: member_height
11
+ });
12
+ });
13
+
14
+
15
+ $('#sc_our_team .sc_team_member').hover(function(){
16
+ $('.sc_team_member_overlay',this).stop(true,false).fadeIn(440);
17
+ $('.wp-post-image',this).addClass('zoomIn');
18
+ $('.sc_team_more',this).addClass('show');
19
+
20
+ },function(){
21
+ $('.sc_team_member_overlay',this).stop(true,false).fadeOut(440)
22
+ $('.wp-post-image',this).removeClass('zoomIn');
23
+ $('.sc_team_more',this).removeClass('show');
24
+
25
+ });
26
+
27
+ });
inc/script/sc_our_team_admin.js ADDED
@@ -0,0 +1,168 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * To change this template, choose Tools | Templates
3
+ * and open the template in the editor.
4
+ */
5
+
6
+
7
+ jQuery(document).ready(function($) {
8
+
9
+ sc_team_set_display();
10
+
11
+ $('#sc_our_team_template').change(function(){
12
+ sc_team_set_display();
13
+ });
14
+
15
+
16
+ function sc_team_set_display(){
17
+ if('hc' == $('#sc_our_team_template').val()){
18
+ $('#social_icons_row').hide();
19
+ $('#honey-comb-row').show();
20
+ $('#columns-row,#height-row,#margin-row').hide();
21
+ }else{
22
+ $('#social_icons_row').show();
23
+ $('#honey-comb-row').hide();
24
+ $('#columns-row,#height-row,#margin-row').show();
25
+ }
26
+ }
27
+
28
+
29
+ sc_team_set_order();
30
+
31
+ $('.sortable').sortable();
32
+ $('.handles').sortable({
33
+ handle: 'span'
34
+ });
35
+ $('.connected').sortable({
36
+ connectWith: '.connected'
37
+ });
38
+ $('.exclude').sortable({
39
+ items: ':not(.disabled)'
40
+ });
41
+ $('.sortable').sortable().bind('sortupdate', function(e, ui) {
42
+ sc_team_set_order();
43
+ });
44
+
45
+ function sc_team_set_order() {
46
+ $('.sortable li').each(function() {
47
+ $(this).attr('sc_member_order', $(this).index());
48
+ });
49
+ }
50
+
51
+ $('#set_order').click(function() {
52
+ var post_path = $('.sortable').attr('data-action');
53
+ // UX
54
+ $(this).attr('disabled','disable');
55
+
56
+ $('.sc_team_member_update_status .sc_team_member_updating').stop(true,false).fadeIn(200,function(){
57
+ $(this).delay(800).fadeOut(200);
58
+ });
59
+
60
+ $('.sortable li').each(function() {
61
+
62
+ var data = {
63
+ action: 'sc_team_update_order',
64
+ id: $(this).attr('id'),
65
+ sc_member_order: $(this).attr('sc_member_order')
66
+ };
67
+
68
+ jQuery.post('admin-ajax.php', data, function(response) {
69
+
70
+ // whatever you need to do; maybe nothing
71
+ $('.sc_team_member_update_status .sc_team_member_updating').hide();
72
+ $('.sc_team_member_update_status .sc_team_member_saved').stop(true,false).fadeIn(200,function() {
73
+ $(this).delay(1000).fadeOut(200);
74
+ });
75
+ $('#set_order').removeAttr('disabled');
76
+
77
+ console.log( response );
78
+
79
+ });
80
+ });
81
+ });
82
+ });
83
+
84
+ /*
85
+ * HTML5 Sortable jQuery Plugin
86
+ * http://farhadi.ir/projects/html5sortable
87
+ *
88
+ * Copyright 2012, Ali Farhadi
89
+ * Released under the MIT license.
90
+ */
91
+ (function($) {
92
+ var dragging, placeholders = $();
93
+ $.fn.sortable = function(options) {
94
+ var method = String(options);
95
+ options = $.extend({
96
+ connectWith: false
97
+ }, options);
98
+ return this.each(function() {
99
+ if (/^enable|disable|destroy$/.test(method)) {
100
+ var items = $(this).children($(this).data('items')).attr('draggable', method == 'enable');
101
+ if (method == 'destroy') {
102
+ items.add(this).removeData('connectWith items')
103
+ .off('dragstart.h5s dragend.h5s selectstart.h5s dragover.h5s dragenter.h5s drop.h5s');
104
+ }
105
+ return;
106
+ }
107
+ var isHandle, index, items = $(this).children(options.items);
108
+ var placeholder = $('<' + (/^ul|ol$/i.test(this.tagName) ? 'li' : 'div') + ' class="sortable-placeholder">');
109
+ items.find(options.handle).mousedown(function() {
110
+ isHandle = true;
111
+ }).mouseup(function() {
112
+ isHandle = false;
113
+ });
114
+ $(this).data('items', options.items)
115
+ placeholders = placeholders.add(placeholder);
116
+ if (options.connectWith) {
117
+ $(options.connectWith).add(this).data('connectWith', options.connectWith);
118
+ }
119
+ items.attr('draggable', 'true').on('dragstart.h5s', function(e) {
120
+ if (options.handle && !isHandle) {
121
+ return false;
122
+ }
123
+ isHandle = false;
124
+ var dt = e.originalEvent.dataTransfer;
125
+ dt.effectAllowed = 'move';
126
+ dt.setData('Text', 'dummy');
127
+ index = (dragging = $(this)).addClass('sortable-dragging').index();
128
+ }).on('dragend.h5s', function() {
129
+ if (!dragging) {
130
+ return;
131
+ }
132
+ dragging.removeClass('sortable-dragging').show();
133
+ placeholders.detach();
134
+ if (index != dragging.index()) {
135
+ dragging.parent().trigger('sortupdate', {item: dragging});
136
+ }
137
+ dragging = null;
138
+ }).not('a[href], img').on('selectstart.h5s', function() {
139
+ this.dragDrop && this.dragDrop();
140
+ return false;
141
+ }).end().add([this, placeholder]).on('dragover.h5s dragenter.h5s drop.h5s', function(e) {
142
+ if (!items.is(dragging) && options.connectWith !== $(dragging).parent().data('connectWith')) {
143
+ return true;
144
+ }
145
+ if (e.type == 'drop') {
146
+ e.stopPropagation();
147
+ placeholders.filter(':visible').after(dragging);
148
+ dragging.trigger('dragend.h5s');
149
+ return false;
150
+ }
151
+ e.preventDefault();
152
+ e.originalEvent.dataTransfer.dropEffect = 'move';
153
+ if (items.is(this)) {
154
+ if (options.forcePlaceholderSize) {
155
+ placeholder.height(dragging.outerHeight());
156
+ }
157
+ dragging.hide();
158
+ $(this)[placeholder.index() < $(this).index() ? 'after' : 'before'](placeholder);
159
+ placeholders.not(placeholder).detach();
160
+ } else if (!placeholders.is(this) && !$(this).children(options.items).length) {
161
+ placeholders.detach();
162
+ $(this).append(placeholder);
163
+ }
164
+ return false;
165
+ });
166
+ });
167
+ };
168
+ })(jQuery);
inc/single-team_member.php DELETED
@@ -1,7 +0,0 @@
1
- <?php
2
-
3
- /*
4
- * Template Name : Team Member Bio
5
- */
6
- echo 2;
7
- ?>
 
 
 
 
 
 
 
inc/stacked.php DELETED
@@ -1,32 +0,0 @@
1
- <?php
2
- /*
3
- * Short description
4
- * @author bilal hassan <info@smartcatdesign.net>
5
- *
6
- */
7
- $args = array(
8
- 'post_type' => 'team_member',
9
- );
10
- $members = new WP_Query($args);
11
- if ($members->have_posts()) {
12
- while ($members->have_posts()) {
13
- $members->the_post();
14
- ?>
15
- <div class="sc_our_team <?php echo esc_html( get_option('sc_our_team_template') ); ?>">
16
- <h1><?php the_title() ?></h1>
17
- <div class='content'>
18
- <?php the_post_thumbnail(); ?>
19
- <?php the_content(); ?>
20
- <?php the_time('F jS, Y'); ?>
21
- <?php echo get_post_meta(get_the_ID(), 'team_member_facebook', true); ?>
22
- <?php echo get_post_meta(get_the_ID(), 'team_member_twitter', true); ?>
23
- <?php echo get_post_meta(get_the_ID(), 'team_member_linkedin', true); ?>
24
- <?php echo get_post_meta(get_the_ID(), 'team_member_gplus', true); ?>
25
- </div>
26
- </div>
27
- <?php
28
- }
29
- } else {
30
- echo 'There are no team members to display';
31
- }
32
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/style/sc_our_team.css ADDED
@@ -0,0 +1,709 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ Document : sc_our_team
3
+ Created on : Jun 23, 2014, 7:07:26 PM
4
+ Author : Bilal
5
+ Description:
6
+ Purpose of the stylesheet follows.
7
+ */
8
+
9
+ .left{ float: left; box-sizing: border-box; }
10
+
11
+ .sc_team_member .sc_team_member_name a{ text-decoration: none;}
12
+ #sc_our_team_lightbox{
13
+ position: fixed;
14
+ left: 0;
15
+ top: 0;
16
+ width: 100%;
17
+ height: 100%;
18
+ z-index: 999;
19
+ background: rgba(0,0,0,0.75);
20
+ display: none;
21
+ }
22
+ #sc_our_team_lightbox .icons{ display: none;}
23
+
24
+ #sc_our_team_lightbox .sc_our_team_lightbox .social a{
25
+ display: inline-block;
26
+ margin-top: 10px;
27
+ margin-right: 5px;
28
+ }
29
+ #sc_our_team_lightbox .sc_our_team_lightbox .social a img{
30
+ width: 25px;
31
+ }
32
+ #sc_our_team_lightbox .progress{
33
+ height: 12px;
34
+ margin-bottom: 20px;
35
+ overflow: hidden;
36
+ background-color: #F5F5F5;
37
+ border-radius: 5px;
38
+ -webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.5);
39
+ -moz-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.5);
40
+ box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.5);
41
+ }
42
+ #sc_our_team_lightbox .title{
43
+ font-weight: 600;
44
+ font-size: 18px;
45
+ }
46
+ #sc_our_team_lightbox .sc_our_team_lightbox .social{
47
+ text-align: center;
48
+ }
49
+ #sc_our_team_lightbox .sc_our_team_lightbox{
50
+ box-shadow: 0 0 4px #fff;
51
+ -moz-box-shadow: 0 0 4px #fff;
52
+ -webkit-box-shadow: 0 0 4px #fff;
53
+ overflow: hidden;
54
+ display: none;
55
+ background: #fff;
56
+ width: 100%;
57
+ }
58
+ .sc_our_team_lightbox.honeycomb .social img{
59
+ display: inline-block !important;
60
+ }
61
+ .sc_our_team_lightbox .image.circle{
62
+ width: 155px;
63
+ height: 155px;
64
+ border-radius: 100%;
65
+ }
66
+ /**
67
+ * Grid CSS
68
+ */
69
+ .grid#sc_our_team{
70
+ overflow: hidden;
71
+ width: 100%;
72
+ }
73
+ .grid#sc_our_team .sc_team_member{
74
+ overflow: hidden;
75
+ box-sizing: border-box;
76
+ padding: 5px;
77
+
78
+ }
79
+ .grid#sc_our_team .sc_team_member .sc_team_skills,
80
+ .honeycombs#sc_our_team .sc_team_member .sc_team_skills{
81
+ display: none;
82
+ }
83
+ .grid#sc_our_team .sc_team_member:hover .sc_team_member_name,
84
+ .grid#sc_our_team .sc_team_member:hover .sc_team_member_jobtitle,
85
+ .grid_circles#sc_our_team .sc_team_member:hover .sc_team_member_name,
86
+ .grid_circles#sc_our_team .sc_team_member:hover .sc_team_member_jobtitle{
87
+ left: -100%;
88
+ }
89
+ .grid#sc_our_team .sc_team_member:hover .wp-post-image{
90
+
91
+
92
+ }
93
+
94
+
95
+ .grid#sc_our_team .sc_team_member .wp-post-image{
96
+ transition: 0.45s all ease-in-out;
97
+ -moz-transition: 0.45s all ease-in-out;
98
+ -webkit-transition: 0.45s all ease-in-out;
99
+ }
100
+ .grid#sc_our_team .sc_team_member .wp-post-image.zoomIn{
101
+ transform: scale(1.1);
102
+ -moz-transform: scale(1.1);
103
+ -webkit-transform: scale(1.1);
104
+ }
105
+ .grid#sc_our_team .sc_team_member .icons{
106
+ z-index: 9;
107
+ position: absolute;
108
+ bottom: -25px;
109
+ display: block;
110
+ width: 100%;
111
+ text-align: center;
112
+ /*display: none;*/
113
+ transition: 0.45s all ease-in-out;
114
+ -moz-transition: 0.45s all ease-in-out;
115
+ -webkit-transition: 0.45s all ease-in-out;
116
+ /*opacity: 0;*/
117
+ }
118
+ .grid_circles#sc_our_team .sc_team_member .icons{
119
+ opacity: 0;
120
+ position: absolute;
121
+ text-align: center;
122
+ transition: 0.45s all ease-in-out;
123
+ -moz-transition: 0.45s all ease-in-out;
124
+ -webkit-transition: 0.45s all ease-in-out;
125
+ bottom: 20%;
126
+ margin: 0 auto;
127
+ display: block;
128
+ width: 100%;
129
+ z-index: 9;
130
+
131
+ }
132
+ .honeycombs#sc_our_team .sc_team_member .icons{
133
+ position: absolute;
134
+ bottom: 20px;
135
+ z-index: 999;
136
+ }
137
+ .grid#sc_our_team .sc_team_member .icons.hidden,
138
+ .grid_circles#sc_our_team .sc_team_member .icons.hidden,
139
+ .honeycombs#sc_our_team .sc_team_member .icons.hidden{
140
+ display: none;
141
+ }
142
+ .grid#sc_our_team .sc_team_member .sc_team_content,
143
+ .grid_circles#sc_our_team .sc_team_member .sc_team_content,
144
+ .honeycombs#sc_our_team .sc_team_member .sc_team_content{
145
+ display: none;
146
+ }
147
+
148
+ .grid#sc_our_team .sc_team_member:hover .icons{
149
+
150
+ bottom: 20px;
151
+ }
152
+
153
+ .grid_circles#sc_our_team .sc_team_member:hover .icons{
154
+ opacity: 1;
155
+ }
156
+
157
+ .grid#sc_our_team .sc_team_member .icons img,
158
+ .grid_circles#sc_our_team .sc_team_member .icons img{
159
+ width: 25px;
160
+ margin-right: 5px;
161
+
162
+ }
163
+ .grid#sc_our_team .sc_team_member .sc_team_member_jobtitle,
164
+ .grid#sc_our_team .sc_team_member .sc_team_member_name,
165
+ .grid_circles#sc_our_team .sc_team_member .sc_team_member_jobtitle,
166
+ .grid_circles#sc_our_team .sc_team_member .sc_team_member_name{
167
+ height: 24px;
168
+ line-height: 26px;
169
+ }
170
+ .grid#sc_our_team .sc_team_member img.wp-post-image{
171
+
172
+ width: 100%;
173
+ display: block;
174
+ margin: 0 auto;
175
+ float: none;
176
+ border: none;
177
+ padding: 0;
178
+ }
179
+ .grid#sc_our_team .sc_team_member .sc_team_member_name{
180
+ font-weight: bold;
181
+ font-size: 20px;
182
+ position: absolute;
183
+ left: 0;
184
+ bottom: 40px;
185
+ padding: 5px 10px;
186
+ height: 30px;
187
+ transition: 0.45s all ease-in-out;
188
+ -moz-transition: 0.45s all ease-in-out;
189
+ -webkit-transition: 0.45s all ease-in-out;
190
+ overflow: hidden;
191
+ }
192
+
193
+ .grid_circles#sc_our_team .sc_team_member .sc_team_member_name{
194
+ position: absolute;
195
+ top: 40%;
196
+ left: 0;
197
+ margin: 0 auto;
198
+ width: 70%;
199
+ display: block;
200
+ transition: 0.45s all ease-in-out;
201
+ -moz-transition: 0.45s all ease-in-out;
202
+ -webkit-transition: 0.45s all ease-in-out;
203
+ opacity: 0.9;
204
+ }
205
+
206
+ .grid#sc_our_team .sc_team_member .sc_team_member_jobtitle{
207
+ position: absolute;
208
+ padding: 5px 10px;
209
+ bottom: 10px;
210
+ left: 0;
211
+ height: 30px;
212
+ line-height: 25px;
213
+ color: #ffffff;
214
+ transition: 0.35s all ease-in-out;
215
+ -moz-transition: 0.35s all ease-in-out;
216
+ -webkit-transition: 0.35s all ease-in-out;
217
+ }
218
+
219
+ .grid_circles#sc_our_team .sc_team_member .sc_team_member_jobtitle{
220
+ position: absolute;
221
+ top: 40%;
222
+ left: 0;
223
+ margin: 24px auto;
224
+ width: 75%;
225
+ display: block;
226
+ color: #ffffff;
227
+ transition: 0.30s all ease-in-out;
228
+ -moz-transition: 0.30s all ease-in-out;
229
+ -webkit-transition: 0.30s all ease-in-out;
230
+ opacity: 0.9;
231
+ }
232
+ #sc_our_team .sc_team_member_inner{
233
+ width: 100%;
234
+ height: 100%;
235
+ overflow: hidden;
236
+ }
237
+ .grid#sc_our_team .sc_team_member_inner{
238
+ height: 170px;
239
+ overflow: hidden;
240
+ background-size: cover;
241
+ position: relative;
242
+ text-align: center;
243
+ background: #404040;
244
+ }
245
+ .grid#sc_our_team .sc_team_member .sc_team_member_overlay{
246
+ position: absolute;
247
+ width: 100%;
248
+ height: 100%;
249
+ left: 0;
250
+ bottom: 0;
251
+ padding: 0 10px;
252
+ color: #fff;
253
+ background: rgba(50,50,50,0.5);
254
+ display: none;
255
+ }
256
+ .grid#sc_our_team .sc_team_member .sc_team_more,
257
+ .grid_circles#sc_our_team .sc_team_member .sc_team_more{
258
+ position: absolute;
259
+ margin-top: -25px;
260
+ width: 100%;
261
+ transition: 0.45s all ease-in-out;
262
+ -moz-transition: 0.45s all ease-in-out;
263
+ -webkit-transition: 0.45s all ease-in-out;
264
+ top: -25px;
265
+ }
266
+ .grid#sc_our_team .sc_team_member .sc_team_more.show,
267
+ .grid_circles#sc_our_team .sc_team_member .sc_team_more.show{
268
+ top: 50%;
269
+ transform: rotate(360deg);
270
+ -moz-transform: rotate(360deg);
271
+ -webkit-transform: rotate(360deg);
272
+ }
273
+ .grid#sc_our_team .sc_team_member .sc_team_member_name a,
274
+ .grid_circles#sc_our_team .sc_team_member .sc_team_member_name a{
275
+ color: #fff;
276
+ }
277
+ .sc_team_single_member{
278
+ overflow: hidden;
279
+
280
+ }
281
+
282
+ .sc_team_single_member .sc_single_side .social{
283
+ margin: 10px 0 0 0;
284
+ }
285
+ .sc_team_single_member .sc_single_side .social li{
286
+ margin-bottom: 10px;
287
+ list-style: none;
288
+ }
289
+ .sc_team_single_member .sc_single_side .social li a{
290
+ text-decoration: none;
291
+ }
292
+ .sc_team_single_member .sc_single_side .social .sc-social{
293
+ width: 25px;
294
+ position: relative;
295
+ top: 7px;
296
+ padding-right: 5px;
297
+
298
+ }
299
+ .sc_team_single_member .sc_single_side .name{
300
+ font-size: 22px;
301
+ margin-top: 12px;
302
+ margin-bottom: 7px;
303
+ text-align: center;
304
+ border-bottom: 1px solid #e1e1e1;
305
+ padding-bottom: 10px;
306
+ text-transform: uppercase;
307
+ color: #333;
308
+ font-weight: 400;
309
+ }
310
+ .sc_team_single_member .sc_single_side .title{
311
+ text-align: center;
312
+ font-weight: 400;
313
+
314
+ }
315
+ .sc_team_single_member .circle .wp-post-image{
316
+ border-radius: 100%;
317
+ width: 200px;
318
+ height: 200px;
319
+ margin: 0 auto;
320
+ text-align: center;
321
+ display: block;
322
+ }
323
+ .sc_team_single_skills{
324
+
325
+ }
326
+ .progress {
327
+ height: 20px;
328
+ margin-bottom: 20px;
329
+ overflow: hidden;
330
+ background-color: rgb(245, 245, 245);
331
+ border-radius: 4px;
332
+ -webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
333
+ box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
334
+ }
335
+ .progress-bar {
336
+ float: left;
337
+ width: 0;
338
+ height: 100%;
339
+ font-size: 12px;
340
+ line-height: 20px;
341
+ color: rgb(255, 255, 255);
342
+ text-align: center;
343
+ background-color: rgb(51, 122, 183);
344
+ -webkit-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15);
345
+ box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15);
346
+ -webkit-transition: width .6s ease;
347
+ -o-transition: width .6s ease;
348
+ transition: width .6s ease;
349
+ }
350
+ .sr-only {
351
+ position: absolute;
352
+ width: 1px;
353
+ height: 1px;
354
+ padding: 0;
355
+ margin: -1px;
356
+ overflow: hidden;
357
+ clip: rect(0,0,0,0);
358
+ border: 0;
359
+ }
360
+ .sc_team_single_member .inner{
361
+ background: rgba(150,150,150,0.2);
362
+ padding: 15px;
363
+ margin-bottom: 15px;
364
+ }
365
+
366
+ /**
367
+ * Circles CSS
368
+ **/
369
+ .grid_circles#sc_our_team .sc_team_member{
370
+ float: left;
371
+
372
+ overflow: hidden;
373
+ border-radius: 100%;
374
+ text-align: center;
375
+ box-shadow:
376
+ 0 0 0 4px #fff,
377
+ 0 0 0 7px #E2E2E2;
378
+ position: relative;
379
+
380
+ }
381
+ .grid_circles#sc_our_team .sc_team_member:hover .wp-post-image{
382
+
383
+ }
384
+ .grid_circles#sc_our_team .sc_team_member .wp-post-image{
385
+ border: none;
386
+ padding: 0;
387
+ float: none;
388
+ margin: 0;
389
+ width: 100%;
390
+ height: 100%;
391
+
392
+
393
+ }
394
+ .grid_circles#sc_our_team .sc_team_member .sc_team_member_overlay{
395
+ position: absolute;
396
+ width: 100%;
397
+ left: 0;
398
+ top: 0;
399
+ height: 100%;
400
+ background: rgba(50,50,50,0.7);
401
+ color: #ffffff;
402
+ display: none;
403
+ border-radius: 100%;
404
+ }
405
+ .grid_circles#sc_our_team .sc_team_member .sc_team_member_overlay .sc_team_member_name{
406
+ margin-top: 30px;
407
+ font-size: 18px;
408
+ }
409
+ .grid_circles#sc_our_team .sc_team_member .sc_team_member_overlay .icons a{
410
+ margin-right: 5px;
411
+ }
412
+ .grid_circles#sc_our_team .icons img{
413
+ width: 25px;
414
+ }
415
+ /**
416
+ * Stacked css
417
+ **/
418
+ .stacked#sc_our_team .sc_team_member{
419
+ width: 100%;
420
+ overflow: hidden;
421
+ border-bottom: 2px solid #333;
422
+ padding-top: 15px;
423
+ margin-bottom: 15px;
424
+ clear: both;
425
+ }
426
+
427
+ .stacked#sc_our_team .sc_team_member .sc_team_member_left{
428
+ float: left;
429
+ width: 25%;
430
+ text-align: center;
431
+ }
432
+ .stacked#sc_our_team .sc_team_member .sc_team_member_right{
433
+ float: right;
434
+ width: 70%;
435
+ }
436
+ .stacked#sc_our_team .sc_team_member .wp-post-image{
437
+ width: 100%;
438
+ }
439
+ .stacked#sc_our_team .sc_team_member .sc_team_member_name{
440
+
441
+ margin: 10px 0;
442
+ padding-bottom: 10px;
443
+ border-bottom: 1px dashed #404040;
444
+ }
445
+ .stacked#sc_our_team .sc_team_member .sc_team_member_jobtitle{
446
+ line-height: 20px;
447
+ margin: 10px 0;
448
+ }
449
+ .stacked#sc_our_team .sc_team_member .sc_team_member_name a{
450
+ text-decoration: none;
451
+ }
452
+
453
+ .stacked#sc_our_team .sc_team_member .sc_team_skills{
454
+ display: none;
455
+ }
456
+ .stacked#sc_our_team .sc_team_member .icons{
457
+
458
+ }
459
+ .stacked#sc_our_team .icons img{
460
+ width: 30px;
461
+ box-shadow: none;
462
+ -moz-box-shadow: none;
463
+ -webkit-box-shadow: none;
464
+ margin-right: 10px;
465
+ transition: 0.3s all ease-in-out;
466
+ -moz-transition: 0.3s all ease-in-out;
467
+ -webkit-transition: 0.3s all ease-in-out;
468
+ }
469
+ .stacked#sc_our_team .icons img:hover{
470
+ /* transform: rotate(360deg);
471
+ -moz-transform: rotate(360deg);
472
+ -webkit-transform: rotate(360deg);*/
473
+ }
474
+ /**
475
+ * widget css
476
+ */
477
+ .widget#sc_our_team .sc_team_member{
478
+ width: 100%;
479
+ overflow: hidden;
480
+ margin: 0 0 10px 0;
481
+ }
482
+ .widget#sc_our_team .sc_team_member .wp-post-image{
483
+ float: left;
484
+ width: 25%;
485
+ border: 1px solid #d0d0d0;
486
+ padding: 3px;
487
+ box-sizing: border-box;
488
+ margin: 0;
489
+ }
490
+ .widget#sc_our_team .sc_team_member .sc_team_member_overlay{
491
+ float: left;
492
+ width: 75%;
493
+ padding: 0 0 0 10px;
494
+ box-sizing: border-box;
495
+ }
496
+
497
+ .widget#sc_our_team .sc_team_member .sc_team_member_overlay .sc_team_member_name{
498
+ font-weight: bold;
499
+ }
500
+
501
+ /**
502
+ * honeycomb
503
+ **/
504
+ .honeycombs{
505
+ position: relative;
506
+ overflow: hidden;
507
+ width: 100%;
508
+ text-align: center;
509
+ }
510
+
511
+ .honeycombs .inner_span{
512
+ display: block;
513
+ height: 100%;
514
+ width: 100%;
515
+ font-family: sans-serif;
516
+ color: #000;
517
+ opacity: 0.8;
518
+ }
519
+ .honeycombs .inner-text{
520
+ padding-top: 35%;
521
+ font-size: 18px;
522
+ }
523
+ .honeycombs .inner-text a{
524
+ text-decoration: none;
525
+ }
526
+ .honeycombs .honeycombs-inner-wrapper{
527
+ display: inline-block;
528
+ overflow: hidden;
529
+ width: 700px;
530
+ position: relative;
531
+ height: 1200px;
532
+ }
533
+
534
+ .honeycombs .comb{
535
+ position: absolute;
536
+ display: inline-block;
537
+ }
538
+
539
+ .honeycombs .hex_l,
540
+ .honeycombs .hex_r{
541
+ overflow: hidden;
542
+ position: absolute;
543
+ /* -webkit-backface-visibility: hidden; */
544
+ }
545
+
546
+ .honeycombs .hex_l{
547
+ visibility: hidden;
548
+ -moz-transform: rotate(60deg);
549
+ -ms-transform: rotate(60deg);
550
+ -o-transform: rotate(60deg);
551
+ -webkit-transform: rotate(60deg);
552
+ transform: rotate(60deg);
553
+ }
554
+
555
+ .honeycombs .hex_r{
556
+ visibility: hidden;
557
+ -moz-transform: rotate(-120deg);
558
+ -ms-transform: rotate(-120deg);
559
+ -o-transform: rotate(-120deg);
560
+ -webkit-transform: rotate(-120deg);
561
+ transform: rotate(-120deg);
562
+ }
563
+
564
+ .honeycombs .hex_inner{
565
+ display: block;
566
+ visibility: visible;
567
+ -moz-transform: rotate(60deg);
568
+ -ms-transform: rotate(60deg);
569
+ -o-transform: rotate(60deg);
570
+ -webkit-transform: rotate(60deg);
571
+ transform: rotate(60deg);
572
+ background-position: center;
573
+ -webkit-background-size: cover;
574
+ -moz-background-size: cover;
575
+ -o-background-size: cover;
576
+ background-size: cover;
577
+ cursor: pointer;
578
+ }
579
+ /**
580
+ * single post
581
+ */
582
+ .smartcat_team_single_icons img.sc-social{
583
+ width: 25px;
584
+ margin-right: 10px;
585
+ box-shadow: none;
586
+ -moz-box-shadow: none;
587
+ -webkit-box-shadow: none;
588
+ }
589
+
590
+
591
+ @media (min-width: 768px){
592
+
593
+ #sc_our_team_lightbox .sc_our_team_lightbox{
594
+ padding: 15px 0;
595
+ margin: 0 auto;
596
+ width: 750px;
597
+ min-height: 300px;
598
+
599
+ margin-top: 100px;
600
+ }
601
+
602
+ .sc_team_single_member .sc_single_side .title{
603
+ font-size: 17px;
604
+ }
605
+ .grid#sc_our_team .sc_team_member{
606
+ float: left;
607
+ width: 25%;
608
+ }
609
+ #sc_our_team.sc-col3 .sc_team_member{
610
+ width: 33.3%;
611
+ /*margin: 1%;*/
612
+ }
613
+ #sc_our_team.sc-col4 .sc_team_member{
614
+ width: 25%;
615
+ /*margin: 1%;*/
616
+ }
617
+ #sc_our_team.sc-col2 .sc_team_member{
618
+ width: 50%;
619
+ /*margin: 1%;*/
620
+ }
621
+ #sc_our_team.sc-col5 .sc_team_member{
622
+ width: 20%;
623
+ }
624
+ #sc_our_team.sc-col10 .sc_team_member{
625
+ width: 10%;
626
+ }
627
+
628
+
629
+ #sc_our_team.grid_circles.sc-col3 .sc_team_member{
630
+ width: 31%;
631
+ margin: 1%;
632
+ }
633
+ #sc_our_team.grid_circles.sc-col4 .sc_team_member{
634
+ width: 23%;
635
+ margin: 1%;
636
+ }
637
+ #sc_our_team.grid_circles.sc-col2 .sc_team_member{
638
+ width: 48%;
639
+ margin: 1%;
640
+ }
641
+ #sc_our_team.sc-col5 .sc_team_member{
642
+ width: 17%;
643
+ margin: 1%;
644
+ }
645
+ #sc_our_team.sc-col10 .sc_team_member{
646
+ width: 10%;
647
+ }
648
+ #sc_our_team .sc_team_member img.wp-post-image{
649
+
650
+ }
651
+ #sc_our_team .sc_team_member_inner{
652
+
653
+ }
654
+
655
+ .sc_team_single_member .sc_single_side{
656
+ float: left;
657
+ width: 25%;
658
+
659
+ box-sizing: border-box;
660
+
661
+ }
662
+ .sc_team_single_member .sc_single_main{
663
+ float: left;
664
+ width: 71%;
665
+ margin-left: 2%;
666
+ padding: 15px;
667
+ box-sizing: border-box;
668
+ background: rgba(150,150,150,0.2);
669
+ }
670
+ .sc_team_single_member .sc_single_main.sc-skills{
671
+ width: 46%;
672
+ margin-right: 2%;
673
+ }
674
+ .sc_team_single_member .sc_team_single_skills{
675
+ width: 25%;
676
+ float: left;
677
+
678
+ }
679
+ .sc_team_single_member .wp-post-image{
680
+ width: 100%;
681
+ }
682
+
683
+ .width25{
684
+ width: 25%;
685
+ padding: 0 15px;
686
+ }
687
+ .width50{
688
+ width: 50%;
689
+ padding: 0 15px;
690
+ }
691
+ .width75{
692
+ width: 75%;
693
+ padding: 0 15px;
694
+ }
695
+
696
+ }
697
+
698
+ @media (min-width: 481px) and (max-width: 767px){
699
+ .grid#sc_our_team .sc_team_member{
700
+ float: left;
701
+ width: 33.33%;
702
+ }
703
+ }
704
+ @media (max-width: 480px){
705
+ .grid#sc_our_team .sc_team_member{
706
+ float: left;
707
+ width: 50%;
708
+ }
709
+ }
inc/style/sc_our_team_admin.css ADDED
@@ -0,0 +1,114 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ Document : sc_our_team_admin
3
+ Created on : Jun 25, 2014, 10:07:44 PM
4
+ Author : Bilal
5
+ Description:
6
+ Purpose of the stylesheet follows.
7
+ */
8
+
9
+ root {
10
+ display: block;
11
+ }
12
+
13
+ .sc_team_member{
14
+ width: 20%;
15
+ float: left;
16
+ overflow: hidden;
17
+ }
18
+ .sc_team_member img{
19
+ width: 100%;
20
+ }
21
+
22
+ .sc_team_member_update_status .sc_team_member_updating,
23
+ .sc_team_member_update_status .sc_team_member_saved{
24
+ display: none;
25
+ }
26
+
27
+ .sc_team_member_inner{
28
+ height: 100%;
29
+ width: 100%;
30
+ position: relative;
31
+ }
32
+ .sc_team_member_overlay{
33
+ position: absolute;
34
+ height: 20px;
35
+ color: #fff;
36
+ width: 100%;
37
+ bottom: -5px;
38
+ left: 0;
39
+ line-height: 20px;
40
+ background: rgba(50,50,50,0.5);
41
+ }
42
+
43
+ #features {
44
+ margin: auto;
45
+ width: 460px;
46
+ font-size: 0.9em;
47
+ }
48
+ .connected, .sortable, .exclude, .handles {
49
+ margin: auto;
50
+ padding: 0;
51
+ width: 450px;
52
+ -webkit-touch-callout: none;
53
+ -webkit-user-select: none;
54
+ -khtml-user-select: none;
55
+ -moz-user-select: none;
56
+ -ms-user-select: none;
57
+ user-select: none;
58
+ }
59
+ .sortable.grid {
60
+ overflow: hidden;
61
+ }
62
+ .connected li, .sortable li, .exclude li, .handles li {
63
+ list-style: none;
64
+ border: 1px solid #CCC;
65
+ background: #F6F6F6;
66
+ font-family: "Tahoma";
67
+ color: #1C94C4;
68
+ margin: 5px;
69
+ padding: 5px;
70
+ height: 22px;
71
+ }
72
+ .handles span {
73
+ cursor: move;
74
+ }
75
+ li.disabled {
76
+ opacity: 0.5;
77
+ }
78
+ .sortable.grid li {
79
+ line-height: 80px;
80
+ float: left;
81
+ width: 80px;
82
+ height: 80px;
83
+ text-align: center;
84
+ }
85
+ li.highlight {
86
+ background: #FEE25F;
87
+ }
88
+ #connected {
89
+ width: 440px;
90
+ overflow: hidden;
91
+ margin: auto;
92
+ }
93
+ .connected {
94
+ float: left;
95
+ width: 200px;
96
+ }
97
+ .connected.no2 {
98
+ float: right;
99
+ }
100
+ li.sortable-placeholder {
101
+ border: 1px dashed #CCC;
102
+ background: none;
103
+ }
104
+ .sc_options_table{
105
+ float: left;
106
+ width: 45%;
107
+
108
+ }
109
+ .sc_options_table a.button{
110
+ /*margin-bottom: 5px;*/
111
+ }
112
+ #smartcat_team_member_info_box .sc_options_table h2{
113
+ margin: 0;
114
+ }
inc/template/grid.php ADDED
@@ -0,0 +1,118 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ * Short description
4
+ * @author bilal hassan <info@smartcatdesign.net>
5
+ *
6
+ */
7
+ $args = $this->sc_get_args( $group );
8
+ $members = new WP_Query( $args );
9
+ ?>
10
+ <div id="sc_our_team" class="<?php echo $template == '' ? $this->options[ 'template' ] : $template; echo ' sc-col' . $this->options['columns']; ?>">
11
+ <div class="clear"></div>
12
+ <?php
13
+ if ( $members->have_posts() ) {
14
+ while ( $members->have_posts() ) {
15
+ $members->the_post();
16
+ ?>
17
+ <div itemscope itemtype="http://schema.org/Person" class="sc_team_member">
18
+ <div class="sc_team_member_inner">
19
+
20
+ <?php
21
+ if ( has_post_thumbnail() )
22
+ echo the_post_thumbnail( 'medium' );
23
+ else {
24
+ echo '<img src="' . SC_TEAM_URL . 'inc/img/noprofile.jpg" class="attachment-medium wp-post-image"/>';
25
+ }
26
+ ?>
27
+
28
+ <?php if( 'yes' == $this->options['name'] ) : ?>
29
+ <div itemprop="name" class="sc_team_member_name">
30
+ <a href="<?php the_permalink() ?>" rel="bookmark" >
31
+ <?php the_title() ?>
32
+ </a>
33
+ </div>
34
+ <?php endif; ?>
35
+
36
+ <?php if( 'yes' == $this->options['title'] ) : ?>
37
+ <div itemprop="jobtitle" class="sc_team_member_jobtitle">
38
+ <?php echo get_post_meta( get_the_ID(), 'team_member_title', true ); ?>
39
+ </div>
40
+ <?php endif; ?>
41
+
42
+
43
+ <div class="sc_team_content">
44
+ <?php the_content(); ?>
45
+ </div>
46
+
47
+ <div class='icons <?php echo 'yes' == $this->options[ 'social' ] ? '' : 'hidden'; ?>'>
48
+
49
+ <?php
50
+ $facebook = get_post_meta( get_the_ID(), 'team_member_facebook', true );
51
+ $twitter = get_post_meta( get_the_ID(), 'team_member_twitter', true );
52
+ $linkedin = get_post_meta( get_the_ID(), 'team_member_linkedin', true );
53
+ $gplus = get_post_meta( get_the_ID(), 'team_member_gplus', true );
54
+ $email = get_post_meta( get_the_ID(), 'team_member_email', true );
55
+
56
+ $this->get_social( $facebook, $twitter, $linkedin, $gplus, $email );
57
+ ?>
58
+
59
+ </div>
60
+
61
+ <div class="sc_team_skills">
62
+
63
+ <?php if( get_post_meta( get_the_ID(), 'team_member_skill1', true) ) : ?>
64
+ <?php echo get_post_meta( get_the_ID(), 'team_member_skill1', true); ?>
65
+ <?php endif; ?>
66
+
67
+ <?php if( get_post_meta( get_the_ID(), 'team_member_skill_value1', true) ) : ?>
68
+ <div class="progress" style="width: <?php echo get_post_meta( get_the_ID(), 'team_member_skill_value1', true); ?>0%"></div>
69
+ <?php endif; ?>
70
+
71
+
72
+ <?php if( get_post_meta( get_the_ID(), 'team_member_skill2', true) ) : ?>
73
+ <?php echo get_post_meta( get_the_ID(), 'team_member_skill2', true); ?>
74
+ <?php endif; ?>
75
+
76
+ <?php if( get_post_meta( get_the_ID(), 'team_member_skill_value2', true) ) : ?>
77
+ <div class="progress" style="width: <?php echo get_post_meta( get_the_ID(), 'team_member_skill_value2', true); ?>0%"></div>
78
+ <?php endif; ?>
79
+
80
+
81
+ <?php if( get_post_meta( get_the_ID(), 'team_member_skill3', true) ) : ?>
82
+ <?php echo get_post_meta( get_the_ID(), 'team_member_skill3', true); ?>
83
+ <?php endif; ?>
84
+
85
+ <?php if( get_post_meta( get_the_ID(), 'team_member_skill_value4', true) ) : ?>
86
+ <div class="progress" style="width: <?php echo get_post_meta( get_the_ID(), 'team_member_skill_value4', true); ?>0%"></div>
87
+ <?php endif; ?>
88
+
89
+
90
+ <?php if( get_post_meta( get_the_ID(), 'team_member_skill1', true) ) : ?>
91
+ <?php echo get_post_meta( get_the_ID(), 'team_member_skill1', true); ?>
92
+ <?php endif; ?>
93
+
94
+ <?php if( get_post_meta( get_the_ID(), 'team_member_skill_value1', true) ) : ?>
95
+ <div class="progress" style="width: <?php echo get_post_meta( get_the_ID(), 'team_member_skill_value1', true); ?>0%"></div>
96
+ <?php endif; ?>
97
+
98
+
99
+ </div>
100
+
101
+
102
+ <div class="sc_team_member_overlay"></div>
103
+ <div class="sc_team_more">
104
+ <a href="<?php the_permalink() ?>" rel="bookmark" class="">
105
+ <img src="<?php echo SC_TEAM_URL . 'inc/img/more.png'?>"/>
106
+ </a>
107
+ </div>
108
+ </div>
109
+
110
+ </div>
111
+ <?php
112
+ }
113
+ } else {
114
+ echo 'There are no team members to display';
115
+ }
116
+ ?>
117
+ <div class="clear"></div>
118
+ </div>
inc/template/grid_circles.php ADDED
@@ -0,0 +1,117 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Created by Bilal Hassan.
4
+ * Date: 2014-06-26
5
+ * Time: 11:04 AM
6
+ */
7
+ $args = $this->sc_get_args( $group );
8
+ $members = new WP_Query( $args );
9
+ ?>
10
+ <div id="sc_our_team" class="<?php echo $template == '' ? $this->options[ 'template' ] : $template; echo ' sc-col' . $this->options['columns']; ?>">
11
+ <!--<div class="clear"></div>-->
12
+ <?php
13
+ if ( $members->have_posts() ) {
14
+ while ( $members->have_posts() ) {
15
+ $members->the_post();
16
+ ?>
17
+ <div itemscope itemtype="http://schema.org/Person" class="sc_team_member">
18
+ <div class="sc_team_member_inner">
19
+ <?php
20
+ if ( has_post_thumbnail() )
21
+ echo the_post_thumbnail( 'medium' );
22
+ else {
23
+ echo '<img src="' . SC_TEAM_URL . 'inc/img/noprofile.jpg" class="attachment-medium wp-post-image"/>';
24
+ }
25
+ ?>
26
+
27
+ <?php if( 'yes' == $this->options['name'] ) : ?>
28
+ <div itemprop="name" class="sc_team_member_name">
29
+ <a href="<?php the_permalink() ?>" rel="bookmark" >
30
+ <?php the_title() ?>
31
+ </a>
32
+ </div>
33
+ <?php endif; ?>
34
+
35
+ <?php if( 'yes' == $this->options['title'] ) : ?>
36
+ <div itemprop="jobtitle" class="sc_team_member_jobtitle">
37
+ <?php echo get_post_meta( get_the_ID(), 'team_member_title', true ); ?>
38
+ </div>
39
+ <?php endif; ?>
40
+
41
+
42
+ <div class="sc_team_content">
43
+ <?php the_content(); ?>
44
+ </div>
45
+
46
+ <div class='icons <?php echo 'yes' == $this->options[ 'social' ] ? '' : 'hidden'; ?>'>
47
+
48
+ <?php
49
+ $facebook = get_post_meta( get_the_ID(), 'team_member_facebook', true );
50
+ $twitter = get_post_meta( get_the_ID(), 'team_member_twitter', true );
51
+ $linkedin = get_post_meta( get_the_ID(), 'team_member_linkedin', true );
52
+ $gplus = get_post_meta( get_the_ID(), 'team_member_gplus', true );
53
+ $email = get_post_meta( get_the_ID(), 'team_member_email', true );
54
+
55
+ $this->get_social( $facebook, $twitter, $linkedin, $gplus, $email );
56
+ ?>
57
+
58
+ </div>
59
+
60
+ <div class="sc_team_skills">
61
+
62
+ <?php if( get_post_meta( get_the_ID(), 'team_member_skill1', true) ) : ?>
63
+ <?php echo get_post_meta( get_the_ID(), 'team_member_skill1', true); ?>
64
+ <?php endif; ?>
65
+
66
+ <?php if( get_post_meta( get_the_ID(), 'team_member_skill_value1', true) ) : ?>
67
+ <div class="progress" style="width: <?php echo get_post_meta( get_the_ID(), 'team_member_skill_value1', true); ?>0%"></div>
68
+ <?php endif; ?>
69
+
70
+
71
+ <?php if( get_post_meta( get_the_ID(), 'team_member_skill2', true) ) : ?>
72
+ <?php echo get_post_meta( get_the_ID(), 'team_member_skill2', true); ?>
73
+ <?php endif; ?>
74
+
75
+ <?php if( get_post_meta( get_the_ID(), 'team_member_skill_value2', true) ) : ?>
76
+ <div class="progress" style="width: <?php echo get_post_meta( get_the_ID(), 'team_member_skill_value2', true); ?>0%"></div>
77
+ <?php endif; ?>
78
+
79
+
80
+ <?php if( get_post_meta( get_the_ID(), 'team_member_skill3', true) ) : ?>
81
+ <?php echo get_post_meta( get_the_ID(), 'team_member_skill3', true); ?>
82
+ <?php endif; ?>
83
+
84
+ <?php if( get_post_meta( get_the_ID(), 'team_member_skill_value4', true) ) : ?>
85
+ <div class="progress" style="width: <?php echo get_post_meta( get_the_ID(), 'team_member_skill_value4', true); ?>0%"></div>
86
+ <?php endif; ?>
87
+
88
+
89
+ <?php if( get_post_meta( get_the_ID(), 'team_member_skill1', true) ) : ?>
90
+ <?php echo get_post_meta( get_the_ID(), 'team_member_skill1', true); ?>
91
+ <?php endif; ?>
92
+
93
+ <?php if( get_post_meta( get_the_ID(), 'team_member_skill_value1', true) ) : ?>
94
+ <div class="progress" style="width: <?php echo get_post_meta( get_the_ID(), 'team_member_skill_value1', true); ?>0%"></div>
95
+ <?php endif; ?>
96
+
97
+
98
+ </div>
99
+
100
+
101
+ <div class="sc_team_member_overlay"></div>
102
+
103
+ <div class="sc_team_more">
104
+ <a href="<?php the_permalink() ?>" rel="bookmark" class="<?php echo 'vcard' == $this->options['single_template'] ? 'sc_team_single_popup' : '' ?>">
105
+ <img src="<?php echo SC_TEAM_URL . 'inc/img/more.png'?>"/>
106
+ </a>
107
+ </div>
108
+ </div>
109
+ </div>
110
+ <?php
111
+ }
112
+ } else {
113
+ echo 'There are no team members to display';
114
+ }
115
+ ?>
116
+ <div class="clear"></div>
117
+ </div>
inc/template/standard.php ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /*
4
+ * Here comes the text of your license
5
+ * Each line should be prefixed with *
6
+ */
7
+
inc/template/vcard.php ADDED
@@ -0,0 +1,69 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ get_header();
3
+ $options = get_option( 'smartcat_team_options' );
4
+ ?>
5
+ <?php
6
+ $facebook = get_post_meta( get_the_ID(), 'team_member_facebook', true );
7
+ $twitter = get_post_meta( get_the_ID(), 'team_member_twitter', true );
8
+ $linkedin = get_post_meta( get_the_ID(), 'team_member_linkedin', true );
9
+ $gplus = get_post_meta( get_the_ID(), 'team_member_gplus', true );
10
+ $email = get_post_meta( get_the_ID(), 'team_member_email', true );
11
+ ?>
12
+ <div>
13
+ <?php while ( have_posts() ) : the_post(); ?>
14
+ <div class="sc_team_single_member <?php echo $options[ 'single_template' ]; ?>">
15
+
16
+ <div class="sc_single_side" itemscope itemtype="http://schema.org/Person">
17
+
18
+ <div class="inner">
19
+ <?php echo the_post_thumbnail( 'medium' ); ?>
20
+ <h2 class="name" itemprop="name"><?php echo the_title(); ?></h2>
21
+ <h3 class="title" itemprop="jobtitle"><?php echo get_post_meta( get_the_ID(), 'team_member_title', true ); ?></h3>
22
+ <ul class="social">
23
+ <?php if ( $facebook ) : ?><li><a href="<?php echo $facebook; ?>"><img src="<?php echo SC_TEAM_URL; ?>inc/img/fb.png" class="sc-social"/>Facebook</a></li><?php endif; ?>
24
+ <?php if ( $twitter ) : ?><li><a href="<?php echo $twitter; ?>"><img src="<?php echo SC_TEAM_URL; ?>inc/img/twitter.png" class="sc-social"/>Twitter</a></li><?php endif; ?>
25
+ <?php if ( $linkedin ) : ?><li><a href="<?php echo $linkedin; ?>"><img src="<?php echo SC_TEAM_URL; ?>inc/img/linkedin.png" class="sc-social"/>Linkedin</a></li><?php endif; ?>
26
+ <?php if ( $gplus ) : ?><li><a href="<?php echo $gplus; ?>"><img src="<?php echo SC_TEAM_URL; ?>inc/img/google.png" class="sc-social"/>Google Plus</a></li><?php endif; ?>
27
+ <?php if ( $email ) : ?><li><a href="mailto:<?php echo $email; ?>"><img src="<?php echo SC_TEAM_URL; ?>inc/img/email.png" class="sc-social"/><?php echo $email; ?></a></li><?php endif; ?>
28
+ </ul>
29
+ </div>
30
+ </div>
31
+
32
+ <div class="sc_single_main <?php echo 'yes' == $options['single_skills'] ? 'sc-skills' : ''; ?>">
33
+ <?php echo the_content(); ?>
34
+ </div>
35
+ <?php if( 'yes' == $options['single_skills'] ) : ?>
36
+ <div class="sc_team_single_skills">
37
+ <div class="inner">
38
+ <?php //echo get_post_meta( get_the_ID(), 'team_member_skill1', TRUE); ?>
39
+ <div class="progress">
40
+ <div class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="40" aria-valuemin="0" aria-valuemax="100" style="width: 40%">
41
+ <span class="sr-only">40% Complete (success)</span>
42
+ </div>
43
+ </div>
44
+
45
+ <div class="progress">
46
+ <div class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="40" aria-valuemin="0" aria-valuemax="100" style="width: 40%">
47
+ <span class="sr-only">40% Complete (success)</span>
48
+ </div>
49
+ </div>
50
+
51
+ <div class="progress">
52
+ <div class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="40" aria-valuemin="0" aria-valuemax="100" style="width: 40%">
53
+ <span class="sr-only">40% Complete (success)</span>
54
+ </div>
55
+ </div>
56
+
57
+ <div class="progress">
58
+ <div class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="40" aria-valuemin="0" aria-valuemax="100" style="width: 40%">
59
+ <span class="sr-only">40% Complete (success)</span>
60
+ </div>
61
+ </div>
62
+ </div>
63
+ </div>
64
+ <?php endif; ?>
65
+ </div>
66
+
67
+ <?php endwhile; ?>
68
+ </div>
69
+ <?php get_footer(); ?>
inc/{widget.php → template/widget.php} RENAMED
@@ -5,8 +5,12 @@
5
  * @author bilal hassan <info@smartcatdesign.net>
6
  *
7
  */
8
-
9
- $args = sc_get_args();
 
 
 
 
10
  $team = new WP_Query($args);
11
  ?>
12
  <div id="sc_our_team" class="widget">
5
  * @author bilal hassan <info@smartcatdesign.net>
6
  *
7
  */
8
+ $args = array(
9
+ 'post_type' => 'team_member',
10
+ 'meta_key' => 'sc_member_order',
11
+ 'orderby' => 'meta_value',
12
+ 'order' => 'ASC'
13
+ );
14
  $team = new WP_Query($args);
15
  ?>
16
  <div id="sc_our_team" class="widget">
readme.txt CHANGED
@@ -1,17 +1,17 @@
1
  === Our Team Showcase ===
2
  Contributors: smartcat
3
  Donate link: http://smartcatdesign.net
4
- Tags: team, page, widget, shortcode, members, title, sidebar, honeycomb, stack, custom, shortcode, template, social, profile, custom post type
5
  Requires at least: 3.2
6
- Tested up to: 3.91
7
- Stable tag: 1.2
8
  License: GPLv2 or later
9
 
10
- The best way to display your employees, team members, or any type of list. SEO friendly, comes with multiple templates & drag & drop re-order functionality. Ready out of the box! Display your team members in a professional and modern style.
11
 
12
  == Description ==
13
 
14
- [View Demo](http://smartcatdesign.net/our-team-showcase/)
15
  This demo shows you the grid style template.
16
 
17
  * This plugin allows you to add, edit, search and display your team members on any page, or in a widget
@@ -36,6 +36,13 @@ quickly and easily.
36
 
37
  == Changelog ==
38
 
 
 
 
 
 
 
 
39
  = 1.2 =
40
  1. Fix bug with team showing above all content
41
  2. Added option to control how many members to output
1
  === Our Team Showcase ===
2
  Contributors: smartcat
3
  Donate link: http://smartcatdesign.net
4
+ Tags: team, staff, employees, widget, shortcode, members, honeycomb, stack, grid, custom, template, social, profile, custom post type, portfolio, profile,meet team, skills, cv,v-card
5
  Requires at least: 3.2
6
+ Tested up to: 4.1
7
+ Stable tag: 1.3
8
  License: GPLv2 or later
9
 
10
+ The best way to display your employees, team members, or any type of list. Multiple appealing templates,SEO friendly, re-order functionality.
11
 
12
  == Description ==
13
 
14
+ [View Demo](http://smartcatdesign.net/our-team-showcase-demo/)
15
  This demo shows you the grid style template.
16
 
17
  * This plugin allows you to add, edit, search and display your team members on any page, or in a widget
36
 
37
  == Changelog ==
38
 
39
+ = 2.0 =
40
+ 1. Major appearance and functionality changes
41
+ 2. updated pro version
42
+
43
+ = 1.3 =
44
+ 1. sanitization fixes
45
+
46
  = 1.2 =
47
  1. Fix bug with team showing above all content
48
  2. Added option to control how many members to output
sc_our_team.php CHANGED
@@ -1,422 +1,36 @@
1
  <?php
2
  /*
3
  Plugin Name: Our Team Showcase
4
- Plugin URI: http://smartcatdesign.net/our-team-showcase/
5
  Description: Display your team members in a very attractive way as a widget or page with a shortcode
6
- Version: 1.3
7
  Author: SmartCat
8
  Author URI: http://smartcatdesign.net
9
  License: GPL v2
10
- */
11
-
12
- if(!defined('SC_TEAM_PATH'))
13
- define('SC_TEAM_PATH', plugin_dir_url(__FILE__));
14
-
15
-
16
- register_activation_hook(__FILE__, 'sc_team');
17
-
18
- function sc_team() {
19
- add_option('sc_team_activation_redirect', true);
20
- flush_rewrite_rules();
21
- sc_team_register_options();
22
- }
23
-
24
- function sc_team_register_options() {
25
- // declare options array
26
- $sc_team_options = array(
27
- 'sc_our_team_template' => 'grid',
28
- 'sc_our_team_social' => 'yes',
29
- 'sc_our_team_profile_link' => 'yes',
30
- 'sc_our_team_member_count' => -1,
31
-
32
- );
33
- // check if option is set, if not, add it
34
- foreach ($sc_team_options as $option_name => $option_value) {
35
- if (get_option($option_name) === false) {
36
- add_option($option_name, $option_value);
37
- } else {
38
- update_option($option_name, addslashes($_POST[$option_name]));
39
- }
40
- }
41
- }
42
-
43
- // redirect when activated
44
- add_action('admin_init', 'sc_team_activation_redirect');
45
-
46
- function sc_team_activation_redirect() {
47
- if (get_option('sc_team_activation_redirect', false)) {
48
- delete_option('sc_team_activation_redirect');
49
- wp_redirect(admin_url() . 'edit.php?post_type=team_member&page=sc_team_settings');
50
- }
51
- }
52
-
53
- /**
54
- * Hook implements admin_menu
55
- * function adds menu and calls options function
56
- * function adds submenu and calls reorder function
57
- */
58
- add_action('admin_menu', 'sc_team_menu');
59
-
60
- function sc_team_menu() {
61
- // add_options_page('Our Team Plugin Settings', 'Our Team Settings', 'administrator', 'sc_team_options.php', 'sc_team_options');
62
- add_submenu_page('edit.php?post_type=team_member', 'Settings', 'Settings', 'administrator', 'sc_team_settings', 'sc_team_settings');
63
- add_submenu_page('edit.php?post_type=team_member', 'Re-Order Members', 'Re-Order Members', 'administrator', 'sc_team_reorder', 'sc_team_reorder');
64
- }
65
-
66
- function sc_team_reorder() {
67
- include_once 'inc/reorder.php';
68
- }
69
-
70
- function sc_team_settings() {
71
-
72
- if (isset($_REQUEST['sc_our_team_save']) && $_REQUEST['sc_our_team_save'] == 'Update') {
73
- sc_team_register_options();
74
- }
75
- include_once 'inc/options.php';
76
- }
77
-
78
- /**
79
- * Hook implements admin_head
80
- * Function sets menu icon
81
- */
82
- add_action('admin_head', 'sc_team_add_menu_icon');
83
-
84
- function sc_team_add_menu_icon() {
85
- ?>
86
- <style>
87
- /* #adminmenu .menu-icon-team_member div.wp-menu-image:before {
88
- content: '\f338';
89
- }*/
90
- </style>
91
- <?php
92
- }
93
-
94
- /**
95
- * Hook implements wp_enqueue_scripts
96
- * function loads plugin styles and scripts
97
- */
98
- function my_enqueue($hook) {
99
- wp_enqueue_style('sc_team_admin_style', SC_TEAM_PATH . 'style/sc_our_team_admin.css');
100
- wp_enqueue_script('my_custom_script', SC_TEAM_PATH . 'script/sc_our_team_admin.js', array('jquery'));
101
- }
102
-
103
- add_action('admin_enqueue_scripts', 'my_enqueue');
104
-
105
- add_action('wp_enqueue_scripts', 'sc_team_load_styles_scripts');
106
-
107
- function sc_team_load_styles_scripts() {
108
- // plugin main style
109
- wp_enqueue_style('sc_team_default_style', plugin_dir_url(__FILE__) . 'style/sc_our_team.css', false, '1.2');
110
-
111
- // plugin main script
112
- wp_enqueue_script('sc_team_default_script', plugin_dir_url(__FILE__) . 'script/sc_our_team.js', array('jquery'), '1.2');
113
- }
114
-
115
- /**
116
  *
 
 
117
  */
118
- add_shortcode('our-team', 'set_our_team');
119
- function set_our_team($atts) {
120
- extract(shortcode_atts(array(
121
- ), $atts));
122
- global $content;
123
-
124
- ob_start();
125
-
126
- if (get_option('sc_our_team_template') === false or get_option('sc_our_team_template') == '') {
127
- include 'inc/grid.php';
128
- $output = ob_get_clean();
129
- } else {
130
- include 'inc/' . esc_attr( get_option('sc_our_team_template') ) . '.php';
131
- $output = ob_get_clean();
132
- }
133
- return $output;
134
- }
135
-
136
- /**
137
- * Hook implements init
138
- * function creates and registers custom post type
139
- */
140
- add_action('init', 'team_members');
141
-
142
- function team_members() {
143
- $labels = array(
144
- 'name' => _x('Team', 'post type general name'),
145
- 'singular_name' => _x('Team Member', 'post type singular name'),
146
- 'add_new' => _x('Add New', 'book'),
147
- 'add_new_item' => __('Add New Member'),
148
- 'edit_item' => __('Edit Member'),
149
- 'new_item' => __('New Team Member'),
150
- 'all_items' => __('All Team Members'),
151
- 'view_item' => __('View Team Member'),
152
- 'search_items' => __('Search Team Members'),
153
- 'not_found' => __('No member found'),
154
- 'not_found_in_trash' => __('No member found in the Trash'),
155
- 'parent_item_colon' => '',
156
- 'menu_name' => 'Our Team'
157
- );
158
- $args = array(
159
- 'labels' => $labels,
160
- 'description' => 'Holds our team members specific data',
161
- 'public' => true,
162
- 'menu_position' => 5,
163
- 'menu_icon' => SC_TEAM_PATH . 'img/icon.png',
164
- 'supports' => array('title', 'editor', 'thumbnail'),
165
- 'has_archive' => true,
166
- );
167
- register_post_type('team_member', $args);
168
- //Ensure the $wp_rewrite global is loaded
169
- global $wp_rewrite;
170
- //Call flush_rules() as a method of the $wp_rewrite object
171
- $wp_rewrite->flush_rules( false );
172
- }
173
-
174
- /**
175
- * Hook to add custom fields box
176
- * calls a function
177
- */
178
- add_action('add_meta_boxes', 'team_member_info_box');
179
-
180
- function team_member_info_box() {
181
- add_meta_box(
182
- 'team_member_info_box', __('Additional Information', 'myplugin_textdomain'), 'team_member_info_box_content', 'team_member', 'advanced', 'high'
183
- );
184
- }
185
-
186
- /**
187
- * function called by team_member_info_box
188
- */
189
- function team_member_info_box_content($post) {
190
- //nonce
191
- wp_nonce_field(plugin_basename(__FILE__), 'team_member_info_box_content_nonce');
192
-
193
- //social
194
-
195
- echo '<p><em>Fields that are left blank, will simply not display any output</em></p>';
196
-
197
- echo '<table>';
198
-
199
- echo '<tr><td><lablel for="team_member_title">Job Title</lablel></td>';
200
- echo '<td><input type="text" value="' . get_post_meta($post->ID, 'team_member_title', true) . '" id="team_member_title" name="team_member_title" placeholder="Enter Job Title"/></td></tr>';
201
-
202
- echo '<tr><td><lablel for="team_member_email">Email Address</lablel></td>';
203
- echo '<td><input type="text" value="' . get_post_meta($post->ID, 'team_member_email', true) . '" id="team_member_email" name="team_member_email" placeholder="Enter Email Address"/></td></tr>';
204
-
205
- echo '<tr><td><lablel for="team_member_facebook">Facebook URL</lablel></td>';
206
- echo '<td><input type="text" value="' . get_post_meta($post->ID, 'team_member_facebook', true) . '" id="team_member_facebook" name="team_member_facebook" placeholder="Enter Facebook URL"/></td></tr>';
207
-
208
- echo '<tr><td><label for="team_member_twitter">Twitter URL</lablel></td>';
209
- echo '<td><input type="text" value="' . get_post_meta($post->ID, 'team_member_twitter', true) . '" id="team_member_twitter" name="team_member_twitter" placeholder="Enter Twitter URL"/></td></tr>';
210
-
211
- echo '<tr><td><lablel for="team_member_linkedin">Linkedin URL</lablel></td>';
212
- echo '<td><input type="text" value="' . get_post_meta($post->ID, 'team_member_linkedin', true) . '" id="team_member_linkedin" name="team_member_linkedin" placeholder="Enter Linkedin URL"/></td></tr>';
213
-
214
- echo '<tr><td><lablel for="team_member_gplus">Google Plus URL</lablel></td>';
215
- echo '<td><input type="text" value="' . get_post_meta($post->ID, 'team_member_gplus', true) . '" id="team_member_gplus" name="team_member_gplus" placeholder="Enter Google Plus URL"/></td></tr>';
216
-
217
- echo '</table>';
218
- }
219
-
220
- /**
221
- * Hook that handles submitted data
222
- */
223
- add_action('save_post', 'team_member_box_save');
224
-
225
- function team_member_box_save($post_id) {
226
-
227
- $slug = 'team_member';
228
-
229
- if (isset($_POST['post_type'])) {
230
- if ($slug != $_POST['post_type']) {
231
- return;
232
- }
233
- }
234
 
235
- // get var values
236
- if (get_post_meta($post_id, 'sc_member_order', true) == '' || get_post_meta($post_id, 'sc_member_order', true) === FALSE)
237
- update_post_meta($post_id, 'sc_member_order', 0);
238
 
239
-
240
- if (isset($_REQUEST['team_member_title'])) {
241
- $facebook_url = $_POST['team_member_title'];
242
- update_post_meta($post_id, 'team_member_title', $facebook_url);
243
- }
244
-
245
- if (isset($_REQUEST['team_member_email'])) {
246
- $facebook_url = $_POST['team_member_email'];
247
- update_post_meta($post_id, 'team_member_email', $facebook_url);
248
- }
249
-
250
-
251
- if (isset($_REQUEST['team_member_facebook'])) {
252
- $facebook_url = $_POST['team_member_facebook'];
253
- update_post_meta($post_id, 'team_member_facebook', $facebook_url);
254
- }
255
-
256
- if (isset($_REQUEST['team_member_twitter'])) {
257
- $twitter_url = $_POST['team_member_twitter'];
258
- update_post_meta($post_id, 'team_member_twitter', $twitter_url);
259
- }
260
-
261
- if (isset($_REQUEST['team_member_linkedin'])) {
262
- $linkedin_url = $_POST['team_member_linkedin'];
263
- update_post_meta($post_id, 'team_member_linkedin', $linkedin_url);
264
- }
265
-
266
- if (isset($_REQUEST['team_member_gplus'])) {
267
- $gplus_url = $_POST['team_member_gplus'];
268
- update_post_meta($post_id, 'team_member_gplus', $gplus_url);
269
- }
270
  }
 
 
 
 
271
 
272
- /**
273
- * Create custom widget
274
- */
275
- // Creating the widget
276
- class sc_team_widget extends WP_Widget {
277
-
278
- function __construct() {
279
- parent::__construct(
280
- 'sc_team_widget', __('Our Team Widget', 'sc_team_widget_domain'), array('description' => __('Use this widget to display the Our Team anywhere on the site.', 'sc_team_widget_domain'),)
281
- );
282
- }
283
 
284
- // Creating widget front-end
285
- // This is where the action happens
286
- public function widget($args, $instance) {
287
- $title = apply_filters('widget_title', $instance['title']);
288
 
289
- // before and after widget arguments are defined by themes
290
- echo $args['before_widget'];
291
- if (!empty($title))
292
- echo $args['before_title'] . $title . $args['after_title'];
293
 
294
- // This is where you run the code and display the output
295
- include 'inc/widget.php';
296
- // echo $args['after_title'];
297
- }
298
 
299
- // Widget Backend
300
- public function form($instance) {
301
- if (isset($instance['title'])) {
302
- $title = $instance['title'];
303
- } else {
304
- $title = __('Meet Our Team', 'sc_team_widget_domain');
305
- }
306
- // Widget admin form
307
- ?>
308
- <p>
309
- <label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:'); ?></label>
310
- <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); ?>" />
311
- </p>
312
- <?php
313
- }
314
 
315
- // Updating widget replacing old instances with new
316
- public function update($new_instance, $old_instance) {
317
- $instance = array();
318
- $instance['title'] = (!empty($new_instance['title']) ) ? strip_tags($new_instance['title']) : '';
319
- return $instance;
320
- }
321
 
322
- }
323
-
324
- // Class sc_team_widget ends here
325
- // Register and load the widget
326
- function wpb_load_widget() {
327
- register_widget('sc_team_widget');
328
- }
329
 
330
- add_action('widgets_init', 'wpb_load_widget');
331
-
332
-
333
- /**
334
- * Show post thumbnails on backend
335
- */
336
- add_filter('manage_posts_columns', 'posts_columns', 5);
337
- add_action('manage_posts_custom_column', 'posts_custom_columns', 5, 2);
338
-
339
- function posts_columns($defaults) {
340
- $defaults['riv_post_thumbs'] = __('Profile Picture');
341
- return $defaults;
342
- }
343
-
344
- function posts_custom_columns($column_name, $id) {
345
- if ($column_name === 'riv_post_thumbs') {
346
- echo the_post_thumbnail('thumbnail');
347
- }
348
- }
349
-
350
- /**
351
- * ajax function to update post order
352
- */
353
- add_action('wp_ajax_my_update_pm', 'sc_team_update_order');
354
- add_action('wp_ajax_nopriv_my_update_pm', 'sc_team_update_order');
355
-
356
- function sc_team_update_order() {
357
- $post_id = $_POST['id'];
358
- $sc_member_order = $_POST['sc_member_order'];
359
- //update_post_meta($post_id, $meta_key, $sc_member_order)
360
- update_post_meta($post_id, 'sc_member_order', $sc_member_order);
361
- }
362
-
363
- /**
364
- * Aux functions
365
- */
366
- //social function
367
- function get_social($facebook, $twitter, $linkedin, $gplus, $email) {
368
- if ('yes' == get_option('sc_our_team_social')) {
369
- if ($facebook != '')
370
- echo '<a href="' . $facebook . '"><img src="' . SC_TEAM_PATH . 'img/fb.png" class="sc-social"/></a>';
371
- if ($twitter != '')
372
- echo '<a href="' . $twitter . '"><img src="' . SC_TEAM_PATH . 'img/twitter.png" class="sc-social"/></a>';
373
- if ($linkedin != '')
374
- echo '<a href="' . $linkedin . '"><img src="' . SC_TEAM_PATH . 'img/linkedin.png" class="sc-social"/></a>';
375
- if ($gplus != '')
376
- echo '<a href="' . $gplus . '"><img src="' . SC_TEAM_PATH . 'img/google.png" class="sc-social"/></a>';
377
- if ($email != '')
378
- echo '<a href=mailto:"' . $email . '"><img src="' . SC_TEAM_PATH . 'img/email.png" class="sc-social"/></a>';
379
- }
380
- }
381
-
382
-
383
- function get_custom_post_type_template($single_template) {
384
- global $post;
385
-
386
- if ($post->post_type == 'my_post_type') {
387
- $single_template = dirname( __FILE__ ) . '/post-type-template.php';
388
- }
389
- return $single_template;
390
- }
391
- add_filter( 'single_template', 'get_custom_post_type_template' );
392
-
393
-
394
- function sc_get_args(){
395
- $args = array(
396
- 'post_type' => 'team_member',
397
- 'meta_key' => 'sc_member_order',
398
- 'orderby' => 'meta_value_num',
399
- 'order' => 'ASC',
400
- 'posts_per_page' => esc_attr( get_option('sc_our_team_member_count') ),
401
- );
402
-
403
- return $args;
404
- }
405
-
406
- function set_single_content($content) {
407
- global $post;
408
-
409
- if ($post->post_type == 'team_member') {
410
- $facebook = get_post_meta(get_the_ID(), 'team_member_facebook', true);
411
- $twitter = get_post_meta(get_the_ID(), 'team_member_twitter', true);
412
- $linkedin = get_post_meta(get_the_ID(), 'team_member_linkedin', true);
413
- $gplus = get_post_meta(get_the_ID(), 'team_member_gplus', true);
414
- $email = get_post_meta(get_the_ID(), 'team_member_email', true);
415
-
416
- echo '<div class="sc_team_single_icons">';
417
- get_social($facebook, $twitter, $linkedin, $gplus, $email);
418
- echo '</div>';
419
- }
420
- return $content;
421
- }
422
- add_filter('the_content', 'set_single_content');
1
  <?php
2
  /*
3
  Plugin Name: Our Team Showcase
4
+ Plugin URI: http://smartcatdesign.net/downloads/our-team-showcase/
5
  Description: Display your team members in a very attractive way as a widget or page with a shortcode
6
+ Version: 2.0
7
  Author: SmartCat
8
  Author URI: http://smartcatdesign.net
9
  License: GPL v2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10
  *
11
+ * @author Bilal Hassan <bilal@smartcat.ca>
12
+ * @copyright Smartcat Design <http://smartcatdesign.net>
13
  */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14
 
 
 
 
15
 
16
+ // Exit if accessed directly
17
+ if( !defined( 'ABSPATH' ) ) {
18
+ die;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
19
  }
20
+ if (!defined('SC_TEAM_PATH'))
21
+ define('SC_TEAM_PATH', plugin_dir_path(__FILE__));
22
+ if (!defined('SC_TEAM_URL'))
23
+ define('SC_TEAM_URL', plugin_dir_url(__FILE__));
24
 
 
 
 
 
 
 
 
 
 
 
 
25
 
26
+ require_once ( plugin_dir_path( __FILE__ ) . 'inc/class/class.smartcat-team.php' );
 
 
 
27
 
 
 
 
 
28
 
29
+ // activation and de-activation hooks
30
+ register_activation_hook( __FILE__, array( 'SmartcatTeamPlugin', 'activate' ) );
31
+ register_deactivation_hook( __FILE__, 'SmartcatTeamPlugin', 'deactivate' );
 
32
 
33
+ SmartcatTeamPlugin::instance();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
34
 
 
 
 
 
 
 
35
 
 
 
 
 
 
 
 
36
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
screenshot-1.png CHANGED
Binary file
screenshot-2.png CHANGED
Binary file
screenshot-3.png CHANGED
Binary file
screenshot-4.jpg CHANGED
Binary file
screenshot-5.jpg CHANGED
Binary file