Skip to content

Commit 3a8184b

Browse files
committed
Bugfix Display Videos
1 parent d2bb1cd commit 3a8184b

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

mathilda_painting.php

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -466,9 +466,9 @@ function mathilda_tweet_paint($date,$tweet,$id,$me,$image,$mention,$url,$hashtag
466466
$num_hashtags=count($tweet_hashtags);
467467
for($i=0; $i<$num_hashtags; $i++)
468468
{
469-
$hashtag_html='<a href="https://twitter.com/search?q=%23'.$tweet_hashtags[$i][1].'" class="mathilda-hashtag" rel="nofollow" target="_blank">#'.$tweet_hashtags[$i][1].'</a>';
470-
$hashtag_search='#'.$tweet_hashtags[$i][1];
471-
$tweet=str_replace ( $hashtag_search, $hashtag_html , $tweet ) ;
469+
$hashtag_html='<a href="https://twitter.com/search?q=%23'.$tweet_hashtags[$i][1].'" class="mathilda-hashtag" rel="nofollow" target="_blank">#'.$tweet_hashtags[$i][1].'</a> ';
470+
$hashtag_search='#'.$tweet_hashtags[$i][1].' ';
471+
$tweet=str_replace ( $hashtag_search, $hashtag_html , $tweet ) ;
472472
}
473473

474474
}
@@ -601,7 +601,17 @@ function mathilda_tweet_paint($date,$tweet,$id,$me,$image,$mention,$url,$hashtag
601601
$upload_dir = wp_upload_dir();
602602
$mathilda_images_dirname="mathilda-images";
603603
$mathilda_images_dirwithpath = $upload_dir['baseurl'].'/'.$mathilda_images_dirname .'/';
604-
$mathilda_content.='<img src="'.$mathilda_images_dirwithpath.$mathilda_tweet_image.'" alt="Tweet Image" class="mathilda-tweet-image"/>';
604+
$mathilda_content.='<img src="'.$mathilda_images_dirwithpath.$mathilda_tweet_image.'" alt="Tweet Image" class="mathilda-tweet-image"/>';
605+
606+
// Identify Video Tweet
607+
$video_extendedurl=$tweet_image[6];
608+
$is_video_url = strpos($video_extendedurl, 'video');
609+
if($is_video_url!==false) {
610+
$mathilda_content.='<span style="position:relative;top:7px;padding-left:50px;">';
611+
$mathilda_content.='Video: <a href="'.$tweet_image[6].'">'.$tweet_image[6].'</a>';
612+
$mathilda_content.="</span>";
613+
$mathilda_content.="&nbsp;<br/>";
614+
}
605615

606616
// Line Break for Tweet Galerys
607617
if($number_of_images>1) {

0 commit comments

Comments
 (0)