<?php

/**
 * @name          : Joomla Social Pinboard
 * @version	  : 1.5.0
 * @package       : apptha
 * @since         : Joomla 1.5
 * @author        : Apptha - http://www.apptha.com
 * @copyright     : Copyright (C) 2011 Powered by Apptha
 * @license       : http://www.gnu.org/licenses/gpl-3.0.html GNU/GPL
 * @abstract      : Social Pinboard Module recent posts
 * @Creation Date : August 2013
 * @Modified Date : March 2014
 * */

	defined('_JEXEC') or die('Restricted access');

    echo "<div class='wwya-title'><h2>" . JText::_('MOD_WISHLOGUE_RECENT_POSTS') . "</h2><h3><i>*</i></h3></div>";
    echo "<div class='wwya-posts'>";

    foreach ($rows as $row)
	{
        echo "<div class='related-posts'>";
		$url = JRoute::_( "index.php?option=com_wishlogue&view=wwya&id=$row->id");
        echo "<h2><a href='$url'>" . $row->title . "</a></h2>";

		$content_text = $row->introtext . $row->fulltext;
		$content_text_len = 35;
		if( strlen($content_text) < 35 ) {
			$content_text_len = strlen($content_text);
		}
		$content_text_trim = substr($content_text, 0, $content_text_len) . '...';
        echo "<p>$content_text_trim</p>";

		$Usr_url = JRoute::_( 'index.php?option=com_wishlogue&view=cataloguedisplay&uid=' . $row->created_by );
		echo "<h3><a href='$Usr_url'>by " . $row->name . "</a></h3>";
        echo "</div>";
    }

    echo "</div>";

?>