| Current Path : /var/www/html/plugins/community/jvldfav/ |
| Current File : /var/www/html/plugins/community/jvldfav/jvldfav.php |
<?php
/**
* @version $Id$
* @package JV-LinkDirectory
* @subpackage com_jvld
* @copyright Copyright 2008-2013 JV-Extensions. All rights reserved
* @license GNU General Public License version 3 or later
* @author JV-Extensions
* @link http://www.jv-extensions.com
*/
// No direct access
defined('_JEXEC') or die('Restricted access');
require_once(JPATH_ROOT.DIRECTORY_SEPARATOR.'components'.DIRECTORY_SEPARATOR.'com_community'.DIRECTORY_SEPARATOR.'libraries'.DIRECTORY_SEPARATOR.'core.php');
if (!class_exists('plgCommunityJvldfav'))
{
class plgCommunityJvldfav extends CApplications
{
var $name = "My Favorite Listings";
var $_name = "myfavlistings";
function onProfileDisplay()
{
if (!defined('_JVLD_INSTALLED'))
return '';
JvldPostinit::loadLanguageFile();
JvldPostinit::loadStyleSheet('style', _JVLD_LIVESITE.'plugins/community/jvldfav/jvldfav');
$cnt = $this->params->get('jvldfav_cnt', 5);
if ($this->params->get('position') == 'content')
{
return JvldCommunity::getFavoriteLinks(CFactory::getRequestUser()->id, $cnt, true);
}
else
{
$links = JvldCommunity::getFavoriteLinks(CFactory::getRequestUser()->id, $cnt, false);
$html = '';
$html .= ' <div class="joms-app--jvldfav">';
if (count($links))
{
$html .= ' <ul class="joms-list">';
foreach ($links as $link)
{
$obj = JvldDb::getRow("select link_published_on from #__jvld_links where id = ".(int)$link->LID);
$html .= ' <li>
<a target="_blank" href="'.JvldPostinit::getRoute("detailpageurl", $link->LID).'" title="'.htmlspecialchars($link->LTITLE).'">'.htmlspecialchars($link->LTITLE).'</a>
<span class="joms-block joms-text--small joms-text--light">'.JvldDate::getDateForDisplay($obj->link_published_on).'</span>
</li>';
}
$html .= ' </ul>';
}
else
{
$html .= ' <p class="alert alert-warning">'.JText::_("COM_JVLD_NO_LISTINGS").'</p>';
}
$html .= '</div>';
return $html;
}
}
}
}