Exemple #1
0
 public static function get_duration_post($post_id = false)
 {
     global $post, $fv_fp;
     $post_id = $post_id ? $post_id : $post->ID;
     $content = false;
     $objPost = get_post($post_id);
     if ($aVideos = FV_Player_Checker::get_videos($objPost->post_content)) {
         if ($sDuration = flowplayer::get_duration($post_id, $aVideos[0])) {
             $content = $sDuration;
         }
     }
     return $content;
 }
Exemple #2
0
function fv_flowplayer_admin_integrations()
{
    global $fv_fp;
    ?>
        <p>Following options are suitable for web developers and programmers.</p>
				<table class="form-table2">
          <tr>
						<td class="first"><label for="cbox_compatibility">Colorbox Compatibility (<abbr title="Use if your theme is using colorbox lightbox to show content and clones the HTML content into it.">?</abbr>):</label></td>
						<td>
              <input type="hidden" name="cbox_compatibility" value="false" />
              <input type="checkbox" name="cbox_compatibility" id="cbox_compatibility" value="true" <?php 
    if (isset($fv_fp->conf['cbox_compatibility']) && $fv_fp->conf['cbox_compatibility'] == 'true') {
        echo 'checked="checked"';
    }
    ?>
 />
						</td>
					</tr>          
          <tr>
						<td class="first"><label for="js-everywhere">Load FV Flowplayer JS everywhere (<abbr title="If you use some special JavaScript integration, you might prefer this option, otherwise it loads only if the shortcode is found.">?</abbr>):</label></td>
						<td>
              <input type="hidden" name="js-everywhere" value="false" />
              <input type="checkbox" name="js-everywhere" id="js-everywhere" value="true" <?php 
    if (isset($fv_fp->conf['js-everywhere']) && $fv_fp->conf['js-everywhere'] == 'true') {
        echo 'checked="checked"';
    }
    ?>
 />
						</td>
					</tr>
          <tr>
						<td class="first"><label for="db_duration">Scan video length (<abbr title="Beta version! Turn on to enable video duration scanning. Turn off if you experience issues when saving posts.">?</abbr>):</label></td>
						<td>
              <input type="hidden" name="db_duration" value="false" />
              <input type="checkbox" name="db_duration" id="db_duration" value="true" <?php 
    if (isset($fv_fp->conf['db_duration']) && $fv_fp->conf['db_duration'] == 'true') {
        echo 'checked="checked"';
    }
    ?>
 />
              <?php 
    global $wpdb;
    $iCount = $wpdb->get_var("SELECT count(meta_id) FROM {$wpdb->postmeta} WHERE meta_key LIKE '_fv_flowplayer_%'");
    $iQueue = count(FV_Player_Checker::queue_get());
    if ($iQueue && ($aQueue = FV_Player_Checker::queue_get())) {
        $htmlQueue = "<a href='#' onclick='jQuery(this).siblings(\"span\").toggle(); return false'>{$iQueue}</a> <span style='display: none'>(";
        foreach ($aQueue as $k => $i) {
            $htmlQueue .= "<a href='" . get_edit_post_link($k) . "'>{$k}</a> ";
        }
        $htmlQueue .= ") <a href='" . site_url() . "/wp-admin/options-general.php?page=fvplayer&fv_flowplayer_checker'>Scan now!</a></span>";
    }
    if ($iCount && $iQueue) {
        echo "Currently {$iCount} videos in database and {$htmlQueue} posts in queue.";
    } else {
        if ($iCount) {
            echo "Currently {$iCount} videos in database.";
        } else {
            if ($iQueue) {
                echo "Currently {$htmlQueue} posts in queue.";
            }
        }
    }
    ?>
						</td>
					</tr>
          <tr>
						<td class="first"><label for="css_disable">Disable saving of color settings into a static file (<abbr title="Normally the player CSS configuration is stored in wp-content/fv-player-custom/style-{blog_id}.css, you can disable this here.">?</abbr>):</label></td>
						<td>
              <input type="hidden" name="css_disable" value="false" />
              <input type="checkbox" name="css_disable" id="css_disable" value="true" <?php 
    if (isset($fv_fp->conf['css_disable']) && $fv_fp->conf['css_disable'] == 'true') {
        echo 'checked="checked"';
    }
    ?>
 />
						</td>
					</tr>           
					<!--<tr>
						<td style="width: 350px"><label for="optimizepress2">Handle OptimizePress 2 videos (<abbr title="Following attributes are not currently supported: margin, border">?</abbr>):</label></td>
						<td>
              <input type="hidden" name="integrations[optimizepress2]" value="false" />
              <input type="checkbox" name="integrations[optimizepress2]" id="optimizepress2" value="true" <?php 
    if (isset($fv_fp->conf['integrations']['optimizepress2']) && $fv_fp->conf['integrations']['optimizepress2'] == 'true') {
        echo 'checked="checked"';
    }
    ?>
 />
						</td>
					</tr>-->
					<tr>
						<td><label for="wp_core_video">Handle Wordpress <code><small>[video]</small></code> shortcodes:</label></td>
						<td>
              <input type="hidden" name="integrations[wp_core_video]" value="false" />
              <input type="checkbox" name="integrations[wp_core_video]" id="wp_core_video" value="true" <?php 
    if (isset($fv_fp->conf['integrations']['wp_core_video']) && $fv_fp->conf['integrations']['wp_core_video'] == 'true') {
        echo 'checked="checked"';
    }
    ?>
 />
						</td>
					</tr>
					<tr>
						<td><label for="embed_iframe">Use iframe embedding (beta):</label></td>
						<td>
              <input type="hidden" name="integrations[embed_iframe]" value="false" />
              <input type="checkbox" name="integrations[embed_iframe]" id="wp_core_video" value="true" <?php 
    if (isset($fv_fp->conf['integrations']['embed_iframe']) && $fv_fp->conf['integrations']['embed_iframe'] == 'true') {
        echo 'checked="checked"';
    }
    ?>
 />
						</td>
					</tr>           
					<tr>    		
						<td colspan="4">
							<input type="submit" name="fv-wp-flowplayer-submit" class="button-primary" value="Save All Changes" />
						</td>
					</tr>                               
				</table>
<?php 
}