Flickr Badges Widget - Version 1.2.3

Version Description

  • Widget prefix and localization added
Download this release

Release Info

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

Version 1.2.3

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,267 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ $this->prefix = 'zflickr';
17
+ $this->textdomain = 'flickr-badges-widget';
18
+
19
+ /* Set up the widget control options. */
20
+ $control_options = array(
21
+ 'width' => 500,
22
+ 'height' => 350,
23
+ 'id_base' => $this->prefix
24
+ );
25
+ /** Add some informations to the widget **/
26
+ $widget_options = array('classname' => 'widget_flickr', 'description' => __( '[+] Displays a Flickr photo stream from an ID', $this->textdomain ) );
27
+
28
+ /* Create the widget. */
29
+ $this->WP_Widget($this->prefix, __('Flickr Badge', $this->textdomain), $widget_options, $control_options );
30
+
31
+ add_action( 'load-widgets.php', array(&$this, 'widget_admin') );
32
+
33
+ if ( is_active_widget(false, false, $this->id_base, true) && !is_admin() ) {
34
+ /* load the widget stylesheet for the widgets screen. */
35
+ wp_enqueue_style( 'z-flickr', FLICKR_BADGES_WIDGET_URL . 'css/widget.css', false, 0.7, 'screen' );
36
+ add_action( 'wp_head', array( &$this, 'print_script' ) );
37
+ }
38
+ }
39
+
40
+ /**
41
+ * Push all script and style from the widget "Custom Style & Script" box.
42
+ * @since 1.2.1
43
+ **/
44
+ function print_script() {
45
+ $settings = $this->get_settings();
46
+ foreach ( $settings as $key => $setting ){
47
+ if ( !empty( $setting['custom'] ) )
48
+ echo $setting['custom'];
49
+ }
50
+ }
51
+
52
+
53
+ /* Push the widget stylesheet widget.css into widget admin page */
54
+ function widget_admin() {
55
+ wp_enqueue_style( 'z-flickr-admin', FLICKR_BADGES_WIDGET_URL . 'css/dialog.css' );
56
+ wp_enqueue_script( 'jquery' );
57
+ wp_enqueue_script( 'z-flickr-admin', FLICKR_BADGES_WIDGET_URL . 'js/jquery.dialog.js' );
58
+ }
59
+
60
+ function widget( $args, $instance ) {
61
+ extract( $args );
62
+
63
+ /* Set up the arguments for wp_list_categories(). */
64
+ $cur_arg = array(
65
+ 'title' => $instance['title'],
66
+ 'type' => empty( $instance['type'] ) ? 'user' : $instance['type'],
67
+ 'flickr_id' => $instance['flickr_id'],
68
+ 'count' => (int)$instance['count'],
69
+ 'display' => empty( $instance['display'] ) ? 'latest' : $instance['display'],
70
+ 'copyright' => !empty( $instance['copyright'] ) ? true : false
71
+ );
72
+
73
+ extract( $cur_arg );
74
+
75
+ // if the photo is < 1, set it to 1
76
+ if ( $count < 1 ) $count = 1;
77
+
78
+ /** if the widget have an ID, we can continue **/
79
+ if ( !empty( $instance['flickr_id'] ) ) {
80
+
81
+ // print the before widget
82
+ echo $before_widget;
83
+
84
+ if ( $title ) echo $before_title . $title . $after_title;
85
+
86
+ /// get the user direction, rtl or ltr
87
+ if ( function_exists( 'is_rtl' ) ) $dir= is_rtl() ? 'rtl' : 'ltr';
88
+
89
+ // wrap the widget
90
+ if (!empty( $instance['intro_text'] ) ) echo '<p>' . do_shortcode( $instance['intro_text'] ) . '</p>';
91
+
92
+ echo "<div class='zframe-flickr-wrap-$dir'>";
93
+ 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>";
94
+ echo '</div>';
95
+
96
+ if (!empty( $instance['outro_text'] ) ) echo '<p>' . do_shortcode( $instance['outro_text'] ) . '</p>';
97
+
98
+ if ( $copyright )
99
+ 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>';
100
+
101
+ // print the after widget
102
+ echo $after_widget;
103
+ }
104
+ }
105
+
106
+ function update( $new_instance, $old_instance ) {
107
+ $instance = $old_instance;
108
+ $instance['type'] = strip_tags($new_instance['type']);
109
+ $instance['flickr_id'] = strip_tags($new_instance['flickr_id']);
110
+ $instance['count'] = (int) $new_instance['count'];
111
+ $instance['display'] = strip_tags($new_instance['display']);
112
+ $instance['title'] = strip_tags($new_instance['title']);
113
+ $instance['copyright'] = ( isset( $new_instance['copyright'] ) ? 1 : 0 );
114
+ $instance['tab'] = $new_instance['tab'];
115
+ $instance['intro_text'] = $new_instance['intro_text'];
116
+ $instance['outro_text'] = $new_instance['outro_text'];
117
+ $instance['custom'] = $new_instance['custom'];
118
+
119
+ return $instance;
120
+ }
121
+
122
+ function form( $instance ) {
123
+ /* Set up the default form values. */
124
+ $defaults = array(
125
+ 'title' => esc_attr__( 'Flickr Widget', $this->textdomain ),
126
+ 'type' => 'user',
127
+ 'flickr_id' => '', // 71865026@N00
128
+ 'count' => 9,
129
+ 'display' => 'display',
130
+ 'copyright' => true,
131
+ 'tab' => array( 0 => true ),
132
+ 'intro_text' => '',
133
+ 'outro_text' => '',
134
+ 'custom' => ''
135
+ );
136
+
137
+ /* Merge the user-selected arguments with the defaults. */
138
+ $instance = wp_parse_args( (array) $instance, $defaults );
139
+
140
+ $types = array(
141
+ 'user' => esc_attr__( 'user', $this->textdomain ),
142
+ 'group' => esc_attr__( 'group', $this->textdomain )
143
+ );
144
+ $displays = array(
145
+ 'latest' => esc_attr__( 'latest', $this->textdomain ),
146
+ 'random' => esc_attr__( 'random', $this->textdomain )
147
+ );
148
+ ?>
149
+
150
+ <div class="pluginName">Flickr Badges Widget<span class="pluginVersion"><?php echo FLICKR_BADGES_WIDGET_VERSION; ?></span></div>
151
+ <script type="text/javascript">
152
+ // Tabs function
153
+ jQuery(document).ready(function($){
154
+ // Tabs function
155
+ $('ul.nav-tabs li').each(function(i) {
156
+ $(this).bind("click", function(){
157
+ var liIndex = $(this).index();
158
+ var content = $(this).parent("ul").next().children("li").eq(liIndex);
159
+ $(this).addClass('active').siblings("li").removeClass('active');
160
+ $(content).show().addClass('active').siblings().hide().removeClass('active');
161
+
162
+ $(this).parent("ul").find("input").val(0);
163
+ $('input', this).val(1);
164
+ });
165
+ });
166
+
167
+ // Widget background
168
+ $("#fbw-<?php echo $this->id; ?>").closest(".widget-inside").addClass("ntotalWidgetBg");
169
+ });
170
+ </script>
171
+
172
+ <div id="fbw-<?php echo $this->id ; ?>" class="totalControls tabbable tabs-left">
173
+ <!-- Tab List -->
174
+ <ul class="nav nav-tabs">
175
+ <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>
176
+ <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>
177
+ <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>
178
+ </ul>
179
+
180
+ <ul class="tab-content">
181
+ <li class="tab-pane <?php if ( $instance['tab'][0] ) : ?>active<?php endif; ?>">
182
+ <ul>
183
+ <li>
184
+ <label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title', $this->textdomain); ?></label>
185
+ <span class="controlDesc"><?php _e( 'Give the widget title, or leave it empty for no title.', $this->textdomain ); ?></span>
186
+ <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'] ); ?>" />
187
+ </li>
188
+ <li>
189
+ <label for="<?php echo $this->get_field_id('type'); ?>"><?php _e( 'Type', $this->textdomain ); ?></label>
190
+ <span class="controlDesc"><?php _e( 'The type of images from user or group.', $this->textdomain ); ?></span>
191
+ <select id="<?php echo $this->get_field_id( 'type' ); ?>" name="<?php echo $this->get_field_name( 'type' ); ?>">
192
+ <?php foreach ( $types as $option_value => $option_label ) { ?>
193
+ <option value="<?php echo esc_attr( $option_value ); ?>" <?php selected( $instance['type'], $option_value ); ?>><?php echo esc_html( $option_label ); ?></option>
194
+ <?php } ?>
195
+ </select>
196
+ </li>
197
+ <li>
198
+ <label for="<?php echo $this->get_field_id('flickr_id'); ?>"><?php _e('Flickr ID', $this->textdomain); ?></label>
199
+ <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'] ); ?>" />
200
+ <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>
201
+ </li>
202
+ <li>
203
+ <label for="<?php echo $this->get_field_id('count'); ?>"><?php _e('Number', $this->textdomain); ?></label>
204
+ <span class="controlDesc"><?php _e( 'Number of photo to show.', $this->textdomain ); ?></span>
205
+ <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" />
206
+ </li>
207
+ <li>
208
+ <label for="<?php echo $this->get_field_id('display'); ?>"><?php _e('Display Method', $this->textdomain); ?></label>
209
+ <span class="controlDesc"><?php _e( 'Get the image from recent or use random function.', $this->textdomain ); ?></span>
210
+ <select id="<?php echo $this->get_field_id( 'display' ); ?>" name="<?php echo $this->get_field_name( 'display' ); ?>">
211
+ <?php foreach ( $displays as $option_value => $option_label ) { ?>
212
+ <option value="<?php echo esc_attr( $option_value ); ?>" <?php selected( $instance['display'], $option_value ); ?>><?php echo esc_html( $option_label ); ?></option>
213
+ <?php } ?>
214
+ </select>
215
+ </li>
216
+ <li>
217
+ <label for="<?php echo $this->get_field_id( 'copyright' ); ?>">
218
+ <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>
219
+ <span class="controlDesc"><?php _e( 'Display the plugin name with link in the front end.', $this->textdomain ); ?></span>
220
+ </li>
221
+ </ul>
222
+ </li>
223
+
224
+ <li class="tab-pane <?php if ( $instance['tab'][1] ) : ?>active<?php endif; ?>">
225
+ <ul>
226
+ <li>
227
+ <label for="<?php echo $this->get_field_id('intro_text'); ?>"><?php _e( 'Intro Text', $this->textdomain ); ?></label>
228
+ <span class="controlDesc"><?php _e( 'This option will display addtional text before the widget content and HTML supports.', $this->textdomain ); ?></span>
229
+ <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>
230
+ </li>
231
+ <li>
232
+ <label for="<?php echo $this->get_field_id('outro_text'); ?>"><?php _e( 'Outro Text', $this->textdomain ); ?></label>
233
+ <span class="controlDesc"><?php _e( 'This option will display addtional text after widget and HTML supports.', $this->textdomain ); ?></span>
234
+ <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>
235
+
236
+ </li>
237
+ <li>
238
+ <label for="<?php echo $this->get_field_id('custom'); ?>"><?php _e( 'Custom Script & Stylesheet', $this->textdomain ) ; ?></label>
239
+ <span class="controlDesc"><?php _e( 'Use this box for additional widget CSS style of custom javascript. Current widget selector: ', $this->textdomain ); ?><?php echo '<tt>#' . $this->id . '</tt>'; ?></span>
240
+ <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>
241
+ </li>
242
+ </ul>
243
+ </li>
244
+ <li class="tab-pane <?php if ( $instance['tab'][2] ) : ?>active<?php endif; ?>">
245
+ <ul>
246
+ <li>
247
+ <h3><?php _e( 'Zourbuth Blog Feeds', $this->textdomain ) ; ?></h3>
248
+ <?php
249
+ wp_widget_rss_output( 'http://zourbuth.com/feed/', array( 'items' => 8 ) );
250
+ ?>
251
+ </li>
252
+ <li>
253
+ <a href="http://feedburner.google.com/fb/a/mailverify?uri=zourbuth&amp;loc=en_US">Subscribe to zourbuth by Email</a><br />
254
+ <?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 /><br />
255
+
256
+ If you like this plugin, please <a href="http://wordpress.org/support/view/plugin-reviews/flickr-badges-widget">give a good rating</a>.<br /><br />
257
+
258
+ <span style="font-size: 11px;"><a href="http://wordpress.org/extend/plugins/flickr-badges-widget/"><span style="color: #0063DC; font-weight: bold;">Flick</span><span style="color: #FF0084; font-weight: bold;">r</span> Badge Widget</a> &copy; Copyright <a href="http://zourbuth.com">Zourbuth</a> <?php echo date("Y"); ?></span>.
259
+ </li>
260
+ </ul>
261
+ </li>
262
+
263
+ </ul>
264
+ </div>
265
+ <?php
266
+ }
267
+ }
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.3
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.3' );
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,81 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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, photo gallery, photography, sidebar, user, group, image, images, recent, random
5
+ Requires at least: 3.5
6
+ Tested up to: 3.0
7
+ Stable tag: 1.2.3
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><strong>Key Features & Options</strong></h3>
19
+ <ul>
20
+ <li>Beautiful widget interface</li>
21
+ <li>The type of images from user or group.</li>
22
+ <li>Flickr NSID support.</li>
23
+ <li>Get the image from recent or use random function.</li>
24
+ <li>Intro text for additional text before the widget content.</li>
25
+ <li>Outro text for additional text after the widget content.</li>
26
+ <li>Custom scripts and stylesheets for each widget</li>
27
+ </ul>
28
+
29
+ <h3><strong>Usefull Links</strong></h3>
30
+ <a href="http://zourbuth.com/?p=500">Flickr Badges Widget - Free WordPress Plugin</a><br />
31
+ <a href="http://goo.gl/PM6rZ">Flickr NSID Lookup</a>
32
+
33
+ <h3><strong>Question & Supports</strong></h3>
34
+ This plugin does not match to your site style? Is this script not quite working as it should?
35
+ Having trouble installing? Or need some custom modifications that aren’t already included?
36
+ Or you want more features on next release? Please leave messages or comments here:<br />
37
+ http://zourbuth.com/archives/500/flickr-badges-widget-free-wordpress-plugin/
38
+
39
+ == Installation ==
40
+
41
+ You can use the built in installer and upgrader, or you can install the plugin manually.
42
+ 1. Go to the menu 'Plugins' -> 'Install' and search for 'Flickr Badges Widget'
43
+ 2. Click 'install'.
44
+
45
+ == Frequently Asked Questions ==
46
+
47
+ = Features Request & Support =
48
+ http://zourbuth.com/archives/500/flickr-badges-widget-free-wordpress-plugin/
49
+
50
+ = Flickr NSID Lookup =
51
+ http://goo.gl/PM6rZ
52
+
53
+
54
+ == Screenshots ==
55
+
56
+ 1. Widget Settings
57
+ 2. Widget in frontend
58
+
59
+ == Changelog ==
60
+
61
+ = 1.2.3 =
62
+ * Widget prefix and localization added
63
+
64
+ = 1.2.2 =
65
+ * Widget admin interface fixed
66
+ * Widget width reduced
67
+
68
+ = 1.2.1 =
69
+ * Updating Flickr NSID lookup
70
+
71
+ = 1.2 =
72
+ * Updating to WP 3.5.1
73
+
74
+ = 1.1 =
75
+ * Updating to WP 3.5
76
+
77
+ = 1.0 =
78
+ * Released
79
+
80
+ == Upgrade Notice ==
81
+ Just upgrade via Wordpress.