Flickr Badges Widget - Version 1.2.1

Version Description

  • Updating Flickr NSID lookup
Download this release

Release Info

Developer zourbuth
Plugin Icon 128x128 Flickr Badges Widget
Version 1.2.1
Comparing to
See all releases

Version 1.2.1

css/dialog.css ADDED
@@ -0,0 +1,389 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .gw-cloning {
2
+ display: none;
3
+ }
4
+ .widget .widget-inside .gw-sortable {
5
+ background-color: #f5f5f5; /* Fallback */
6
+ background-image: -ms-linear-gradient(top, #f9f9f9, #f5f5f5); /* IE10 */
7
+ background-image: -moz-linear-gradient(top, #f9f9f9, #f5f5f5); /* Firefox */
8
+ background-image: -o-linear-gradient(top, #f9f9f9, #f5f5f5); /* Opera */
9
+ background-image: -webkit-gradient(linear, left top, left bottom, from(#f9f9f9), to(#f5f5f5)); /* old Webkit */
10
+ background-image: -webkit-linear-gradient(top, #f9f9f9, #f5f5f5); /* new Webkit */
11
+ background-image: linear-gradient(top, #f9f9f9, #f5f5f5); /* proposed W3C Markup */
12
+ border: 1px solid #DFDFDF;
13
+ -webkit-border-radius: 3px;
14
+ -moz-border-radius: 3px;
15
+ border-radius: 3px;
16
+ position:relative;
17
+ cursor: pointer;
18
+ margin-bottom: 7px;
19
+ padding: 5px;
20
+ }
21
+ .gw-delete {
22
+ background: url(../images/delete.png) no-repeat scroll -2px -3px transparent;
23
+ width: 14px;
24
+ height: 14px;
25
+ position: absolute;
26
+ border: 1px solid #ddd;
27
+ -webkit-border-radius: 1px;
28
+ -moz-border-radius: 1px;
29
+ border-radius: 1px;
30
+ right: 8px;
31
+ top: 8px;
32
+ cursor: pointer;
33
+ }
34
+ .gw-delete:hover {
35
+ border: 1px solid #bbb;
36
+ }
37
+ .gw-add-widget {
38
+ border-bottom: 1px dashed #E8E8E8;
39
+ margin-bottom: 7px;
40
+ padding-bottom: 9px;
41
+ }
42
+
43
+
44
+ /* Shortcode dialog properties
45
+ ================================================================== */
46
+ #optionSection {
47
+ height: auto !important;
48
+ margin-bottom: 41px;
49
+ background: url(../images/background.png) repeat-x scroll left top #F7F7F7;
50
+ padding: 15px;
51
+ position: relative;
52
+ }
53
+ #optionSection select {
54
+ height: 2em;
55
+ padding: 2px;
56
+ }
57
+ #optionSection .hide-if-js {
58
+ display: none;
59
+ }
60
+ #buttonSection input[type="button"] {
61
+ -webkit-border-radius: 3px;
62
+ -moz-border-radius: 3px;
63
+ border-radius: 3px;
64
+ }
65
+ #optionSection .clear{clear:both;display:block;overflow:hidden;visibility:hidden;width:0;height:0}
66
+ #buttonSection {
67
+ background-color: #F9F9F9;
68
+ border-top: 1px solid #DFDFDF;
69
+ bottom: 0;
70
+ margin: 0;
71
+ position: fixed;
72
+ text-align: right;
73
+ width: 100%;
74
+ }
75
+ #buttonSection .inner {
76
+ padding: 10px 20px;
77
+ }
78
+
79
+
80
+ /* Shortocode and widget dialog properties
81
+ ================================================================== */
82
+ .totalControls .role {
83
+ border: 1px solid #DFDFDF;
84
+ border-radius: 3px 3px 3px 3px;
85
+ box-shadow: 0 1px 0 #FFFFFF inset;
86
+ background-color: #F5F5F5;
87
+ background-image: -moz-linear-gradient(center top , #F9F9F9, #F5F5F5);
88
+ padding: 5px 10px;
89
+ margin-top: 5px;
90
+ text-shadow: 1px 1px #fff;
91
+ cursor: move;
92
+ }
93
+ .totalControls .placeholder {
94
+ border: 1px dashed #DFDFDF;
95
+ border-radius: 2px;
96
+ box-shadow: 0 1px 0 #FFFFFF inset;
97
+ padding: 13px 10px;
98
+ margin-top: 5px;
99
+ margin-bottom: 5px;
100
+ }
101
+ .totalControls .role label {
102
+ font-weight: normal;
103
+ }
104
+ .totalControls .role .totalUser {
105
+ color: #AAAAAA;
106
+ float: right;
107
+ font-size: 11px;
108
+ }
109
+ .totalControls a.rsswidget {
110
+ font-family: sans-serif;
111
+ font-size: 12px;
112
+ line-height: 16px;
113
+ }
114
+
115
+ .totalControls a {
116
+ text-decoration: none;
117
+ }
118
+ .totalControls label {
119
+ font-weight: bold;
120
+ color: #222222;
121
+ font-size: 13m;
122
+ display: block;
123
+ text-shadow: 0 1px 0 #FFFFFF;
124
+ }
125
+ .totalControls .jj,
126
+ .totalControls .hh,
127
+ .totalControls .mn {
128
+ width: 2em;
129
+ }
130
+ .totalControls .aa {
131
+ width: 3.4em;
132
+ }
133
+ .totalControls .timestamp span {
134
+ font-weight: bold;
135
+ }
136
+ .totalControls .edit-timestamp {
137
+ font-size: 11px;
138
+ }
139
+ .totalControls textarea:hover, .totalControls input[type="text"]:hover {
140
+ background-color: #f9f9f9;
141
+ }
142
+ .totalControls select[multiple="multiple"] {
143
+ width: 100%;
144
+ height: 8em !important;
145
+ }
146
+ .totalControls input[type="checkbox"],
147
+ .totalControls input[type="radio"] {
148
+ margin: 1px 4px 0 0;
149
+ }
150
+ .totalControls input.smallfat {
151
+ width: 66px;
152
+ }
153
+ .totalControls select.smallfat {
154
+ min-width: 66px;
155
+ }
156
+ .totalControls .controlDesc {
157
+ font-size: 11.25px;
158
+ display: block;
159
+ color: #888;
160
+ margin-bottom: 4px;
161
+ }
162
+ .totalControls .controlDesc code {
163
+ color: #555;
164
+ }
165
+ .totalControls table .controlDesc {
166
+ color: #666;
167
+ margin-bottom: 0;
168
+ }
169
+ .totalControls table .separator {
170
+ width: 10%;
171
+ }
172
+ .totalControls .optionImage {
173
+ margin-bottom: 8px;
174
+ display: block;
175
+ }
176
+ .totalControls .pickcolor span {
177
+ background: url("../images/color.png") no-repeat scroll center center transparent;
178
+ margin-left: 5px;
179
+ padding: 2px 10px;
180
+ }
181
+ .totalControls .farbtastic-wrapper {
182
+ display:none;
183
+ margin-top: 10px;
184
+ }
185
+ .totalControls .farbtastic {
186
+ background:#eee;
187
+ border:1px solid #ccc;
188
+ }
189
+
190
+ .totalControls ul.tab-content li ul li {
191
+ border-bottom: 1px dashed #e8e8e8;
192
+ margin-bottom: 7px;
193
+ padding-bottom: 9px;
194
+ }
195
+ .totalControls ul.tab-content li ul li:last-child {
196
+ border-bottom: none;
197
+ margin-bottom: 0;
198
+ padding-bottom: 0;
199
+ }
200
+ .totalControls .optionImage {
201
+ display: block;
202
+ max-width: 100%;
203
+ }
204
+ .totalControls .addImage,
205
+ .totalControls .button,
206
+ .totalControls .removeImage {
207
+ -webkit-border-radius: 3px;
208
+ -moz-border-radius: 3px;
209
+ border-radius: 3px;
210
+ }
211
+ .totalControls .removeImage {
212
+ color: orangered;
213
+ }
214
+ .totalControls .hideRemove {
215
+ display: none;
216
+ }
217
+ .pluginVersion {
218
+ color: #BBBBBB;
219
+ font-size: 12px;
220
+ font-weight: normal;
221
+ margin-left: 5px;
222
+ }
223
+ .pluginName {
224
+ color: #cccccc;
225
+ display: block;
226
+ font-size: 18px;
227
+ margin: 10px 15px;
228
+ text-shadow: 1px 1px #FFFFFF;
229
+ }
230
+ .widget .ntotalWidgetBg {
231
+ background: url("../images/background.png") no-repeat scroll left top transparent;
232
+ border-top: 1px solid #E4E4E4;
233
+ position: relative;
234
+ }
235
+
236
+
237
+ /* Template Style
238
+ ----------------------------------------------------------------------------------------------------*/
239
+ .totalControls .apw-template p {
240
+ margin-bottom: 5px;
241
+ }
242
+ .totalControls .template-left .template-image {
243
+ float: left;
244
+ width: 55px;
245
+ height: 55px;
246
+ overflow: hidden;
247
+ margin-right: 10px;
248
+ }
249
+ .totalControls .template-right .template-image {
250
+ float: right;
251
+ width: 55px;
252
+ height: 55px;
253
+ margin-left: 10px;
254
+ }
255
+ .totalControls .template-title {
256
+ display: block;
257
+ font-size: 13px;
258
+ }
259
+ .totalControls .template-image {
260
+ overflow: hidden;
261
+ }
262
+ .totalControls .template-date,
263
+ .totalControls .template-comments {
264
+ color: #555555;
265
+ font-size: 11px;
266
+ }
267
+ .totalControls .template-date {
268
+ background: url("../images/icons.png") no-repeat scroll 0 0 transparent;
269
+ padding-left: 20px;
270
+ margin-right: 10px;
271
+ }
272
+ .totalControls .template-comments {
273
+ background: url("../images/comments.png") no-repeat scroll 0 0 transparent;
274
+ margin-right: 10px;
275
+ padding-left: 20px;
276
+ }
277
+
278
+
279
+ /* Widgets Tabs. ------------------------ */
280
+ .tabbable:after {
281
+ clear: both;
282
+ }
283
+ .tabbable:before, .tabbable:after {
284
+ content: "";
285
+ display: table;
286
+ }
287
+ .nav-tabs {
288
+ list-style: none outside none;
289
+ margin-bottom: 18px;
290
+ margin-left: 0;
291
+ margin-top: 24px;
292
+ }
293
+ .tabs-below > .nav-tabs, .tabs-right > .nav-tabs, .tabs-left > .nav-tabs {
294
+ border-bottom: 0 none;
295
+ }
296
+ .nav-tabs:after, .nav-pills:after {
297
+ clear: both;
298
+ }
299
+ .nav-tabs:before, .nav-pills:before, .nav-tabs:after, .nav-pills:after {
300
+ content: "";
301
+ display: table;
302
+ }
303
+ .nav-tabs:before, .nav-pills:before, .nav-tabs:after, .nav-pills:after {
304
+ content: "";
305
+ display: table;
306
+ }
307
+ .tabs-left > .nav-tabs {
308
+ float: left;
309
+ }
310
+ .tabs-left > .nav-tabs > li, .tabs-right > .nav-tabs > li {
311
+ float: none;
312
+ }
313
+ .nav-tabs > li {
314
+ margin-bottom: -1px;
315
+ }
316
+ .tabs-left > .nav-tabs .active, .tabs-left > .nav-tabs .active:hover {
317
+ border-color: #DDDDDD rgba(255, 255, 255, 0.8) #DDDDDD #DDDDDD;
318
+ }
319
+ .tabs-left > .nav-tabs > li {
320
+ border-radius: 4px 0 0 4px;
321
+ margin-right: -1px;
322
+ }
323
+ .tabs-left > .nav-tabs > li, .tabs-right > .nav-tabs > li {
324
+ margin-bottom: 3px;
325
+ margin-right: 0;
326
+ min-width: 74px;
327
+ }
328
+ .nav-tabs > .active > a, .nav-tabs > .active:hover {
329
+ -moz-border-bottom-colors: none;
330
+ -moz-border-left-colors: none;
331
+ -moz-border-right-colors: none;
332
+ -moz-border-top-colors: none;
333
+ background-color: #transparent;
334
+ border-color: #DDDDDD #DDDDDD transparent;
335
+ border-image: none;
336
+ border-style: solid;
337
+ border-width: 1px;
338
+ color: #555555;
339
+ cursor: default;
340
+ }
341
+ .nav-tabs > li {
342
+ border: 1px solid transparent;
343
+ border-radius: 4px 4px 0 0;
344
+ color: #999999;
345
+ cursor: pointer;
346
+ display: block;
347
+ font-weight: bold;
348
+ line-height: 14px;
349
+ margin-right: 2px;
350
+ padding: 8px 20px 8px 15px;
351
+ text-shadow: 0 1px 1px #FFFFFF;
352
+ }
353
+
354
+ .tabs-left > .nav-tabs .active, .tabs-left > .nav-tabs .active:hover {
355
+ background: none repeat scroll 0 0 rgba(255, 255, 255, 0.8);
356
+ color: #222222;
357
+ opacity: 1;
358
+ }
359
+ .tabs-left > .nav-tabs > li {
360
+ border-radius: 4px 0 0 4px;
361
+ margin-right: -1px;
362
+ }
363
+ .nav-tabs > li:hover {
364
+ background-color: #F2F2F2;
365
+ text-decoration: none;
366
+ }
367
+ .tabs-left > .nav-tabs > li:hover {
368
+ border-color: #DDDDDD;
369
+ opacity: 0.5;
370
+ color: #222222;
371
+ }
372
+ .tabs-left > .nav-tabs .active:hover {
373
+ background: none repeat scroll 0 0 rgba(255, 255, 255, 0.8);
374
+ }
375
+ .tab-content > .tab-pane {
376
+ display: none;
377
+ }
378
+ .tab-content > .active {
379
+ display: block;
380
+ }
381
+ .tab-content {
382
+ border: 1px solid #DDDDDD;
383
+ min-height: 300px;
384
+ overflow: auto;
385
+ padding: 19px;
386
+ background: none repeat scroll 0 0 rgba(255, 255, 255, 0.8);
387
+ border-radius: 3px;
388
+
389
+ }
css/widget.css ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .zframe-flickr-wrap-ltr,
2
+ .zframe-flickr-wrap-rtl {
3
+ display: block;
4
+ overflow: hidden;
5
+ }
6
+ .zframe-flickr-wrap-ltr img,
7
+ .zframe-flickr-wrap-rtl img {
8
+ margin-bottom: 10px;
9
+ }
10
+
11
+ .zframe-flickr-wrap-ltr img {
12
+ float: left;
13
+ margin-right: 10px;
14
+ }
15
+
16
+ .zframe-flickr-wrap-rtl img {
17
+ float: right;
18
+ margin-left: 10px;
19
+ }
flickr-badges-widget.php ADDED
@@ -0,0 +1,249 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Widget - Flickr Badge Widget
4
+ *
5
+ * @package zFrame
6
+ * @subpackage Classes
7
+ * For another improvement, you can drop email to zourbuth@gmail.com or visit http://zourbuth.com
8
+ **/
9
+
10
+ class Flickr_Badges_Widget extends WP_Widget {
11
+ var $prefix;
12
+ var $textdomain;
13
+
14
+ /** Set up the widget's unique name, ID, class, description, and other options. **/
15
+ function __construct() {
16
+
17
+ /* Set up the widget control options. */
18
+ $control_options = array(
19
+ 'width' => 525,
20
+ 'height' => 350,
21
+ 'id_base' => "zflickr"
22
+ );
23
+ /** Add some informations to the widget **/
24
+ $widget_options = array('classname' => 'widget_flickr', 'description' => __( '[+] Displays a Flickr photo stream from an ID', $this->textdomain ) );
25
+
26
+ /* Create the widget. */
27
+ $this->WP_Widget('zflickr', __('Flickr Badge', $this->textdomain), $widget_options, $control_options );
28
+
29
+ add_action( 'load-widgets.php', array(&$this, 'widget_admin') );
30
+
31
+ if ( is_active_widget(false, false, $this->id_base, true) && !is_admin() ) {
32
+ /* load the widget stylesheet for the widgets screen. */
33
+ wp_enqueue_style( 'z-flickr', FLICKR_BADGES_WIDGET_URL . 'css/widget.css', false, 0.7, 'screen' );
34
+ }
35
+ }
36
+
37
+
38
+ /* Push the widget stylesheet widget.css into widget admin page */
39
+ function widget_admin() {
40
+ wp_enqueue_style( 'z-flickr-admin', FLICKR_BADGES_WIDGET_URL . 'css/dialog.css' );
41
+ wp_enqueue_script( 'jquery' );
42
+ wp_enqueue_script( 'z-flickr-admin', FLICKR_BADGES_WIDGET_URL . 'js/jquery.dialog.js' );
43
+ }
44
+
45
+ function widget( $args, $instance ) {
46
+ extract( $args );
47
+
48
+ /* Set up the arguments for wp_list_categories(). */
49
+ $cur_arg = array(
50
+ 'title' => $instance['title'],
51
+ 'type' => empty( $instance['type'] ) ? 'user' : $instance['type'],
52
+ 'flickr_id' => $instance['flickr_id'],
53
+ 'count' => (int)$instance['count'],
54
+ 'display' => empty( $instance['display'] ) ? 'latest' : $instance['display'],
55
+ 'copyright' => !empty( $instance['copyright'] ) ? true : false
56
+ );
57
+
58
+ extract( $cur_arg );
59
+
60
+ // if the photo is < 1, set it to 1
61
+ if ( $count < 1 ) $count = 1;
62
+
63
+ /** if the widget have an ID, we can continue **/
64
+ if ( !empty( $instance['flickr_id'] ) ) {
65
+
66
+ // print the before widget
67
+ echo $before_widget;
68
+
69
+ if ( $title ) echo $before_title . $title . $after_title;
70
+
71
+ /// get the user direction, rtl or ltr
72
+ if ( function_exists( 'is_rtl' ) ) $dir= is_rtl() ? 'rtl' : 'ltr';
73
+
74
+ // wrap the widget
75
+ if (!empty( $instance['intro_text'] ) ) echo '<p>' . do_shortcode( $instance['intro_text'] ) . '</p>';
76
+
77
+ echo "<div class='zframe-flickr-wrap-$dir'>";
78
+ echo "<script type='text/javascript' src='http://www.flickr.com/badge_code_v2.gne?count=$count&amp;display=$display&amp;size=s&amp;layout=x&amp;source=$type&amp;$type=$flickr_id'></script>";
79
+ echo '</div>';
80
+
81
+ if (!empty( $instance['outro_text'] ) ) echo '<p>' . do_shortcode( $instance['outro_text'] ) . '</p>';
82
+
83
+ if ( $copyright )
84
+ echo '<a href="http://zourbuth.com/archives/500/flickr-badges-widget-free-wordpress-plugin/"><span style="font-size: 11px;"><span style="color: #0063DC; font-weight: bold;">Flick</span><span style="color: #FF0084; font-weight: bold;">r</span> Badge Widget</span></a>';
85
+
86
+ // print the after widget
87
+ echo $after_widget;
88
+ }
89
+ }
90
+
91
+ function update( $new_instance, $old_instance ) {
92
+ $instance = $old_instance;
93
+ $instance['type'] = strip_tags($new_instance['type']);
94
+ $instance['flickr_id'] = strip_tags($new_instance['flickr_id']);
95
+ $instance['count'] = (int) $new_instance['count'];
96
+ $instance['display'] = strip_tags($new_instance['display']);
97
+ $instance['title'] = strip_tags($new_instance['title']);
98
+ $instance['copyright'] = ( isset( $new_instance['copyright'] ) ? 1 : 0 );
99
+ $instance['tab'] = $new_instance['tab'];
100
+ $instance['intro_text'] = $new_instance['intro_text'];
101
+ $instance['outro_text'] = $new_instance['outro_text'];
102
+ $instance['custom'] = $new_instance['custom'];
103
+
104
+ return $instance;
105
+ }
106
+
107
+ function form( $instance ) {
108
+ /* Set up the default form values. */
109
+ $defaults = array(
110
+ 'title' => esc_attr__( 'Flickr Widget', $this->textdomain ),
111
+ 'type' => 'user',
112
+ 'flickr_id' => '', // 71865026@N00
113
+ 'count' => 9,
114
+ 'display' => 'display',
115
+ 'copyright' => true,
116
+ 'tab' => array( 0 => true ),
117
+ 'intro_text' => '',
118
+ 'outro_text' => '',
119
+ 'custom' => ''
120
+ );
121
+
122
+ /* Merge the user-selected arguments with the defaults. */
123
+ $instance = wp_parse_args( (array) $instance, $defaults );
124
+
125
+ $types = array(
126
+ 'user' => esc_attr__( 'user', $this->textdomain ),
127
+ 'group' => esc_attr__( 'group', $this->textdomain )
128
+ );
129
+ $displays = array(
130
+ 'latest' => esc_attr__( 'latest', $this->textdomain ),
131
+ 'random' => esc_attr__( 'random', $this->textdomain )
132
+ );
133
+ ?>
134
+
135
+ <div class="pluginName">Flickr Badges Widget<span class="pluginVersion"><?php echo FLICKR_BADGES_WIDGET_VERSION; ?></span></div>
136
+ <script type="text/javascript">
137
+ // Tabs function
138
+ jQuery(document).ready(function($){
139
+ // Tabs function
140
+ $('ul.nav-tabs li').each(function(i) {
141
+ $(this).bind("click", function(){
142
+ var liIndex = $(this).index();
143
+ var content = $(this).parent("ul").next().children("li").eq(liIndex);
144
+ $(this).addClass('active').siblings("li").removeClass('active');
145
+ $(content).show().addClass('active').siblings().hide().removeClass('active');
146
+
147
+ $(this).parent("ul").find("input").val(0);
148
+ $('input', this).val(1);
149
+ });
150
+ });
151
+
152
+ // Widget background
153
+ $("#fbw-<?php echo $this->id; ?>").closest(".widget-inside").addClass("ntotalWidgetBg");
154
+ });
155
+ </script>
156
+
157
+ <div id="fbw-<?php echo $this->id ; ?>" class="totalControls tabbable tabs-left">
158
+ <!-- Tab List -->
159
+ <ul class="nav nav-tabs">
160
+ <li class="<?php if ( $instance['tab'][0] ) : ?>active<?php endif; ?>">General<input type="hidden" name="<?php echo $this->get_field_name( 'tab' ); ?>[]" value="<?php echo esc_attr( $instance['tab'][0] ); ?>" /></li>
161
+ <li class="<?php if ( $instance['tab'][1] ) : ?>active<?php endif; ?>">Customs<input type="hidden" name="<?php echo $this->get_field_name( 'tab' ); ?>[]" value="<?php echo esc_attr( $instance['tab'][1] ); ?>" /></li>
162
+ <li class="<?php if ( $instance['tab'][2] ) : ?>active<?php endif; ?>">Information<input type="hidden" name="<?php echo $this->get_field_name( 'tab' ); ?>[]" value="<?php echo esc_attr( $instance['tab'][2] ); ?>" /></li>
163
+ </ul>
164
+
165
+ <ul class="tab-content">
166
+ <li class="tab-pane <?php if ( $instance['tab'][0] ) : ?>active<?php endif; ?>">
167
+ <ul>
168
+ <li>
169
+ <label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title', $this->textdomain); ?></label>
170
+ <span class="controlDesc"><?php _e( 'Give the widget title, or leave it empty for no title.', $this->textdomain ); ?></span>
171
+ <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( $instance['title'] ); ?>" />
172
+ </li>
173
+ <li>
174
+ <label for="<?php echo $this->get_field_id('type'); ?>"><?php _e( 'Type', $this->textdomain ); ?></label>
175
+ <span class="controlDesc"><?php _e( 'The type of images from user or group.', $this->textdomain ); ?></span>
176
+ <select id="<?php echo $this->get_field_id( 'type' ); ?>" name="<?php echo $this->get_field_name( 'type' ); ?>">
177
+ <?php foreach ( $types as $option_value => $option_label ) { ?>
178
+ <option value="<?php echo esc_attr( $option_value ); ?>" <?php selected( $instance['type'], $option_value ); ?>><?php echo esc_html( $option_label ); ?></option>
179
+ <?php } ?>
180
+ </select>
181
+ </li>
182
+ <li>
183
+ <label for="<?php echo $this->get_field_id('flickr_id'); ?>"><?php _e('Flickr ID', $this->textdomain); ?></label>
184
+ <input id="<?php echo $this->get_field_id('flickr_id'); ?>" name="<?php echo $this->get_field_name('flickr_id'); ?>" type="text" value="<?php echo esc_attr( $instance['flickr_id'] ); ?>" />
185
+ <span class="controlDesc"><?php _e( 'Put the flickr ID here, go to <a href="http://goo.gl/PM6rZ" target="_blank">Flickr NSID Lookup</a> if you don\'t know your ID. Example: 71865026@N00', $this->textdomain ); ?></span>
186
+ </li>
187
+ <li>
188
+ <label for="<?php echo $this->get_field_id('count'); ?>"><?php _e('Number', $this->textdomain); ?></label>
189
+ <span class="controlDesc"><?php _e( 'Number of photo to show.', $this->textdomain ); ?></span>
190
+ <input class="column-last" id="<?php echo $this->get_field_id('count'); ?>" name="<?php echo $this->get_field_name('count'); ?>" type="text" value="<?php echo esc_attr( $instance['count'] ); ?>" size="3" />
191
+ </li>
192
+ <li>
193
+ <label for="<?php echo $this->get_field_id('display'); ?>"><?php _e('Display Method', $this->textdomain); ?></label>
194
+ <span class="controlDesc"><?php _e( 'Get the image from recent or use random function.', $this->textdomain ); ?></span>
195
+ <select id="<?php echo $this->get_field_id( 'display' ); ?>" name="<?php echo $this->get_field_name( 'display' ); ?>">
196
+ <?php foreach ( $displays as $option_value => $option_label ) { ?>
197
+ <option value="<?php echo esc_attr( $option_value ); ?>" <?php selected( $instance['display'], $option_value ); ?>><?php echo esc_html( $option_label ); ?></option>
198
+ <?php } ?>
199
+ </select>
200
+ </li>
201
+ <li>
202
+ <label for="<?php echo $this->get_field_id( 'copyright' ); ?>">
203
+ <input class="checkbox" type="checkbox" <?php checked( $instance['copyright'], true ); ?> id="<?php echo $this->get_field_id( 'copyright' ); ?>" name="<?php echo $this->get_field_name( 'copyright' ); ?>" /><?php _e( 'Show Copyright', $this->textdomain ); ?></label>
204
+ <span class="controlDesc"><?php _e( 'Display the plugin name with link in the front end.', $this->textdomain ); ?></span>
205
+ </li>
206
+ </ul>
207
+ </li>
208
+
209
+ <li class="tab-pane <?php if ( $instance['tab'][1] ) : ?>active<?php endif; ?>">
210
+ <ul>
211
+ <li>
212
+ <label for="<?php echo $this->get_field_id('intro_text'); ?>"><?php _e( 'Intro Text', $this->textdomain ); ?></label>
213
+ <span class="controlDesc"><?php _e( 'This option will display addtional text before the widget content and HTML supports.', $this->textdomain ); ?></span>
214
+ <textarea name="<?php echo $this->get_field_name( 'intro_text' ); ?>" id="<?php echo $this->get_field_id( 'intro_text' ); ?>" rows="2" class="widefat"><?php echo esc_textarea($instance['intro_text']); ?></textarea>
215
+ </li>
216
+ <li>
217
+ <label for="<?php echo $this->get_field_id('outro_text'); ?>"><?php _e( 'Outro Text', $this->textdomain ); ?></label>
218
+ <span class="controlDesc"><?php _e( 'This option will display addtional text after widget and HTML supports.', $this->textdomain ); ?></span>
219
+ <textarea name="<?php echo $this->get_field_name( 'outro_text' ); ?>" id="<?php echo $this->get_field_id( 'outro_text' ); ?>" rows="2" class="widefat"><?php echo esc_textarea($instance['outro_text']); ?></textarea>
220
+
221
+ </li>
222
+ <li>
223
+ <label for="<?php echo $this->get_field_id('custom'); ?>"><?php _e( 'Custom Script & Stylesheet', $this->textdomain ) ; ?></label>
224
+ <span class="controlDesc"><?php _e( 'Use this box for additional widget CSS style of custom javascript. Current widget selector: ', $this->textdomain ); ?><?php echo '<code>#' . $this->id . '</code>'; ?></span>
225
+ <textarea name="<?php echo $this->get_field_name( 'custom' ); ?>" id="<?php echo $this->get_field_id( 'custom' ); ?>" rows="5" class="widefat code"><?php echo htmlentities($instance['custom']); ?></textarea>
226
+ </li>
227
+ </ul>
228
+ </li>
229
+ <li class="tab-pane <?php if ( $instance['tab'][2] ) : ?>active<?php endif; ?>">
230
+ <ul>
231
+ <li>
232
+ <h3><?php _e( 'Zourbuth Feeds', $this->textdomain ) ; ?></h3>
233
+ <?php
234
+ wp_widget_rss_output( 'http://zourbuth.com/feed/', array( 'items' => 8 ) );
235
+ ?>
236
+ </li>
237
+ <li>
238
+ <a href="http://feedburner.google.com/fb/a/mailverify?uri=zourbuth&amp;loc=en_US">Subscribe to zourbuth by Email</a><br />
239
+ <?php _e( 'Like my work? Please consider to ', $this->textdomain ); ?><a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=W6D3WAJTVKAFC" title="Donate"><?php _e( 'donate', $this->textdomain ); ?></a>.<br />
240
+ <span style="font-size: 11px;"><span style="color: #0063DC; font-weight: bold;">Flick</span><span style="color: #FF0084; font-weight: bold;">r</span> Badge Widget &copy; Copyright <a href="http://zourbuth.com">Zourbuth</a> <?php echo date("Y"); ?></span>.
241
+ </li>
242
+ </ul>
243
+ </li>
244
+
245
+ </ul>
246
+ </div>
247
+ <?php
248
+ }
249
+ }
images/background.png ADDED
Binary file
index.php ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ Plugin Name: Flickr Badges Widget
4
+ Plugin URI: http://zourbuth.com/archives/500/flickr-badge-widget/
5
+ Description: Display your Flickr latest photostream in widget area using javascript. Easy to customize, just put your Flickr id and your widget ready to lunch.
6
+ Version: 1.2.1
7
+ Author: zourbuth
8
+ Author URI: http://zourbuth.com
9
+ License: Under GPL2
10
+
11
+ Copyright 2012 zourbuth (email : zourbuth@gmail.com)
12
+
13
+ This program is free software; you can redistribute it and/or modify
14
+ it under the terms of the GNU General Public License, version 2, as
15
+ published by the Free Software Foundation.
16
+
17
+ This program is distributed in the hope that it will be useful,
18
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
19
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20
+ GNU General Public License for more details.
21
+
22
+ You should have received a copy of the GNU General Public License
23
+ along with this program; if not, write to the Free Software
24
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25
+ */
26
+
27
+ /* Launch the plugin. */
28
+ add_action( 'plugins_loaded', 'flickr_badges_widget_plugins_loaded' );
29
+
30
+ /* Initializes the plugin and it's features. */
31
+ function flickr_badges_widget_plugins_loaded() {
32
+
33
+ // Set constant path to the members plugin directory
34
+ define( 'FLICKR_BADGES_WIDGET_VERSION', '1.2.1' );
35
+ define( 'FLICKR_BADGES_WIDGET_DIR', plugin_dir_path( __FILE__ ) );
36
+ define( 'FLICKR_BADGES_WIDGET_URL', plugin_dir_url( __FILE__ ) );
37
+
38
+ // Loads and registers the new widgets
39
+ add_action( 'widgets_init', 'flickr_badges_widget_init' );
40
+ }
41
+
42
+ /* Register the extra widgets. Each widget is meant to replace or extend the current default */
43
+ function flickr_badges_widget_init() {
44
+
45
+ /* Load widget file. */
46
+ require_once( FLICKR_BADGES_WIDGET_DIR . 'flickr-badges-widget.php' );
47
+
48
+ /* Register widget. */
49
+ register_widget( 'Flickr_Badges_Widget' );
50
+ }
51
+ ?>
js/jquery.dialog.js ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * @detail
3
+ * Additional function to handle content
4
+ * http://zourbuth.com/
5
+ */
6
+
7
+ (function ($) {
8
+
9
+ $.fn.totalAddImages = function(){
10
+ $(this).click(function() {
11
+ var imagesibling = $(this).siblings('img'),
12
+ inputsibling = $(this).siblings('input'),
13
+ buttonsibling = $(this).siblings('a');
14
+ tb_show('Select Image/Icon Title', 'media-upload.php?post_id=0&type=image&TB_iframe=true');
15
+ window.send_to_editor = function(html) {
16
+ var imgurl = $('img',html).attr('src');
17
+ if ( imgurl === undefined || typeof( imgurl ) == "undefined" ) imgurl = $(html).attr('src');
18
+ imagesibling.attr("src", imgurl).slideDown();
19
+ inputsibling.val(imgurl);
20
+ buttonsibling.addClass("showRemove").removeClass("hideRemove");
21
+ tb_remove();
22
+ };
23
+ return false;
24
+ });
25
+ }
26
+
27
+ $.fn.totalRemoveImages = function(){
28
+ $(this).click(function() {
29
+ $(this).next().val('');
30
+ $(this).siblings('img').slideUp();
31
+ $(this).removeClass('show-remove').addClass('hide-remove');
32
+ $(this).fadeOut();
33
+ return false;
34
+ });
35
+ }
36
+ })(jQuery);
readme.txt ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ === Flickr Badges Widget ===
2
+ Contributors: zourbuth
3
+ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=W6D3WAJTVKAFC
4
+ Tags: flickr, widget, badge, feed, photostream, javascript, sidebar, gallery, photo, photography
5
+ Requires at least: 3.5
6
+ Tested up to: 3.0
7
+ Stable tag: 1.2.1
8
+
9
+ Display your Flickr latest photostream in a sidebar widget area.
10
+
11
+ == Description ==
12
+
13
+ This is a simple widget to display your Flickr latest photostream in widget area using javascript from http://www.flickr.com/badge_code_v2.gne.
14
+ Find your Flickr ID from <a href="http://goo.gl/PM6rZ"><strong>Flickr NSID Lookup</strong></a> if you do not know your flickr id.
15
+ With its very beautiful widget interface, tabbed system, and powered by jQuery makes this plugin easier to customize.
16
+ Just put your Flickr ID and your widget will be ready to lunch.
17
+
18
+ <h3>Installation</h3>
19
+ You can use the built in installer and upgrader, or you can install the plugin manually.<br />
20
+ 1. Go to the menu 'Plugins' -> 'Install' and search for 'Flickr Badges Widget'.<br />
21
+ 2. Click 'install'.
22
+
23
+ <h3>Usefull Links</h3>
24
+ <a href="http://zourbuth.com/archives/500/flickr-badges-widget-free-wordpress-plugin/">Plugin homepage</a><br />
25
+ <a href="http://goo.gl/PM6rZ">Flickr NSID Lookup</a>
26
+
27
+ == Installation ==
28
+
29
+ You can use the built in installer and upgrader, or you can install the plugin manually.
30
+ 1. Go to the menu 'Plugins' -> 'Install' and search for 'Flickr Badges Widget'
31
+ 2. Click 'install'.
32
+
33
+ == Frequently Asked Questions ==
34
+
35
+ = Features Request & Support =
36
+ http://zourbuth.com/archives/500/flickr-badges-widget-free-wordpress-plugin/
37
+
38
+ = Flickr NSID Lookup =
39
+ http://goo.gl/PM6rZ
40
+
41
+
42
+ == Screenshots ==
43
+
44
+ 1. Widget Settings
45
+ 2. Widget in frontend
46
+
47
+ == Changelog ==
48
+
49
+ = 1.2.1 =
50
+ * Updating Flickr NSID lookup
51
+
52
+ = 1.2 =
53
+ * Updating to WP 3.5.1
54
+
55
+ = 1.1 =
56
+ * Updating to WP 3.5
57
+
58
+ = 1.0 =
59
+ * Released
60
+
61
+ == Upgrade Notice ==
62
+
63
+ = 1.0 =
64
+ Just upgrade via Wordpress.