-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwp-appstore.php
1732 lines (1581 loc) · 92.4 KB
/
wp-appstore.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?php
/*
Plugin Name: WP AppStore
Plugin URI: http://wp-appstore.com
Description: Premium plugins and themes
Author: Lifeisgoodlabs
Version: 1.0.5
Author URI: http://www.wp-appstore.com
*/
if ( ! class_exists('WP_Upgrader') )
include_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
include_once 'wp-appstore.class.php';
if(file_exists(WP_PLUGIN_DIR."/wp-appstore/tools/config.php"))
include_once WP_PLUGIN_DIR."/wp-appstore/tools/config.php";
if (! function_exists('get_plugin_data'))
require_once(ABSPATH . 'wp-admin/includes/plugin.php');
function wp_appstore_admin_init() {
wp_enqueue_style( 'wp-appstore-css', plugins_url( basename( dirname( __FILE__ ) ) . '/wp-appstore.css' ), false, '20110322' );
wp_enqueue_style( 'wp-appstore-slider', plugins_url( basename( dirname( __FILE__ ) ) . '/assets/scrollable-horizontal.css' ), false, '20110322' );
wp_enqueue_style( 'wp-appstore-slider-buttons', plugins_url( basename( dirname( __FILE__ ) ) . '/assets/scrollable-buttons.css' ), false, '20110322' );
wp_enqueue_style( 'thickbox' );
wp_enqueue_script( 'wp-appstore-slider-js', plugins_url( basename( dirname( __FILE__ ) ) . '/assets/jquery.tools.min.js'), array( 'jquery'), '20110322' );
wp_enqueue_script('thickbox');
if(get_option('wp_appstore_frontend_rescan') && function_exists('wp_appstore_frontend'))
wp_appstore_frontend();
}
function wp_appstore_admin_menu() {
add_menu_page( 'WP Appstore', 'WP AppStore', 'manage_options', basename( __FILE__ ), 'wp_appstore_main', null, 61 );
add_submenu_page( basename( __FILE__ ), 'All Plugins', 'All Plugins', 'manage_options', basename( __FILE__ ).'&screen=all-plugins', 'wp_appstore_main' );
add_submenu_page( basename( __FILE__ ), 'All Themes', 'All Themes', 'manage_options', basename( __FILE__ ).'&screen=all-themes', 'wp_appstore_main' );
add_submenu_page( basename( __FILE__ ), 'Installed', 'Installed', 'manage_options', basename( __FILE__ ).'&screen=installed', 'wp_appstore_main' );
}
function wp_appstore_page_store($msg = false){
$appstore = new WP_AppStore();
$featured_plugins = $appstore->get_featured('plugin');
$featured_themes = $appstore->get_featured('theme');
$latest_plugins = $appstore->get_lastest('plugin');
$latest_themes = $appstore->get_lastest('theme');
$updates = get_option('wp_appstore_plugins_for_update', array());
if (is_array($updates) && isset($updates['wp-appstore']))
unset($updates['wp-appstore']);
$stats = $appstore->get_stats();
?>
<div class="wrap">
<?php screen_icon( 'plugins' );?>
<h2>WP AppStore
<span style="position:absolute;padding-left:15px;">
<a href="http://www.facebook.com/pages/WP-AppStore/147376395324061" target="_blank"><img src="<?php echo plugins_url( 'images/facebook.png', __FILE__ ); ?>" alt="" /></a>
<a href="http://twitter.com/wpappstore" target="_blank"><img src="<?php echo plugins_url( 'images/twitter.png', __FILE__ ); ?>" alt="" /></a>
<a href="http://wp-appstore.com/" target="_blank"><img src="<?php echo plugins_url( 'images/rss.png', __FILE__ ); ?>" alt="" /></a>
</span>
</h2>
<?php if($msg) echo $msg; ?>
<div id="poststuff" class="metabox-holder has-right-sidebar" style="max-width:950px;min-width:640px;">
<div id="side-info-column" class="inner-sidebar draggable">
<?php if(get_option('wp_appstore_autoupdate_request')): ?>
<div id="" class="postbox " style="">
<h3 class="hndle"><span>Update Avaliable!</span></h3>
<div class="inside">
<p>New update for this plugin now avaliable!</p>
<p style="text-align: center;">
<span class="buyoptions"><a href="<?php echo esc_attr(WP_AppStore::admin_url(array('screen'=>'autoupdate')));?>" class="button rbutton" title="Update It Now">Get Update Now!</a></span>
</p>
</div>
</div>
<?php endif; ?>
<div id="" class="postbox " style="">
<h3 class="hndle"><span>WELCOME!</span></h3>
<div class="inside">
<p>Welcome to the first place where you can get professional plugins and the best themes.</p>
<p>Please send feedback to <a href="mailto:eugene@lifeisgoodlabs.com">eugene@lifeisgoodlabs.com</a></p>
<p><strong>Submit your plugins on <a href="https://github.com/bsn/wp-appstore" target="_blank">our github page</a>!</strong></p>
</div>
</div>
<div id="" class="postbox " style="">
<h3 class="hndle"><span>Search</span></h3>
<div class="inside">
<form method="get" enctype="text/plain" action="">
<input type="hidden" value="wp-appstore.php" name="page" />
<input type="hidden" value="search" name="screen" />
<p class="searchbox">
<label for="plugin-search-input" class="screen-reader-text">Search Formulas Library:</label>
<input type="text" value="" name="s" id="plugin-search-input" style="margin-right: 1.5em;padding: .2em .3em;width: 95%;float: left;z-index: 999;"/>
<ul class="search-options">
<li><input type="checkbox" value="1" checked="checked" name="plugin" title="Search Plugins" />Search Plugins</li>
<li><input type="checkbox" value="1" name="theme" title="Search Themes" />Search Themes</li>
</ul>
<input type="submit" value="Search" class="button" id="search-submit" name="" />
</p>
</form>
</div>
</div>
<div id="" class="postbox " style="">
<h3 class="hndle"><span>WP AppStore stats</span></h3>
<div class="inside">
<?php if (get_option('wp_appstore_file_permissions_denied')):?>
<p>Automatic formulas update blocked on your site. Try to do it manually switching folder permissions to 0777 or let us try to do it</p>
<p><span class="buyoptions"><a href="<?php echo esc_attr(WP_AppStore::admin_url(array('screen'=>'force-formulas-update')));?>" class="button rbutton" title="Update It Now">Get Update Now!</a></span></p>
<?php else: ?>
<p><?php echo $stats['last_update']; ?></a></p>
<p>Plugin formulas: <?php echo $stats['plugins']; ?></p>
<p>Theme formulas: <?php echo $stats['themes']; ?></p>
<?php endif; ?>
<?php if (defined('WP_APPSTORE_DEV') && WP_APPSTORE_DEV == true):?>
<p>
<a class="button rbutton" href="<?php echo esc_attr(WP_AppStore::admin_url(array('screen'=>'force-update','formulas'=>'true')));?>">Update Formulas</a>
<a class="button rbutton" href="<?php echo esc_attr(WP_AppStore::admin_url(array('screen'=>'force-update','autoupdate'=>'true')));?>">Update WP AppStore</a>
</p>
<?php endif; ?>
</div>
</div>
<?php if(sizeof($updates) > 0): ?>
<div id="" class="postbox " style="">
<h3 class="hndle"><span>NEW VERSIONS OF PLUGINS AVALIABLE!</span></h3>
<div class="inside">
<p>We just received info about updates of next plugins:</p>
<ul>
<?php foreach($updates as $update): ?>
<li><a href="<?php echo esc_attr(WP_AppStore::admin_url(array('screen'=>'view-plugin','plugin_name'=>$update['object']->slug,'plugin_id'=>$update['object']->id)));?>" title="View Plugin Page"><?php echo $update['title'].' : Updated to version '.$update['object']->new_version; ?></a></li>
<?php endforeach; ?>
</ul>
</p>
</div>
</div>
<?php endif; ?>
<script src="http://widgets.twimg.com/j/2/widget.js"></script>
<script>
new TWTR.Widget({
version: 2,
type: 'profile',
rpp: 5,
interval: 6000,
width: 280,
height: 300,
theme: {
shell: {
background: '#e6e6e6',
color: '#303030'
},
tweets: {
background: '#ffffff',
color: '#5c5c5c',
links: '#56748f'
}
},
features: {
scrollbar: false,
loop: false,
live: true,
hashtags: true,
timestamp: false,
avatars: false,
behavior: 'all'
}
}).render().setUser('wpappstore').start();
</script>
<div id="" class="postbox " style="margin-top:20px;">
<h3 class="hndle"><span>SUBSCRIBE FOR UPDATES</span></h3>
<div class="inside">
<!-- Begin MailChimp Signup Form -->
<!--[if IE]>
<style type="text/css" media="screen">
#mc_embed_signup fieldset {position: relative;}
#mc_embed_signup legend {position: absolute; top: -1em; left: .2em;}
</style>
<![endif]-->
<!--[if IE 7]>
<style type="text/css" media="screen">
.mc-field-group {overflow:visible;}
</style>
<![endif]-->
<div id="mc_embed_signup">
<form action="http://lifeisgoodlabs.us1.list-manage2.com/subscribe/post?u=382bf9a62c1627d0e7dd2cb42&id=da67cb7263" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate" target="_blank" style="font: normal 100% Arial, sans-serif;font-size: 10px;">
<fieldset style="padding-top: 1.5em;background-color: #fff;color: #000;text-align: left;">
<div class="mc-field-group" style="margin: .3em 5%;clear: both;overflow: hidden;">
<label for="mce-EMAIL" style="display: block;line-height: 1.5em;font-weight: bold;">Email Address <strong class="note-required">*</strong>
</label>
<input type="text" value="" name="EMAIL" class="required email" id="mce-EMAIL" style="margin-right: 1.5em;padding: .2em .3em;width: 95%;float: left;z-index: 999;">
</div>
<div id="mce-responses" style="float: left;top: -1.4em;padding: 0em .5em 0em .5em;overflow: hidden;width: 90%;margin: 0 5%;clear: both;">
<div class="response" id="mce-error-response" style="display: none;margin: 1em 0;padding: 1em .5em .5em 0;font-weight: bold;float: left;top: -1.5em;z-index: 1;width: 80%;background: FBE3E4;color: #D12F19;"></div>
<div class="response" id="mce-success-response" style="display: none;margin: 1em 0;padding: 1em .5em .5em 0;font-weight: bold;float: left;top: -1.5em;z-index: 1;width: 80%;background: #E3FBE4;color: #529214;"></div>
</div>
<div>
<input type="submit" value="Subscribe" name="subscribe" id="mc-embedded-subscribe" class="button" style="clear: both;width: auto;display: block;margin: 1em 0 1em 5%;"></div>
</fieldset>
<a href="#" id="mc_embed_close" class="mc_embed_close" style="display: none;">Close</a>
</form>
</div>
<!--End mc_embed_signup-->
</div>
</div>
</div>
<div id="post-body">
<div id="post-body-content">
<?php if(is_array($featured_plugins)): ?>
<div id="namediv" class="stuffbox">
<h3><label for="link_name">Featured Plugins</label> - <a href="<?php echo esc_attr(WP_AppStore::admin_url(array('screen'=>'featured-plugins')));?>" title="All Featured Plugins">All Featured Plugins</a></h3>
<div class="inside">
<?php foreach($featured_plugins as $one): ?>
<div class="plugin">
<img class="logo" src="<?php echo icon_path($one); ?>" alt="" />
<a class="title" href="<?php echo esc_attr(WP_AppStore::admin_url(array('screen'=>'view-plugin','plugin_name'=>$one->slug,'plugin_id'=>$one->id)));?>"><?php echo $one->title;?></a>
<span class="category"><?php echo $one->category_name ?></span>
<span class="buyoptions"><a href="<?php if(!in_array($one->slug, $appstore->installed_plugins)){echo esc_attr(WP_AppStore::admin_url(array('screen'=>'install-plugin','plugin_name'=>$one->slug,'plugin_id'=>$one->id)));}else{echo "#";}?>" class="button rbutton" title="Get It Now"><?php if(in_array($one->slug, $appstore->installed_plugins)){echo "INSTALLED"; } else {echo "INSTALL";}?></a></span>
</div>
<?php endforeach; ?>
</div>
</div>
<?php endif; ?>
<?php if(is_array($latest_plugins)): ?>
<div id="namediv1" class="stuffbox">
<h3><label for="link_name">Lastest Plugins</label> - <a href="<?php echo esc_attr(WP_AppStore::admin_url(array('screen'=>'all-plugins')));?>" title="All Plugins">All Plugins</a></h3>
<div class="inside">
<?php foreach($latest_plugins as $one): ?>
<div class="plugin">
<img class="logo" src="<?php echo icon_path($one); ?>" alt="" />
<a class="title" href="<?php echo esc_attr(WP_AppStore::admin_url(array('screen'=>'view-plugin','plugin_name'=>$one->slug,'plugin_id'=>$one->id)));?>"><?php echo $one->title;?></a>
<span class="category"><?php echo $one->category_name ?></span>
<span class="buyoptions"><a href="<?php if(!in_array($one->slug, $appstore->installed_plugins)){echo esc_attr(WP_AppStore::admin_url(array('screen'=>'install-plugin','plugin_name'=>$one->slug,'plugin_id'=>$one->id)));}else{echo "#";}?>" class="button rbutton" title="Get It Now"><?php if(in_array($one->slug, $appstore->installed_plugins)){echo "INSTALLED"; } else {echo "INSTALL";}?></a></span>
</div>
<?php endforeach; ?>
</div>
</div>
<?php endif; ?>
<?php if(is_array($featured_themes)): ?>
<div id="addressdiv" class="stuffbox">
<h3><label for="link_url">Featured Themes</label> - <a href="<?php echo esc_attr(WP_AppStore::admin_url(array('screen'=>'featured-themes')));?>" title="All Featured Themes">All Featured Themes</a></h3>
<div class="inside">
<?php foreach($featured_themes as $one): ?>
<div class="theme">
<img class="scrot" width="280px" src="<?php echo icon_path($one); ?>" alt="" />
<a class="title" href="<?php echo esc_attr(WP_AppStore::admin_url(array('screen'=>'view-theme','theme_name'=>$one->slug,'theme_id'=>$one->id)));?>"><?php echo $one->title; ?></a>
<span class="category"><?php echo $one->category_name; ?></span>
<span class="buyoptions"><a href="<?php if(!in_array($one->slug, $appstore->installed_themes)){echo esc_attr(WP_AppStore::admin_url(array('screen'=>'install-theme','theme_name'=>$one->slug,'theme_id'=>$one->id)));}else{echo "#";}?>" class="button rbutton" title="Get It Now"><?php if(in_array($one->slug, $appstore->installed_themes)){echo "INSTALLED"; } else {echo "INSTALL";}?></a></span>
</div>
<?php endforeach; ?>
</div>
</div>
<?php endif; ?>
<?php if(is_array($latest_themes)): ?>
<div id="addressdiv1" class="stuffbox">
<h3><label for="link_url">Lastest Themes</label> - <a href="<?php echo esc_attr(WP_AppStore::admin_url(array('screen'=>'all-themes')));?>" title="All Themes">All Themes</a></h3>
<div class="inside">
<?php foreach($latest_themes as $one): ?>
<div class="theme">
<img class="scrot" width="280px" src="<?php echo icon_path($one); ?>" alt="" />
<a class="title" href="<?php echo esc_attr(WP_AppStore::admin_url(array('screen'=>'view-theme','theme_name'=>$one->slug,'theme_id'=>$one->id)));?>"><?php echo $one->title; ?></a>
<span class="category"><?php echo $one->category_name; ?></span>
<span class="buyoptions"><a href="<?php if(!in_array($one->slug, $appstore->installed_themes)){echo esc_attr(WP_AppStore::admin_url(array('screen'=>'install-theme','theme_name'=>$one->slug,'theme_id'=>$one->id)));}else{echo "#";}?>" class="button rbutton" title="Get It Now"><?php if(in_array($one->slug, $appstore->installed_themes)){echo "INSTALLED"; } else {echo "INSTALL";}?></a></span>
</div>
<?php endforeach; ?>
</div>
</div>
<?php endif; ?>
</div>
</div>
</div>
</div>
<?php
}
function wp_appstore_page_search_results($results){
$plugins = array();
$themes = array();
if (isset($results['plugin']))
$plugins = $results['plugin'];
if (isset($results['theme']))
$themes = $results['theme'];
$updates = get_option('wp_appstore_plugins_for_update', array());
if (is_array($updates) && isset($updates['wp-appstore']))
unset($updates['wp-appstore']);
$appstore = $results['appstore_object'];
$stats = $appstore->get_stats();
$tags = array();
if (isset($results['tags']))
$tags = $results['tags'];
?>
<div class="wrap">
<?php screen_icon( 'plugins' );?>
<h2>WP AppStore
<span style="position:absolute;padding-left:15px;">
<a href="http://www.facebook.com/pages/WP-AppStore/147376395324061" target="_blank"><img src="<?php echo plugins_url( 'images/facebook.png', __FILE__ ); ?>" alt="" /></a>
<a href="http://twitter.com/wpappstore" target="_blank"><img src="<?php echo plugins_url( 'images/twitter.png', __FILE__ ); ?>" alt="" /></a>
<a href="http://wp-appstore.com/" target="_blank"><img src="<?php echo plugins_url( 'images/rss.png', __FILE__ ); ?>" alt="" /></a>
</span>
</h2>
<div id="poststuff" class="metabox-holder has-right-sidebar" style="max-width:950px;min-width:640px;">
<div id="side-info-column" class="inner-sidebar draggable">
<?php if(get_option('wp_appstore_autoupdate_request')): ?>
<div id="" class="postbox " style="">
<h3 class="hndle"><span>Update Avaliable!</span></h3>
<div class="inside">
<p>New update for this plugin now avaliable!</p>
<p style="text-align: center;">
<span class="buyoptions"><a href="<?php echo esc_attr(WP_AppStore::admin_url(array('screen'=>'autoupdate')));?>" class="button rbutton" title="Update It Now">Get Update Now!</a></span>
</p>
</div>
</div>
<?php endif; ?>
<div id="" class="postbox " style="">
<h3 class="hndle"><span>WELCOME!</span></h3>
<div class="inside">
<p>Welcome to the first place where you can get professional plugins and the best themes.</p>
<p>Please send feedback to <a href="mailto:eugene@lifeisgoodlabs.com">eugene@lifeisgoodlabs.com</a></p>
<p><strong>Submit your plugins on <a href="https://github.com/bsn/wp-appstore" target="_blank">our github page</a>!</strong></p>
</div>
</div>
<div id="" class="postbox " style="">
<h3 class="hndle"><span>Search</span></h3>
<div class="inside">
<form method="get" enctype="text/plain" action="">
<input type="hidden" value="wp-appstore.php" name="page" />
<input type="hidden" value="search" name="screen" />
<p class="searchbox">
<label for="plugin-search-input" class="screen-reader-text">Search Formulas Library:</label>
<input type="text" value="<?php if(isset($results['keyword'])) echo $results['keyword']; ?>" name="s" id="plugin-search-input" style="margin-right: 1.5em;padding: .2em .3em;width: 95%;float: left;z-index: 999;"/>
<ul class="search-options">
<li><input type="checkbox" value="1" checked="checked" name="plugin" title="Search Plugins" />Search Plugins</li>
<li><input type="checkbox" value="1" name="theme" title="Search Themes" />Search Themes</li>
</ul>
<input type="submit" value="Search" class="button" id="search-submit" name="" />
</p>
</form>
</div>
</div>
<?php if($tags): ?>
<div id="" class="postbox " style="">
<h3 class="hndle"><span>Tags:</span></h3>
<div class="inside">
<p>
<?php foreach($tags as $tag): ?>
<?php
$tags_type = '';
if (sizeof($plugins) > 0) {
$tags_type = array('plugin'=>'1');
}
if (sizeof($themes) > 0 ) {
$tags_type = array('theme'=>'1');
}
if (sizeof($plugins) > 0 && sizeof($themes) > 0 ) {
$tags_type = '';
}
?>
<a href="<?php echo esc_attr(WP_AppStore::admin_url(array('screen'=>'tag-filter','tag'=>$tag,$tags_type))); ?>" style="text-transform: capitalize; margin-right: 5px;"><?php echo $tag; ?></a>
<?php endforeach; ?>
</p>
</div>
</div>
<?php endif; ?>
<div id="" class="postbox " style="">
<h3 class="hndle"><span>WP AppStore stats</span></h3>
<div class="inside">
<p><?php echo $stats['last_update']; ?></a></p>
<p>Plugins formulas in database: <?php echo $stats['plugins']; ?></p>
<p>Themes formulas in database: <?php echo $stats['themes']; ?></p>
</div>
</div>
<?php if(sizeof($updates) > 0): ?>
<div id="" class="postbox " style="">
<h3 class="hndle"><span>NEW VERSIONS OF PLUGINS AVALIABLE!</span></h3>
<div class="inside">
<p>We just received info about updates of next plugins:</p>
<ul>
<?php foreach($updates as $update): ?>
<li><a href="<?php echo esc_attr(WP_AppStore::admin_url(array('screen'=>'view-plugin','plugin_name'=>$update['object']->slug,'plugin_id'=>$update['object']->id)));?>" title="View Plugin Page"><?php echo $update['title'].' : Updated to version '.$update['object']->new_version; ?></a></li>
<?php endforeach; ?>
</ul>
</p>
</div>
</div>
<?php endif; ?>
<script src="http://widgets.twimg.com/j/2/widget.js"></script>
<script>
new TWTR.Widget({
version: 2,
type: 'profile',
rpp: 5,
interval: 6000,
width: 280,
height: 300,
theme: {
shell: {
background: '#e6e6e6',
color: '#303030'
},
tweets: {
background: '#ffffff',
color: '#5c5c5c',
links: '#56748f'
}
},
features: {
scrollbar: false,
loop: false,
live: true,
hashtags: true,
timestamp: false,
avatars: false,
behavior: 'all'
}
}).render().setUser('wpappstore').start();
</script>
<div id="" class="postbox " style="margin-top:20px;">
<h3 class="hndle"><span>SUBSCRIBE FOR UPDATES</span></h3>
<div class="inside">
<!-- Begin MailChimp Signup Form -->
<!--[if IE]>
<style type="text/css" media="screen">
#mc_embed_signup fieldset {position: relative;}
#mc_embed_signup legend {position: absolute; top: -1em; left: .2em;}
</style>
<![endif]-->
<!--[if IE 7]>
<style type="text/css" media="screen">
.mc-field-group {overflow:visible;}
</style>
<![endif]-->
<div id="mc_embed_signup">
<form action="http://lifeisgoodlabs.us1.list-manage2.com/subscribe/post?u=382bf9a62c1627d0e7dd2cb42&id=da67cb7263" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate" target="_blank" style="font: normal 100% Arial, sans-serif;font-size: 10px;">
<fieldset style="padding-top: 1.5em;background-color: #fff;color: #000;text-align: left;">
<div class="mc-field-group" style="margin: .3em 5%;clear: both;overflow: hidden;">
<label for="mce-EMAIL" style="display: block;line-height: 1.5em;font-weight: bold;">Email Address <strong class="note-required">*</strong>
</label>
<input type="text" value="" name="EMAIL" class="required email" id="mce-EMAIL" style="margin-right: 1.5em;padding: .2em .3em;width: 95%;float: left;z-index: 999;">
</div>
<div id="mce-responses" style="float: left;top: -1.4em;padding: 0em .5em 0em .5em;overflow: hidden;width: 90%;margin: 0 5%;clear: both;">
<div class="response" id="mce-error-response" style="display: none;margin: 1em 0;padding: 1em .5em .5em 0;font-weight: bold;float: left;top: -1.5em;z-index: 1;width: 80%;background: FBE3E4;color: #D12F19;"></div>
<div class="response" id="mce-success-response" style="display: none;margin: 1em 0;padding: 1em .5em .5em 0;font-weight: bold;float: left;top: -1.5em;z-index: 1;width: 80%;background: #E3FBE4;color: #529214;"></div>
</div>
<div>
<input type="submit" value="Subscribe" name="subscribe" id="mc-embedded-subscribe" class="button" style="clear: both;width: auto;display: block;margin: 1em 0 1em 5%;"></div>
</fieldset>
<a href="#" id="mc_embed_close" class="mc_embed_close" style="display: none;">Close</a>
</form>
</div>
<!--End mc_embed_signup-->
</div>
</div>
</div>
<div id="post-body">
<div id="post-body-content">
<?php if(isset($results['serched_for'])): ?>
<h2><?php echo $results['serched_for']; ?></h2>
<?php endif; ?>
<?php if(sizeof($plugins) > 0): ?>
<div id="namediv" class="stuffbox">
<h3><label for="link_name">Plugins</label></h3>
<div class="inside">
<?php foreach($plugins as $one): ?>
<div class="plugin">
<img class="logo" src="<?php echo icon_path($one); ?>" alt="" />
<a class="title" href="<?php echo esc_attr(WP_AppStore::admin_url(array('screen'=>'view-plugin','plugin_name'=>$one->slug,'plugin_id'=>$one->id)));?>"><?php echo $one->title;?></a>
<span class="category"><?php echo $one->category_name; ?></span>
<span class="buyoptions"><a href="<?php if(array_key_exists($one->slug, $updates)){echo esc_attr(WP_AppStore::admin_url(array('screen'=>'plugin-update','plugin_name'=>$one->slug)));} elseif(!in_array($one->slug, $appstore->installed_plugins)){echo esc_attr(WP_AppStore::admin_url(array('screen'=>'install-plugin','plugin_name'=>$one->slug,'plugin_id'=>$one->id)));}else{echo "#";}?>" class="button rbutton" title="Buy It Now"><?php if(array_key_exists($one->slug, $updates)){echo "UPDATE";} elseif(in_array($one->slug, $appstore->installed_plugins)){echo "INSTALLED"; } else {echo "INSTALL";}?></a></span>
</div>
<?php endforeach; ?>
</div>
</div>
<?php endif; ?>
<?php if(sizeof($themes) > 0): ?>
<div id="addressdiv" class="stuffbox">
<h3><label for="link_url">Themes</label></h3>
<div class="inside">
<?php foreach($themes as $one): ?>
<div class="theme">
<img class="scrot" width="280px" src="<?php echo icon_path($one); ?>" alt="" />
<a class="title" href="<?php echo esc_attr(WP_AppStore::admin_url(array('screen'=>'view-theme','theme_name'=>$one->slug,'theme_id'=>$one->id)));?>"><?php echo $one->title; ?></a>
<span class="category"><?php echo $one->category_name; ?></span>
<span class="buyoptions"><a href="<?php if(!in_array($one->slug, $appstore->installed_themes)){echo esc_attr(WP_AppStore::admin_url(array('screen'=>'install-theme','theme_name'=>$one->slug,'theme_id'=>$one->id)));}else{echo "#";}?>" class="button rbutton" title="Buy It Now"><?php if(in_array($one->slug, $appstore->installed_themes)){echo "INSTALLED"; } else {echo "INSTALL";}?></a></span>
</div>
<?php endforeach; ?>
</div>
</div>
<?php endif; ?>
</div>
</div>
</div>
</div>
<div id="buysorrymessage" style="display:none;">
<p style="margin-top:50px;margin-left:20px;margin-right:30px;">Sorry, but this functionality is not yet available.
Please enter your email below and we will notify you when you can download an update.</p>
<p>
<form action="http://lifeisgoodlabs.us1.list-manage2.com/subscribe/post?u=382bf9a62c1627d0e7dd2cb42&id=da67cb7263" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate" target="_blank" style="font: normal 100% Arial, sans-serif;font-size: 10px;">
<fieldset style="background-color: #fff;color: #000;text-align: left;">
<div class="mc-field-group" style="margin: .3em 5%;clear: both;overflow: hidden;">
<label for="mce-EMAIL" style="display: block;line-height: 1.5em;font-weight: bold;">Email Address <strong class="note-required">*</strong>
</label>
<input type="text" value="" name="EMAIL" class="required email" id="mce-EMAIL" style="margin-right: 1.5em;padding: .2em .3em;width: 95%;float: left;z-index: 999;">
</div>
<div id="mce-responses" style="float: left;top: -1.4em;padding: 0em .5em 0em .5em;overflow: hidden;width: 90%;margin: 0 5%;clear: both;">
<div class="response" id="mce-error-response" style="display: none;margin: 1em 0;padding: 1em .5em .5em 0;font-weight: bold;float: left;top: -1.5em;z-index: 1;width: 80%;background: FBE3E4;color: #D12F19;"></div>
<div class="response" id="mce-success-response" style="display: none;margin: 1em 0;padding: 1em .5em .5em 0;font-weight: bold;float: left;top: -1.5em;z-index: 1;width: 80%;background: #E3FBE4;color: #529214;"></div>
</div>
<div>
<input type="submit" value="Subscribe" name="subscribe" id="mc-embedded-subscribe" class="button" style="clear: both;width: auto;display: block;margin: 1em 0 1em 5%;"></div>
</fieldset>
<a href="#" id="mc_embed_close" class="mc_embed_close" style="display: none;">Close</a>
</form>
</p>
</div>
<?php
}
function wp_appstore_page_view_plugin($plugin_info){
$appstore = new WP_AppStore();
$updates = get_option('wp_appstore_plugins_for_update', array());
if (is_array($updates) && isset($updates['wp-appstore']))
unset($updates['wp-appstore']);
$tags = $appstore->sort_item_tags($plugin_info, 'plugin');
?>
<script type="text/javascript">
jQuery(document).ready(function($) {
$('a.tags-trigger').click(function(){
$('.tags-annotation').toggle('slow');
$('.tags-all').toggle('slow');
});
});
</script>
<div id="buysorrymessage" style="display:none;">
<p style="margin-top:50px;margin-left:20px;margin-right:30px;">Sorry, but this functionality is not yet available.
Please enter your email below and we will notify you when you can download an update.</p>
<p>
<form action="http://lifeisgoodlabs.us1.list-manage2.com/subscribe/post?u=382bf9a62c1627d0e7dd2cb42&id=da67cb7263" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate" target="_blank" style="font: normal 100% Arial, sans-serif;font-size: 10px;">
<fieldset style="background-color: #fff;color: #000;text-align: left;">
<div class="mc-field-group" style="margin: .3em 5%;clear: both;overflow: hidden;">
<label for="mce-EMAIL" style="display: block;line-height: 1.5em;font-weight: bold;">Email Address <strong class="note-required">*</strong>
</label>
<input type="text" value="" name="EMAIL" class="required email" id="mce-EMAIL" style="margin-right: 1.5em;padding: .2em .3em;width: 95%;float: left;z-index: 999;">
</div>
<div id="mce-responses" style="float: left;top: -1.4em;padding: 0em .5em 0em .5em;overflow: hidden;width: 90%;margin: 0 5%;clear: both;">
<div class="response" id="mce-error-response" style="display: none;margin: 1em 0;padding: 1em .5em .5em 0;font-weight: bold;float: left;top: -1.5em;z-index: 1;width: 80%;background: FBE3E4;color: #D12F19;"></div>
<div class="response" id="mce-success-response" style="display: none;margin: 1em 0;padding: 1em .5em .5em 0;font-weight: bold;float: left;top: -1.5em;z-index: 1;width: 80%;background: #E3FBE4;color: #529214;"></div>
</div>
<div>
<input type="submit" value="Subscribe" name="subscribe" id="mc-embedded-subscribe" class="button" style="clear: both;width: auto;display: block;margin: 1em 0 1em 5%;"></div>
</fieldset>
<a href="#" id="mc_embed_close" class="mc_embed_close" style="display: none;">Close</a>
</form>
</p>
</div>
<div class="wrap">
<?php screen_icon( 'plugins' );?>
<h2>WP AppStore</h2>
<div id="poststuff" class="metabox-holder has-right-sidebar" style="max-width:950px;min-width:640px;">
<div id="side-info-column" class="inner-sidebar draggable">
<div id="" class="postbox " style="margin-top:50px;">
<h3 class="hndle"><span>Information</span></h3>
<div class="inside">
<p>
<ul style="margin-left:10px;font-weight:bold;">
<li>Released: <?php echo date('d M, Y', strtotime($plugin_info->updated));?></li>
<li>Version: <?php echo $plugin_info->version; ?></li>
<?php if(sizeof($tags) > 0): ?>
<li>Tags:
<div class="tags-annotation collapsable" style="display: block;">
<?php for ($i=0;$i<=4 ;$i++):?>
<a href="<?php echo esc_attr(WP_AppStore::admin_url(array('screen'=>'tag-filter','tag'=>$tags[$i],'plugin'=>'1'))); ?>" style="text-transform: capitalize; margin-right: 5px;"><?php echo $tags[$i]; ?></a>
<?php endfor; ?>
<a href="#" class="tags-trigger">All tags...</a>
</div>
<div class="tags-all collapsable" style="display: none;">
<?php foreach($tags as $tag): ?>
<a href="<?php echo esc_attr(WP_AppStore::admin_url(array('screen'=>'tag-filter','tag'=>$tag,'plugin'=>'1'))); ?>" style="text-transform: capitalize; margin-right: 5px;"><?php echo $tag; ?></a>
<?php endforeach; ?>
</div>
</li>
<?php endif; ?>
<li>Rating:
<div title="<?php printf( _n( '(based on %s rating)', '(based on %s ratings)', $plugin_info->votes ), number_format_i18n( $plugin_info->votes ) ) ?>" class="star-holder">
<div style="width: <?php echo esc_attr( $plugin_info->rating ) ?>px" class="star star-rating"></div>
<div class="star star5"><img alt="5 stars" src="<?php echo plugins_url( 'images/gray-star.png?v=20110615', __FILE__ ); ?>"></div>
<div class="star star4"><img alt="4 stars" src="<?php echo plugins_url( 'images/gray-star.png?v=20110615', __FILE__ ); ?>"></div>
<div class="star star3"><img alt="3 stars" src="<?php echo plugins_url( 'images/gray-star.png?v=20110615', __FILE__ ); ?>"></div>
<div class="star star2"><img alt="2 stars" src="<?php echo plugins_url( 'images/gray-star.png?v=20110615', __FILE__ ); ?>"></div>
<div class="star star1"><img alt="1 star" src="<?php echo plugins_url( 'images/gray-star.png?v=20110615', __FILE__ ); ?>"></div>
</div>
</li>
<li></li>
</ul>
</p>
</div>
</div>
<div id="" class="postbox " style="">
<h3 class="hndle"><span>About Developer</span></h3>
<div class="inside">
<p>
<ul style="margin-left:10px;font-weight:bold;">
<li>Developer: <?php echo $plugin_info->author; ?></li>
</ul>
</p>
</div>
</div>
</div>
<div id="post-body">
<div id="post-body-content">
<div class="general_info">
<div class="logo_and_buy_button" >
<img class="logo" src="<?php echo icon_path($plugin_info); ?>" alt="" />
<span class="buyoptions"><a href="<?php if(array_key_exists($plugin_info->slug, $updates)){echo esc_attr(WP_AppStore::admin_url(array('screen'=>'plugin-update','plugin_name'=>$plugin_info->slug)));} elseif(!in_array($plugin_info->slug, $appstore->installed_plugins)){echo esc_attr(WP_AppStore::admin_url(array('screen'=>'install-plugin','plugin_name'=>$plugin_info->slug,'plugin_id'=>$plugin_info->id)));}else{echo "#";}?>" class="button rbutton" title="Get It Now"><?php if(array_key_exists($plugin_info->slug, $updates)){echo "UPDATE";} elseif(in_array($plugin_info->slug, $appstore->installed_plugins)){echo "INSTALLED"; } else {echo "INSTALL";}?></a></span>
<?php if (defined('WP_APPSTORE_DEV') && WP_APPSTORE_DEV == true):?>
<?php if(in_array($plugin_info->slug, $appstore->installed_plugins)): ?>
<span class="buyoptions"><a href="<?php echo esc_attr(WP_AppStore::admin_url(array('screen'=>'force-update','plugin'=>$plugin_info->id)));?>" class="button rbutton" title="Get It Now">REINSTALL</a></span>
<?php endif; ?>
<?php endif; ?>
</div>
<h2><?php echo $plugin_info->title; ?></h2>
<div class="description">
<?php echo $plugin_info->description; ?>
</div>
<div class="latest_changes"></div>
</div>
<?php if(count($plugin_info->screenshots)>0): ?>
<!-- slider -->
<!-- wrapper element for the large image -->
<div id="image_wrap">
<!-- Initially the image is a simple 1x1 pixel transparent GIF -->
<img src="<?php echo plugins_url( 'assets/img/blank.gif', __FILE__ ); ?>" width="530" />
</div>
<!-- "previous page" action -->
<a class="prev browse left"></a>
<!-- root element for scrollable -->
<div class="scrollable">
<!-- root element for the items -->
<div class="items">
<div>
<?php for ($i=1;$i <= count($plugin_info->screenshots); $i++): ?>
<?php if(!($i % 5)) echo '</div><div>'; ?>
<?php echo '<img src="'.$plugin_info->screenshots[$i-1].'" />' ?>
<?php endfor; ?>
</div>
</div>
</div>
<!-- "next page" action -->
<a class="next browse right"></a>
<script>
// execute your scripts when the DOM is ready. this is mostly a good habit
jQuery(document).ready(function($) {
// initialize scrollable
$(".scrollable").scrollable();
$(".items img").click(function() {
// see if same thumb is being clicked
if ($(this).hasClass("active")) { return; }
// calclulate large image's URL based on the thumbnail URL (flickr specific)
var url = $(this).attr("src")//.replace("_t", "");
// get handle to element that wraps the image and make it semi-transparent
var wrap = $("#image_wrap").fadeTo("medium", 0.5);
// the large image from www.flickr.com
var img = new Image();
// call this function after it's loaded
img.onload = function() {
// make wrapper fully visible
wrap.fadeTo("fast", 1);
// change the image
wrap.find("img").attr("src", url);
};
// begin loading the image from www.flickr.com
img.src = url;
// activate item
$(".items img").removeClass("active");
$(this).addClass("active");
// when page loads simulate a "click" on the first image
}).filter(":first").click();
});
</script>
<!-- endof slider -->
<?php endif; ?>
</div>
</div>
</div>
</div>
<?php
}
function wp_appstore_page_view_theme($theme_info){
$appstore = new WP_AppStore();
$updates = get_option('wp_appstore_themes_for_update', array());
$tags = $appstore->sort_item_tags($theme_info, 'theme');
?>
<script type="text/javascript">
jQuery(document).ready(function($) {
$('a.tags-trigger').click(function(){
$('.tags-annotation').toggle('slow');
$('.tags-all').toggle('slow');
});
});
</script>
<div id="buysorrymessage" style="display:none;">
<p style="margin-top:50px;margin-left:20px;margin-right:30px;">Sorry, but this functionality is not yet available.
Please enter your email below and we will notify you when you can download an update.</p>
<p>
<form action="http://lifeisgoodlabs.us1.list-manage2.com/subscribe/post?u=382bf9a62c1627d0e7dd2cb42&id=da67cb7263" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate" target="_blank" style="font: normal 100% Arial, sans-serif;font-size: 10px;">
<fieldset style="background-color: #fff;color: #000;text-align: left;">
<div class="mc-field-group" style="margin: .3em 5%;clear: both;overflow: hidden;">
<label for="mce-EMAIL" style="display: block;line-height: 1.5em;font-weight: bold;">Email Address <strong class="note-required">*</strong>
</label>
<input type="text" value="" name="EMAIL" class="required email" id="mce-EMAIL" style="margin-right: 1.5em;padding: .2em .3em;width: 95%;float: left;z-index: 999;">
</div>
<div id="mce-responses" style="float: left;top: -1.4em;padding: 0em .5em 0em .5em;overflow: hidden;width: 90%;margin: 0 5%;clear: both;">
<div class="response" id="mce-error-response" style="display: none;margin: 1em 0;padding: 1em .5em .5em 0;font-weight: bold;float: left;top: -1.5em;z-index: 1;width: 80%;background: FBE3E4;color: #D12F19;"></div>
<div class="response" id="mce-success-response" style="display: none;margin: 1em 0;padding: 1em .5em .5em 0;font-weight: bold;float: left;top: -1.5em;z-index: 1;width: 80%;background: #E3FBE4;color: #529214;"></div>
</div>
<div>
<input type="submit" value="Subscribe" name="subscribe" id="mc-embedded-subscribe" class="button" style="clear: both;width: auto;display: block;margin: 1em 0 1em 5%;"></div>
</fieldset>
<a href="#" id="mc_embed_close" class="mc_embed_close" style="display: none;">Close</a>
</form>
</p>
</div>
<div class="wrap">
<?php screen_icon( 'plugins' );?>
<h2>WP AppStore</h2>
<div id="poststuff" class="metabox-holder has-right-sidebar" style="max-width:950px;min-width:640px;">
<div id="side-info-column" class="inner-sidebar draggable">
<div id="" class="postbox " style="margin-top:50px;">
<h3 class="hndle"><span>Information</span></h3>
<div class="inside">
<p>
<ul style="margin-left:10px;font-weight:bold;">
<li>Released: <?php echo date('d M, Y', strtotime($theme_info->updated));?></li>
<li>Version: <?php echo $theme_info->version; ?></li>
<?php if(sizeof($tags) > 0): ?>
<li>Tags:
<div class="tags-annotation collapsable" style="display: block;">
<?php for ($i=0;$i<=4 ;$i++):?>
<a href="<?php echo esc_attr(WP_AppStore::admin_url(array('screen'=>'tag-filter','tag'=>$tags[$i],'theme'=>'1'))); ?>" style="text-transform: capitalize; margin-right: 5px;"><?php echo $tags[$i]; ?></a>
<?php endfor; ?>
<a href="#" class="tags-trigger">All tags...</a>
</div>
<div class="tags-all collapsable" style="display: none;">
<?php foreach($tags as $tag): ?>
<a href="<?php echo esc_attr(WP_AppStore::admin_url(array('screen'=>'tag-filter','tag'=>$tag,'theme'=>'1'))); ?>" style="text-transform: capitalize; margin-right: 5px;"><?php echo $tag; ?></a>
<?php endforeach; ?>
</div>
</li>
<?php endif; ?>
<li>Rating:
<div title="<?php printf( _n( '(based on %s rating)', '(based on %s ratings)', $theme_info->votes ), number_format_i18n( $theme_info->votes ) ) ?>" class="star-holder">
<div style="width: <?php echo esc_attr( $theme_info->rating ) ?>px" class="star star-rating"></div>
<div class="star star5"><img alt="5 stars" src="<?php echo plugins_url( 'images/gray-star.png?v=20110615', __FILE__ ); ?>"></div>
<div class="star star4"><img alt="4 stars" src="<?php echo plugins_url( 'images/gray-star.png?v=20110615', __FILE__ ); ?>"></div>
<div class="star star3"><img alt="3 stars" src="<?php echo plugins_url( 'images/gray-star.png?v=20110615', __FILE__ ); ?>"></div>
<div class="star star2"><img alt="2 stars" src="<?php echo plugins_url( 'images/gray-star.png?v=20110615', __FILE__ ); ?>"></div>
<div class="star star1"><img alt="1 star" src="<?php echo plugins_url( 'images/gray-star.png?v=20110615', __FILE__ ); ?>"></div>
</div>
</li>
<li></li>
</ul>
</p>
</div>
</div>
<div id="" class="postbox " style="">
<h3 class="hndle"><span>About Developer</span></h3>
<div class="inside">
<p>
<ul style="margin-left:10px;font-weight:bold;">
<li>Developer: <?php echo $theme_info->author;?></li>
<li><a href="<?php echo $theme_info->link;?>">Theme Website</a></li>
</ul>
</p>
</div>
</div>
</div>
<div id="post-body">
<div id="post-body-content">
<div class="general_info">
<div class="logo_and_buy_button" >
<span class="buyoptions"><a href="<?php if(array_key_exists($theme_info->slug, $updates)){echo esc_attr(WP_AppStore::admin_url(array('screen'=>'theme-update','theme'=>$theme_info->slug)));} elseif(!in_array($theme_info->slug, $appstore->installed_themes)){echo esc_attr(WP_AppStore::admin_url(array('screen'=>'install-theme','theme'=>$theme_info->slug,'theme_id'=>$theme_info->id)));}else{echo "#";}?>" class="button rbutton" title="Get It Now"><?php if(array_key_exists($theme_info->slug, $updates)){echo "UPDATE";} elseif(in_array($theme_info->slug, $appstore->installed_themes)){echo "INSTALLED"; } else {echo "INSTALL";}?></a></span>
<?php if (defined('WP_APPSTORE_DEV') && WP_APPSTORE_DEV == true):?>
<?php if(in_array($theme_info->slug, $appstore->installed_themes)): ?>
<span class="buyoptions"><a href="<?php echo esc_attr(WP_AppStore::admin_url(array('screen'=>'force-update','theme'=>$theme_info->id)));?>" class="button rbutton" title="Get It Now">REINSTALL</a></span>
<?php endif; ?>
<?php endif; ?>
</div>
<h2><?php echo $theme_info->title;?></h2>
<div class="description">
<?php echo $theme_info->description;?>
</ul>
</p>
</div>
<div class="latest_changes"></div>
</div>
<?php if(count($theme_info->screenshots)>0): ?>
<!-- slider -->
<!-- wrapper element for the large image -->
<div id="image_wrap">
<!-- Initially the image is a simple 1x1 pixel transparent GIF -->
<img src="<?php echo plugins_url( 'assets/img/blank.gif', __FILE__ ); ?>" width="530" />
</div>
<!-- "previous page" action -->
<a class="prev browse left"></a>
<!-- root element for scrollable -->
<div class="scrollable">
<!-- root element for the items -->
<div class="items">
<div>
<?php for ($i=1;$i <= count($theme_info->screenshots); $i++): ?>
<?php if(!($i % 5)) echo '</div><div>'; ?>
<?php echo '<img src="'.$theme_info->screenshots[$i-1].'" />' ?>
<?php endfor; ?>
</div>
</div>
</div>
<!-- "next page" action -->
<a class="next browse right"></a>
<script>
// execute your scripts when the DOM is ready. this is mostly a good habit
jQuery(document).ready(function($) {
// initialize scrollable
$(".scrollable").scrollable();
$(".items img").click(function() {
// see if same thumb is being clicked
if ($(this).hasClass("active")) { return; }
// calclulate large image's URL based on the thumbnail URL (flickr specific)
var url = $(this).attr("src")//.replace("_t", "");
// get handle to element that wraps the image and make it semi-transparent
var wrap = $("#image_wrap").fadeTo("medium", 0.5);
// the large image from www.flickr.com
var img = new Image();
// call this function after it's loaded
img.onload = function() {
// make wrapper fully visible
wrap.fadeTo("fast", 1);
// change the image
wrap.find("img").attr("src", url);
};
// begin loading the image from www.flickr.com
img.src = url;
// activate item
$(".items img").removeClass("active");
$(this).addClass("active");
// when page loads simulate a "click" on the first image
}).filter(":first").click();
});
</script>
<!-- endof slider -->
<?php endif; ?>
</div>
</div>
</div>
</div>
<?php
}
function wp_appstore_main() {
$pages = array('store', 'search', 'tag-filter', 'all-plugins', 'all-themes', 'view-plugin', 'view-theme', 'install-plugin', 'install-theme', 'autoupdate', 'plugin-update', 'theme-update', 'installed', 'featured-plugins', 'featured-themes', 'force-formulas-update', 'force-update');
$page = '';
if(!isset($_GET['screen']) || !in_array($_GET['screen'],$pages)){
$page = 'store';
} else {
$page = $_GET['screen'];
}
switch($page){
case 'store':
wp_appstore_page_store();
break;
case 'view-plugin':
if(isset($_GET['plugin_id']) && (intval($_GET['plugin_id']) > 0)){
$appstore = new WP_AppStore();
$plugin_info = $appstore->get_plugin(intval($_GET['plugin_id']));
if($plugin_info != null){
wp_appstore_page_view_plugin($plugin_info);
} else {
wp_appstore_page_store();
}
} else {
wp_appstore_page_store();
}
break;
case 'search':
if(isset($_GET['s']) && (strlen($_GET['s']) > 2)){
//s=keyword&plugin=1&theme=1
if (isset($_GET['plugin']))
$type = 'plugin';
elseif(isset($_GET['theme']))
$type = 'theme';
else
$type = '';
if (isset($_GET['plugin']) && isset($_GET['theme']))
$type = '';
$appstore = new WP_AppStore();
$result = $appstore->search($_GET['s'], $type);
if ( !$result['plugin'] && !$result['theme'] )
$result['serched_for'] = sprintf('No matches found for "%s" in formulas library', $_GET['s']);
else
$result['serched_for'] = sprintf('Search results for "%s" from formulas library:', $_GET['s']);
$result['keyword'] = $_GET['s'];
$result['appstore_object'] = $appstore;
if(sizeof($result) > 0){
wp_appstore_page_search_results($result);
} else {
wp_appstore_page_store();
}
} else {
wp_appstore_page_store();
}
break;
case 'installed':
$appstore = new WP_AppStore();
$result['plugin'] = $appstore->get_installed('plugin');
$result['theme'] = $appstore->get_installed('theme');
$result['serched_for'] = 'Plugins and Themes installed in your system:';
$result['appstore_object'] = $appstore;
wp_appstore_page_search_results($result);
break;
case 'featured-plugins':
$appstore = new WP_AppStore();
$result['plugin'] = $appstore->get_featured('plugin', false, false);
$result['tags'] = $appstore->get_tags('plugin', false);
$result['serched_for'] = 'All featured plugins:';
$result['appstore_object'] = $appstore;
wp_appstore_page_search_results($result);
break;
case 'featured-themes':