Flickr Badges Widget - Version 1.1

Version Description

Download this release

Release Info

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

Version 1.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,232 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ );
56
+
57
+ extract( $cur_arg );
58
+
59
+ // if the photo is < 1, set it to 1
60
+ if ( $count < 1 ) $count = 1;
61
+
62
+ /** if the widget have an ID, we can continue **/
63
+ if ( !empty( $instance['flickr_id'] ) ) {
64
+
65
+ // print the before widget
66
+ echo $before_widget;
67
+
68
+ if ( $title ) echo $before_title . $title . $after_title;
69
+
70
+ /// get the user direction, rtl or ltr
71
+ if ( function_exists( 'is_rtl' ) ) $dir= is_rtl() ? 'rtl' : 'ltr';
72
+
73
+ // wrap the widget
74
+ if (!empty( $instance['intro_text'] ) ) echo '<p>' . do_shortcode( $instance['intro_text'] ) . '</p>';
75
+
76
+ echo "<div class='zframe-flickr-wrap-$dir'>";
77
+ 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>";
78
+ echo '</div>';
79
+
80
+ if (!empty( $instance['outro_text'] ) ) echo '<p>' . do_shortcode( $instance['outro_text'] ) . '</p>';
81
+
82
+ // print the after widget
83
+ echo $after_widget;
84
+ }
85
+ }
86
+
87
+ function update( $new_instance, $old_instance ) {
88
+ $instance = $old_instance;
89
+ $instance['type'] = strip_tags($new_instance['type']);
90
+ $instance['flickr_id'] = strip_tags($new_instance['flickr_id']);
91
+ $instance['count'] = (int) $new_instance['count'];
92
+ $instance['display'] = strip_tags($new_instance['display']);
93
+ $instance['title'] = strip_tags($new_instance['title']);
94
+ $instance['tab'] = $new_instance['tab'];
95
+ $instance['intro_text'] = $new_instance['intro_text'];
96
+ $instance['outro_text'] = $new_instance['outro_text'];
97
+ $instance['custom'] = $new_instance['custom'];
98
+
99
+ return $instance;
100
+ }
101
+
102
+ function form( $instance ) {
103
+ /* Set up the default form values. */
104
+ $defaults = array(
105
+ 'title' => esc_attr__( 'Flickr Widget', $this->textdomain ),
106
+ 'type' => 'user',
107
+ 'flickr_id' => '', // 71865026@N00
108
+ 'count' => 9,
109
+ 'display' => 'display',
110
+ 'tab' => array( 0 => true ),
111
+ 'intro_text' => '',
112
+ 'outro_text' => '',
113
+ 'custom' => ''
114
+ );
115
+
116
+ /* Merge the user-selected arguments with the defaults. */
117
+ $instance = wp_parse_args( (array) $instance, $defaults );
118
+
119
+ $types = array(
120
+ 'user' => esc_attr__( 'user', $this->textdomain ),
121
+ 'group' => esc_attr__( 'group', $this->textdomain )
122
+ );
123
+ $displays = array(
124
+ 'latest' => esc_attr__( 'latest', $this->textdomain ),
125
+ 'random' => esc_attr__( 'random', $this->textdomain )
126
+ );
127
+ ?>
128
+
129
+ <div class="pluginName">Flickr Badges Widget<span class="pluginVersion"><?php echo FLICKR_BADGES_WIDGET_VERSION; ?></span></div>
130
+ <script type="text/javascript">
131
+ // Tabs function
132
+ jQuery(document).ready(function($){
133
+ // Tabs function
134
+ $('ul.nav-tabs li').each(function(i) {
135
+ $(this).bind("click", function(){
136
+ var liIndex = $(this).index();
137
+ var content = $(this).parent("ul").next().children("li").eq(liIndex);
138
+ $(this).addClass('active').siblings("li").removeClass('active');
139
+ $(content).show().addClass('active').siblings().hide().removeClass('active');
140
+
141
+ $(this).parent("ul").find("input").val(0);
142
+ $('input', this).val(1);
143
+ });
144
+ });
145
+
146
+ // Widget background
147
+ $("#fbw-<?php echo $this->id; ?>").closest(".widget-inside").addClass("ntotalWidgetBg");
148
+ });
149
+ </script>
150
+
151
+ <div id="fbw-<?php echo $this->id ; ?>" class="totalControls tabbable tabs-left">
152
+ <!-- Tab List -->
153
+ <ul class="nav nav-tabs">
154
+ <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>
155
+ <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>
156
+ <li class="<?php if ( $instance['tab'][2] ) : ?>active<?php endif; ?>">About<input type="hidden" name="<?php echo $this->get_field_name( 'tab' ); ?>[]" value="<?php echo esc_attr( $instance['tab'][2] ); ?>" /></li>
157
+ </ul>
158
+
159
+ <ul class="tab-content">
160
+ <li class="tab-pane <?php if ( $instance['tab'][0] ) : ?>active<?php endif; ?>">
161
+ <ul>
162
+ <li>
163
+ <label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title', $this->textdomain); ?></label>
164
+ <span class="controlDesc"><?php _e( 'Give the widget title, or leave it empty for no title.', $this->textdomain ); ?></span>
165
+ <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'] ); ?>" />
166
+ </li>
167
+ <li>
168
+ <label for="<?php echo $this->get_field_id('type'); ?>"><?php _e( 'Type', $this->textdomain ); ?></label>
169
+ <span class="controlDesc"><?php _e( 'The type of images from user or group.', $this->textdomain ); ?></span>
170
+ <select id="<?php echo $this->get_field_id( 'type' ); ?>" name="<?php echo $this->get_field_name( 'type' ); ?>">
171
+ <?php foreach ( $types as $option_value => $option_label ) { ?>
172
+ <option value="<?php echo esc_attr( $option_value ); ?>" <?php selected( $instance['type'], $option_value ); ?>><?php echo esc_html( $option_label ); ?></option>
173
+ <?php } ?>
174
+ </select>
175
+ </li>
176
+ <li>
177
+ <label for="<?php echo $this->get_field_id('flickr_id'); ?>"><?php _e('Flickr ID', $this->textdomain); ?></label>
178
+ <span class="controlDesc"><?php _e( 'Put the flickr ID here, go to <a href="http://www.idgettr.com" target="_blank">idGettr</a> if you don\'t know your ID.', $this->textdomain ); ?></span>
179
+ <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'] ); ?>" />
180
+ </li>
181
+ <li>
182
+ <label for="<?php echo $this->get_field_id('count'); ?>"><?php _e('Number', $this->textdomain); ?></label>
183
+ <span class="controlDesc"><?php _e( 'Number of photo to show.', $this->textdomain ); ?></span>
184
+ <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" />
185
+ </li>
186
+ <li>
187
+ <label for="<?php echo $this->get_field_id('display'); ?>"><?php _e('Display Method', $this->textdomain); ?></label>
188
+ <span class="controlDesc"><?php _e( 'Get the image from recent or use random function.', $this->textdomain ); ?></span>
189
+ <select id="<?php echo $this->get_field_id( 'display' ); ?>" name="<?php echo $this->get_field_name( 'display' ); ?>">
190
+ <?php foreach ( $displays as $option_value => $option_label ) { ?>
191
+ <option value="<?php echo esc_attr( $option_value ); ?>" <?php selected( $instance['display'], $option_value ); ?>><?php echo esc_html( $option_label ); ?></option>
192
+ <?php } ?>
193
+ </select>
194
+ </li>
195
+ </ul>
196
+ </li>
197
+
198
+ <li class="tab-pane <?php if ( $instance['tab'][1] ) : ?>active<?php endif; ?>">
199
+ <ul>
200
+ <li>
201
+ <label for="<?php echo $this->get_field_id('intro_text'); ?>"><?php _e( 'Intro Text', $this->textdomain ); ?></label>
202
+ <span class="controlDesc"><?php _e( 'This option will display addtional text before the widget content and HTML supports.', $this->textdomain ); ?></span>
203
+ <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>
204
+ </li>
205
+ <li>
206
+ <label for="<?php echo $this->get_field_id('outro_text'); ?>"><?php _e( 'Outro Text', $this->textdomain ); ?></label>
207
+ <span class="controlDesc"><?php _e( 'This option will display addtional text after widget and HTML supports.', $this->textdomain ); ?></span>
208
+ <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>
209
+
210
+ </li>
211
+ <li>
212
+ <label for="<?php echo $this->get_field_id('custom'); ?>"><?php _e( 'Custom Script & Stylesheet', $this->textdomain ) ; ?></label>
213
+ <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>
214
+ <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>
215
+ </li>
216
+ </ul>
217
+ </li>
218
+ <li class="tab-pane <?php if ( $instance['tab'][2] ) : ?>active<?php endif; ?>">
219
+ <ul>
220
+ <li>
221
+ <a href="http://feedburner.google.com/fb/a/mailverify?uri=zourbuth&amp;loc=en_US">Subscribe to zourbuth by Email</a><br />
222
+ <?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 />
223
+ <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"); ?>.
224
+ </li>
225
+ </ul>
226
+ </li>
227
+
228
+ </ul>
229
+ </div>
230
+ <?php
231
+ }
232
+ }
images/background.png ADDED
Binary file
index.php ADDED
@@ -0,0 +1,65 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ Plugin Name: Flickr Badges Widget
4
+ Plugin URI: http://zourbuth.com/plugins/flickr-badges-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.1
7
+ Author: zourbuth
8
+ Author URI: http://zourbuth.com
9
+ License: Under GPL2
10
+ */
11
+
12
+ /*
13
+ Copyright 2011 zourbuth (email : zourbuth@gmail.com)
14
+
15
+ This program is free software; you can redistribute it and/or modify
16
+ it under the terms of the GNU General Public License, version 2, as
17
+ published by the Free Software Foundation.
18
+
19
+ This program is distributed in the hope that it will be useful,
20
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
21
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22
+ GNU General Public License for more details.
23
+
24
+ You should have received a copy of the GNU General Public License
25
+ along with this program; if not, write to the Free Software
26
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
27
+ */
28
+
29
+ /* Launch the plugin. */
30
+ add_action( 'plugins_loaded', 'flickr_badges_widget_plugins_loaded' );
31
+
32
+ /* Initializes the plugin and it's features. */
33
+ function flickr_badges_widget_plugins_loaded() {
34
+
35
+ // Set constant path to the members plugin directory
36
+ define( 'FLICKR_BADGES_WIDGET_VERSION', '1.1' );
37
+ define( 'FLICKR_BADGES_WIDGET_DIR', plugin_dir_path( __FILE__ ) );
38
+ define( 'FLICKR_BADGES_WIDGET_URL', plugin_dir_url( __FILE__ ) );
39
+
40
+ // Loads and registers the new widgets
41
+ add_action( 'widgets_init', 'flickr_badges_widget_init' );
42
+
43
+ // Create additional links to plugin list
44
+ add_filter( 'plugin_row_meta', '_fbw_my_portfolio', 10, 2 );
45
+ }
46
+
47
+ /* Register the extra widgets. Each widget is meant to replace or extend the current default */
48
+ function flickr_badges_widget_init() {
49
+
50
+ /* Load widget file. */
51
+ require_once( FLICKR_BADGES_WIDGET_DIR . 'flickr-badges-widget.php' );
52
+
53
+ /* Register widget. */
54
+ register_widget( 'Flickr_Badges_Widget' );
55
+ }
56
+
57
+ function _fbw_my_portfolio($links, $file) {
58
+ $plugin = plugin_basename(__FILE__);
59
+
60
+ if ($file == $plugin) // create link
61
+ return array_merge( $links, array( sprintf( '<a href="http://codecanyon.net/user/zourbuth/portfolio?ref=zourbuth">Portfolios</a>', $plugin, __('Portfolios') ) ));
62
+ return $links;
63
+ }
64
+
65
+ ?>
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,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
5
+ Requires at least: 3.0
6
+ Tested up to: 3.3
7
+ Stable tag: 1.1
8
+
9
+ Display your Flickr latest photostream in widget area.
10
+
11
+ == Description ==
12
+
13
+ This is a simple widget to display your Flickr latest photostream in widget area using javascript from <code>http://www.flickr.com/badge_code_v2.gne</code>.
14
+ Find your Flickr ID from (<a href="http://www.idgettr.com" target="_blank">idGettr</a> if you do not know your 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
+ == Installation ==
24
+
25
+ You can use the built in installer and upgrader, or you can install the plugin manually.
26
+ 1. Go to the menu 'Plugins' -> 'Install' and search for 'Flickr Badges Widget'
27
+ 2. Click 'install'.
28
+
29
+ == Frequently Asked Questions ==
30
+
31
+ = A question that someone might have =
32
+
33
+ Please read the FAQ under http://zourbuth.com/plugins/flickr-badges-widget
34
+
35
+
36
+ == Screenshots ==
37
+
38
+ 1. Widget Settings
39
+ 2. Widget in frontend
40
+
41
+ == Changelog ==
42
+
43
+ = 1.0 =
44
+ * Released
45
+
46
+ == Upgrade Notice ==
47
+
48
+ = 1.0 =
49
+ Just upgrade via Wordpress.