Flickr Badges Widget - Version 1.2.2

Version Description

  • Widget admin interface fixed
  • Widget width reduced
Download this release

Release Info

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

Version 1.2.2

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,265 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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' => 500,
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
+ add_action( 'wp_head', array( &$this, 'print_script' ) );
35
+ }
36
+ }
37
+
38
+ /**
39
+ * Push all script and style from the widget "Custom Style & Script" box.
40
+ * @since 1.2.1
41
+ **/
42
+ function print_script() {
43
+ $settings = $this->get_settings();
44
+ foreach ( $settings as $key => $setting ){
45
+ if ( !empty( $setting['custom'] ) )
46
+ echo $setting['custom'];
47
+ }
48
+ }
49
+
50
+
51
+ /* Push the widget stylesheet widget.css into widget admin page */
52
+ function widget_admin() {
53
+ wp_enqueue_style( 'z-flickr-admin', FLICKR_BADGES_WIDGET_URL . 'css/dialog.css' );
54
+ wp_enqueue_script( 'jquery' );
55
+ wp_enqueue_script( 'z-flickr-admin', FLICKR_BADGES_WIDGET_URL . 'js/jquery.dialog.js' );
56
+ }
57
+
58
+ function widget( $args, $instance ) {
59
+ extract( $args );
60
+
61
+ /* Set up the arguments for wp_list_categories(). */
62
+ $cur_arg = array(
63
+ 'title' => $instance['title'],
64
+ 'type' => empty( $instance['type'] ) ? 'user' : $instance['type'],
65
+ 'flickr_id' => $instance['flickr_id'],
66
+ 'count' => (int)$instance['count'],
67
+ 'display' => empty( $instance['display'] ) ? 'latest' : $instance['display'],
68
+ 'copyright' => !empty( $instance['copyright'] ) ? true : false
69
+ );
70
+
71
+ extract( $cur_arg );
72
+
73
+ // if the photo is < 1, set it to 1
74
+ if ( $count < 1 ) $count = 1;
75
+
76
+ /** if the widget have an ID, we can continue **/
77
+ if ( !empty( $instance['flickr_id'] ) ) {
78
+
79
+ // print the before widget
80
+ echo $before_widget;
81
+
82
+ if ( $title ) echo $before_title . $title . $after_title;
83
+
84
+ /// get the user direction, rtl or ltr
85
+ if ( function_exists( 'is_rtl' ) ) $dir= is_rtl() ? 'rtl' : 'ltr';
86
+
87
+ // wrap the widget
88
+ if (!empty( $instance['intro_text'] ) ) echo '<p>' . do_shortcode( $instance['intro_text'] ) . '</p>';
89
+
90
+ echo "<div class='zframe-flickr-wrap-$dir'>";
91
+ 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>";
92
+ echo '</div>';
93
+
94
+ if (!empty( $instance['outro_text'] ) ) echo '<p>' . do_shortcode( $instance['outro_text'] ) . '</p>';
95
+
96
+ if ( $copyright )
97
+ 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>';
98
+
99
+ // print the after widget
100
+ echo $after_widget;
101
+ }
102
+ }
103
+
104
+ function update( $new_instance, $old_instance ) {
105
+ $instance = $old_instance;
106
+ $instance['type'] = strip_tags($new_instance['type']);
107
+ $instance['flickr_id'] = strip_tags($new_instance['flickr_id']);
108
+ $instance['count'] = (int) $new_instance['count'];
109
+ $instance['display'] = strip_tags($new_instance['display']);
110
+ $instance['title'] = strip_tags($new_instance['title']);
111
+ $instance['copyright'] = ( isset( $new_instance['copyright'] ) ? 1 : 0 );
112
+ $instance['tab'] = $new_instance['tab'];
113
+ $instance['intro_text'] = $new_instance['intro_text'];
114
+ $instance['outro_text'] = $new_instance['outro_text'];
115
+ $instance['custom'] = $new_instance['custom'];
116
+
117
+ return $instance;
118
+ }
119
+
120
+ function form( $instance ) {
121
+ /* Set up the default form values. */
122
+ $defaults = array(
123
+ 'title' => esc_attr__( 'Flickr Widget', $this->textdomain ),
124
+ 'type' => 'user',
125
+ 'flickr_id' => '', // 71865026@N00
126
+ 'count' => 9,
127
+ 'display' => 'display',
128
+ 'copyright' => true,
129
+ 'tab' => array( 0 => true ),
130
+ 'intro_text' => '',
131
+ 'outro_text' => '',
132
+ 'custom' => ''
133
+ );
134
+
135
+ /* Merge the user-selected arguments with the defaults. */
136
+ $instance = wp_parse_args( (array) $instance, $defaults );
137
+
138
+ $types = array(
139
+ 'user' => esc_attr__( 'user', $this->textdomain ),
140
+ 'group' => esc_attr__( 'group', $this->textdomain )
141
+ );
142
+ $displays = array(
143
+ 'latest' => esc_attr__( 'latest', $this->textdomain ),
144
+ 'random' => esc_attr__( 'random', $this->textdomain )
145
+ );
146
+ ?>
147
+
148
+ <div class="pluginName">Flickr Badges Widget<span class="pluginVersion"><?php echo FLICKR_BADGES_WIDGET_VERSION; ?></span></div>
149
+ <script type="text/javascript">
150
+ // Tabs function
151
+ jQuery(document).ready(function($){
152
+ // Tabs function
153
+ $('ul.nav-tabs li').each(function(i) {
154
+ $(this).bind("click", function(){
155
+ var liIndex = $(this).index();
156
+ var content = $(this).parent("ul").next().children("li").eq(liIndex);
157
+ $(this).addClass('active').siblings("li").removeClass('active');
158
+ $(content).show().addClass('active').siblings().hide().removeClass('active');
159
+
160
+ $(this).parent("ul").find("input").val(0);
161
+ $('input', this).val(1);
162
+ });
163
+ });
164
+
165
+ // Widget background
166
+ $("#fbw-<?php echo $this->id; ?>").closest(".widget-inside").addClass("ntotalWidgetBg");
167
+ });
168
+ </script>
169
+
170
+ <div id="fbw-<?php echo $this->id ; ?>" class="totalControls tabbable tabs-left">
171
+ <!-- Tab List -->
172
+ <ul class="nav nav-tabs">
173
+ <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>
174
+ <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>
175
+ <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>
176
+ </ul>
177
+
178
+ <ul class="tab-content">
179
+ <li class="tab-pane <?php if ( $instance['tab'][0] ) : ?>active<?php endif; ?>">
180
+ <ul>
181
+ <li>
182
+ <label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title', $this->textdomain); ?></label>
183
+ <span class="controlDesc"><?php _e( 'Give the widget title, or leave it empty for no title.', $this->textdomain ); ?></span>
184
+ <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'] ); ?>" />
185
+ </li>
186
+ <li>
187
+ <label for="<?php echo $this->get_field_id('type'); ?>"><?php _e( 'Type', $this->textdomain ); ?></label>
188
+ <span class="controlDesc"><?php _e( 'The type of images from user or group.', $this->textdomain ); ?></span>
189
+ <select id="<?php echo $this->get_field_id( 'type' ); ?>" name="<?php echo $this->get_field_name( 'type' ); ?>">
190
+ <?php foreach ( $types as $option_value => $option_label ) { ?>
191
+ <option value="<?php echo esc_attr( $option_value ); ?>" <?php selected( $instance['type'], $option_value ); ?>><?php echo esc_html( $option_label ); ?></option>
192
+ <?php } ?>
193
+ </select>
194
+ </li>
195
+ <li>
196
+ <label for="<?php echo $this->get_field_id('flickr_id'); ?>"><?php _e('Flickr ID', $this->textdomain); ?></label>
197
+ <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'] ); ?>" />
198
+ <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>
199
+ </li>
200
+ <li>
201
+ <label for="<?php echo $this->get_field_id('count'); ?>"><?php _e('Number', $this->textdomain); ?></label>
202
+ <span class="controlDesc"><?php _e( 'Number of photo to show.', $this->textdomain ); ?></span>
203
+ <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" />
204
+ </li>
205
+ <li>
206
+ <label for="<?php echo $this->get_field_id('display'); ?>"><?php _e('Display Method', $this->textdomain); ?></label>
207
+ <span class="controlDesc"><?php _e( 'Get the image from recent or use random function.', $this->textdomain ); ?></span>
208
+ <select id="<?php echo $this->get_field_id( 'display' ); ?>" name="<?php echo $this->get_field_name( 'display' ); ?>">
209
+ <?php foreach ( $displays as $option_value => $option_label ) { ?>
210
+ <option value="<?php echo esc_attr( $option_value ); ?>" <?php selected( $instance['display'], $option_value ); ?>><?php echo esc_html( $option_label ); ?></option>
211
+ <?php } ?>
212
+ </select>
213
+ </li>
214
+ <li>
215
+ <label for="<?php echo $this->get_field_id( 'copyright' ); ?>">
216
+ <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>
217
+ <span class="controlDesc"><?php _e( 'Display the plugin name with link in the front end.', $this->textdomain ); ?></span>
218
+ </li>
219
+ </ul>
220
+ </li>
221
+
222
+ <li class="tab-pane <?php if ( $instance['tab'][1] ) : ?>active<?php endif; ?>">
223
+ <ul>
224
+ <li>
225
+ <label for="<?php echo $this->get_field_id('intro_text'); ?>"><?php _e( 'Intro Text', $this->textdomain ); ?></label>
226
+ <span class="controlDesc"><?php _e( 'This option will display addtional text before the widget content and HTML supports.', $this->textdomain ); ?></span>
227
+ <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>
228
+ </li>
229
+ <li>
230
+ <label for="<?php echo $this->get_field_id('outro_text'); ?>"><?php _e( 'Outro Text', $this->textdomain ); ?></label>
231
+ <span class="controlDesc"><?php _e( 'This option will display addtional text after widget and HTML supports.', $this->textdomain ); ?></span>
232
+ <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>
233
+
234
+ </li>
235
+ <li>
236
+ <label for="<?php echo $this->get_field_id('custom'); ?>"><?php _e( 'Custom Script & Stylesheet', $this->textdomain ) ; ?></label>
237
+ <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>
238
+ <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>
239
+ </li>
240
+ </ul>
241
+ </li>
242
+ <li class="tab-pane <?php if ( $instance['tab'][2] ) : ?>active<?php endif; ?>">
243
+ <ul>
244
+ <li>
245
+ <h3><?php _e( 'Zourbuth Blog Feeds', $this->textdomain ) ; ?></h3>
246
+ <?php
247
+ wp_widget_rss_output( 'http://zourbuth.com/feed/', array( 'items' => 8 ) );
248
+ ?>
249
+ </li>
250
+ <li>
251
+ <a href="http://feedburner.google.com/fb/a/mailverify?uri=zourbuth&amp;loc=en_US">Subscribe to zourbuth by Email</a><br />
252
+ <?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 />
253
+
254
+ 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 />
255
+
256
+ <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>.
257
+ </li>
258
+ </ul>
259
+ </li>
260
+
261
+ </ul>
262
+ </div>
263
+ <?php
264
+ }
265
+ }
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.2
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.2' );
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,68 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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.2
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.2 =
50
+ * Widget admin interface fixed
51
+ * Widget width reduced
52
+
53
+ = 1.2.1 =
54
+ * Updating Flickr NSID lookup
55
+
56
+ = 1.2 =
57
+ * Updating to WP 3.5.1
58
+
59
+ = 1.1 =
60
+ * Updating to WP 3.5
61
+
62
+ = 1.0 =
63
+ * Released
64
+
65
+ == Upgrade Notice ==
66
+
67
+ = 1.0 =
68
+ Just upgrade via Wordpress.