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 a public holiday for us from where we are at.

There may be a delay in our responses but rest assured that we will be back at full speed when we are back to the office.
  Support is offline

Struggle with mod_recentdiscussions

Mist · ·
9:34 AM Tuesday, 24 June 2014
None
Hi guys, i am in "pain" for so long now trying to make this module (mod_recentdiscussions) retrieve the informations i want for easydiscuss posts. :(

I know that the module was built from the ground up to just retrieve basic post information.
I am trying to use the some code that works perfect inside frontpage.post.php template file for EasyDiscuss.
So this code work flawless there, but not inside the mod_recentdiscussions module template file (default.php)

If you guys think that you can help with anything .... it would save me from headache. If you think that this is a custom mod ... then i am out of luck and i should figure something else out.

So, what i am trying to achieve is make the mod_recentdiscussions module display the posts similar like they show up in our frontpage.post.php file.

Long story short, i would need the code below to work in the module template file.

1 Retrieve the post attachments and display the first one.

<?php
$attachments = $post->getAttachments();
$attachment = isset( $attachments[ 0 ] ) ? $attachments[ 0 ] : false;
?>

<?php if ( $attachment ) {?>
<img src="/<?php echo $this->baseurl ?>/assets/image/green.jpg" data-toggle="unveil" class="unveiled">
<?php } else { ?>
***show_this***
<?php } ?>


2. Check if there is a post reply, if yes show the reply information, if not, show something else

<?php if( isset( $post->reply ) ){ ?>
<?php if( $post->reply->id ){ ?>
<li>
<div class="img-group img-group-stack">
<img alt="" class="img-circle" src="/<?php echo $post->reply->getAvatar();?>" data-es-provide="tooltip" data-placement="top" data-original-title="<?php echo $this->escape( $post->reply->getName() );?>">
</div>
</li>
<li class="text-right">
<?php $lastReply = DiscussHelper::getModel( 'Posts' )->getLastReply( $post->id ); ?>
<p class="nm"><a class="semibold" href="/<?php echo DiscussRouter::getPostRoute( $post->id ) . '#' . JText::_('COM_EASYDISCUSS_REPLY_PERMALINK') . '-' . $lastReply->id;?>"> Reply</a> <?php echo $post->duration; ?> <time datetime="<?php echo $this->formatDate( '%Y-%m-%d' , $post->created ); ?>"></time></p>
</li>

<?php } ?>
<?php } else { ?>
<li>
<div class="img-group img-group-stack">
<img alt="" class="img-circle" src="/templates/my_template/html/com_easysocial/avatars/users/medium.png">
</div>
</li>
<li class="text-right">
<p class="nm">No Reply</p>
</li>
<?php } ?>



So, all of the code above works perfect inside frontpage.post.php template file within EasyDiscuss .. but does not work within default.php template file of mod_recentdiscussions module.

Thanks in advance !
The replies under this section are restricted to logged in users or users with an active subscription with us