Changeset 529529
- Timestamp:
- 04/10/2012 04:16:02 PM (14 years ago)
- Location:
- guidepress/trunk
- Files:
-
- 1 added
- 7 deleted
- 6 edited
-
css/gp.css (modified) (5 diffs)
-
fancybox (deleted)
-
gp-ajax.php (modified) (1 diff)
-
guidepress.php (modified) (12 diffs)
-
images/Flag.png (deleted)
-
images/camera-video.png (added)
-
images/delete.png (deleted)
-
images/edit.png (deleted)
-
images/green-flag.png (deleted)
-
images/overlay-bg.png (deleted)
-
images/red-flag.png (deleted)
-
js/gp-common.js (modified) (1 diff)
-
readme.txt (modified) (2 diffs)
-
videopress-player.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
guidepress/trunk/css/gp.css
r528260 r529529 1 .c lient.video-container {1 .cgp.video-container { 2 2 } 3 3 4 .c lient.video-container .video-box {4 .cgp.video-container .video-box { 5 5 float:left; 6 6 width:250px; … … 8 8 } 9 9 10 .c lient.video-container .video-actions {10 .cgp.video-container .video-actions { 11 11 12 12 } … … 98 98 99 99 /* Guidpress Playlist */ 100 101 .clear {102 clear:both;103 }104 105 .odd {106 background-color: #f1f1f1 !important;107 }108 109 100 #guidepress_video_list {background-color: #222222} 110 101 … … 128 119 } 129 120 130 . active {121 .guidpress_playlist_video.active { 131 122 background-color: #ffffff 132 123 } 133 124 134 .comments { 135 font-weight:bold; 125 #guidepress_main_video .comments { 126 font-weight:bold !important; 127 } 128 129 #guidpress_video_useful_links a { 130 font-weight:bold !important; 136 131 } 137 132 … … 174 169 } 175 170 176 a{171 #guidepress_container a{ 177 172 text-decoration:none 178 173 } -
guidepress/trunk/gp-ajax.php
r528260 r529529 1 1 <?php 2 2 /* 3 Client GuidePress Ajax 4 AJAX endpoint 5 (c) 2011. Web factory Ltd 6 */ 7 8 define('API_URL', 'http://wpdev4.webfactoryltd.com/wp-content/plugins/master-guidepress/index.php'); 9 define('E_MAIL', 'hrvoje.krbavac@gmail.com'); 3 Copyright (c) 2012, GuidePress.net. 4 5 This program is free software; you can redistribute it and/or 6 modify it under the terms of the GNU General Public License 7 as published by the Free Software Foundation; either version 2 8 of the License, or (at your option) any later version. 9 10 This program is distributed in the hope that it will be useful, 11 but WITHOUT ANY WARRANTY; without even the implied warranty of 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 GNU General Public License for more details. 14 15 You should have received a copy of the GNU General Public License 16 along with this program; if not, write to the Free Software 17 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 */ 19 20 define('API_URL', 'http://guidepress.net/wp-content/plugins/master-guidepress/index.php'); 10 21 11 22 class client_gp_ajax extends client_gp { 12 13 14 23 // Show embed code for user selected video 15 24 function ajax_callback_fetch_video() { -
guidepress/trunk/guidepress.php
r528661 r529529 3 3 Plugin Name: GuidePress 4 4 Plugin URI: http://guidepress.net/ 5 Description: Video Tutorials for learning WordPress at your fingertips.6 Author: Guide press5 Description: The GuidePress plugin puts WordPress video tutorials right into the the WP dashboard! It's a handy companion for new and seasoned WP users. 6 Author: GuidePress 7 7 Version: 0.1 8 Author URI: http://www.guidepress.net/ 8 Author URI: http://guidepress.net/ 9 10 @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 11 Copyright (c) 2012, GuidePress.net. 12 13 This program is free software; you can redistribute it and/or 14 modify it under the terms of the GNU General Public License 15 as published by the Free Software Foundation; either version 2 16 of the License, or (at your option) any later version. 17 18 This program is distributed in the hope that it will be useful, 19 but WITHOUT ANY WARRANTY; without even the implied warranty of 20 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 GNU General Public License for more details. 22 23 You should have received a copy of the GNU General Public License 24 along with this program; if not, write to the Free Software 25 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 9 26 */ 27 10 28 11 29 if (!function_exists('add_action')) { … … 13 31 } 14 32 15 global $wpdb;16 33 define('CGP_DIR', plugin_dir_url(__FILE__)); 17 34 … … 20 37 21 38 class client_gp { 22 23 39 // Init 24 40 function init() { … … 53 69 54 70 // add div elements for dialog content 55 add_action('admin_footer', array(__CLASS__, 'prep_dialog')); 56 57 // add script for fancybox 58 add_action('admin_footer', array(__CLASS__, 'fancybox_script')); 71 add_action('admin_footer', array(__CLASS__, 'prep_dialog')); 59 72 60 73 // add dialog for subscription activation, new account creation and forgotten username … … 63 76 // send comments to master server 64 77 add_action('admin_footer', array(__CLASS__, 'leave_comment')); 65 66 67 68 78 } // if (is_admin) 69 79 } // init 70 71 72 // Cron Function 73 function gp_hourly() { 74 global $wpdb; 75 76 // Vars 77 $errors = array(); 78 $output = array(); 79 $total_videos = 0; 80 $client_status = 'Free'; 81 $tmp_meta = ''; 82 $inputs = client_gp::fetch_options(); 83 84 // Setup username and domain data 85 $params = "?username=" . $inputs['username'] . "&password=" . $inputs['password']; 86 87 $ch = curl_init(); 88 89 curl_setopt($ch, CURLOPT_URL, API_URL . $params); 90 curl_setopt($ch, CURLOPT_HEADER, 0); 91 curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 92 curl_setopt($ch, CURLOPT_POST, 0); 93 94 // grab URL and pass it to the browser 95 $response = curl_exec($ch); 96 curl_close($ch); 97 98 // Unserialize response 99 $unserialized_response = unserialize($response); 100 101 // If Master Response is valid and contains required data... 102 if ($unserialized_response && is_array($unserialized_response) && !isset($unserialized_response['error'])) { 103 104 // Delete Old tutorials 105 $posts = get_posts(array('post_type'=>'video-tutorials', 'numberposts'=>'-1')); 106 foreach ($posts as $post) { 107 wp_delete_post($post->ID); 108 } 109 110 // Loop for inserting new videos in Client database 111 foreach ($unserialized_response as $post_item) { 112 // Save post meta to tmp and unset 113 $tmp_meta = $post_item->post_meta; 114 115 // Unset unneeded data 116 unset($post_item->post_meta); 117 unset($post_item->ID); 118 119 // If video does not have "exclude" flag status, retrive it 120 if ($tmp_meta['status'] != 'exclude') { 121 122 // Video level (Beginner, advanced etc..) 123 $tmp_meta['level'] = str_replace('-', ' ', $tmp_meta['level']); 124 $tmp_meta['level'] = ucfirst($tmp_meta['level']); 125 // Video status (Up to date, old but relevant etc...) 126 $tmp_meta['status'] = str_replace('-', ' ', $tmp_meta['status']); 127 $tmp_meta['status'] = ucfirst($tmp_meta['status']); 128 129 // Add new post to custom post type "video-tutorials" 130 $new_post_id = wp_insert_post($post_item); 131 132 // Update youtube video meta for new post 133 update_post_meta($new_post_id, 'youtube', $tmp_meta['youtube']); 134 135 // Update videopress meta for new post 136 if (isset($tmp_meta['videopress'])) { 137 // And set the new client status as "Premium" 138 $client_status = 'Premium'; 139 update_post_meta($new_post_id, 'videopress', $tmp_meta['videopress']); 140 } 141 142 // Update category settings for new post 143 if (is_array($tmp_meta['category'])) { 144 foreach ($tmp_meta['category'] as $cat) { 145 $name = explode('.', $cat->name); 146 add_post_meta($new_post_id, 'category', $name[0]); 147 } 148 } 149 150 // Update post order 151 if ($tmp_meta['order']) { 152 foreach ($tmp_meta['order'] as $ord => $pos) { 153 foreach ($pos as $order => $value) { 154 update_post_meta($new_post_id, $order, $value); 155 } 156 } 157 } 158 159 // Get all other meta data for new post 160 update_post_meta($new_post_id, 'description', $tmp_meta['description']); 161 update_post_meta($new_post_id, 'level', $tmp_meta['level']); 162 update_post_meta($new_post_id, 'status', $tmp_meta['status']); 163 update_post_meta($new_post_id, 'links', $tmp_meta['links']); 164 update_post_meta($new_post_id, 'comment_count', $tmp_meta['comment_count']); 165 166 // Count how many videos are added 167 $total_videos++; 168 } // if ($tmp_meta['status'] != 'exclude') 169 } // foreach ($unserialized_response) 170 171 // Update client status - just for refreshing status from Free to Premium or otherwise 172 update_option('client_gp_type', $client_status); 173 } 174 175 die('1'); 176 } // do_this_hourly 177 80 178 81 179 82 // Add content to Guidepress tab … … 217 120 218 121 // Content output 219 echo '<div id="guidepress_content" >122 echo '<div id="guidepress_content" style="display:none;"> 220 123 <div id="guidepress_container">'; 221 124 … … 336 239 'href' => '#')); 337 240 } // add_admin_bar_guidepress 338 339 340 // Add Fancy Box Script341 function fancybox_script() {342 echo "<script type='text/javascript'>343 jQuery(document).ready(function(){344 jQuery('.various').fancybox({'transitionIn' : 'none',345 'transitionOut' : 'none'});346 347 jQuery('.various-inline').fancybox({'titlePosition' : 'inside',348 'transitionIn' : 'none',349 'transitionOut' : 'none'});350 });351 </script>";352 } // scripts353 241 354 242 … … 379 267 $category = $current_screen->id; 380 268 381 $output .= '<div class="c lientvideo-container">';269 $output .= '<div class="cgp video-container">'; 382 270 $output .= '<div id="error">Please register if you wish to view this video!</div>'; 383 271 … … 617 505 // } 618 506 619 echo '<div id="subscribe-dialog" >';507 echo '<div id="subscribe-dialog" style="display:none;">'; 620 508 // Logo 621 509 echo '<div align="center"> … … 650 538 651 539 function admin_enqueue_scripts() { 652 wp_enqueue_style('client-gp-fancybox-style', plugins_url('fancybox/jquery.fancybox-1.3.4.css', __FILE__), array(), '1.0.0');653 540 wp_enqueue_style('wp-jquery-ui-dialog'); 654 541 wp_enqueue_style('client-gp-style', plugins_url('css/gp.css', __FILE__), array(), '1.0.0'); … … 658 545 function admin_footer_enqueus() { 659 546 wp_enqueue_script('gp-video-client-common', plugins_url('js/gp-common.js', __FILE__), array(), '1.0.0'); 660 wp_enqueue_script('gp-video-client-fancybox-mousewheel', plugins_url('fancybox/jquery.mousewheel-3.0.4.pack.js', __FILE__), array(), '1.0.0');661 wp_enqueue_script('gp-video-client-fancybox-main', plugins_url('fancybox/jquery.fancybox-1.3.4.pack.js', __FILE__), array(), '1.0.0');662 wp_enqueue_script('gp-video-client-fancybox-main2', plugins_url('fancybox/jquery.fancybox-1.3.4.js', __FILE__), array(), '1.0.0');663 wp_enqueue_script('gp-video-client-fancybox-main3', plugins_url('fancybox/jquery.easing-1.3.pack.js', __FILE__), array(), '1.0.0');664 547 wp_enqueue_script('jquery-ui-dialog'); 665 548 } // admin_footer_enqueus … … 699 582 } 700 583 } // youtube_id 701 584 585 586 // Activate plugin 587 function activate() { 588 } // activate 589 590 591 // Deactivate plugin 592 function deactivate() { 593 wp_clear_scheduled_hook('gp_update_cron'); 594 } // deactivate 595 596 597 // Update cRon 598 function gp_update_cron() { 599 global $wpdb; 600 601 // Vars 602 $errors = array(); 603 $output = array(); 604 $total_videos = 0; 605 $client_status = 'Free'; 606 $tmp_meta = ''; 607 $inputs = self::fetch_options(); 608 609 // Setup username and domain data 610 $params = "?username=" . $inputs['username'] . "&password=" . $inputs['password'] . "&domain=" . $_SERVER['HTTP_HOST']; 611 612 $ch = curl_init(); 613 614 curl_setopt($ch, CURLOPT_URL, API_URL . $params); 615 curl_setopt($ch, CURLOPT_HEADER, 0); 616 curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 617 curl_setopt($ch, CURLOPT_POST, 0); 618 619 // grab URL and pass it to the browser 620 $response = curl_exec($ch); 621 curl_close($ch); 622 623 // Unserialize response 624 $unserialized_response = unserialize($response); 625 626 // If Master Response is valid and contains required data... 627 if ($unserialized_response && is_array($unserialized_response) && !isset($unserialized_response['error'])) { 628 // Delete Old tutorials 629 $posts = get_posts(array('post_type'=>'video-tutorials', 'numberposts'=>'-1')); 630 foreach ($posts as $post) { 631 wp_delete_post($post->ID); 632 } 633 634 // Loop for inserting new videos in Client database 635 foreach ($unserialized_response as $post_item) { 636 637 // Save post meta to tmp and unset 638 $tmp_meta = $post_item->post_meta; 639 640 // Unset unneeded data 641 unset($post_item->post_meta); 642 unset($post_item->ID); 643 644 // If video does not have "exclude" flag status, retrive it 645 if ($tmp_meta['status'] != 'exclude') { 646 647 // Video level (Beginner, advanced etc..) 648 $tmp_meta['level'] = str_replace('-', ' ', $tmp_meta['level']); 649 $tmp_meta['level'] = ucfirst($tmp_meta['level']); 650 // Video status (Up to date, old but relevant etc...) 651 $tmp_meta['status'] = str_replace('-', ' ', $tmp_meta['status']); 652 $tmp_meta['status'] = ucfirst($tmp_meta['status']); 653 654 // Add new post to custom post type "video-tutorials" 655 $new_post_id = wp_insert_post($post_item); 656 657 // Update youtube video meta for new post 658 update_post_meta($new_post_id, 'youtube', $tmp_meta['youtube']); 659 660 // Update videopress meta for new post 661 if (isset($tmp_meta['videopress'])) { 662 // And set the new client status as "Premium" 663 $client_status = 'Premium'; 664 update_post_meta($new_post_id, 'videopress', $tmp_meta['videopress']); 665 } 666 667 // Update category settings for new post 668 if (is_array($tmp_meta['category'])) { 669 foreach ($tmp_meta['category'] as $cat) { 670 $name = explode('.', $cat->name); 671 add_post_meta($new_post_id, 'category', $name[0]); 672 } 673 } 674 675 // Update post order 676 if ($tmp_meta['order']) { 677 foreach ($tmp_meta['order'] as $ord => $pos) { 678 foreach ($pos as $order => $value) { 679 update_post_meta($new_post_id, $order, $value); 680 } 681 } 682 } 683 684 // Get all other meta data for new post 685 update_post_meta($new_post_id, 'description', $tmp_meta['description']); 686 update_post_meta($new_post_id, 'level', $tmp_meta['level']); 687 update_post_meta($new_post_id, 'status', $tmp_meta['status']); 688 update_post_meta($new_post_id, 'links', $tmp_meta['links']); 689 update_post_meta($new_post_id, 'comment_count', $tmp_meta['comment_count']); 690 691 // Count how many videos are added 692 $total_videos++; 693 } // if ($tmp_meta['status'] != 'exclude') 694 } // foreach ($unserialized_response) 695 696 // Update client status - just for refreshing status from Free to Premium or otherwise 697 update_option('client_gp_type', $client_status); 698 } 699 } // gp_update_cron 700 701 702 702 } // class client_gp 703 703 704 add_action('init', array('client_gp','init')); 705 706 // Cron 707 add_action('do_this_hourly', array('client_gp', 'gp_hourly')); 708 if (!wp_next_scheduled('do_this_hourly')) { 709 wp_schedule_event(time(), 'hourly', 'do_this_hourly'); 704 add_action('init', array('client_gp', 'init')); 705 register_activation_hook(__FILE__, array('client_gp', 'activate')); 706 register_deactivation_hook(__FILE__, array('client_gp', 'deactivate')); 707 708 // Cron 709 add_action('gp_update_cron', 'gp_update_cron', 1); 710 711 //make new schedule round 712 if (!wp_next_scheduled('gp_update_cron')) { 713 wp_schedule_event(time(), 'hourly', 'gp_update_cron'); 710 714 } 715 716 // Cron Function 717 function gp_update_cron() { 718 client_gp::gp_update_cron(); 719 } // gp_update_cron3 720 711 721 ?> -
guidepress/trunk/js/gp-common.js
r528260 r529529 358 358 }] 359 359 }); // jQuery Comment dialog 360 361 362 360 }); // jQuery -
guidepress/trunk/readme.txt
r528666 r529529 11 11 == Description == 12 12 13 **Please don't download yet. Plugin currently has some bugs and w e will try to get it working by 12/04/12**13 **Please don't download yet. Plugin currently has some bugs and will try to get it working by 12/04/12** 14 14 15 15 … … 73 73 == Changelog == 74 74 75 = 0.3 = 75 = 0.1 = 76 * 10/04/12 76 77 * Initial beta release. 77 78 -
guidepress/trunk/videopress-player.php
r528260 r529529 736 736 } 737 737 $cache_key_pieces[] = $guid; 738 if ( $width > 0 )738 if ( @$width > 0 ) 739 739 $cache_key_pieces[] = $maxwidth; 740 740 if ( is_ssl() )
Note: See TracChangeset
for help on using the changeset viewer.