Plugin Directory

Changeset 529529


Ignore:
Timestamp:
04/10/2012 04:16:02 PM (14 years ago)
Author:
GuidePress
Message:
 
Location:
guidepress/trunk
Files:
1 added
7 deleted
6 edited

Legend:

Unmodified
Added
Removed
  • guidepress/trunk/css/gp.css

    r528260 r529529  
    1 .client.video-container {
     1.cgp.video-container {
    22}
    33
    4 .client.video-container .video-box {
     4.cgp.video-container .video-box {
    55  float:left;
    66  width:250px;
     
    88}
    99
    10 .client.video-container .video-actions {
     10.cgp.video-container .video-actions {
    1111 
    1212}
     
    9898
    9999/* Guidpress Playlist */
    100 
    101 .clear {
    102   clear:both;
    103 }
    104 
    105 .odd {
    106   background-color: #f1f1f1 !important;
    107 }
    108 
    109100#guidepress_video_list {background-color: #222222}
    110101
     
    128119}
    129120
    130 .active {
     121.guidpress_playlist_video.active {
    131122  background-color: #ffffff
    132123}
    133124
    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; 
    136131}
    137132
     
    174169}
    175170
    176 a {
     171#guidepress_container a{
    177172    text-decoration:none
    178173}
  • guidepress/trunk/gp-ajax.php

    r528260 r529529  
    11<?php
    22/*
    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');
     3Copyright (c) 2012, GuidePress.net.
     4
     5This program is free software; you can redistribute it and/or
     6modify it under the terms of the GNU General Public License
     7as published by the Free Software Foundation; either version 2
     8of the License, or (at your option) any later version.
     9
     10This program is distributed in the hope that it will be useful,
     11but WITHOUT ANY WARRANTY; without even the implied warranty of
     12MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     13GNU General Public License for more details.
     14
     15You should have received a copy of the GNU General Public License
     16along with this program; if not, write to the Free Software
     17Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
     18*/
     19
     20define('API_URL', 'http://guidepress.net/wp-content/plugins/master-guidepress/index.php');
    1021
    1122class client_gp_ajax extends client_gp {
    12  
    13  
    1423  // Show embed code for user selected video
    1524  function ajax_callback_fetch_video() {
  • guidepress/trunk/guidepress.php

    r528661 r529529  
    33Plugin Name: GuidePress
    44Plugin URI: http://guidepress.net/
    5 Description: Video Tutorials for learning WordPress at your fingertips.
    6 Author: Guidepress
     5Description: The GuidePress plugin puts WordPress video tutorials right into the the WP dashboard! It's a handy companion for new and seasoned WP users.
     6Author: GuidePress
    77Version: 0.1
    8 Author URI: http://www.guidepress.net/
     8Author URI: http://guidepress.net/
     9
     10@license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
     11Copyright (c) 2012, GuidePress.net.
     12
     13This program is free software; you can redistribute it and/or
     14modify it under the terms of the GNU General Public License
     15as published by the Free Software Foundation; either version 2
     16of the License, or (at your option) any later version.
     17
     18This program is distributed in the hope that it will be useful,
     19but WITHOUT ANY WARRANTY; without even the implied warranty of
     20MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     21GNU General Public License for more details.
     22
     23You should have received a copy of the GNU General Public License
     24along with this program; if not, write to the Free Software
     25Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
    926*/
     27
    1028
    1129if (!function_exists('add_action')) {
     
    1331}
    1432
    15 global $wpdb;
    1633define('CGP_DIR', plugin_dir_url(__FILE__));
    1734
     
    2037
    2138class client_gp {
    22 
    2339  // Init
    2440  function init() {
     
    5369     
    5470      // 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'));
    5972     
    6073      // add dialog for subscription activation, new account creation and forgotten username
     
    6376      // send comments to master server
    6477      add_action('admin_footer', array(__CLASS__, 'leave_comment'));
    65 
    66      
    67 
    6878    } // if (is_admin)
    6979  } // 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
    17881
    17982  // Add content to Guidepress tab
     
    217120   
    218121    // Content output
    219     echo '<div id="guidepress_content">
     122    echo '<div id="guidepress_content" style="display:none;">
    220123            <div id="guidepress_container">';
    221124   
     
    336239                                   'href' => '#'));
    337240  } // add_admin_bar_guidepress
    338 
    339  
    340   // Add Fancy Box Script
    341   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   } // scripts
    353241 
    354242 
     
    379267    $category = $current_screen->id;
    380268   
    381     $output .= '<div class="client video-container">';
     269    $output .= '<div class="cgp video-container">';
    382270    $output .= '<div id="error">Please register if you wish to view this video!</div>';
    383271             
     
    617505        // }
    618506   
    619     echo '<div id="subscribe-dialog">';
     507    echo '<div id="subscribe-dialog" style="display:none;">';
    620508    // Logo
    621509    echo '<div align="center">
     
    650538 
    651539  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');
    653540      wp_enqueue_style('wp-jquery-ui-dialog');
    654541      wp_enqueue_style('client-gp-style', plugins_url('css/gp.css', __FILE__), array(), '1.0.0');
     
    658545  function admin_footer_enqueus() {
    659546      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');   
    664547      wp_enqueue_script('jquery-ui-dialog');
    665548  } // admin_footer_enqueus
     
    699582    }
    700583  } // 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 
    702702} // class client_gp
    703703
    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');
     704add_action('init', array('client_gp', 'init'));
     705register_activation_hook(__FILE__, array('client_gp', 'activate'));
     706register_deactivation_hook(__FILE__, array('client_gp', 'deactivate'));
     707
     708// Cron
     709add_action('gp_update_cron', 'gp_update_cron', 1);
     710
     711//make new schedule round
     712if (!wp_next_scheduled('gp_update_cron')) {
     713  wp_schedule_event(time(), 'hourly', 'gp_update_cron');
    710714}
     715
     716// Cron Function
     717function gp_update_cron() {
     718  client_gp::gp_update_cron();
     719} // gp_update_cron3
     720
    711721?>
  • guidepress/trunk/js/gp-common.js

    r528260 r529529  
    358358      }]
    359359  }); // jQuery Comment dialog
    360  
    361  
    362360}); // jQuery
  • guidepress/trunk/readme.txt

    r528666 r529529  
    1111== Description ==
    1212
    13 **Please don't download yet. Plugin currently has some bugs and we 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**
    1414
    1515
     
    7373== Changelog ==
    7474
    75 = 0.3 =
     75= 0.1 =
     76* 10/04/12
    7677* Initial beta release.
    7778
  • guidepress/trunk/videopress-player.php

    r528260 r529529  
    736736      }
    737737      $cache_key_pieces[] = $guid;
    738       if ( $width > 0 )
     738      if ( @$width > 0 )
    739739        $cache_key_pieces[] = $maxwidth;
    740740      if ( is_ssl() )
Note: See TracChangeset for help on using the changeset viewer.