Changeset 1296909
- Timestamp:
- 11/29/2015 07:07:42 PM (10 years ago)
- Location:
- os-media/trunk
- Files:
-
- 6 edited
-
classes/OSmedia-base.php (modified) (1 diff)
-
classes/OSmedia-post-admin.php (modified) (3 diffs)
-
classes/OSmedia-post-frontend.php (modified) (8 diffs)
-
classes/OSmedia-settings.php (modified) (1 diff)
-
layout/osmedia_cpt-twentyfifteen.php (modified) (1 diff)
-
readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
os-media/trunk/classes/OSmedia-base.php
r1296549 r1296909 156 156 */ 157 157 public function activate( $network_wide ) { 158 // create default options if not exists159 if( @get_option(OSmedia_OPTS) ) {160 $opts = @get_option(OSmedia_OPTS);161 }162 if( !isset($opts) || !is_array($opts) ) {163 update_option( OSmedia_OPTS, OSmedia_Settings::get_default_settings() );164 }165 166 // add demp CPT167 $post_id = wp_insert_post(array (168 'post_type' => 'osmedia_cpt',169 'post_title' => 'OSmedia demo CPT',170 'post_content' => 'OSmedia demo CPT content',171 'post_status' => 'publish',172 'comment_status' => 'closed', // if you prefer173 'ping_status' => 'closed', // if you prefer174 ));175 if ($post_id) {176 // insert post meta177 add_post_meta($post_id, 'OSmedia_mp4', 'https://s3-eu-west-1.amazonaws.com/openstream.tv/SEP/OSmedia_demo1.mp4');178 add_post_meta($post_id, 'OSmedia_webm', 'https://s3-eu-west-1.amazonaws.com/openstream.tv/SEP/OSmedia_demo1.webm');179 add_post_meta($post_id, 'OSmedia_autoplay', 'on');180 add_post_meta($post_id, 'OSmedia_loop', 'on');181 }182 183 158 184 159 if ( $network_wide && is_multisite() ) { -
os-media/trunk/classes/OSmedia-post-admin.php
r1296549 r1296909 448 448 } 449 449 450 echo '<pre> DATA_MODEL: post_id->'.$post_id.' ';var_dump($out); echo '</pre>'; // MONITOR450 // echo '<pre> DATA_MODEL: post_id->'.$post_id.' ';var_dump($out); echo '</pre>'; // MONITOR 451 451 return $out; 452 452 } … … 622 622 self::create_taxonomies(); 623 623 624 // add demo CPT 625 $cpt_id = @wp_insert_post(array ( 626 'post_type' => 'osmedia_cpt', 627 'post_title' => 'OSmedia Demo Featured Video', 628 'post_content' => 'OSmedia Demo CPT - Featured Video Content', 629 'post_status' => 'publish', 630 'comment_status' => 'closed', 631 'ping_status' => 'closed' 632 )); 633 if ($cpt_id && !is_wp_error( $cpt_id ) ) { 634 add_post_meta($cpt_id, 'OSmedia_mp4', 'https://s3-eu-west-1.amazonaws.com/openstream.tv/SEP/OSmedia_demo1.mp4'); 635 add_post_meta($cpt_id, 'OSmedia_webm', 'https://s3-eu-west-1.amazonaws.com/openstream.tv/SEP/OSmedia_demo1.webm'); 636 add_post_meta($cpt_id, 'OSmedia_autoplay', 'on'); 637 add_post_meta($cpt_id, 'OSmedia_loop', 'on'); 638 } 639 640 // add featured video page 641 $page_id = @wp_insert_post(array ( 642 'post_type' => 'page', 643 'post_title' => 'OSmedia Featured Video', 644 'post_status' => 'publish', 645 'comment_status' => 'closed', 646 'ping_status' => 'closed' 647 )); 648 if ( $page_id && !is_wp_error( $page_id ) ){ 649 update_post_meta( $page_id, '_wp_page_template', 'featured_video_list.php' ); 650 } 624 651 } 625 652 … … 639 666 */ 640 667 public function init() { 668 641 669 self::get_metabox_params(); 642 670 -
os-media/trunk/classes/OSmedia-post-frontend.php
r1296137 r1296909 10 10 class OSmedia_Post_Frontend extends OSmedia_Module { 11 11 12 // public static $OSmedia_postmeta = array();13 14 // private static $options = array();15 16 12 public static $video_ext = array('mp4', 'ogg', 'ogv', 'webm'); // Arrays are not allowed in class constants in PHP :( 17 13 … … 34 30 /** 35 31 * Metodo per il confronto dei parametri del singolo post (meta), con quelli generali (option). 36 * Se il post è nuovo (is_edit_page('new')) i parametri meta INIZIALI sono pescati dalle options generali. 37 * Se si edita un post esistente sono pescati dai suoi custom field 32 * 38 33 * 39 34 * @mvc Model … … 93 88 }elseif( $atts['type'] == 'vimeo' ) { // 4. Vimeo 94 89 $view = 'frontend/vimeo.php'; 90 /* RETROCOMP //////////////// 91 }elseif( $atts['type'] == 'old_version' ) { 92 echo 'GUHGHGIHGIHGIHGIGIHGIHGIHGIHGIGI'.do_shortcode( $atts ); 93 ////////////////////////////*/ 95 94 }else{ // 5. standard HTML5 96 95 $view = 'frontend/standard.php'; … … 128 127 // echo '<pre> SHORTCODE:'; var_dump($shortcode); echo '</pre>'; 129 128 130 $base_atts = self::OSmedia_data_model(); // carica i dati e li elabora pescand adai postmeta (solo CPT)129 $base_atts = self::OSmedia_data_model(); // carica i dati e li elabora pescando dai postmeta (solo CPT) 131 130 // echo '<pre> BASE_ATTS:'; var_dump($base_atts); echo '</pre>'; 132 131 … … 183 182 if( !empty($atts['vimeo']) ) $atts['type'] ='vimeo'; 184 183 } 184 // if( isset($atts['feat']) && $atts['feat'] == 'true' ) $atts['type'] = 'old_version'; // retrocomp. 185 185 186 186 // poster image controller … … 190 190 $post_thumbnail = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'single-post-thumbnail' ); 191 191 if( isset($post_thumbnail[0]) ) $atts['img'] = $post_thumbnail[0]; 192 else $atts['img'] = $filepath . $file. ".jpg";192 elseif( $filepath && $file ) $atts['img'] = $filepath . $file. ".jpg"; 193 193 }elseif( isset($atts['yt_vjs']) && $atts['yt_vjs'] =='true' && isset($atts['type']) && $atts['type'] == 'youtube'){ 194 194 $atts['img'] = 'img'; // temporary trick … … 338 338 */ 339 339 public function register_hook_callbacks() { 340 // global $post; // NON FUNZIONA: DA CAPIRE PERCHÈ 341 //////////////////// CPT & POST 342 343 add_action( 'init', array( $this, 'init' ) ); 344 345 // RIMOSSO PER AVERE MAGGIORE CONTROLLO NEL TEMPLATE: NEI CPT IL VIDEOPLAYER È GENERATO DELLA FUNZIONE OSmedia_videoplayer() 340 341 add_action( 'init', array( $this, 'init' ) ); 346 342 // add_action( 'get_template_part_content', __CLASS__ . '::get_videoplayer' ); 347 343 // soluz. provvisoria 348 344 if( isset(self::$OSmedia_options['OSmedia_shortcode']) ) 349 add_shortcode( self::$OSmedia_options['OSmedia_shortcode'], __CLASS__ . '::get_videoplayer' );350 // RETRO-COMPATIBILIT A'351 add_shortcode( 'youtube', __CLASS__ . '::get_videoplayer' );345 add_shortcode( self::$OSmedia_options['OSmedia_shortcode'], __CLASS__ . '::get_videoplayer' ); 346 // RETRO-COMPATIBILITY 347 add_shortcode( 'youtube', __CLASS__ . '::get_videoplayer' ); 352 348 353 349 add_filter( 'template_include', __CLASS__ . '::include_template_function', 1, 2); … … 379 375 */ 380 376 public function init() { 381 // OSmedia_Post_Admin::get_options(); 377 382 378 OSmedia_Post_Admin::get_metabox_params(); 379 383 380 } 384 381 -
os-media/trunk/classes/OSmedia-settings.php
r1296138 r1296909 135 135 */ 136 136 public function activate( $network_wide ) { 137 138 // create default options if not exists 139 if( @get_option(OSmedia_OPTS) ) { 140 $opts = @get_option(OSmedia_OPTS); 141 } 142 if( !isset($opts) || !is_array($opts) ) { 143 update_option( OSmedia_OPTS, OSmedia_Settings::get_default_settings() ); 144 } 137 145 138 146 } -
os-media/trunk/layout/osmedia_cpt-twentyfifteen.php
r1296137 r1296909 17 17 <?php while ( have_posts() ) : the_post(); ?> 18 18 19 <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> 19 <article style="padding-top:0" id="post-<?php the_ID(); ?>" <?php post_class(); ?>> 20 21 <header class="entry-header"></header><!-- .entry-header --> 20 22 21 23 <?php echo OSmedia_video() ?> 22 23 <header class="entry-header">24 </header><!-- .entry-header -->25 24 26 25 <div class="entry-content" style="margin-top:20px"> -
os-media/trunk/readme.txt
r1296780 r1296909 21 21 There are two areas in wich can be insert multimedia content: 22 22 23 * **Custom Post Type for "Featured Video"**, ideal for video platforms where we have a single "Featured video" for each page (like WP Featured Images). The best way to display video is to use a specific template (like **Osmedia-theme**, specifically designed for this plugin) or insert the function **Osmedia_video()** in your theme. This content are also optimized for latests WP theme like Twenty Fifteen or Twenty Fourteen.23 * **Custom Post Type for "Featured Video"**, specifically dedicated to video platforms where we have a single "Featured video" for each page (like WP Featured Images). 24 24 * in normal post or page with the classic **shortcodes** added to the post textarea. 25 25 26 There are 5 possibility to insert and stream on-demandvideo:26 There are 5 possibility to insert video: 27 27 28 28 * from **self-hosted local** WP installation: you must place the PATH of this local video resource (/opt/lampp/htdocs/wp/wp-content/uploads/video) **[main file selector]** … … 32 32 * from the platform **Youtube & Vimeo**. **[dedicated input]** 33 33 34 **OSmedia Featured video - Custom Post Type:** 35 36 For this type of page, the best way to display video is to use a specific template (like **Osmedia-theme**, specifically designed for this plugin) or you can insert the function **Osmedia_video()** in your theme. This content are also optimized for latests WP theme like Twenty Fifteen or Twenty Fourteen, automatically detected by this plugin, which loads the dedicated layout for CPT content. You can also customize the file **layout/osmedia_cpt.php** loaded by default, if your theme was not recognized. 37 34 38 **Image poster for video:** 35 39 36 40 * you can place URL in shortcode for post/page. 37 41 * In custom Post Field you can use the Featured Image, otherwise the plugin try to load file from the same directory with the same name and .jpg extension. 42 38 43 39 44 **Option settings:** … … 51 56 **Variables list:** 52 57 http://www.mariomarino.eu/wp-content/uploads/2013/10/OSmedia_vars.pdf 58 59 **IMPORTANT NOTE about old version:** 60 The old post / page create through old version of this plugin MUST be simply manually reloaded in Admin Area and, when appear the video data on the metabox form, click "Generate Shortcode" button. This because in the new version in post and page, video are displayed only through shortcode. 53 61 54 62 == Installation ==
Note: See TracChangeset
for help on using the changeset viewer.