Changeset 1168652
- Timestamp:
- 05/27/2015 03:30:25 PM (11 years ago)
- Location:
- bliptv-admin-menu/trunk
- Files:
-
- 2 edited
-
readme.txt (modified) (2 diffs)
-
rwsdev-blip.php (modified) (14 diffs)
Legend:
- Unmodified
- Added
- Removed
-
bliptv-admin-menu/trunk/readme.txt
r668779 r1168652 1 1 === Plugin Name === 2 Contributors: rwsdev-team3 Donate link: http:// rwsdev.net/bliptv-admin-menu2 Contributors: CrypTech Studios 3 Donate link: http://cryptechstudios.com/wp-plugins/bliptv-admin-menu 4 4 Tags: blip, blip.tv, api, video, upload 5 5 Requires at least: 3.0 6 Tested up to: 3.5.16 Tested up to: 4.2.2 7 7 License: GPLv2 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 40 40 41 41 == Changelog == 42 42 = 2.0 = 43 * fine tuned and compatability tested for 4.2.2. 43 44 = 1.0 = 44 45 * updated path info. -
bliptv-admin-menu/trunk/rwsdev-blip.php
r629434 r1168652 2 2 /* 3 3 Plugin Name: bliptv-admin-menu 4 Plugin URI: http:// rwsdev.net/bliptv-admin-menu4 Plugin URI: http://CrypTechStudios.com/wp-plugins/bliptv-admin-menu 5 5 Description: Wordpress admin area interface for Blip.tv API. Allow upload, delete and edit of uploaded files on blip.tv 6 Author: Jason Becht ( RWS Dev Team)7 Version: 1.0 Fri Nov 23 11:44:53 20128 Author URI: http:// rwsdev.net/6 Author: Jason Becht (CrypTech Studios, Inc.) 7 Version: 2.0 Wed May 27 10:05:00 2015 8 Author URI: http://CrypTechStudios.com/ 9 9 */ 10 10 … … 12 12 class RWSDevBlip { 13 13 const DB_VERSION = 1; 14 14 15 15 public function __construct() { 16 16 /* globalize $wpdb */ 17 17 global $wpdb; 18 18 19 19 /* include for pluggable.php */ 20 20 include_once(ABSPATH.'wp-includes/pluggable.php'); … … 22 22 /* blipPHP class */ 23 23 include_once('includes/blip-php/blipPHP.php'); 24 24 25 25 /* set plugin path and url */ 26 26 $this->pluginpath = dirname(__FILE__); 27 27 $this->pluginurl = WP_PLUGIN_URL.'/bliptv-admin-menu/'; 28 28 29 29 /* set table names */ 30 30 31 31 /* hooks, actions and filters */ 32 32 register_activation_hook(__FILE__,array($this,'RWSDevBlip_create_tables')); … … 37 37 add_action('wp_ajax_load_video_info',array($this,'load_video_info')); 38 38 add_action('wp_ajax_delete_video',array($this,'delete_video')); 39 40 39 40 41 41 /* localize $_POST and $_FILES data if we have it */ 42 42 $this->post_data = (isset($_POST))?$_POST:NULL; 43 43 $this->files_data = (isset($_FILES))?$_FILES:NULL; 44 44 45 45 } 46 46 public function RWSDEVBlip_activate() { … … 54 54 /* set table names */ 55 55 $this->videos_table = $wpdb->prefix."RWSDevBlip_videos"; 56 56 57 57 /* SQL for queries */ 58 58 $sql[0] = "CREATE TABLE $this->videos_table( … … 68 68 UNIQUE INDEX(blip_id) 69 69 );"; 70 70 71 71 require_once(ABSPATH . 'wp-admin/includes/upgrade.php'); 72 72 foreach ($sql as $sqlQuery) { … … 85 85 wp_register_style('RWSDevBlip-style', $css_path); 86 86 wp_enqueue_style('RWSDevBlip-style'); 87 87 88 88 /* enqueue wp jquery */ 89 89 wp_enqueue_script('jquery'); … … 106 106 /* globalize $wpdb */ 107 107 global $wpdb; 108 108 109 109 if (isset($this->post_data['submit'])) { 110 110 $this->update_video(); … … 117 117 /* globalize $wpdb */ 118 118 global $wpdb; 119 119 120 120 /* remove all video items from DB for refresh */ 121 121 $wpdb->query("DELETE FROM ".$wpdb->prefix."RWSDevBlip_videos"); … … 123 123 /* instantiate blipPHP */ 124 124 $blip = new blipPHP(get_option('RWSDevBlip_username'),get_option('RWSDevBlip_password')); 125 125 126 126 /* Blip API documentation states it returns 100 videos per page 127 127 * however they only return 12 and no indication of how many pages … … 172 172 global $wpdb; 173 173 if (check_admin_referer('RWSDevBlip-videos-form','_wpnonce')) { 174 174 175 175 /* instantiate blipPHP */ 176 176 $blip = new blipPHP(get_option('RWSDevBlip_username'),get_option('RWSDevBlip_password')); 177 177 178 178 $videoArr = $this->post_data['video']; 179 179 180 180 /* send edit to blip */ 181 181 $res = $blip->edit($videoArr['blip_id'],$videoArr['title'],$videoArr['description']); 182 182 183 183 /* if resp status is OK then update the db for the video */ 184 184 if ($res->status == 'OK') { … … 207 207 /* instantiate blipPHP */ 208 208 $blip = new blipPHP(get_option('RWSDevBlip_username'),get_option('RWSDevBlip_password')); 209 209 210 210 $videoArr = $this->post_data['video']; 211 211 212 212 /* send edit to blip */ 213 213 $res = $blip->upload($target_path,$videoArr['title'],$videoArr['description']); 214 215 214 215 216 216 /* if resp status is OK then update the db for the video */ 217 217 if ($res->status == 'OK') { 218 218 $videoArr['blip_id'] = $res->payload->asset->item_id; 219 219 220 220 /* remove local temp video */ 221 221 unlink($target_path); … … 248 248 $id = $this->post_data['id']; 249 249 $reason = ($this->post_data['reason'])?$this->post_data['reason']:'No reason given'; 250 250 251 251 /* get the blip_id for local video id */ 252 252 $blip_id = $wpdb->get_var("SELECT blip_id FROM ".$wpdb->prefix."RWSDevBlip_videos WHERE id = ".$id); … … 254 254 $blip = new blipPHP(get_option('RWSDevBlip_username'),get_option('RWSDevBlip_password')); 255 255 $res = $blip->delete($blip_id,$reason); 256 256 257 257 if ($res->payload->asset->deleted == 'true') { 258 258 $wpdb->delete($wpdb->prefix."RWSDevBlip_videos",array('id' => $id));
Note: See TracChangeset
for help on using the changeset viewer.