UPDATES EasyBlog 6.0.14 Released! Joomla 5.x and PHP 8.x compatible now!

Helpdesk

Your Time
Our Time
Response Time
24 — 48 hours
We strive to provide the fastest ever response possible. However, we are not super beings.

Allow at least 24 — 48 hours
  Support is offline
It is currently off working hours and most of us aren't around

Rest assured that we will get back to you as soon as the day starts tomorrow!
  Support is offline

Easyblog timeline with ads and modules between posts

Espen · ·
6:48 PM Thursday, 07 April 2016
Low
I just want to share a modification i made to the latest blog posts component. I have added code to display ads and modules between the blog posts randomly. This will allow you to display ads and modules between posts. The reason it´s randomly is to not flood the listing with ads or modules after every post.

public_html/components/com_easyblog/themes/wireframe/blogs/latest/default.php


<?php
/**
* @package EasyBlog
* @copyright Copyright (C) 2010 - 2015 Stack Ideas Sdn Bhd. All rights reserved.
* @license GNU/GPL, see LICENSE.php
* EasyBlog is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* See COPYRIGHT.php for copyright notices and details.
*/
defined('_JEXEC') or die('Unauthorized Access');
?>
<?php echo $this->output('site/blogs/latest/featured'); ?>

<?php $timeline_array = array("none", "none", "ads", "content"); ?>

<div itemscope itemtype="http://schema.org/Blog" class="eb-posts eb-responsive" data-blog-posts>

<?php echo EB::renderModule('easyblog-before-entries');?>

<?php if ($posts) { ?>
<?php foreach ($posts as $post) { ?>
<?php if (!EB::isSiteAdmin() && $this->config->get('main_password_protect') && !empty($post->blogpassword) && !$post->verifyPassword()) { ?>
<?php echo $this->output('site/blogs/latest/default.protected', array('post' => $post)); ?>
<?php } else { ?>
<?php echo $this->output('site/blogs/latest/default.main', array('post' => $post)); ?>
<?php
$random_timeline = $timeline_array[array_rand($timeline_array, 1)];
if($random_timeline == 'none') {
}
else if($random_timeline == 'ads') {
echo EB::renderModule('easyblog-after-ads');
}
else if($random_timeline == 'content') {
echo EB::renderModule('easyblog-after-random');
}
?>
<?php } ?>
<?php } ?>
<?php } else { ?>
<div class="eb-empty">
<i class="fa fa-paper-plane-o"></i>
<?php echo JText::_('COM_EASYBLOG_NO_BLOG_ENTRY');?>
</div>
<?php } ?>

<?php echo EB::renderModule('easyblog-after-entries'); ?>
</div>

<?php if($pagination) {?>
<?php echo EB::renderModule('easyblog-before-pagination'); ?>

<?php echo $pagination;?>

<?php echo EB::renderModule('easyblog-after-pagination'); ?>
<?php } ?>
The replies under this section are restricted to logged in users or users with an active subscription with us