Omari, there are several approaches to this issue. And it is up to you to choose needed one.
Here is one of the solutions:
We are editing init.php file of "Blogs" plugin.
Original code:
$content = nl2br( UTIL_String::truncate(strip_tags($post->post), 150, '...') );
1. SHOW IMAGES UPLOADED TO BLOG'S BODY IN NEWSFEED
Modified code:
$content = nl2br( UTIL_String::truncate(strip_tags($post->post,'<img>'), 150, '...') );
Where
'<img>' part tells the script to strip ALL tags except <img> ones.
As a result images added to blog posts will be displayed in newsfeed.
2. REMOVE EMPTY LINES
Modified FINAL code:
$content = preg_replace("/(^[\r\n]*|[\r\n]+)[\s\t]*[\r\n]+/", "\n",( UTIL_String::truncate(strip_tags($post->post, '<img>'), 500, '...')));
Where:
preg_replace("/(^[\r\n]*|[\r\n]+)[\s\t]*[\r\n]+/", "\n" tells the script to completely remove
empty lines and give out $post as one string.
500- is increased number of allowed symbols. You need to increase it because now script will be counting symbols within the <img> tag.
Example: <img style="padding:5px;" src="
http://sitename.com/...-macro_sharon_14.jpg" /> . This string already contains 100 symbols. So original 150 limit to the $post itself is definitely not enough.
RESULT:
IMPORTANT NOTES.
1. Any custom code modifications done in .php files will be erased if you update the plugin. Always keep track of what and where you are changing.
2. If image string contains for example 100 symbols, and user adds the image after the text which already contains 450 symbols, script will cut the image giving that the overall $post limit is 500 symbols.
3. You are doing any custom work at your own risk. Always back up the file you are going to edit.
WHY OXWALL WORKS THE WAY It CURRENTLY DOES.
1. Showing additional images in newsfeed effect site performance.
2. Increasing $post limit in newsfeed will result in longer newsfeed, which is not what majority user want to.
3. With regards to empty spaces, images are being replaced with optimal ( 4-5) empty lines, which doesn't influence the perception of the site and saves server resources.
Likelihood of user entering 20 empty lines at the beginning of the blog is small. Your report is the first one we received. If we get similar reports in future we will surely try to find a better solution to displaying blogs in newsfeed.