Version Description
- sdded support for youtu.be links (why didn't I do that earlier, .be-ing Belgian myself?)
- added sl_SI translation (thanks Dizzy Streak @arnes.si!)
- load donottrack js in https if needed (thanks Chris @campino2k.de
- tested & confirmed to work perfectly with wordpress 3.2.1
Download this release
Release Info
Developer | futtta |
Plugin | WP YouTube Lyte |
Version | 0.7.3 |
Comparing to | |
See all releases |
Code changes from version 0.7.2 to 0.7.3
- languages/wp-youtube-lyte-sl_SI.mo +0 -0
- options.php +23 -20
- player_sizes.inc.php +10 -6
- readme.txt +8 -2
- widget.php +15 -10
- wp-youtube-lyte.php +10 -6
languages/wp-youtube-lyte-sl_SI.mo
ADDED
Binary file
|
options.php
CHANGED
@@ -1,4 +1,7 @@
|
|
1 |
<?php
|
|
|
|
|
|
|
2 |
$wp_lyte_plugin_url = defined('WP_PLUGIN_URL') ? trailingslashit(WP_PLUGIN_URL . '/' . dirname(plugin_basename(__FILE__))) : trailingslashit(get_bloginfo('wpurl')) . PLUGINDIR . '/' . dirname(plugin_basename(__FILE__));
|
3 |
|
4 |
add_action('admin_menu', 'lyte_create_menu');
|
@@ -31,27 +34,27 @@ function lyte_admin_styles() {
|
|
31 |
function lyte_settings_page() {
|
32 |
?>
|
33 |
<div class="wrap">
|
34 |
-
<h2
|
35 |
<div style="float:left;width:70%;">
|
36 |
-
<p
|
37 |
-
<p
|
38 |
-
<p
|
39 |
<form method="post" action="options.php">
|
40 |
<?php settings_fields( 'lyte-settings-group' ); ?>
|
41 |
<table class="form-table">
|
42 |
<tr valign="top">
|
43 |
-
<th scope="row"
|
44 |
<td>
|
45 |
<fieldset><legend class="screen-reader-text"><span>Use Flash or HTML5 video?</span></legend>
|
46 |
-
<label title="embed HTML5 video"><input type="radio" name="newTube" value="1" <?php if (get_option('newTube')==="1") echo "checked" ?> /> Embed HTML5 video (uses <a href
|
47 |
-
|
48 |
</fieldset>
|
49 |
</td>
|
50 |
</tr>
|
51 |
<tr valign="top">
|
52 |
<th scope="row">Player size:</th>
|
53 |
<td>
|
54 |
-
<fieldset><legend class="screen-reader-text"><span
|
55 |
<?php require 'player_sizes.inc.php';
|
56 |
$i=0;
|
57 |
if (is_bool(get_option('size'))) { $sel = (int) $pDefault; } else { $sel= (int) get_option('size'); }
|
@@ -68,22 +71,22 @@ function lyte_settings_page() {
|
|
68 |
</td>
|
69 |
</tr>
|
70 |
<tr valign="top">
|
71 |
-
<th scope="row"
|
72 |
<td>
|
73 |
-
<fieldset><legend class="screen-reader-text"><span
|
74 |
-
<label title="Show YouTube-link"><input type="radio" name="show_links" value="1" <?php if (get_option('show_links')==="1") echo "checked" ?>
|
75 |
-
<label title="Show YouTube and Ease YouTube link"><input type="radio" name="show_links" value="2" <?php if (get_option('show_links')==="2") echo "checked" ?>
|
76 |
-
<label title="Don't include links."><input type="radio" name="show_links" value="0" <?php if ((get_option('show_links')!=="1") && (get_option('show_links')!=="2")) echo "checked" ?>
|
77 |
</fieldset>
|
78 |
</td>
|
79 |
</tr>
|
80 |
<tr valign="top">
|
81 |
-
<th scope="row"
|
82 |
<td>
|
83 |
<fieldset>
|
84 |
<legend class="screen-reader-text"><span>Activate DoNotTrack</span></legend>
|
85 |
-
<label title="Enable DoNotTrack"><input type="radio" name="donottrack" value="1" <?php if (get_option('donottrack')==="1") echo "checked" ?>
|
86 |
-
<label title="Leave DoNotTrack disabled (default)"><input type="radio" name="donottrack" value="0" <?php if (get_option('donottrack')!=="1") echo "checked" ?>
|
87 |
</fieldset>
|
88 |
</td>
|
89 |
</tr>
|
@@ -98,11 +101,11 @@ function lyte_settings_page() {
|
|
98 |
<div style="float:right;width:30%" id="lyte_admin_feed">
|
99 |
<div style="margin-left:10px;margin-top:-5px;">
|
100 |
<h3>
|
101 |
-
futtta about
|
102 |
<select id="feed_dropdown" >
|
103 |
-
<option value="1"
|
104 |
-
<option value="2"
|
105 |
-
<option value="3"
|
106 |
</select>
|
107 |
</h3>
|
108 |
<div id="futtta_feed"></div>
|
1 |
<?php
|
2 |
+
$plugin_dir = basename(dirname(__FILE__)).'/languages';
|
3 |
+
load_plugin_textdomain( 'wp-youtube-lyte', false, $plugin_dir );
|
4 |
+
|
5 |
$wp_lyte_plugin_url = defined('WP_PLUGIN_URL') ? trailingslashit(WP_PLUGIN_URL . '/' . dirname(plugin_basename(__FILE__))) : trailingslashit(get_bloginfo('wpurl')) . PLUGINDIR . '/' . dirname(plugin_basename(__FILE__));
|
6 |
|
7 |
add_action('admin_menu', 'lyte_create_menu');
|
34 |
function lyte_settings_page() {
|
35 |
?>
|
36 |
<div class="wrap">
|
37 |
+
<h2><?php _e("WP YouTube Lyte Settings","wp-youtube-lyte") ?></h2>
|
38 |
<div style="float:left;width:70%;">
|
39 |
+
<p><?php _e("WP YouTube Lyte inserts \"Lite YouTube Embeds\" in your blog. These look and feel like normal embedded YouTube, but don't use Flash unless clicked on, thereby <a href=\"http://blog.futtta.be/2010/08/30/the-state-of-wp-youtube-lyte/\" target=\"_blank\">reducing download size & rendering time substantially</a>. When a video is played, WP-YouTube-Lyte can either activate <a href=\"http://apiblog.youtube.com/2010/07/new-way-to-embed-youtube-videos.html\" target=\"_blank\">YouTube's embedded html5-player</a> or the older Flash-version, depending on the settings below.","wp-youtube-lyte") ?></p>
|
40 |
+
<p><?php _e("You can place video and audio in your posts and pages by adding one or more http<strong>v</strong> or http<strong>a</strong> YouTube-links to your post. These will automatically be replaced by WP YouTube Lyte with the correct (flash-less) code. To add a video for example, you type a URL like <em>http<strong>v</strong>://www.youtube.com/watch?v=QQPSMRQnNlU</em>. If you want an audio-only player, you enter <em>http<strong>a</strong>://www.youtube.com/watch?v=BIQIGR-kWtc</em>. There's more info on the <a href=\"http://wordpress.org/extend/plugins/wp-youtube-lyte/faq/\" target=\"_blank\">wordpress.org WP YouTube Lyte FAQ page</a>.","wp-youtube-lyte") ?></p>
|
41 |
+
<p><?php _e("You can modify WP-YouTube-Lyte's behaviour by changing the following settings:","wp-youtube-lyte") ?></p>
|
42 |
<form method="post" action="options.php">
|
43 |
<?php settings_fields( 'lyte-settings-group' ); ?>
|
44 |
<table class="form-table">
|
45 |
<tr valign="top">
|
46 |
+
<th scope="row"><?php _e("Play video using Flash or HTML5-video?","wp-youtube-lyte") ?></th>
|
47 |
<td>
|
48 |
<fieldset><legend class="screen-reader-text"><span>Use Flash or HTML5 video?</span></legend>
|
49 |
+
<label title="embed HTML5 video"><input type="radio" name="newTube" value="1" <?php if (get_option('newTube')==="1") echo "checked" ?> /> <?php _e("Embed HTML5 video (uses <a href=\"http://apiblog.youtube.com/2010/07/new-way-to-embed-youtube-videos.html\" target=\"_blank\">the new YouTube embed-code</a>)","wp-youtube-lyte") ?></label><br />
|
50 |
+
<label title="normal YouTube embeds with Flash video"><input type="radio" name="newTube" value="0" <?php if (get_option('newTube')!=="1") echo "checked" ?> /> <?php _e("Old-style YouTube embeds with Flash video.","wp-youtube-lyte") ?></label><br />
|
51 |
</fieldset>
|
52 |
</td>
|
53 |
</tr>
|
54 |
<tr valign="top">
|
55 |
<th scope="row">Player size:</th>
|
56 |
<td>
|
57 |
+
<fieldset><legend class="screen-reader-text"><span><?php _e("Player size","wp-youtube-lyte") ?></span></legend>
|
58 |
<?php require 'player_sizes.inc.php';
|
59 |
$i=0;
|
60 |
if (is_bool(get_option('size'))) { $sel = (int) $pDefault; } else { $sel= (int) get_option('size'); }
|
71 |
</td>
|
72 |
</tr>
|
73 |
<tr valign="top">
|
74 |
+
<th scope="row"><?php _e("Add links below the embedded videos?","wp-youtube-lyte") ?></th>
|
75 |
<td>
|
76 |
+
<fieldset><legend class="screen-reader-text"><span><?php _e("Show links?","wp-youtube-lyte") ?></span></legend>
|
77 |
+
<label title="Show YouTube-link"><input type="radio" name="show_links" value="1" <?php if (get_option('show_links')==="1") echo "checked" ?> /><?php _e(" Add YouTube-link.","wp-youtube-lyte") ?></label><br />
|
78 |
+
<label title="Show YouTube and Ease YouTube link"><input type="radio" name="show_links" value="2" <?php if (get_option('show_links')==="2") echo "checked" ?> /><?php _e(" Add both a YouTube and an <a href=\"http://icant.co.uk/easy-youtube/docs/index.html\" target=\"_blank\">Easy YouTube</a>-link.","wp-youtube-lyte") ?></label><br />
|
79 |
+
<label title="Don't include links."><input type="radio" name="show_links" value="0" <?php if ((get_option('show_links')!=="1") && (get_option('show_links')!=="2")) echo "checked" ?> /><?php _e(" Don't add any links.","wp-youtube-lyte") ?></label>
|
80 |
</fieldset>
|
81 |
</td>
|
82 |
</tr>
|
83 |
<tr valign="top">
|
84 |
+
<th scope="row"><?php _e("Bonus feature: ","wp-youtube-lyte") ?><a href="http://blog.futtta.be/tag/donottrack" target="_blank">DoNotTrack</a></th>
|
85 |
<td>
|
86 |
<fieldset>
|
87 |
<legend class="screen-reader-text"><span>Activate DoNotTrack</span></legend>
|
88 |
+
<label title="Enable DoNotTrack"><input type="radio" name="donottrack" value="1" <?php if (get_option('donottrack')==="1") echo "checked" ?> /><?php _e("Disable 3rd party tracking.","wp-youtube-lyte") ?></label><br />
|
89 |
+
<label title="Leave DoNotTrack disabled (default)"><input type="radio" name="donottrack" value="0" <?php if (get_option('donottrack')!=="1") echo "checked" ?> /><?php _e("I don't mind 3rd party tracking (default)","wp-youtube-lyte") ?></label>
|
90 |
</fieldset>
|
91 |
</td>
|
92 |
</tr>
|
101 |
<div style="float:right;width:30%" id="lyte_admin_feed">
|
102 |
<div style="margin-left:10px;margin-top:-5px;">
|
103 |
<h3>
|
104 |
+
<?php _e("futtta about","wp-youtube-lyte") ?>
|
105 |
<select id="feed_dropdown" >
|
106 |
+
<option value="1"><?php _e("WP YouTube Lyte","wp-youtube-lyte") ?></option>
|
107 |
+
<option value="2"><?php _e("WordPress","wp-youtube-lyte") ?></option>
|
108 |
+
<option value="3"><?php _e("Web Technology","wp-youtube-lyte") ?></option>
|
109 |
</select>
|
110 |
</h3>
|
111 |
<div id="futtta_feed"></div>
|
player_sizes.inc.php
CHANGED
@@ -1,35 +1,39 @@
|
|
1 |
<?php
|
|
|
|
|
|
|
|
|
2 |
$pDefault=2;
|
3 |
|
4 |
$pSize[0]['a']=true;
|
5 |
$pSize[0]['w']=425;
|
6 |
$pSize[0]['h']=344;
|
7 |
-
$pSize[0]['t']="Smaller 4:3 player";
|
8 |
|
9 |
$pSize[1]['a']=true;
|
10 |
$pSize[1]['w']=560;
|
11 |
$pSize[1]['h']=340;
|
12 |
-
$pSize[1]['t']="Smaller 16:9 player";
|
13 |
|
14 |
$pSize[2]['a']=true;
|
15 |
$pSize[2]['w']=480;
|
16 |
$pSize[2]['h']=385;
|
17 |
-
$pSize[2]['t']="Standard value, YouTube default for 4:3-ratio video";
|
18 |
|
19 |
$pSize[3]['a']=true;
|
20 |
$pSize[3]['w']=640;
|
21 |
$pSize[3]['h']=385;
|
22 |
-
$pSize[3]['t']="YouTube default for 16:9-ratio video";
|
23 |
|
24 |
$pSize[4]['a']=true;
|
25 |
$pSize[4]['w']=640;
|
26 |
$pSize[4]['h']=505;
|
27 |
-
$pSize[4]['t']="Larger 4:3 player";
|
28 |
|
29 |
$pSize[5]['a']=true;
|
30 |
$pSize[5]['w']=853;
|
31 |
$pSize[5]['h']=505;
|
32 |
-
$pSize[5]['t']="Larger 16:9 player";
|
33 |
|
34 |
// widget sizes
|
35 |
$wDefault=2;
|
1 |
<?php
|
2 |
+
|
3 |
+
$plugin_dir = basename(dirname(__FILE__)).'/languages';
|
4 |
+
load_plugin_textdomain( 'wp-youtube-lyte', false, $plugin_dir );
|
5 |
+
|
6 |
$pDefault=2;
|
7 |
|
8 |
$pSize[0]['a']=true;
|
9 |
$pSize[0]['w']=425;
|
10 |
$pSize[0]['h']=344;
|
11 |
+
$pSize[0]['t']=__("Smaller 4:3 player","wp-youtube-lyte");
|
12 |
|
13 |
$pSize[1]['a']=true;
|
14 |
$pSize[1]['w']=560;
|
15 |
$pSize[1]['h']=340;
|
16 |
+
$pSize[1]['t']=__("Smaller 16:9 player","wp-youtube-lyte");
|
17 |
|
18 |
$pSize[2]['a']=true;
|
19 |
$pSize[2]['w']=480;
|
20 |
$pSize[2]['h']=385;
|
21 |
+
$pSize[2]['t']=__("Standard value, YouTube default for 4:3-ratio video","wp-youtube-lyte");
|
22 |
|
23 |
$pSize[3]['a']=true;
|
24 |
$pSize[3]['w']=640;
|
25 |
$pSize[3]['h']=385;
|
26 |
+
$pSize[3]['t']=__("YouTube default for 16:9-ratio video","wp-youtube-lyte");
|
27 |
|
28 |
$pSize[4]['a']=true;
|
29 |
$pSize[4]['w']=640;
|
30 |
$pSize[4]['h']=505;
|
31 |
+
$pSize[4]['t']=__("Larger 4:3 player","wp-youtube-lyte");
|
32 |
|
33 |
$pSize[5]['a']=true;
|
34 |
$pSize[5]['w']=853;
|
35 |
$pSize[5]['h']=505;
|
36 |
+
$pSize[5]['t']=__("Larger 16:9 player","wp-youtube-lyte");
|
37 |
|
38 |
// widget sizes
|
39 |
$wDefault=2;
|
readme.txt
CHANGED
@@ -2,8 +2,8 @@
|
|
2 |
Contributors: futtta
|
3 |
Tags: youtube, video, lyte, lite youtube embeds, html5 video, html5, widget, youtube audio, audio
|
4 |
Requires at least: 2.9
|
5 |
-
Tested up to: 3.
|
6 |
-
Stable tag: 0.7.
|
7 |
|
8 |
"Lite YouTube Embeds" look like normal YouTube embeds but don't use Flash, thus reducing download size & page rendering time.
|
9 |
|
@@ -54,6 +54,12 @@ and you're good to go!
|
|
54 |
* [Rate my plugin on wordpress.org](http://wordpress.org/extend/plugins/wp-youtube-lyte/), even if you think it stinks ;-)
|
55 |
|
56 |
== Changelog ==
|
|
|
|
|
|
|
|
|
|
|
|
|
57 |
= 0.7.2 =
|
58 |
* fixed a bug introduced in 0.7.1 which caused httpv-links that were not on newline, not to be turned into a lyte-player
|
59 |
* added audio as option for widgets as well (consider this beta, not thoroughly tested yet)
|
2 |
Contributors: futtta
|
3 |
Tags: youtube, video, lyte, lite youtube embeds, html5 video, html5, widget, youtube audio, audio
|
4 |
Requires at least: 2.9
|
5 |
+
Tested up to: 3.2.1
|
6 |
+
Stable tag: 0.7.3
|
7 |
|
8 |
"Lite YouTube Embeds" look like normal YouTube embeds but don't use Flash, thus reducing download size & page rendering time.
|
9 |
|
54 |
* [Rate my plugin on wordpress.org](http://wordpress.org/extend/plugins/wp-youtube-lyte/), even if you think it stinks ;-)
|
55 |
|
56 |
== Changelog ==
|
57 |
+
= 0.7.3 =
|
58 |
+
* sdded support for youtu.be links (why didn't I do that earlier, .be-ing Belgian myself?)
|
59 |
+
* added sl_SI translation (thanks Dizzy Streak @[arnes.si](http://www.arnes.si/)!)
|
60 |
+
* load donottrack js in https if needed (thanks Chris @[campino2k.de](http://campino2k.de/)
|
61 |
+
* tested & confirmed to work perfectly with wordpress 3.2.1
|
62 |
+
|
63 |
= 0.7.2 =
|
64 |
* fixed a bug introduced in 0.7.1 which caused httpv-links that were not on newline, not to be turned into a lyte-player
|
65 |
* added audio as option for widgets as well (consider this beta, not thoroughly tested yet)
|
widget.php
CHANGED
@@ -19,9 +19,14 @@ class WYLWidget extends WP_Widget {
|
|
19 |
if ($WYLaudio!=="audio") $WYLaudio="";
|
20 |
|
21 |
$WYLurl=esc_url($instance['WYLurl']);
|
22 |
-
|
23 |
-
|
24 |
-
|
|
|
|
|
|
|
|
|
|
|
25 |
|
26 |
$wp_lyte_plugin_url = defined('WP_PLUGIN_URL') ? trailingslashit(WP_PLUGIN_URL . '/' . dirname(plugin_basename(__FILE__))) : trailingslashit(get_bloginfo('wpurl')) . PLUGINDIR . '/' . dirname(plugin_basename(__FILE__));
|
27 |
$lyteSettings[0]=$wp_lyte_plugin_url."lyte/";
|
@@ -69,8 +74,8 @@ class WYLWidget extends WP_Widget {
|
|
69 |
if ($WYLsize=="") $WYLsize=$wDefault;
|
70 |
|
71 |
?>
|
72 |
-
<p><label for="<?php echo $this->get_field_id('WYLtitle'); ?>"><?php _e(
|
73 |
-
<p><label for="<?php echo $this->get_field_id('WYLsize'); ?>"><?php _e(
|
74 |
<select class="widefat" id="<?php echo $this->get_field_id('WYLsize'); ?>" name="<?php echo $this->get_field_name('WYLsize'); ?>">
|
75 |
<?php
|
76 |
$x=1;
|
@@ -86,7 +91,7 @@ class WYLWidget extends WP_Widget {
|
|
86 |
?>
|
87 |
</select>
|
88 |
</label></p>
|
89 |
-
<p><label for="<?php echo $this->get_field_id('WYLaudio'); ?>"><?php _e(
|
90 |
<select class="widefat" id="<?php echo $this->get_field_id('WYLaudio'); ?>" name="<?php echo $this->get_field_name('WYLaudio'); ?>">
|
91 |
<?php
|
92 |
if($WYLaudio==="audio") {
|
@@ -94,13 +99,13 @@ class WYLWidget extends WP_Widget {
|
|
94 |
} else {
|
95 |
$vselected=" selected=\"true\"";
|
96 |
}
|
97 |
-
|
98 |
-
echo "<option value=\"video\"".$vselected.">video</option>";
|
99 |
?>
|
100 |
</select>
|
101 |
</label></p>
|
102 |
-
<p><label for="<?php echo $this->get_field_id('WYLurl'); ?>"><?php _e(
|
103 |
-
<p><label for="<?php echo $this->get_field_id('WYLtext'); ?>"><?php _e(
|
104 |
<?php
|
105 |
}
|
106 |
}
|
19 |
if ($WYLaudio!=="audio") $WYLaudio="";
|
20 |
|
21 |
$WYLurl=esc_url($instance['WYLurl']);
|
22 |
+
|
23 |
+
if (strpos($WYLurl,'youtu.be')) {
|
24 |
+
$WYLid=substr(parse_url($WYLurl,PHP_URL_PATH),1,11);
|
25 |
+
} else {
|
26 |
+
$WYLqs=substr(strstr($WYLurl,'?'),1);
|
27 |
+
parse_str($WYLqs,$WYLarr);
|
28 |
+
$WYLid=$WYLarr['v'];
|
29 |
+
}
|
30 |
|
31 |
$wp_lyte_plugin_url = defined('WP_PLUGIN_URL') ? trailingslashit(WP_PLUGIN_URL . '/' . dirname(plugin_basename(__FILE__))) : trailingslashit(get_bloginfo('wpurl')) . PLUGINDIR . '/' . dirname(plugin_basename(__FILE__));
|
32 |
$lyteSettings[0]=$wp_lyte_plugin_url."lyte/";
|
74 |
if ($WYLsize=="") $WYLsize=$wDefault;
|
75 |
|
76 |
?>
|
77 |
+
<p><label for="<?php echo $this->get_field_id('WYLtitle'); ?>"><?php _e("Title:","wp-youtube-lyte") ?> <input class="widefat" id="<?php echo $this->get_field_id('WYLtitle'); ?>" name="<?php echo $this->get_field_name('WYLtitle'); ?>" type="text" value="<?php echo $WYLtitle; ?>" /></label></p>
|
78 |
+
<p><label for="<?php echo $this->get_field_id('WYLsize'); ?>"><?php _e("Size:","wp-youtube-lyte") ?>
|
79 |
<select class="widefat" id="<?php echo $this->get_field_id('WYLsize'); ?>" name="<?php echo $this->get_field_name('WYLsize'); ?>">
|
80 |
<?php
|
81 |
$x=1;
|
91 |
?>
|
92 |
</select>
|
93 |
</label></p>
|
94 |
+
<p><label for="<?php echo $this->get_field_id('WYLaudio'); ?>"><?php _e("Type:","wp-youtube-lyte") ?>
|
95 |
<select class="widefat" id="<?php echo $this->get_field_id('WYLaudio'); ?>" name="<?php echo $this->get_field_name('WYLaudio'); ?>">
|
96 |
<?php
|
97 |
if($WYLaudio==="audio") {
|
99 |
} else {
|
100 |
$vselected=" selected=\"true\"";
|
101 |
}
|
102 |
+
echo "<option value=\"audio\"".$aselected.">".__("audio","wp-youtube-lyte")."</option>";
|
103 |
+
echo "<option value=\"video\"".$vselected.">".__("video","wp-youtube-lyte")."</option>";
|
104 |
?>
|
105 |
</select>
|
106 |
</label></p>
|
107 |
+
<p><label for="<?php echo $this->get_field_id('WYLurl'); ?>"><?php _e("Youtube-URL:","wp-youtube-lyte") ?> <input class="widefat" id="<?php echo $this->get_field_id('WYLurl'); ?>" name="<?php echo $this->get_field_name('WYLurl'); ?>" type="text" value="<?php echo $WYLurl; ?>" /></label></p>
|
108 |
+
<p><label for="<?php echo $this->get_field_id('WYLtext'); ?>"><?php _e("Text:","wp-youtube-lyte") ?> <textarea class="widefat" id="<?php echo $this->get_field_id('WYLtext'); ?>" name="<?php echo $this->get_field_name('WYLtext'); ?>" rows="16" cols="20"><?php echo $WYLtext; ?></textarea></label></p>
|
109 |
<?php
|
110 |
}
|
111 |
}
|
wp-youtube-lyte.php
CHANGED
@@ -4,7 +4,7 @@ Plugin Name: WP YouTube Lyte
|
|
4 |
Plugin URI: http://blog.futtta.be/tag/lyte
|
5 |
Description: Lite and accessible YouTube audio and video embedding.
|
6 |
Author: Frank Goossens (futtta)
|
7 |
-
Version: 0.7.
|
8 |
Author URI: http://blog.futtta.be/
|
9 |
*/
|
10 |
|
@@ -37,7 +37,7 @@ function lyte_parse($the_content) {
|
|
37 |
$replacements = array("x", "--");
|
38 |
$the_content=str_replace($char_codes, $replacements, $the_content);
|
39 |
|
40 |
-
preg_match_all("/http(a|v):\/\/([a-zA-Z0-9\-\_]+\.|)youtube\.com\/watch(\?v\=|\/v\/)([a-zA-Z0-9\-\_]{11})([^<\s]*)/", $the_content, $matches, PREG_SET_ORDER);
|
41 |
|
42 |
foreach($matches as $match) {
|
43 |
if ($match[1]!=="a") {
|
@@ -59,15 +59,15 @@ function lyte_parse($the_content) {
|
|
59 |
break;
|
60 |
case "2":
|
61 |
$noscript_post="";
|
62 |
-
$lytelinks_txt="<div class=\"lL\">".__("Watch this video","wp-youtube-lyte")." <a href=\"http://youtu.be/".$match[
|
63 |
break;
|
64 |
default:
|
65 |
$noscript_post="";
|
66 |
-
$lytelinks_txt="<div class=\"lL\">".__("Watch this video","wp-youtube-lyte")." <a href=\"http://youtu.be/".$match[
|
67 |
}
|
68 |
|
69 |
-
$lytetemplate = "<div class=\"lyte".$audioClass."\" id=\"".$match[
|
70 |
-
$the_content = preg_replace("/(<p>)?http(v|a):\/\/([a-zA-Z0-9\-\_]+\.|)youtube\.com\/watch(\?v\=|\/v\/)([a-zA-Z0-9\-\_]{11})([^\s<]*)(<\/p>)?/", $lytetemplate, $the_content, 1);
|
71 |
}
|
72 |
}
|
73 |
return $the_content;
|
@@ -78,6 +78,10 @@ add_filter('the_content', 'lyte_parse', 90);
|
|
78 |
/* donottrack */
|
79 |
$donottrack_js=$wp_lyte_plugin_url."external/donottrack-min.js";
|
80 |
|
|
|
|
|
|
|
|
|
81 |
function init_lyte_donottrack() {
|
82 |
global $donottrack_js;
|
83 |
wp_enqueue_script( 'donottrack',$donottrack_js );
|
4 |
Plugin URI: http://blog.futtta.be/tag/lyte
|
5 |
Description: Lite and accessible YouTube audio and video embedding.
|
6 |
Author: Frank Goossens (futtta)
|
7 |
+
Version: 0.7.3
|
8 |
Author URI: http://blog.futtta.be/
|
9 |
*/
|
10 |
|
37 |
$replacements = array("x", "--");
|
38 |
$the_content=str_replace($char_codes, $replacements, $the_content);
|
39 |
|
40 |
+
preg_match_all("/http(a|v):\/\/([a-zA-Z0-9\-\_]+\.|)(youtube|youtu)(\.com|\.be)\/(watch(\?v\=|\/v\/)|)([a-zA-Z0-9\-\_]{11})([^<\s]*)/", $the_content, $matches, PREG_SET_ORDER);
|
41 |
|
42 |
foreach($matches as $match) {
|
43 |
if ($match[1]!=="a") {
|
59 |
break;
|
60 |
case "2":
|
61 |
$noscript_post="";
|
62 |
+
$lytelinks_txt="<div class=\"lL\">".__("Watch this video","wp-youtube-lyte")." <a href=\"http://youtu.be/".$match[7]."\">".__("on YouTube","wp-youtube-lyte")."</a> ".__("or on","wp-youtube-lyte")." <a href=\"http://icant.co.uk/easy-youtube/?http://www.youtube.com/watch?v=".$match[7]."\">Easy Youtube</a>.</div>";
|
63 |
break;
|
64 |
default:
|
65 |
$noscript_post="";
|
66 |
+
$lytelinks_txt="<div class=\"lL\">".__("Watch this video","wp-youtube-lyte")." <a href=\"http://youtu.be/".$match[7]."\">".__("on YouTube","wp-youtube-lyte")."</a>.</div>";
|
67 |
}
|
68 |
|
69 |
+
$lytetemplate = "<div class=\"lyte".$audioClass."\" id=\"".$match[7]."\" style=\"width:".$lyteSettings[2]."px;height:".$divHeight."px;\"><noscript><a href=\"http://youtu.be/".$match[7]."\"><img src=\"http://img.youtube.com/vi/".$match[7]."/0.jpg\" alt=\"\" width=\"".$lyteSettings[2]."\" height=\"".$divHeight."\" />".$noscript_post."</a></noscript><script type=\"text/javascript\"><!-- \n var nT='".$lyteSettings[1]."';var bU='".$lyteSettings[0]."';var d=document;if(d.addEventListener){d.addEventListener('DOMContentLoaded', insert, false)}else{window.onload=insert} function insert(){if(!d.getElementById('lytescr')){lytescr=d.createElement('script');lytescr.async=true;lytescr.id='lytescr';lytescr.src='".$lyteSettings[0]."lyte-min.js';h=d.getElementsByTagName('script')[0];h.parentNode.insertBefore(lytescr, h)}}; \n --></script></div>".$lytelinks_txt;
|
70 |
+
$the_content = preg_replace("/(<p>)?http(v|a):\/\/([a-zA-Z0-9\-\_]+\.|)(youtube|youtu)(\.com|\.be)\/(watch(\?v\=|\/v\/)|)([a-zA-Z0-9\-\_]{11})([^\s<]*)(<\/p>)?/", $lytetemplate, $the_content, 1);
|
71 |
}
|
72 |
}
|
73 |
return $the_content;
|
78 |
/* donottrack */
|
79 |
$donottrack_js=$wp_lyte_plugin_url."external/donottrack-min.js";
|
80 |
|
81 |
+
if ($_SERVER['HTTPS']) {
|
82 |
+
$donottrack_js = str_replace( $donottrack_js, "http:","https:" );
|
83 |
+
}
|
84 |
+
|
85 |
function init_lyte_donottrack() {
|
86 |
global $donottrack_js;
|
87 |
wp_enqueue_script( 'donottrack',$donottrack_js );
|