Changeset 950187
- Timestamp:
- 07/17/2014 10:06:00 AM (12 years ago)
- Location:
- f2-tumblr-widget
- Files:
-
- 8 edited
- 1 copied
-
tags/0.2.2 (copied) (copied from f2-tumblr-widget/trunk)
-
tags/0.2.2/README.txt (modified) (3 diffs)
-
tags/0.2.2/f2-tumblr.php (modified) (3 diffs)
-
tags/0.2.2/views/admin.php (modified) (1 diff)
-
tags/0.2.2/views/widget.php (modified) (2 diffs)
-
trunk/README.txt (modified) (3 diffs)
-
trunk/f2-tumblr.php (modified) (3 diffs)
-
trunk/views/admin.php (modified) (1 diff)
-
trunk/views/widget.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
f2-tumblr-widget/tags/0.2.2/README.txt
r922315 r950187 5 5 Requires at least: 3.3 6 6 Tested up to: 3.9 7 Stable tag: 0.2. 17 Stable tag: 0.2.2 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 22 22 video and audio posts will have the media displayed when the display type 23 23 is not 'title only'. 24 25 The audio player in posts can now be automatically resized to match the 26 selected media width - this is enabled by default, but can be deselected 27 in the widget setup. 24 28 25 29 == Installation == … … 45 49 == Changelog == 46 50 51 = 0.2.2 = 52 * Added the option to adjust the width of the player in audio posts to match 53 the chosen media width. 54 47 55 = 0.2.1 = 48 56 * Added CSS to ensure that media posts with short text are properly separated. -
f2-tumblr-widget/tags/0.2.2/f2-tumblr.php
r922328 r950187 15 15 * Plugin URI: http://www.fsquared.co.uk/software/f2-tumblr/ 16 16 * Description: Widget to display recent posts from a tumblr blog 17 * Version: 0.2. 117 * Version: 0.2.2 18 18 * Author: fsquared limited 19 19 * Author URI: http://www.fsquared.co.uk … … 50 50 'line_spacing' => '', 51 51 'media_padding' => '', 52 'audio_width' => 1, 52 53 ); 53 54 … … 251 252 $instance['posts'] = intval( $new_instance['posts'] ); 252 253 $instance['cache_period'] = intval( $new_instance['cache_period'] ); 254 $instance['audio_width'] = intval( $new_instance['audio_width'] ); 253 255 if ( !empty( $new_instance['excerpt_size'] ) ) { 254 256 $instance['excerpt_size'] = intval( $new_instance['excerpt_size'] ); -
f2-tumblr-widget/tags/0.2.2/views/admin.php
r918021 r950187 140 140 </select> 141 141 </label> 142 <label> 143 <?php _e( 'Apply to Audio Posts:', $this->get_widget_slug() ); ?> 144 <input type="checkbox" 145 id="<?php echo $this->get_field_id('audio_width'); ?>" 146 name="<?php echo $this->get_field_name('audio_width'); ?>" 147 value="1" 148 <?php checked( $local_params['audio_width'], 1 ); ?>> 149 </label> 142 150 </p> 143 151 <p> -
f2-tumblr-widget/tags/0.2.2/views/widget.php
r918021 r950187 82 82 break; 83 83 case 'photo': // Photograph 84 // Try and extract some sort of sensible title from the caption 85 $dom = new DOMDocument(); 86 $dom->loadHTML( (string)$the_post->{'photo-caption'} ); 87 $xpath = new DOMXpath( $dom ); 88 $xres = $xpath->query( '//*[name()="h1" or name()="h2" or name()="h3"]' ); 89 if ( $xres->length > 0 ) { 90 // Save the title 91 $post_title = $xres->item(0)->nodeValue; 92 93 // And remove it from the DOM document 94 $xres->item(0)->parentNode->removeChild($xres->item(0)); 95 } else { 96 // No title found, so pluck out the first sentence instead 97 $title_split = preg_split( 98 '/[.?!:]/', 99 strip_tags( 100 preg_replace( 101 array( '/<a.*?<\/a>/', '/<p>:<\/p>/' ), 102 '', 103 (string)$the_post->{'photo-caption'} 104 ) 105 ), 106 2 107 ); 108 $post_title = $title_split[0]; 84 // Try and extract some sort of sensible title from the caption, 85 // assuming of course that there is one! 86 if ( !empty( $the_post->{'photo-caption'} ) ) { 87 $dom = new DOMDocument(); 88 $dom->loadHTML( (string)$the_post->{'photo-caption'} ); 89 $xpath = new DOMXpath( $dom ); 90 $xres = $xpath->query( '//*[name()="h1" or name()="h2" or name()="h3"]' ); 91 if ( $xres->length > 0 ) { 92 // Save the title 93 $post_title = $xres->item(0)->nodeValue; 94 95 // And remove it from the DOM document 96 $xres->item(0)->parentNode->removeChild($xres->item(0)); 97 } else { 98 // No title found, so pluck out the first sentence instead 99 $title_split = preg_split( 100 '/[.?!:]/', 101 strip_tags( 102 preg_replace( 103 array( '/<a.*?<\/a>/', '/<p>:<\/p>/' ), 104 '', 105 (string)$the_post->{'photo-caption'} 106 ) 107 ), 108 2 109 ); 110 $post_title = $title_split[0]; 111 } 109 112 } 110 113 … … 227 230 // And now the content, if required 228 231 if ( 'none' != $local_params['content_type'] ) { 229 $post_media = (string)$the_post->{'audio-player'}; 232 $media_embed = (string)$the_post->{'audio-player'}; 233 234 // Optionally, tweak the width to our set media width 235 if ( 1 == $local_params['audio_width'] ) { 236 $post_media = preg_replace( 237 '/ width="[0-9]+" /', 238 ' width="' . $local_params['media_width'] . '" ', 239 $media_embed 240 ); 241 } else { 242 $post_media = $media_embed; 243 } 230 244 231 245 // And as much of the body as we require -
f2-tumblr-widget/trunk/README.txt
r922315 r950187 5 5 Requires at least: 3.3 6 6 Tested up to: 3.9 7 Stable tag: 0.2. 17 Stable tag: 0.2.2 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 22 22 video and audio posts will have the media displayed when the display type 23 23 is not 'title only'. 24 25 The audio player in posts can now be automatically resized to match the 26 selected media width - this is enabled by default, but can be deselected 27 in the widget setup. 24 28 25 29 == Installation == … … 45 49 == Changelog == 46 50 51 = 0.2.2 = 52 * Added the option to adjust the width of the player in audio posts to match 53 the chosen media width. 54 47 55 = 0.2.1 = 48 56 * Added CSS to ensure that media posts with short text are properly separated. -
f2-tumblr-widget/trunk/f2-tumblr.php
r922328 r950187 15 15 * Plugin URI: http://www.fsquared.co.uk/software/f2-tumblr/ 16 16 * Description: Widget to display recent posts from a tumblr blog 17 * Version: 0.2. 117 * Version: 0.2.2 18 18 * Author: fsquared limited 19 19 * Author URI: http://www.fsquared.co.uk … … 50 50 'line_spacing' => '', 51 51 'media_padding' => '', 52 'audio_width' => 1, 52 53 ); 53 54 … … 251 252 $instance['posts'] = intval( $new_instance['posts'] ); 252 253 $instance['cache_period'] = intval( $new_instance['cache_period'] ); 254 $instance['audio_width'] = intval( $new_instance['audio_width'] ); 253 255 if ( !empty( $new_instance['excerpt_size'] ) ) { 254 256 $instance['excerpt_size'] = intval( $new_instance['excerpt_size'] ); -
f2-tumblr-widget/trunk/views/admin.php
r918021 r950187 140 140 </select> 141 141 </label> 142 <label> 143 <?php _e( 'Apply to Audio Posts:', $this->get_widget_slug() ); ?> 144 <input type="checkbox" 145 id="<?php echo $this->get_field_id('audio_width'); ?>" 146 name="<?php echo $this->get_field_name('audio_width'); ?>" 147 value="1" 148 <?php checked( $local_params['audio_width'], 1 ); ?>> 149 </label> 142 150 </p> 143 151 <p> -
f2-tumblr-widget/trunk/views/widget.php
r918021 r950187 82 82 break; 83 83 case 'photo': // Photograph 84 // Try and extract some sort of sensible title from the caption 85 $dom = new DOMDocument(); 86 $dom->loadHTML( (string)$the_post->{'photo-caption'} ); 87 $xpath = new DOMXpath( $dom ); 88 $xres = $xpath->query( '//*[name()="h1" or name()="h2" or name()="h3"]' ); 89 if ( $xres->length > 0 ) { 90 // Save the title 91 $post_title = $xres->item(0)->nodeValue; 92 93 // And remove it from the DOM document 94 $xres->item(0)->parentNode->removeChild($xres->item(0)); 95 } else { 96 // No title found, so pluck out the first sentence instead 97 $title_split = preg_split( 98 '/[.?!:]/', 99 strip_tags( 100 preg_replace( 101 array( '/<a.*?<\/a>/', '/<p>:<\/p>/' ), 102 '', 103 (string)$the_post->{'photo-caption'} 104 ) 105 ), 106 2 107 ); 108 $post_title = $title_split[0]; 84 // Try and extract some sort of sensible title from the caption, 85 // assuming of course that there is one! 86 if ( !empty( $the_post->{'photo-caption'} ) ) { 87 $dom = new DOMDocument(); 88 $dom->loadHTML( (string)$the_post->{'photo-caption'} ); 89 $xpath = new DOMXpath( $dom ); 90 $xres = $xpath->query( '//*[name()="h1" or name()="h2" or name()="h3"]' ); 91 if ( $xres->length > 0 ) { 92 // Save the title 93 $post_title = $xres->item(0)->nodeValue; 94 95 // And remove it from the DOM document 96 $xres->item(0)->parentNode->removeChild($xres->item(0)); 97 } else { 98 // No title found, so pluck out the first sentence instead 99 $title_split = preg_split( 100 '/[.?!:]/', 101 strip_tags( 102 preg_replace( 103 array( '/<a.*?<\/a>/', '/<p>:<\/p>/' ), 104 '', 105 (string)$the_post->{'photo-caption'} 106 ) 107 ), 108 2 109 ); 110 $post_title = $title_split[0]; 111 } 109 112 } 110 113 … … 227 230 // And now the content, if required 228 231 if ( 'none' != $local_params['content_type'] ) { 229 $post_media = (string)$the_post->{'audio-player'}; 232 $media_embed = (string)$the_post->{'audio-player'}; 233 234 // Optionally, tweak the width to our set media width 235 if ( 1 == $local_params['audio_width'] ) { 236 $post_media = preg_replace( 237 '/ width="[0-9]+" /', 238 ' width="' . $local_params['media_width'] . '" ', 239 $media_embed 240 ); 241 } else { 242 $post_media = $media_embed; 243 } 230 244 231 245 // And as much of the body as we require
Note: See TracChangeset
for help on using the changeset viewer.