Ejemplo n.º 1
0
 protected function _prepareDocument()
 {
     $uri = clone JUri::getInstance();
     $domain = $uri->toString(array('scheme', 'host', 'port'));
     $canonicalLink = $domain . JRoute::_(JUDirectoryHelperRoute::getListingsRoute(true), false);
     JUDirectoryFrontHelper::setCanonical($canonicalLink);
     $seoData = array("metatitle" => JText::_('COM_JUDIRECTORY_SEO_TITLE_LISTINGS'), "metadescription" => "", "metakeyword" => "");
     JUDirectoryFrontHelperSeo::seo($this, $seoData);
 }
Ejemplo n.º 2
0
 public function search()
 {
     JSession::checkToken() or die(JText::_('JINVALID_TOKEN'));
     $app = JFactory::getApplication();
     $searchWord = $app->input->post->getString('searchword', '');
     $cat_id = $app->input->post->getInt('cat_id', 0);
     $sub_cat = $app->input->post->getInt('sub_cat', 0);
     $searchWord = JUDirectoryFrontHelper::UrlEncode($searchWord);
     $this->setRedirect(JRoute::_(JUDirectoryHelperRoute::getSearchRoute($cat_id, $sub_cat, $searchWord), false));
 }
Ejemplo n.º 3
0
 protected function _setBreadcrumb()
 {
     $app = JFactory::getApplication();
     $pathway = $app->getPathway();
     $pathwayArray = array();
     $pathwayArray[] = JUDirectoryFrontHelperBreadcrumb::getRootPathway();
     $linkTags = JRoute::_(JUDirectoryHelperRoute::getTagsRoute());
     $pathwayArray[] = JUDirectoryFrontHelperBreadcrumb::createPathwayItem($this->getName(), $linkTags);
     $pathway->setPathway($pathwayArray);
 }
Ejemplo n.º 4
0
 protected function _setBreadcrumb()
 {
     $app = JFactory::getApplication();
     $pathway = $app->getPathway();
     $pathwayArray = array();
     $pathwayArray[] = JUDirectoryFrontHelperBreadcrumb::getRootPathway();
     $linkMaintenance = JRoute::_(JUDirectoryHelperRoute::getMaintenanceRoute(true), false);
     $pathwayArray[] = JUDirectoryFrontHelperBreadcrumb::createPathwayItem($this->getName(), $linkMaintenance);
     $pathway->setPathway($pathwayArray);
 }
Ejemplo n.º 5
0
 public static function getRootPathway()
 {
     $app = JFactory::getApplication();
     $menus = $app->getMenu('site');
     $categoryRoot = JUDirectoryFrontHelperCategory::getRootCategory();
     $needles = array('tree' => array((int) $categoryRoot->id));
     $findMenuTreeRoot = JUDirectoryHelperRoute::findItemId($needles, true);
     $rootPathway = new stdClass();
     if ($findMenuTreeRoot) {
         $menuTreeRoot = $menus->getItem($findMenuTreeRoot);
         $rootPathway->name = $menuTreeRoot->title;
         $rootPathway->link = JRoute::_($menuTreeRoot->link);
     } else {
         $rootPathway->name = html_entity_decode(JText::_('COM_JUDIRECTORY_ROOT'), ENT_COMPAT, 'UTF-8');
         $rootPathway->link = JUDirectoryHelperRoute::getTreeRoute($categoryRoot->id);
     }
     return $rootPathway;
 }
Ejemplo n.º 6
0
 public function display($cachable = false, $urlparams = false)
 {
     $app = JFactory::getApplication();
     $cachable = true;
     $id = $app->input->getInt('id', 0);
     $vName = $app->input->getCmd('view', 'categories');
     $app->input->set('view', $vName);
     $user = JFactory::getUser();
     if ($user->get('id') || $_SERVER['REQUEST_METHOD'] == 'POST' && ($vName == 'category' && $app->input->get('layout') != 'blog' || $vName == 'archive')) {
         $cachable = false;
     }
     $safeurlparams = array('catid' => 'INT', 'id' => 'INT', 'cid' => 'ARRAY', 'year' => 'INT', 'month' => 'INT', 'limit' => 'UINT', 'limitstart' => 'UINT', 'showall' => 'INT', 'return' => 'BASE64', 'filter' => 'STRING', 'filter_order' => 'CMD', 'filter_order_Dir' => 'CMD', 'filter-search' => 'STRING', 'print' => 'BOOLEAN', 'lang' => 'CMD', 'Itemid' => 'INT');
     $params = JUDirectoryHelper::getParams();
     if (!$user->authorise('core.admin', 'com_judirectory') && $params->get('activate_maintenance', 0) && $app->input->getString('view', '') != 'maintenance') {
         $this->setRedirect(JUDirectoryHelperRoute::getMaintenanceRoute());
     }
     if ($vName == 'form' && $id > 0 && !$this->checkEditId('com_judirectory.edit.listing', $id)) {
         return JError::raiseError(403, JText::sprintf('JLIB_APPLICATION_ERROR_UNHELD_ID', $id));
     }
     parent::display($cachable, $safeurlparams);
     return $this;
 }
Ejemplo n.º 7
0
<?php

/**
 * ------------------------------------------------------------------------
 * JUDirectory for Joomla 2.5, 3.x
 * ------------------------------------------------------------------------
 *
 * @copyright      Copyright (C) 2010-2015 JoomUltra Co., Ltd. All Rights Reserved.
 * @license        GNU General Public License version 2 or later; see LICENSE.txt
 * @author         JoomUltra Co., Ltd
 * @website        http://www.joomultra.com
 * @----------------------------------------------------------------------@
 */
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
if (!$isDetailsView) {
    $this->setAttribute("href", JRoute::_(JUDirectoryHelperRoute::getListingRoute($this->listing_id)), "output");
    echo '<a ' . $this->getAttribute(null, null, "output") . '>' . $value . '</a>';
} else {
    echo '<span ' . $this->getAttribute(null, null, "output") . '>' . $value . '</span>';
}
Ejemplo n.º 8
0
    echo '<a class="hasTooltip btn" title="' . JText::_('COM_JUDIRECTORY_ADD_LISTING') . '" href="' . $this->category->submit_listing_link . '"><i class="fa fa-file-o"></i></a>';
}
if ($this->show_feed) {
    ?>
	<a class="hasTooltip btn" href="<?php 
    echo $this->rss_link;
    ?>
"
	   title="<?php 
    echo JText::_('COM_JUDIRECTORY_SUBSCRIBE_TO_THIS_RSS_FEED');
    ?>
">
		<i class="fa fa-rss"></i>
	</a>
<?php 
}
if ($this->category->id != 1) {
    ?>
	<a class="hasTooltip btn"
	   href="<?php 
    echo JRoute::_(JUDirectoryHelperRoute::getCategoryRoute($this->category->parent_id));
    ?>
"
	   title="<?php 
    echo JText::_('COM_JUDIRECTORY_UP_TO_PARENT_CATEGORY');
    ?>
">
		<i class="fa fa-chevron-up"></i>
	</a>
<?php 
}
Ejemplo n.º 9
0
 protected function _setBreadcrumb()
 {
     $categoryId = JUDirectoryFrontHelperCategory::getMainCategoryId($this->item->id);
     $app = JFactory::getApplication();
     $pathway = $app->getPathway();
     $pathwayArray = array();
     if ($categoryId) {
         $pathwayArray = JUDirectoryFrontHelperBreadcrumb::getBreadcrumbCategory($categoryId);
     } else {
         $pathwayArray[] = JUDirectoryFrontHelperBreadcrumb::getRootPathway();
     }
     $linkListing = JRoute::_(JUDirectoryHelperRoute::getListingRoute($this->item->id));
     $pathwayArray[] = JUDirectoryFrontHelperBreadcrumb::createPathwayItem($this->item->title, $linkListing);
     if ($this->_layout == 'print') {
         $pathwayArray[] = JUDirectoryFrontHelperBreadcrumb::createPathwayItem('PRINT');
         $document = JFactory::getDocument();
         $document->setMetaData('robots', 'noindex, nofollow');
     }
     $pathway->setPathway($pathwayArray);
 }
Ejemplo n.º 10
0
						<td>
							<a href="<?php 
        echo JRoute::_(JUDirectoryHelperRoute::getListingRoute($item->listing_id));
        ?>
">
								<?php 
        echo $item->listing_title;
        ?>
</a>
							<?php 
        if ($item->level > 1) {
            ?>
								<span class="divider"> > </span>
								<a target="_blank"
								   href="<?php 
            echo JRoute::_(JUDirectoryHelperRoute::getListingRoute($item->listing_id)) . "#comment-item-" . $item->parent_id;
            ?>
">
									<?php 
            echo $item->parent_title;
            ?>
</a>
							<?php 
        }
        ?>
						</td>
						<td>
							<?php 
        if ($item->user_id > 0) {
            $userComment = JFactory::getUser($item->user_id);
            echo $userComment->get('name');
Ejemplo n.º 11
0
echo $this->pagination->getLimitBox();
?>
					</div>
				</div>
			</div>
		</div>

		<div class="container-fluid">
			<div class="row-fluid">
				<?php 
foreach ($this->items as $key => $item) {
    ?>
				<div class="span6">
					<i class="fa fa-tag"></i>
					<a href="<?php 
    echo JRoute::_('index.php?option=com_judirectory&view=tag&id=' . $item->id . '&Itemid=' . JUDirectoryHelperRoute::findItemId(array('tag' => array($item->id))));
    ?>
">
						<?php 
    echo $item->title;
    ?>
<span> (<?php 
    echo $item->total_listings;
    ?>
)</span></a>
				</div>
				<?php 
    $key++;
    if ($key % 2 == 0 && $key < count($this->items)) {
        ?>
			</div>
Ejemplo n.º 12
0
 * @author         JoomUltra Co., Ltd
 * @website        http://www.joomultra.com
 * @----------------------------------------------------------------------@
 */
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
?>
<div class="judir-cat clearfix">
	<h2 class="cat-title"><?php 
echo JText::sprintf('COM_JUDIRECTORY_LIST_ALL_LISTINGS', $this->category->title);
?>
</h2>
</div>

<div class="clearfix">
	<a class="btn btn-primary btn-mini pull-left" href="#"
	   onclick="javascript:jQuery('.filter-form').slideToggle('300'); return false;">
		<i class="fa fa-filter"></i> <?php 
echo JText::_('COM_JUDIRECTORY_FILTER');
?>
	</a>
	<a class="btn btn-mini pull-right"
	   href="<?php 
echo JUDirectoryHelperRoute::getCategoryRoute($this->category->id);
?>
">
		<i class="fa fa-folder-open"></i> <?php 
echo JText::_('COM_JUDIRECTORY_THIS_CATEGORY');
?>
	</a>
</div>
Ejemplo n.º 13
0
 protected function _prepareDocument()
 {
     $uri = clone JUri::getInstance();
     $domain = $uri->toString(array('scheme', 'host', 'port'));
     $canonicalLink = $domain . JRoute::_(JUDirectoryHelperRoute::getCategoryRoute($this->category->id, null, false, $this->_layout), false);
     JUDirectoryFrontHelper::setCanonical($canonicalLink);
     $this->item = $this->category;
     JUDirectoryFrontHelperSeo::seo($this);
 }
Ejemplo n.º 14
0
 public static function getCategoryDTree($cat_id = null)
 {
     JLoader::register('JUDirectoryHelperRoute', JPATH_SITE . '/components/com_judirectory/helpers/route.php');
     $document = JFactory::getDocument();
     $document->addStyleSheet(JUri::root() . "components/com_judirectory/assets/dtree/css/dtree.css");
     $document->addScript(JUri::root() . "components/com_judirectory/assets/dtree/js/dtree.js");
     $db = JFactory::getDbo();
     $query = $db->getQuery(true);
     $query->select('id, title, parent_id, level, config_params');
     $query->from('#__judirectory_categories');
     $query->order('title ASC, id ASC');
     $db->setQuery($query);
     $categories = $db->loadObjectList();
     $script = "<script type=\"text/javascript\">\r\n";
     $iconFolder = JUri::root() . 'components/com_judirectory/assets/dtree/img';
     $script .= "tree_cat = new dTree('tree_cat');\r\n";
     $script .= "tree_cat.icon.root = '{$iconFolder}/base.gif';\r\n\n\t\t\t\t\ttree_cat.icon.folder = '{$iconFolder}/folder.gif';\r\n\n\t\t\t\t\ttree_cat.icon.folderOpen = '{$iconFolder}/folderopen.gif';\r\n\n\t\t\t\t\ttree_cat.icon.node = '{$iconFolder}/folder.gif';\r\n\n\t\t\t\t\ttree_cat.icon.empty = '{$iconFolder}/empty.gif';\r\n\n\t\t\t\t\ttree_cat.icon.line = '{$iconFolder}/line.gif';\r\n\n\t\t\t\t\ttree_cat.icon.join = '{$iconFolder}/join.gif';\r\n\n\t\t\t\t\ttree_cat.icon.joinBottom = '{$iconFolder}/joinbottom.gif';\r\n\n\t\t\t\t\ttree_cat.icon.plus = '{$iconFolder}/plus.gif';\r\n\n\t\t\t\t\ttree_cat.icon.plusBottom = '{$iconFolder}/plusbottom.gif';\r\n\n\t\t\t\t\ttree_cat.icon.minus = '{$iconFolder}/minus.gif';\r\n\n\t\t\t\t\ttree_cat.icon.minusBottom = '{$iconFolder}/minusbottom.gif';\r\n\n\t\t\t\t\ttree_cat.icon.nlPlus = '{$iconFolder}/nolines_plus.gif';\r\n\n\t\t\t\t\ttree_cat.icon.nlMinus = '{$iconFolder}/nolines_minus.gif';\r\n";
     foreach ($categories as $category) {
         $cat_title = addslashes(htmlspecialchars($category->title, ENT_QUOTES));
         if ($category->level == 1 && $category->config_params) {
             $cat_title .= " <i class=\"icon-cog disabled hasTooltip\" title=\"" . JText::_('COM_JUDIRECTORY_OVERRIDE_CONFIG') . "\"></i>";
         }
         if ($category->level == 1 && JUDirectoryHelperRoute::findItemId(array('tree' => array($category->id)))) {
             $script .= "tree_cat.add({$category->id}, {$category->parent_id}, '{$cat_title}', '" . JUri::Base() . "index.php?option=com_judirectory&view=listcats&cat_id={$category->id}', '', '', tree_cat.icon.root);\r\n";
         } else {
             $script .= "tree_cat.add({$category->id}, {$category->parent_id}, '{$cat_title}', '" . JUri::Base() . "index.php?option=com_judirectory&view=listcats&cat_id={$category->id}');\r\n";
         }
     }
     $script .= "tree_cat.config.useCookies=false;\r\n";
     $script .= "tree_cat.config.closeSameLevel=true;\r\n";
     $script .= "document.write(tree_cat);\r\n";
     if ($cat_id) {
         $script .= "tree_cat.openTo({$cat_id}, true);";
     }
     $script .= "</script>";
     return $script;
 }
Ejemplo n.º 15
0
        } elseif ($item->level > 1) {
            $parentCommentObject = JUDirectoryFrontHelperComment::getCommentObject($item->parent_id, 'cm.id, cm.title');
            $limitStart = $listingModel->getLimitStartForComment($parentCommentObject->id);
            ?>
								<a href="<?php 
            echo JRoute::_(JUDirectoryHelperRoute::getListingRoute($item->listing_id));
            ?>
">
									<?php 
            echo $item->listing_title;
            ?>
								</a>
								<span> / </span>
								<a target="_blank"
								   href="<?php 
            echo JRoute::_(JUDirectoryHelperRoute::getListingRoute($item->listing_id) . '&limitstart=' . $limitStart . '&resetfilter=1' . '#comment-item-' . $parentCommentObject->id);
            ?>
">
									<?php 
            echo $parentCommentObject->title;
            ?>
								</a>
							<?php 
        }
        ?>
						</td>

						<td class="center">
							<?php 
        if ($item->user_id > 0) {
            $userComment = JFactory::getUser($item->user_id);
Ejemplo n.º 16
0
 public static function getLocations($listings)
 {
     $locations = array();
     $listingIds = array();
     if ($listings) {
         foreach ($listings as $listing) {
             $listingIds[] = $listing->id;
         }
         $db = JFactory::getDbo();
         $query = $db->getQuery(true);
         $query->select('location.*, listing.image AS listing_image, listing.title')->from('#__judirectory_locations AS location')->join('', '#__judirectory_listings AS listing ON listing.id = location.listing_id')->where('listing.id IN (' . implode(',', $listingIds) . ')');
         $db->setQuery($query);
         $locations = $db->loadObjectList();
         $locationIconUrl = JUri::root(true) . '/media/com_judirectory/images/location/';
         JTable::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_judirectory/tables');
         $addressTable = JTable::getInstance('Address', 'JUDirectoryTable');
         foreach ($locations as $location) {
             if ($location->image) {
                 $location->image = $locationIconUrl . $location->listing_id . '/' . $location->image;
             } else {
                 $location->image = JUDirectoryHelper::getListingImage($location->listing_image);
             }
             $addresses = self::getAddresses($addressTable, $location->address_id);
             $addresses[] = $location->address;
             $location->address = implode(', ', array_reverse($addresses));
             $location->link = JRoute::_(JUDirectoryHelperRoute::getListingRoute($location->listing_id));
             $location->description = nl2br($location->description);
         }
     }
     return $locations;
 }
Ejemplo n.º 17
0
<?php

/**
 * ------------------------------------------------------------------------
 * JUDirectory for Joomla 2.5, 3.x
 * ------------------------------------------------------------------------
 *
 * @copyright      Copyright (C) 2010-2015 JoomUltra Co., Ltd. All Rights Reserved.
 * @license        GNU General Public License version 2 or later; see LICENSE.txt
 * @author         JoomUltra Co., Ltd
 * @website        http://www.joomultra.com
 * @----------------------------------------------------------------------@
 */
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
if ($value) {
    $html = "<ul " . $this->getAttribute(null, null, "output") . ">";
    foreach ($value as $tag) {
        $tagLink = JRoute::_(JUDirectoryHelperRoute::getTagRoute($tag->id));
        $html .= '<li><a href="' . $tagLink . '">' . $tag->title . '</a></li>';
    }
    $html .= "</ul>";
    echo $html;
}
Ejemplo n.º 18
0
 public static function getCustomListRoute($customlistId, $canonical = false, $layout = '')
 {
     $link = 'index.php?option=com_judirectory&view=customlist&id=' . $customlistId;
     if ($canonical) {
         $itemIdTreeRoot = JUDirectoryHelperRoute::getMenuItemIdOfViewCategoryTreeRoot();
         if ($itemIdTreeRoot > 0) {
             $itemId = $itemIdTreeRoot;
         } else {
             $itemId = JUDirectoryHelperRoute::getHomeMenuItemId();
         }
     } else {
         $needles = array('customlist' => array((int) $customlistId));
         $itemId = JUDirectoryHelperRoute::findItemId($needles);
     }
     if ($layout && $layout != 'default') {
         $link .= '&layout=' . $layout;
     }
     if ($itemId) {
         $link .= "&Itemid=" . $itemId;
     }
     return $link;
 }
Ejemplo n.º 19
0
 protected function _setBreadcrumb()
 {
     $app = JFactory::getApplication();
     $pathway = $app->getPathway();
     $pathwayArray = array();
     if ($this->categoryId) {
         $pathwayArray = JUDirectoryFrontHelperBreadcrumb::getBreadcrumbCategory($this->categoryId);
     } else {
         $pathwayArray[] = JUDirectoryFrontHelperBreadcrumb::getRootPathway();
     }
     $linkFeatured = JRoute::_(JUDirectoryHelperRoute::getFeaturedRoute($this->categoryId, $this->fetchAllSubCat));
     $pathwayArray[] = JUDirectoryFrontHelperBreadcrumb::createPathwayItem($this->getName(), $linkFeatured);
     $pathway->setPathway($pathwayArray);
 }
Ejemplo n.º 20
0
?>
">

	<div id="judir-comparison-notification"></div>

	<?php 
$app = JFactory::getApplication();
if ($app->input->getInt('advancedsearch', 0) || !is_null($app->input->get('limitstart'))) {
    ?>

		<div class="pull-right">
			<a class="hasTooltip btn" title="<?php 
    echo JText::_('COM_JUDIRECTORY_BACK_TO_SEARCH_FORM');
    ?>
" href="<?php 
    echo JRoute::_(JUDirectoryHelperRoute::getAdvsearchRoute());
    ?>
">
				<i class="fa fa-undo"></i>
			</a>
		</div>

		<h2><?php 
    echo JText::_('COM_JUDIRECTORY_SEARCH_RESULTS');
    ?>
</h2>

		<?php 
    if (!count($this->items)) {
        ?>
			<div class="alert alert-no-items"><?php 
Ejemplo n.º 21
0
 public function getOutput($options = array())
 {
     if (!$this->isPublished()) {
         return "";
     }
     if (!$this->value) {
         return "";
     }
     $options = (array) $options;
     if ($this->isDetailsView($options)) {
         if ($this->params->get("show_introtext_in_details_view", 1)) {
             $description = $this->value;
         } else {
             $description = $this->listing->fulltext;
         }
         if ($this->params->get("strip_tags_details_view", 0)) {
             $allowable_tags = $this->params->get("allowable_tags", "u,b,i,a,ul,li,pre,blockquote,strong,em");
             $allowable_tags = str_replace(' ', '', $allowable_tags);
             $allowable_tags = "<" . str_replace(',', '><', $allowable_tags) . ">";
             $description = strip_tags($description, $allowable_tags);
         }
         if ($this->params->get("parse_plugin", 0)) {
             $description = JHtml::_('content.prepare', $description);
         }
         if ($this->params->get("auto_link", 1)) {
             $trim_long_url = $this->params->get('trim_long_url', 0);
             $front_portion_url = $this->params->get('front_portion_url', 0);
             $back_portion_url = $this->params->get('back_portion_url', 0);
             $regex = "#http(?:s)?:\\/\\/(?:www\\.)?[\\.0-9a-z]{1,255}(\\.[a-z]{2,4}){1,2}([\\/\\?][^\\s]{1,}){0,}[\\/]?#i";
             preg_match_all($regex, $description, $matches);
             $matches = array_unique($matches[0]);
             if (count($matches) > 0) {
                 foreach ($matches as $url) {
                     $shortenUrl = urldecode($url);
                     if ($trim_long_url > 0 && strlen($shortenUrl) > $trim_long_url) {
                         if ($front_portion_url > 0 || $back_portion_url > 0) {
                             $frontStr = $front_portion_url > 0 ? substr($shortenUrl, 0, $front_portion_url) : "";
                             $backStr = $back_portion_url > 0 ? substr($shortenUrl, (int) (0 - $back_portion_url)) : "";
                             $shortenUrl = $frontStr . '...' . $backStr;
                         }
                         $shortenUrl = '<a href="' . $url . '">' . $shortenUrl . '</a> ';
                         $description = str_replace(trim($url), $shortenUrl, $description);
                         $description = JUDirectoryFrontHelperString::replaceIgnore(trim($url), $shortenUrl, $description);
                     } else {
                         $description = JUDirectoryFrontHelperString::replaceIgnore($url, '<a href="' . $url . '">' . trim($shortenUrl) . '</a> ', $description);
                     }
                 }
             }
         }
         if ($this->params->get("nl2br_details_view", 0)) {
             $description = nl2br($description);
         }
     } else {
         $description = $this->listing->introtext;
         if ($this->params->get("strip_tags_list_view", 1)) {
             $allowable_tags = $this->params->get("allowable_tags", "u,b,i,a,ul,li,pre,blockquote,strong,em");
             $allowable_tags = str_replace(' ', '', $allowable_tags);
             $allowable_tags = "<" . str_replace(',', '><', $allowable_tags) . ">";
             $description = strip_tags($description, $allowable_tags);
         }
         if ($this->params->get("use_html_entities", 0)) {
             $description = htmlentities($description);
         }
         $isTruncated = false;
         if ($this->params->get("truncate", 1)) {
             if ($this->params->get("limit_char_in_list_view", 200) < strlen($description)) {
                 $isTruncated = true;
             }
             $description = JUDirectoryFrontHelperString::truncateHtml($description, $this->params->get("limit_char_in_list_view", 200));
         }
         if ($this->params->get("parse_plugin", 0)) {
             $description = JHtml::_('content.prepare', $description);
         }
         if ($this->params->get("show_readmore", 0)) {
             if ($this->params->get("show_readmore_when", 1) == 2 || $this->params->get("show_readmore_when", 1) == 1 && $isTruncated) {
                 $description .= ' <a class="readmore" href="' . JRoute::_(JUDirectoryHelperRoute::getListingRoute($this->listing_id)) . '">' . $this->params->get("readmore_text", 'Read more...') . '</a>';
             }
         }
     }
     $this->setVariable('value', $description);
     return $this->fetch('output.php', __CLASS__);
 }
Ejemplo n.º 22
0
								</a>
							<?php 
        } else {
            ?>
                                <?php 
            echo str_repeat('<span class="gi">&mdash;</span>', $item->level);
            ?>
								<?php 
            echo $item->title;
            ?>
							<?php 
        }
        ?>

                            <?php 
        if ($item->level == 1 && JUDirectoryHelperRoute::findItemId(array('tree' => array($item->id)))) {
            ?>
                                <span class="btn btn-mini"><i class="icon-home"></i></span>
                            <?php 
        }
        if ($item->level == 1 && $item->config_params) {
            ?>
                                <span class="btn btn-mini"><i class="icon-cog hasTooltip" title="<?php 
            echo JText::_('COM_JUDIRECTORY_OVERRIDE_CONFIG');
            ?>
"></i></span>
                            <?php 
        }
        ?>

							<p class="small"><?php 
Ejemplo n.º 23
0
?>
			</tr>
			</thead>

			<tbody>
			<?php 
if (count($this->items) > 0) {
    foreach ($this->items as $key => $value) {
        $type = $value->type;
        if ($type == 'listing') {
            $title = $value->listing_title;
            $linkListing = JRoute::_(JUDirectoryHelperRoute::getListingRoute($value->item_id));
        }
        if ($type == 'comment') {
            $title = $value->comment_title;
            $linkListing = JRoute::_(JUDirectoryHelperRoute::getListingRoute($value->listing_id));
        }
        if ($this->isOwnDashboard) {
            $unsubscribeLink = JRoute::_('index.php?option=com_judirectory&task=usersubscriptions.unsubscribe&sub_id=' . $value->id . '&' . $this->token . '=1');
        }
        ?>
					<?php 
        if ($title) {
            ?>
						<tr>
							<?php 
            if ($this->isOwnDashboard) {
                ?>
								<td>
									<?php 
                echo JHtml::_('grid.id', $key, $value->id);
Ejemplo n.º 24
0
    ?>
</span>
								<span> <a
										href="<?php 
    echo $this->unapproved_comments_link;
    ?>
"><?php 
    echo JText::_('COM_JUDIRECTORY_PENDING_COMMENTS');
    ?>
</a></span>
							</li>
							<li>
								<span>
									<a class="btn btn-default btn-xs"
									   href="<?php 
    echo JRoute::_(JUDirectoryHelperRoute::getModeratorPermissionsRoute());
    ?>
">
										<i class="fa fa-shield"></i> <?php 
    echo JText::_('COM_JUDIRECTORY_MODERATOR_PERMISSIONS');
    ?>
									</a>
								</span>
							</li>
						</ul>
					</div>
				</div>
			</div>
		<?php 
}
?>
Ejemplo n.º 25
0
        ?>
		<tr>
		<td class="center">
			<input type="checkbox" class="judir-cb" name="cid[]" value="<?php 
        echo $item->id;
        ?>
"
			       id="judir-cb-<?php 
        echo $i;
        ?>
"/>
		</td>
		<td class="title">
			<div class="title-wrapper">
				<a href="<?php 
        echo JRoute::_(JUDirectoryHelperRoute::getListingRoute($item->id));
        ?>
"
				   title="<?php 
        echo $item->title;
        ?>
">
					<?php 
        echo $item->title;
        ?>
				</a>
				<?php 
        if ($item->label_unpublished) {
            ?>
					<span class="label label-unpublished"><?php 
            echo JText::_('COM_JUDIRECTORY_UNPUBLISHED');
Ejemplo n.º 26
0
 public function parse(&$segments)
 {
     $total = count($segments);
     $vars = array();
     for ($i = 0; $i < $total; $i++) {
         $segments[$i] = preg_replace('/:/', '-', $segments[$i], 1);
     }
     $params = JUDirectoryHelper::getParams();
     $app = JFactory::getApplication('site');
     $menu = $app->getMenu();
     $activeMenu = $menu->getActive();
     $indexLastSegment = $total - 1;
     $endSegment = end($segments);
     $searchViewApproveComment = array_search(JApplication::stringURLSafe('mod-comment'), $segments);
     if ($searchViewApproveComment !== false) {
         $vars['view'] = 'modcomment';
         if (isset($segments[$searchViewApproveComment + 1])) {
             $vars['id'] = (int) $segments[$searchViewApproveComment + 1];
         }
         if (isset($segments[$searchViewApproveComment + 2])) {
             if ($segments[$searchViewApproveComment + 2] == JApplication::stringURLSafe('approve')) {
                 $vars['approve'] = 1;
             }
         }
         $previousIndexSegment = $total - 1;
         if (isset($segments[$previousIndexSegment])) {
             $isLayout = JUDirectoryHelperRoute::parseLayout($segments[$previousIndexSegment], $vars, $params);
             if ($isLayout) {
                 $previousIndexSegment -= 1;
             }
         }
         return $vars;
     }
     if (isset($segments[0]) && $segments[0] == JApplication::stringURLSafe('comment')) {
         if (isset($segments[2])) {
             switch ($segments[2]) {
                 case JApplication::stringURLSafe('edit'):
                     $vars['task'] = 'modcomment.edit';
                     if (isset($segments[1])) {
                         $vars['id'] = (int) $segments[1];
                     }
                     break;
                 case JApplication::stringURLSafe('approve'):
                     $vars['task'] = 'modpendingcomment.edit';
                     if (isset($segments[1])) {
                         $vars['id'] = (int) $segments[1];
                     }
                     break;
                 case JApplication::stringURLSafe('subscribe'):
                     $vars['task'] = 'subscribe.save';
                     if (isset($segments[1])) {
                         $vars['comment_id'] = (int) $segments[1];
                     }
                     break;
                 case JApplication::stringURLSafe('unsubscribe'):
                     $vars['task'] = 'subscribe.remove';
                     if (isset($segments[3])) {
                         $vars['sub_id'] = (int) $segments[3];
                     }
                     if (isset($segments[4])) {
                         $vars['code'] = $segments[4];
                     }
                     break;
                 case JApplication::stringURLSafe('delete'):
                     $vars['task'] = 'listing.deleteComment';
                     if (isset($segments[1])) {
                         $vars['comment_id'] = (int) $segments[1];
                     }
                     break;
                 default:
                     break;
             }
             if (isset($vars['task'])) {
                 return $vars;
             }
         }
     }
     $searchViewReportComment = array_search(JApplication::stringURLSafe('comment'), $segments);
     if ($searchViewReportComment !== false) {
         $validArrayIndex = array(0, 1);
         if (in_array($searchViewReportComment, $validArrayIndex)) {
             if (isset($segments[$searchViewReportComment + 2])) {
                 if ($segments[$searchViewReportComment + 2] == JApplication::stringURLSafe('report')) {
                     $vars['view'] = 'report';
                     if (isset($segments[$searchViewReportComment + 1])) {
                         $vars['comment_id'] = (int) $segments[$searchViewReportComment + 1];
                     }
                     $previousIndexSegment = $total - 1;
                     if (isset($segments[$previousIndexSegment])) {
                         $isLayout = JUDirectoryHelperRoute::parseLayout($segments[$previousIndexSegment], $vars, $params);
                         if ($isLayout) {
                             $previousIndexSegment -= 1;
                         }
                     }
                     return $vars;
                 }
             }
         }
     }
     $searchViewModeratorPermission = array_search(JApplication::stringURLSafe('mod-permission'), $segments);
     if ($searchViewModeratorPermission !== false) {
         $validArrayIndex = array(0, 1);
         if (in_array($searchViewModeratorPermission, $validArrayIndex)) {
             $vars['view'] = 'modpermission';
             if (isset($segments[$searchViewModeratorPermission + 1])) {
                 $vars['id'] = (int) $segments[$searchViewModeratorPermission + 1];
             }
             $previousIndexSegment = $total - 1;
             if (isset($segments[$previousIndexSegment])) {
                 $isLayout = JUDirectoryHelperRoute::parseLayout($segments[$previousIndexSegment], $vars, $params);
                 if ($isLayout) {
                     $previousIndexSegment -= 1;
                 }
             }
             return $vars;
         }
     }
     $searchViewCustomList = array_search(JApplication::stringURLSafe('custom-list'), $segments);
     if ($searchViewCustomList !== false) {
         $validArrayIndex = array(0, 1);
         if (in_array($searchViewCustomList, $validArrayIndex)) {
             $vars['view'] = 'customlist';
             if (isset($segments[$searchViewCustomList + 1])) {
                 $vars['id'] = (int) $segments[$searchViewCustomList + 1];
             }
             $previousIndexSegment = $total - 1;
             $isPaged = JUDirectoryHelperRoute::parsePagination($vars, $segments, $params);
             if ($isPaged) {
                 $previousIndexSegment -= 1;
             }
             if (isset($segments[$previousIndexSegment])) {
                 if ($segments[$previousIndexSegment] == JApplication::stringURLSafe('rss')) {
                     $vars['format'] = 'feed';
                     $previousIndexSegment -= 1;
                 }
             }
             if (isset($segments[$previousIndexSegment])) {
                 $isLayout = JUDirectoryHelperRoute::parseLayout($segments[$previousIndexSegment], $vars, $params);
                 if ($isLayout) {
                     $previousIndexSegment -= 1;
                 }
             }
             return $vars;
         }
     }
     $searchViewCompare = array_search(JApplication::stringURLSafe('compare'), $segments);
     if ($searchViewCompare !== false) {
         $validArrayIndex = array(0, 1);
         if (in_array($searchViewCompare, $validArrayIndex)) {
             $vars['view'] = 'compare';
             $previousIndexSegment = $total - 1;
             if (isset($segments[$previousIndexSegment])) {
                 $isLayout = JUDirectoryHelperRoute::parseLayout($segments[$previousIndexSegment], $vars, $params);
                 if ($isLayout) {
                     $previousIndexSegment -= 1;
                 }
             }
             return $vars;
         }
     }
     if (isset($segments[0]) && $segments[0] == JApplication::stringURLSafe('user-subscriptions')) {
         if (isset($segments[2])) {
             if ($segments[2] == JApplication::stringURLSafe('unsubscribe')) {
                 $vars['task'] = 'usersubscriptions.unsubscribe';
                 if (isset($segments[1])) {
                     $vars['sub_id'] = (int) $segments[1];
                 }
                 return $vars;
             }
         }
     }
     if (isset($segments[0]) && $segments[0] == JApplication::stringURLSafe('email')) {
         if (isset($segments[1]) && $segments[1] == JApplication::stringURLSafe('download-attachment')) {
             $vars['task'] = 'email.downloadattachment';
             if (isset($segments[2])) {
                 $vars['mail_id'] = (int) $segments[2];
             }
             if (isset($segments[3])) {
                 $vars['file'] = $segments[3];
             }
             if (isset($segments[4])) {
                 $vars['code'] = $segments[4];
             }
         }
         return $vars;
     }
     $searchViewModeratorPermissions = array_search(JApplication::stringURLSafe('mod-permissions'), $segments);
     if ($searchViewModeratorPermissions !== false) {
         $validArrayIndex = array(0, 1);
         if (in_array($searchViewModeratorPermissions, $validArrayIndex)) {
             $vars['view'] = 'modpermissions';
             $previousIndexSegment = $total - 1;
             if (isset($segments[$previousIndexSegment])) {
                 $isLayout = JUDirectoryHelperRoute::parseLayout($segments[$previousIndexSegment], $vars, $params);
                 if ($isLayout) {
                     $previousIndexSegment -= 1;
                 }
             }
             return $vars;
         }
     }
     $searchViewProfile = array_search(JApplication::stringURLSafe('profile'), $segments);
     if ($searchViewProfile !== false) {
         $validArrayIndex = array(0, 1, 2);
         if (in_array($searchViewProfile, $validArrayIndex)) {
             $vars['view'] = 'profile';
             $previousIndexSegment = $total - 1;
             if (isset($segments[$previousIndexSegment])) {
                 $isLayout = JUDirectoryHelperRoute::parseLayout($segments[$previousIndexSegment], $vars, $params);
                 if ($isLayout) {
                     $previousIndexSegment -= 1;
                 }
             }
             return $vars;
         }
     }
     $searchViewModeratorPendingListings = array_search(JApplication::stringURLSafe('mod-pending-listings'), $segments);
     if ($searchViewModeratorPendingListings !== false) {
         $validArrayIndex = array(0, 1, 2);
         if (in_array($searchViewModeratorPendingListings, $validArrayIndex)) {
             $vars['view'] = 'modpendinglistings';
             $previousIndexSegment = $total - 1;
             $isPaged = JUDirectoryHelperRoute::parsePagination($vars, $segments, $params);
             if ($isPaged) {
                 $previousIndexSegment -= 1;
             }
             if (isset($segments[$previousIndexSegment])) {
                 $isLayout = JUDirectoryHelperRoute::parseLayout($segments[$previousIndexSegment], $vars, $params);
                 if ($isLayout) {
                     $previousIndexSegment -= 1;
                 }
             }
             return $vars;
         }
     }
     $searchViewModeratorPendingComments = array_search(JApplication::stringURLSafe('mod-pending-comments'), $segments);
     if ($searchViewModeratorPendingComments !== false) {
         $validArrayIndex = array(0, 1, 2);
         if (in_array($searchViewModeratorPendingComments, $validArrayIndex)) {
             $vars['view'] = 'modpendingcomments';
             $previousIndexSegment = $total - 1;
             $isPaged = JUDirectoryHelperRoute::parsePagination($vars, $segments, $params);
             if ($isPaged) {
                 $previousIndexSegment -= 1;
             }
             if (isset($segments[$previousIndexSegment])) {
                 $isLayout = JUDirectoryHelperRoute::parseLayout($segments[$previousIndexSegment], $vars, $params);
                 if ($isLayout) {
                     $previousIndexSegment -= 1;
                 }
             }
             return $vars;
         }
     }
     $searchViewModeratorComments = array_search(JApplication::stringURLSafe('mod-comments'), $segments);
     if ($searchViewModeratorComments !== false) {
         $validArrayIndex = array(0, 1, 2);
         if (in_array($searchViewModeratorComments, $validArrayIndex)) {
             $vars['view'] = 'modcomments';
             $previousIndexSegment = $total - 1;
             $isPaged = JUDirectoryHelperRoute::parsePagination($vars, $segments, $params);
             if ($isPaged) {
                 $previousIndexSegment -= 1;
             }
             if (isset($segments[$previousIndexSegment])) {
                 $isLayout = JUDirectoryHelperRoute::parseLayout($segments[$previousIndexSegment], $vars, $params);
                 if ($isLayout) {
                     $previousIndexSegment -= 1;
                 }
             }
             return $vars;
         }
     }
     $searchViewModeratorListings = array_search(JApplication::stringURLSafe('mod-listings'), $segments);
     if ($searchViewModeratorListings !== false) {
         $validArrayIndex = array(0, 1, 2);
         if (in_array($searchViewModeratorListings, $validArrayIndex)) {
             $vars['view'] = 'modlistings';
             $previousIndexSegment = $total - 1;
             $isPaged = JUDirectoryHelperRoute::parsePagination($vars, $segments, $params);
             if ($isPaged) {
                 $previousIndexSegment -= 1;
             }
             if (isset($segments[$previousIndexSegment])) {
                 $isLayout = JUDirectoryHelperRoute::parseLayout($segments[$previousIndexSegment], $vars, $params);
                 if ($isLayout) {
                     $previousIndexSegment -= 1;
                 }
             }
             return $vars;
         }
     }
     if (isset($segments[0]) && $segments[0] == JApplication::stringURLSafe('subscribe')) {
         if (isset($segments[1]) && $segments[1] == JApplication::stringURLSafe('activate')) {
             $vars['task'] = 'subscribe.activate';
             if (isset($segments[2])) {
                 $vars['code'] = $segments[2];
             }
             if (isset($segments[3])) {
                 $vars['id'] = (int) $segments[3];
             }
             if (isset($segments[4])) {
                 $vars['listing_id'] = (int) $segments[4];
             }
             return $vars;
         }
     }
     $searchViewSearch = array_search(JApplication::stringURLSafe('search'), $segments);
     if ($searchViewSearch !== false) {
         $validArrayIndex = array(0, 1, 2, 3);
         if (in_array($searchViewSearch, $validArrayIndex)) {
             $vars['view'] = 'search';
             if (isset($segments[$searchViewSearch - 1])) {
                 if ($segments[$searchViewSearch - 1] == JApplication::stringURLSafe('all')) {
                     $vars['sub_cat'] = 1;
                     if (isset($segments[$searchViewSearch - 2])) {
                         $vars['cat_id'] = (int) $segments[$searchViewSearch - 2];
                     }
                 } else {
                     $vars['cat_id'] = (int) $segments[$searchViewSearch - 1];
                 }
             }
             $previousIndexSegment = $total - 1;
             $isPaged = JUDirectoryHelperRoute::parsePagination($vars, $segments, $params);
             if ($isPaged) {
                 $previousIndexSegment -= 1;
             }
             if (isset($segments[$previousIndexSegment])) {
                 $isLayout = JUDirectoryHelperRoute::parseLayout($segments[$previousIndexSegment], $vars, $params);
                 if ($isLayout) {
                     $previousIndexSegment -= 1;
                 }
             }
             if (isset($segments[$previousIndexSegment]) && $previousIndexSegment > $searchViewSearch) {
                 $vars['searchword'] = $segments[$previousIndexSegment];
                 $previousIndexSegment -= 1;
             }
             return $vars;
         }
     }
     $searchViewCategories = array_search(JApplication::stringURLSafe('categories'), $segments);
     if ($searchViewCategories !== false) {
         $validArrayIndex = array(0, 1);
         if (in_array($searchViewCategories, $validArrayIndex)) {
             $vars['view'] = 'categories';
             if (isset($segments[$searchViewCategories + 1])) {
                 $vars['id'] = (int) $segments[$searchViewCategories + 1];
             }
             if (isset($segments[$searchViewCategories + 2])) {
                 JUDirectoryHelperRoute::parseLayout($segments[$searchViewCategories + 2], $vars, $params);
             }
             return $vars;
         }
     }
     $searchViewAdvancedSearch = array_search(JApplication::stringURLSafe('advanced-search'), $segments);
     if ($searchViewAdvancedSearch !== false) {
         $validArrayIndex = array(0, 1, 2);
         if (in_array($searchViewAdvancedSearch, $validArrayIndex)) {
             $vars['view'] = 'advsearch';
             $previousIndexSegment = $total - 1;
             $isPaged = JUDirectoryHelperRoute::parsePagination($vars, $segments, $params);
             if ($isPaged) {
                 $previousIndexSegment -= 1;
             }
             if (isset($segments[$previousIndexSegment])) {
                 $isLayout = JUDirectoryHelperRoute::parseLayout($segments[$previousIndexSegment], $vars, $params);
                 if ($isLayout) {
                     $previousIndexSegment -= 1;
                 }
             }
             return $vars;
         }
     }
     $searchViewCommentTree = array_search(JApplication::stringURLSafe('comment-tree'), $segments);
     if ($searchViewCommentTree !== false) {
         $validArrayIndex = array(0, 1, 2);
         if (in_array($searchViewCommentTree, $validArrayIndex)) {
             $vars['view'] = 'commenttree';
             if (isset($segments[$searchViewCommentTree + 1])) {
                 $vars['id'] = (int) $segments[$searchViewCommentTree + 1];
             }
             $previousIndexSegment = $total - 1;
             if (isset($segments[$previousIndexSegment])) {
                 $isLayout = JUDirectoryHelperRoute::parseLayout($segments[$previousIndexSegment], $vars, $params);
                 if ($isLayout) {
                     $previousIndexSegment -= 1;
                 }
             }
             return $vars;
         }
     }
     $searchViewListings = array_search(JApplication::stringURLSafe('modal-listings'), $segments);
     if ($searchViewListings !== false) {
         $validArrayIndex = array(0, 1, 2);
         if (in_array($searchViewListings, $validArrayIndex)) {
             $vars['view'] = 'listings';
             if (isset($segments[$searchViewListings + 1])) {
                 $vars['tmpl'] = $segments[$searchViewListings + 1];
             }
             if (isset($segments[$searchViewListings + 2])) {
                 $vars['function'] = $segments[$searchViewListings + 2];
             }
             $previousIndexSegment = $total - 1;
             $isPaged = JUDirectoryHelperRoute::parsePagination($vars, $segments, $params);
             if ($isPaged) {
                 $previousIndexSegment -= 1;
             }
             if (isset($segments[$previousIndexSegment])) {
                 $isLayout = JUDirectoryHelperRoute::parseLayout($segments[$previousIndexSegment], $vars, $params);
                 if ($isLayout) {
                     $previousIndexSegment -= 1;
                 }
             }
             return $vars;
         }
     }
     $searchViewMaintenance = array_search(JApplication::stringURLSafe('maintenance'), $segments);
     if ($searchViewMaintenance !== false) {
         $validArrayIndex = array(0, 1);
         if (in_array($searchViewMaintenance, $validArrayIndex)) {
             $vars['view'] = 'maintenance';
             $previousIndexSegment = $total - 1;
             if (isset($segments[$previousIndexSegment])) {
                 $isLayout = JUDirectoryHelperRoute::parseLayout($segments[$previousIndexSegment], $vars, $params);
                 if ($isLayout) {
                     $previousIndexSegment -= 1;
                 }
             }
             return $vars;
         }
     }
     $searchViewSearchBy = array_search(JApplication::stringURLSafe('search-by'), $segments);
     if ($searchViewSearchBy !== false) {
         $validArrayIndex = array(0, 1, 2);
         if (in_array($searchViewSearchBy, $validArrayIndex)) {
             $vars['view'] = 'searchby';
             if (isset($segments[$searchViewSearchBy + 1])) {
                 $vars['field_id'] = (int) $segments[$searchViewSearchBy + 1];
             }
             if (isset($segments[$searchViewSearchBy + 2])) {
                 $vars['value'] = $segments[$searchViewSearchBy + 2];
             }
             $previousIndexSegment = $total - 1;
             $isPaged = JUDirectoryHelperRoute::parsePagination($vars, $segments, $params);
             if ($isPaged) {
                 $previousIndexSegment -= 1;
             }
             if (isset($segments[$previousIndexSegment])) {
                 $isLayout = JUDirectoryHelperRoute::parseLayout($segments[$previousIndexSegment], $vars, $params);
                 if ($isLayout) {
                     $previousIndexSegment -= 1;
                 }
             }
             return $vars;
         }
     }
     $searchViewTag = array_search(JApplication::stringURLSafe('tag'), $segments);
     if ($searchViewTag !== false) {
         $validArrayIndex = array(0, 1, 2);
         if (in_array($searchViewTag, $validArrayIndex)) {
             $vars['view'] = 'tag';
             if (isset($segments[$searchViewTag + 1])) {
                 $vars['id'] = (int) $segments[$searchViewTag + 1];
             }
             $previousIndexSegment = $total - 1;
             $isPaged = JUDirectoryHelperRoute::parsePagination($vars, $segments, $params);
             if ($isPaged) {
                 $previousIndexSegment -= 1;
             }
             if (isset($segments[$previousIndexSegment])) {
                 if ($segments[$previousIndexSegment] == JApplication::stringURLSafe('rss')) {
                     $vars['format'] = 'feed';
                     $previousIndexSegment -= 1;
                 }
             }
             if (isset($segments[$previousIndexSegment])) {
                 $isLayout = JUDirectoryHelperRoute::parseLayout($segments[$previousIndexSegment], $vars, $params);
                 if ($isLayout) {
                     $previousIndexSegment -= 1;
                 }
             }
             return $vars;
         }
     }
     $searchViewTags = array_search(JApplication::stringURLSafe('tags'), $segments);
     if ($searchViewTags !== false) {
         $validArrayIndex = array(0, 1);
         if (in_array($searchViewTags, $validArrayIndex)) {
             $vars['view'] = 'tags';
             $previousIndexSegment = $total - 1;
             $isPaged = JUDirectoryHelperRoute::parsePagination($vars, $segments, $params);
             if ($isPaged) {
                 $previousIndexSegment -= 1;
             }
             if (isset($segments[$previousIndexSegment])) {
                 $isLayout = JUDirectoryHelperRoute::parseLayout($segments[$previousIndexSegment], $vars, $params);
                 if ($isLayout) {
                     $previousIndexSegment -= 1;
                 }
             }
             return $vars;
         }
     }
     $searchViewTopComments = array_search(JApplication::stringURLSafe('top-comments'), $segments);
     if ($searchViewTopComments !== false) {
         $validArrayIndex = array(0, 1);
         if (in_array($searchViewTopComments, $validArrayIndex)) {
             $vars['view'] = 'topcomments';
             $previousIndexSegment = $total - 1;
             $isPaged = JUDirectoryHelperRoute::parsePagination($vars, $segments, $params);
             if ($isPaged) {
                 $previousIndexSegment -= 1;
             }
             if (isset($segments[$previousIndexSegment])) {
                 $isLayout = JUDirectoryHelperRoute::parseLayout($segments[$previousIndexSegment], $vars, $params);
                 if ($isLayout) {
                     $previousIndexSegment -= 1;
                 }
             }
             return $vars;
         }
     }
     $searchViewTree = array_search(JApplication::stringURLSafe('tree'), $segments);
     if ($searchViewTree !== false) {
         $validArrayIndex = array(0, 1);
         if (in_array($searchViewTree, $validArrayIndex)) {
             $vars['view'] = 'tree';
             $previousIndexSegment = $total - 1;
             $isPaged = JUDirectoryHelperRoute::parsePagination($vars, $segments, $params);
             if ($isPaged) {
                 $previousIndexSegment -= 1;
             }
             if (isset($segments[$previousIndexSegment])) {
                 if ($segments[$previousIndexSegment] == JApplication::stringURLSafe('rss')) {
                     $vars['format'] = 'feed';
                     $previousIndexSegment -= 1;
                 }
             }
             if (isset($segments[$previousIndexSegment])) {
                 $isLayout = JUDirectoryHelperRoute::parseLayout($segments[$previousIndexSegment], $vars, $params);
                 if ($isLayout) {
                     $previousIndexSegment -= 1;
                 }
             }
             if (isset($segments[$previousIndexSegment])) {
                 if ($segments[$previousIndexSegment] == JApplication::stringURLSafe('root')) {
                     $rootCategory = JUDirectoryFrontHelperCategory::getRootCategory();
                     $vars['id'] = $rootCategory->id;
                 } else {
                     $vars['id'] = (int) $segments[$previousIndexSegment];
                 }
                 $previousIndexSegment -= 1;
             } else {
                 if ($activeMenu && isset($activeMenu->query) && isset($activeMenu->query['view']) && isset($activeMenu->query['id']) && $activeMenu->query['view'] == 'tree') {
                     $vars['id'] = $activeMenu->query['id'];
                 }
             }
             return $vars;
         }
     }
     $orderTypeTopListings = array();
     $orderTypeTopListings[] = JApplication::stringURLSafe('latest-listings');
     $orderTypeTopListings[] = JApplication::stringURLSafe('top-featured-listings');
     $orderTypeTopListings[] = JApplication::stringURLSafe('recent-modified-listings');
     $orderTypeTopListings[] = JApplication::stringURLSafe('recent-updated-listings');
     $orderTypeTopListings[] = JApplication::stringURLSafe('popular-listings');
     $orderTypeTopListings[] = JApplication::stringURLSafe('most-rated-listings');
     $orderTypeTopListings[] = JApplication::stringURLSafe('top-rated-listings');
     $orderTypeTopListings[] = JApplication::stringURLSafe('latest-rated-listings');
     $orderTypeTopListings[] = JApplication::stringURLSafe('most-commented-listings');
     $orderTypeTopListings[] = JApplication::stringURLSafe('latest-commented-listings');
     $orderTypeTopListings[] = JApplication::stringURLSafe('recent-viewed-listings');
     $orderTypeTopListings[] = JApplication::stringURLSafe('alpha-ordered-listings');
     $orderTypeTopListings[] = JApplication::stringURLSafe('random-listings');
     $orderTypeTopListings[] = JApplication::stringURLSafe('random-fast-listings');
     $orderTypeTopListings[] = JApplication::stringURLSafe('random-featured-listings');
     if (!empty($orderTypeTopListings)) {
         foreach ($orderTypeTopListings as $orderTypeTopListingItem) {
             $searchViewTopListings = array_search($orderTypeTopListingItem, $segments);
             if ($searchViewTopListings !== false) {
                 break;
             }
         }
         if ($searchViewTopListings !== false) {
             $validArrayIndex = array(0, 1, 2);
             if (in_array($searchViewTopListings, $validArrayIndex)) {
                 $vars['view'] = 'toplistings';
                 switch ($segments[$searchViewTopListings]) {
                     case JApplication::stringURLSafe('latest-listings'):
                         $vars['ordertype'] = 'new';
                         break;
                     case JApplication::stringURLSafe('top-featured-listings'):
                         $vars['ordertype'] = 'featured';
                         break;
                     case JApplication::stringURLSafe('recent-modified-listings'):
                         $vars['ordertype'] = 'recent_modified';
                         break;
                     case JApplication::stringURLSafe('recent-updated-listings'):
                         $vars['ordertype'] = 'recent_updated';
                         break;
                     case JApplication::stringURLSafe('popular-listings'):
                         $vars['ordertype'] = 'popular';
                         break;
                     case JApplication::stringURLSafe('most-rated-listings'):
                         $vars['ordertype'] = 'most_rated';
                         break;
                     case JApplication::stringURLSafe('top-rated-listings'):
                         $vars['ordertype'] = 'top_rated';
                         break;
                     case JApplication::stringURLSafe('latest-rated-listings'):
                         $vars['ordertype'] = 'latest_rated';
                         break;
                     case JApplication::stringURLSafe('most-commented-listings'):
                         $vars['ordertype'] = 'most_commented';
                         break;
                     case JApplication::stringURLSafe('latest-commented-listings'):
                         $vars['ordertype'] = 'latest_commented';
                         break;
                     case JApplication::stringURLSafe('recent-viewed-listings'):
                         $vars['ordertype'] = 'recently_viewed';
                         break;
                     case JApplication::stringURLSafe('alpha-ordered-listings'):
                         $vars['ordertype'] = 'alpha_ordered';
                         break;
                     case JApplication::stringURLSafe('random-listings'):
                         $vars['ordertype'] = 'random';
                         break;
                     case JApplication::stringURLSafe('random-fast-listings'):
                         $vars['ordertype'] = 'random_fast';
                         break;
                     case JApplication::stringURLSafe('random-featured-listings'):
                         $vars['ordertype'] = 'random_featured';
                         break;
                     default:
                         $vars['ordertype'] = 'new';
                         break;
                 }
                 if (isset($segments[$searchViewTopListings - 1])) {
                     if ($segments[$searchViewTopListings - 1] == JApplication::stringURLSafe('root')) {
                         $rootCategory = JUDirectoryFrontHelperCategory::getRootCategory();
                         $vars['id'] = $rootCategory->id;
                     } else {
                         $vars['id'] = (int) $segments[$searchViewTopListings - 1];
                     }
                 } else {
                     if ($activeMenu && isset($activeMenu->query) && isset($activeMenu->query['view']) && isset($activeMenu->query['id']) && $activeMenu->query['view'] == 'tree') {
                         $vars['id'] = $activeMenu->query['id'];
                     }
                 }
                 if (isset($segments[$searchViewTopListings + 1])) {
                     if ($segments[$searchViewTopListings + 1] == JApplication::stringURLSafe('all')) {
                         $vars['all'] = 1;
                     }
                 }
                 $previousIndexSegment = $total - 1;
                 $isPaged = JUDirectoryHelperRoute::parsePagination($vars, $segments, $params);
                 if ($isPaged) {
                     $previousIndexSegment -= 1;
                 }
                 if (isset($segments[$previousIndexSegment])) {
                     if ($segments[$previousIndexSegment] == JApplication::stringURLSafe('rss')) {
                         $vars['format'] = 'feed';
                         $previousIndexSegment -= 1;
                     }
                 }
                 if (isset($segments[$previousIndexSegment])) {
                     $isLayout = JUDirectoryHelperRoute::parseLayout($segments[$previousIndexSegment], $vars, $params);
                     if ($isLayout) {
                         $previousIndexSegment -= 1;
                     }
                 }
                 return $vars;
             }
         }
     }
     $searchSefRedirectUrl = array_search(JApplication::stringURLSafe('redirect-url'), $segments);
     if ($searchSefRedirectUrl !== false) {
         $vars['task'] = 'listing.redirecturl';
         if (isset($segments[$searchSefRedirectUrl - 1])) {
             $vars['field_id'] = (int) $segments[$searchSefRedirectUrl - 1];
         }
         if (isset($segments[$searchSefRedirectUrl - 2])) {
             $vars['listing_id'] = (int) $segments[$searchSefRedirectUrl - 2];
         }
         return $vars;
     }
     $searchSefTaskRawData = array_search(JApplication::stringURLSafe('raw-data'), $segments);
     if ($searchSefTaskRawData !== false) {
         $vars['task'] = 'rawdata';
         if (isset($segments[$searchSefTaskRawData - 1])) {
             $vars['field_id'] = (int) $segments[$searchSefTaskRawData - 1];
         }
         if (isset($segments[$searchSefTaskRawData - 2])) {
             $vars['listing_id'] = (int) $segments[$searchSefTaskRawData - 2];
         }
         return $vars;
     }
     $searchSefCollection = array_search(JApplication::stringURLSafe('collection'), $segments);
     if ($searchSefCollection !== false) {
         if (isset($segments[$searchSefCollection + 1])) {
             if ($segments[$searchSefCollection + 1] == JApplication::stringURLSafe('add')) {
                 $vars['task'] = 'collection.add';
                 return $vars;
             }
         }
     }
     $searchSefCollection = array_search(JApplication::stringURLSafe('collection'), $segments);
     if ($searchSefCollection !== false) {
         if (isset($segments[$searchSefCollection + 2])) {
             if ($segments[$searchSefCollection + 2] == JApplication::stringURLSafe('edit')) {
                 if (isset($segments[$searchSefCollection - 1])) {
                     $vars['user_id'] = (int) $segments[$searchSefCollection - 1];
                 }
                 $vars['id'] = (int) $segments[$searchSefCollection + 1];
                 $vars['task'] = 'collection.edit';
                 return $vars;
             }
         }
     }
     $searchSefCollection = array_search(JApplication::stringURLSafe('collection'), $segments);
     if ($searchSefCollection !== false) {
         if (isset($segments[$searchSefCollection + 2])) {
             if ($segments[$searchSefCollection + 2] == JApplication::stringURLSafe('delete')) {
                 $vars['cid'] = (int) $segments[$searchSefCollection + 1];
                 $vars['task'] = 'collections.delete';
                 return $vars;
             }
         }
     }
     $searchSefCollection = array_search(JApplication::stringURLSafe('collection'), $segments);
     if ($searchSefCollection !== false) {
         if (isset($segments[$searchSefCollection + 1])) {
             if ($segments[$searchSefCollection + 1] == JApplication::stringURLSafe('new-collection')) {
                 $vars['id'] = 0;
                 $vars['view'] = 'collection';
                 JUDirectoryHelperRoute::parseLayout($segments[$searchSefCollection + 2], $vars, $params);
                 return $vars;
             }
         }
     }
     $searchSefCollection = array_search(JApplication::stringURLSafe('collection'), $segments);
     if ($searchSefCollection !== false) {
         $validArrayIndex = array(0, 1, 2);
         if (in_array($searchSefCollection, $validArrayIndex)) {
             $vars['view'] = 'collection';
             if (isset($segments[$searchSefCollection - 1])) {
                 if ($segments[$searchSefCollection - 1] != 'root') {
                     $vars['user_id'] = (int) $segments[$searchSefCollection - 1];
                 }
             }
             if (isset($segments[$searchSefCollection + 1])) {
                 $vars['id'] = (int) $segments[$searchSefCollection + 1];
             }
             $previousIndexSegment = $total - 1;
             $isPaged = JUDirectoryHelperRoute::parsePagination($vars, $segments, $params);
             if ($isPaged) {
                 $previousIndexSegment -= 1;
             }
             if (isset($segments[$previousIndexSegment])) {
                 if ($segments[$previousIndexSegment] == JApplication::stringURLSafe('rss')) {
                     $vars['format'] = 'feed';
                     $previousIndexSegment -= 1;
                 }
             }
             if (isset($segments[$previousIndexSegment])) {
                 $isLayout = JUDirectoryHelperRoute::parseLayout($segments[$previousIndexSegment], $vars, $params);
                 if ($isLayout) {
                     $previousIndexSegment -= 1;
                 }
             }
             return $vars;
         }
     }
     $searchSefClaimListing = array_search(JApplication::stringURLSafe('claim'), $segments);
     if ($searchSefClaimListing !== false) {
         $vars['view'] = 'claim';
         if (isset($segments[$searchSefClaimListing - 1])) {
             $vars['listing_id'] = (int) $segments[$searchSefClaimListing - 1];
         }
         $previousIndexSegment = $total - 1;
         if (isset($segments[$previousIndexSegment])) {
             $isLayout = JUDirectoryHelperRoute::parseLayout($segments[$previousIndexSegment], $vars, $params);
             if ($isLayout) {
                 $previousIndexSegment -= 1;
             }
         }
         return $vars;
     }
     $searchSefReportListing = array_search(JApplication::stringURLSafe('report'), $segments);
     if ($searchSefReportListing !== false) {
         $vars['view'] = 'report';
         if (isset($segments[$searchSefReportListing - 1])) {
             $vars['listing_id'] = (int) $segments[$searchSefReportListing - 1];
         }
         $previousIndexSegment = $total - 1;
         if (isset($segments[$previousIndexSegment])) {
             $isLayout = JUDirectoryHelperRoute::parseLayout($segments[$previousIndexSegment], $vars, $params);
             if ($isLayout) {
                 $previousIndexSegment -= 1;
             }
         }
         return $vars;
     }
     $searchSefRemoveCompare = array_search(JApplication::stringURLSafe('remove-compare'), $segments);
     if ($searchSefRemoveCompare !== false) {
         $vars['task'] == 'listing.removeCompare';
         if (isset($segments[$searchSefRemoveCompare + 1])) {
             if ($segments[$searchSefRemoveCompare + 1] == JApplication::stringURLSafe('all')) {
                 $vars['all'] = 1;
                 return $vars;
             }
         }
         if (isset($segments[$searchSefRemoveCompare - 1])) {
             $vars['listing_id'] = (int) $segments[$searchSefRemoveCompare - 1];
             return $vars;
         }
         return $vars;
     }
     $searchSefSubscribeListingForGuest = array_search(JApplication::stringURLSafe('guest-subscribe'), $segments);
     if ($searchSefSubscribeListingForGuest !== false) {
         $vars['view'] = 'subscribe';
         if (isset($segments[$searchSefSubscribeListingForGuest - 1])) {
             $vars['listing_id'] = (int) $segments[$searchSefSubscribeListingForGuest - 1];
         }
         $previousIndexSegment = $total - 1;
         if (isset($segments[$previousIndexSegment])) {
             $isLayout = JUDirectoryHelperRoute::parseLayout($segments[$previousIndexSegment], $vars, $params);
             if ($isLayout) {
                 $previousIndexSegment -= 1;
             }
         }
         return $vars;
     }
     $searchSefListAll = array_search('list-all', $segments);
     if ($searchSefListAll !== false) {
         $validArrayIndex = array(0, 1, 2);
         if (in_array($searchSefListAll, $validArrayIndex)) {
             $vars['view'] = 'listall';
             if (isset($segments[$searchSefListAll - 1])) {
                 if ($segments[$searchSefListAll - 1] == JApplication::stringURLSafe('root')) {
                     $rootCategory = JUDirectoryFrontHelperCategory::getRootCategory();
                     $vars['id'] = $rootCategory->id;
                 } else {
                     $vars['id'] = (int) $segments[$searchSefListAll - 1];
                 }
             } else {
                 if ($activeMenu && isset($activeMenu->query) && isset($activeMenu->query['view']) && isset($activeMenu->query['id']) && $activeMenu->query['view'] == 'tree') {
                     $vars['id'] = $activeMenu->query['id'];
                 }
             }
             $previousIndexSegment = $total - 1;
             $isPaged = JUDirectoryHelperRoute::parsePagination($vars, $segments, $params);
             if ($isPaged) {
                 $previousIndexSegment -= 1;
             }
             if (isset($segments[$previousIndexSegment])) {
                 if ($segments[$previousIndexSegment] == JApplication::stringURLSafe('rss')) {
                     $vars['format'] = 'feed';
                     $previousIndexSegment -= 1;
                 }
             }
             if (isset($segments[$previousIndexSegment])) {
                 $isLayout = JUDirectoryHelperRoute::parseLayout($segments[$previousIndexSegment], $vars, $params);
                 if ($isLayout) {
                     $previousIndexSegment -= 1;
                 }
             }
             return $vars;
         }
     }
     $searchSefListAlpha = array_search(JApplication::stringURLSafe('list-alpha'), $segments);
     if ($searchSefListAlpha !== false) {
         $validArrayIndex = array(0, 1, 2);
         if (in_array($searchSefListAlpha, $validArrayIndex)) {
             $vars['view'] = 'listalpha';
             if (isset($segments[$searchSefListAlpha - 1])) {
                 if ($segments[$searchSefListAlpha - 1] == JApplication::stringURLSafe('root')) {
                     $rootCategory = JUDirectoryFrontHelperCategory::getRootCategory();
                     $vars['id'] = $rootCategory->id;
                 } else {
                     $vars['id'] = (int) $segments[$searchSefListAlpha - 1];
                 }
             } else {
                 if ($activeMenu && isset($activeMenu->query) && isset($activeMenu->query['view']) && isset($activeMenu->query['id']) && $activeMenu->query['view'] == 'tree') {
                     $vars['id'] = $activeMenu->query['id'];
                 }
             }
             $previousIndexSegment = $total - 1;
             $isPaged = JUDirectoryHelperRoute::parsePagination($vars, $segments, $params);
             if ($isPaged) {
                 $previousIndexSegment -= 1;
             }
             if (isset($segments[$previousIndexSegment])) {
                 if ($segments[$previousIndexSegment] == JApplication::stringURLSafe('rss')) {
                     $vars['format'] = 'feed';
                     $previousIndexSegment -= 1;
                 }
             }
             if (isset($segments[$previousIndexSegment])) {
                 $isLayout = JUDirectoryHelperRoute::parseLayout($segments[$previousIndexSegment], $vars, $params);
                 if ($isLayout) {
                     $previousIndexSegment -= 1;
                 }
             }
             if (isset($segments[$previousIndexSegment])) {
                 if ($previousIndexSegment > $searchSefListAlpha) {
                     $vars['alpha'] = $segments[$previousIndexSegment];
                 }
             }
             return $vars;
         }
     }
     $searchSefFeatured = array_search(JApplication::stringURLSafe('featured'), $segments);
     if ($searchSefFeatured !== false) {
         $validArrayIndex = array(0, 1, 2);
         if (in_array($searchSefFeatured, $validArrayIndex)) {
             $vars['view'] = 'featured';
             if (isset($segments[$searchSefFeatured - 1])) {
                 if ($segments[$searchSefFeatured - 1] == JApplication::stringURLSafe('root')) {
                     $rootCategory = JUDirectoryFrontHelperCategory::getRootCategory();
                     $vars['id'] = $rootCategory->id;
                 } else {
                     $vars['id'] = (int) $segments[$searchSefFeatured - 1];
                 }
             } else {
                 if ($activeMenu && isset($activeMenu->query) && isset($activeMenu->query['view']) && isset($activeMenu->query['id']) && $activeMenu->query['view'] == 'tree') {
                     $vars['id'] = $activeMenu->query['id'];
                 }
             }
             if (isset($segments[$searchSefFeatured + 1])) {
                 if ($segments[$searchSefFeatured + 1] == JApplication::stringURLSafe('all')) {
                     $vars['all'] = 1;
                 }
             }
             $previousIndexSegment = $total - 1;
             $isPaged = JUDirectoryHelperRoute::parsePagination($vars, $segments, $params);
             if ($isPaged) {
                 $previousIndexSegment -= 1;
             }
             if (isset($segments[$previousIndexSegment])) {
                 if ($segments[$previousIndexSegment] == JApplication::stringURLSafe('rss')) {
                     $vars['format'] = 'feed';
                     $previousIndexSegment -= 1;
                 }
             }
             if (isset($segments[$previousIndexSegment])) {
                 $isLayout = JUDirectoryHelperRoute::parseLayout($segments[$previousIndexSegment], $vars, $params);
             }
             return $vars;
         }
     }
     $searchSefCollections = array_search(JApplication::stringURLSafe('collections'), $segments);
     if ($searchSefCollections !== false) {
         $validArrayIndex = array(0, 1, 2);
         if (in_array($searchSefCollections, $validArrayIndex)) {
             $vars['view'] = 'collections';
             if (isset($segments[$searchSefCollections - 1])) {
                 if ($segments[$searchSefCollections - 1] != JApplication::stringURLSafe('root')) {
                     $vars['id'] = (int) $segments[$searchSefCollections - 1];
                 }
             }
             $previousIndexSegment = $total - 1;
             $isPaged = JUDirectoryHelperRoute::parsePagination($vars, $segments, $params);
             if ($isPaged) {
                 $previousIndexSegment -= 1;
             }
             if (isset($segments[$previousIndexSegment])) {
                 if ($segments[$previousIndexSegment] == JApplication::stringURLSafe('rss')) {
                     $vars['format'] = 'feed';
                     $previousIndexSegment -= 1;
                 }
             }
             if (isset($segments[$previousIndexSegment])) {
                 $isLayout = JUDirectoryHelperRoute::parseLayout($segments[$previousIndexSegment], $vars, $params);
             }
             return $vars;
         }
     }
     $searchSefDashboard = array_search(JApplication::stringURLSafe('dashboard'), $segments);
     if ($searchSefDashboard !== false) {
         $validArrayIndex = array(0, 1, 2);
         if (in_array($searchSefDashboard, $validArrayIndex)) {
             $vars['view'] = 'dashboard';
             if (isset($segments[$searchSefDashboard - 1])) {
                 if ($segments[$searchSefDashboard - 1] != JApplication::stringURLSafe('root')) {
                     $vars['id'] = (int) $segments[$searchSefDashboard - 1];
                 }
             }
             $previousIndexSegment = $total - 1;
             $isPaged = JUDirectoryHelperRoute::parsePagination($vars, $segments, $params);
             if ($isPaged) {
                 $previousIndexSegment -= 1;
             }
             if (isset($segments[$previousIndexSegment])) {
                 $isLayout = JUDirectoryHelperRoute::parseLayout($segments[$previousIndexSegment], $vars, $params);
             }
             return $vars;
         }
     }
     $searchSefUserComments = array_search(JApplication::stringURLSafe('comments'), $segments);
     if ($searchSefUserComments !== false) {
         $validArrayIndex = array(0, 1, 2);
         if (in_array($searchSefUserComments, $validArrayIndex)) {
             $vars['view'] = 'usercomments';
             if (isset($segments[$searchSefUserComments - 1])) {
                 if ($segments[$searchSefUserComments - 1] != JApplication::stringURLSafe('root')) {
                     $vars['id'] = (int) $segments[$searchSefUserComments - 1];
                 }
             }
             $previousIndexSegment = $total - 1;
             $isPaged = JUDirectoryHelperRoute::parsePagination($vars, $segments, $params);
             if ($isPaged) {
                 $previousIndexSegment -= 1;
             }
             if (isset($segments[$previousIndexSegment])) {
                 $isLayout = JUDirectoryHelperRoute::parseLayout($segments[$previousIndexSegment], $vars, $params);
             }
             return $vars;
         }
     }
     $searchSefUserListings = array_search(JApplication::stringURLSafe('listings'), $segments);
     if ($searchSefUserListings !== false) {
         $validArrayIndex = array(0, 1, 2);
         if (in_array($searchSefUserListings, $validArrayIndex)) {
             $vars['view'] = 'userlistings';
             if (isset($segments[$searchSefUserListings - 1])) {
                 if ($segments[$searchSefUserListings - 1] != JApplication::stringURLSafe('root')) {
                     $vars['id'] = (int) $segments[$searchSefUserListings - 1];
                 }
             }
             if (isset($segments[$searchSefUserListings + 1])) {
                 if ($segments[$searchSefUserListings + 1] == JApplication::stringURLSafe('published')) {
                     $vars['filter'] = 'published';
                 } elseif ($segments[$searchSefUserListings + 1] == JApplication::stringURLSafe('unpublished')) {
                     $vars['filter'] = 'unpublished';
                 } elseif ($segments[$searchSefUserListings + 1] == JApplication::stringURLSafe('pending')) {
                     $vars['filter'] = 'pending';
                 }
             }
             $previousIndexSegment = $total - 1;
             $isPaged = JUDirectoryHelperRoute::parsePagination($vars, $segments, $params);
             if ($isPaged) {
                 $previousIndexSegment -= 1;
             }
             if (isset($segments[$previousIndexSegment])) {
                 if ($segments[$previousIndexSegment] == JApplication::stringURLSafe('rss')) {
                     $vars['format'] = 'feed';
                     $previousIndexSegment -= 1;
                 }
             }
             if (isset($segments[$previousIndexSegment])) {
                 $isLayout = JUDirectoryHelperRoute::parseLayout($segments[$previousIndexSegment], $vars, $params);
             }
             return $vars;
         }
     }
     $searchSefUserSubscriptions = array_search(JApplication::stringURLSafe('user-subscriptions'), $segments);
     if ($searchSefUserSubscriptions !== false) {
         $validArrayIndex = array(0, 1, 2);
         if (in_array($searchSefUserSubscriptions, $validArrayIndex)) {
             $vars['view'] = 'usersubscriptions';
             if (isset($segments[$searchSefUserSubscriptions - 1])) {
                 if ($segments[$searchSefUserSubscriptions - 1] != JApplication::stringURLSafe('root')) {
                     $vars['id'] = (int) $segments[$searchSefUserSubscriptions - 1];
                 }
             }
             $previousIndexSegment = $total - 1;
             $isPaged = JUDirectoryHelperRoute::parsePagination($vars, $segments, $params);
             if ($isPaged) {
                 $previousIndexSegment -= 1;
             }
             if (isset($segments[$previousIndexSegment])) {
                 $isLayout = JUDirectoryHelperRoute::parseLayout($segments[$previousIndexSegment], $vars, $params);
             }
             return $vars;
         }
     }
     $searchSefSearchBy = array_search(JApplication::stringURLSafe('search-by'), $segments);
     if ($searchSefSearchBy !== false) {
         $validArrayIndex = array(0, 1);
         if (in_array($searchSefSearchBy, $validArrayIndex)) {
             $vars['view'] = 'searchby';
             if (isset($segments[$searchSefSearchBy + 1])) {
                 $vars['field_id'] = (int) $segments[$searchSefSearchBy + 1];
             }
             if (isset($segments[$searchSefSearchBy + 2])) {
                 $vars['value'] = $segments[$searchSefSearchBy + 2];
             }
             $previousIndexSegment = $total - 1;
             $isPaged = JUDirectoryHelperRoute::parsePagination($vars, $segments, $params);
             if ($isPaged) {
                 $previousIndexSegment -= 1;
             }
             if (isset($segments[$previousIndexSegment])) {
                 $isLayout = JUDirectoryHelperRoute::parseLayout($segments[$previousIndexSegment], $vars, $params);
             }
             return $vars;
         }
     }
     $searchSefContact = array_search(JApplication::stringURLSafe('contact'), $segments);
     if ($searchSefContact !== false) {
         if ($searchSefContact == $indexLastSegment || $searchSefContact == $indexLastSegment - 1) {
             $vars['view'] = 'contact';
             if (isset($segments[$searchSefContact - 1])) {
                 $vars['listing_id'] = (int) $segments[$searchSefContact - 1];
             }
             $previousIndexSegment = $total - 1;
             if (isset($segments[$previousIndexSegment])) {
                 $isLayout = JUDirectoryHelperRoute::parseLayout($segments[$previousIndexSegment], $vars, $params);
             }
             return $vars;
         }
     }
     $searchSefCheckIn = array_search(JApplication::stringURLSafe('checkin'), $segments);
     if ($searchSefCheckIn !== false) {
         $vars['task'] = 'forms.checkin';
         if (isset($segments[$searchSefCheckIn - 1])) {
             $vars['id'] = (int) $segments[$searchSefCheckIn - 1];
         }
         return $vars;
     }
     $searchSefAdd = array_search(JApplication::stringURLSafe('add'), $segments);
     if ($searchSefAdd !== false) {
         $vars['task'] = 'form.add';
         if (isset($segments[$searchSefAdd - 1])) {
             $vars['cat_id'] = (int) $segments[$searchSefAdd - 1];
         }
         return $vars;
     }
     $searchSefEdit = array_search(JApplication::stringURLSafe('edit'), $segments);
     if ($searchSefEdit !== false) {
         $vars['task'] = 'form.edit';
         if (isset($segments[$searchSefEdit - 1])) {
             $vars['id'] = (int) $segments[$searchSefEdit - 1];
         }
         return $vars;
     }
     $searchSefDelete = array_search(JApplication::stringURLSafe('delete'), $segments);
     if ($searchSefDelete !== false) {
         $vars['task'] = 'forms.delete';
         if (isset($segments[$searchSefDelete - 1])) {
             $vars['id'] = (int) $segments[$searchSefDelete - 1];
         }
         return $vars;
     }
     $searchNewListing = array_search(JApplication::stringURLSafe('new-listing'), $segments);
     if ($searchNewListing !== false) {
         $vars['view'] = 'form';
         $vars['layout'] = 'edit';
         if (isset($segments[$searchNewListing - 1])) {
             $vars['cat_id'] = (int) $segments[$searchNewListing - 1];
         }
         return $vars;
     }
     $searchSefApprove = array_search(JApplication::stringURLSafe('approve'), $segments);
     if ($searchSefApprove !== false) {
         if ($searchSefApprove == $indexLastSegment) {
             $vars['task'] = 'modpendinglisting.edit';
             $vars['approve'] = 1;
         } else {
             $vars['view'] = 'form';
             $vars['layout'] = 'edit';
             $vars['approve'] = 1;
         }
         if (isset($segments[$searchSefApprove - 1])) {
             $vars['id'] = (int) $segments[$searchSefApprove - 1];
         }
         return $vars;
     }
     $searchSefPublish = array_search(JApplication::stringURLSafe('publish'), $segments);
     if ($searchSefPublish !== false) {
         $vars['task'] = 'forms.publish';
         if (isset($segments[$searchSefPublish - 1])) {
             $vars['id'] = (int) $segments[$searchSefPublish - 1];
         }
         return $vars;
     }
     $searchSefUnPublish = array_search(JApplication::stringURLSafe('unpublish'), $segments);
     if ($searchSefUnPublish !== false) {
         $vars['task'] = 'forms.unpublish';
         if (isset($segments[$searchSefUnPublish - 1])) {
             $vars['id'] = (int) $segments[$searchSefUnPublish - 1];
         }
         return $vars;
     }
     $searchSefSubscribe = array_search(JApplication::stringURLSafe('subscribe'), $segments);
     if ($searchSefSubscribe !== false) {
         $vars['task'] = 'subscribe.save';
         if (isset($segments[$searchSefSubscribe - 1])) {
             $vars['listing_id'] = (int) $segments[$searchSefSubscribe - 1];
         }
         return $vars;
     }
     $searchSefUnSubscribe = array_search(JApplication::stringURLSafe('unsubscribe'), $segments);
     if ($searchSefUnSubscribe !== false) {
         $vars['task'] = 'subscribe.remove';
         if (isset($segments[$searchSefUnSubscribe + 1])) {
             $vars['sub_id'] = (int) $segments[$searchSefUnSubscribe + 1];
         }
         if (isset($segments[$searchSefUnSubscribe + 2])) {
             $vars['code'] = $segments[$searchSefUnSubscribe + 2];
         }
         return $vars;
     }
     $previousIndexSegment = $indexLastSegment;
     if (isset($segments[$previousIndexSegment])) {
         $isPaged = preg_match('/' . preg_quote(JApplication::stringURLSafe('page') . '-') . '[0-9]*+/', $segments[$previousIndexSegment]);
         if ($isPaged) {
             if ($indexLastSegment == 0) {
                 if (is_object($activeMenu) && $activeMenu->component == 'com_judirectory') {
                     $vars = $activeMenu->query;
                     JUDirectoryHelperRoute::parsePagination($vars, $segments, $params);
                     return $vars;
                 }
             }
             $previousIndexSegment -= 1;
         }
     }
     if (isset($segments[$previousIndexSegment])) {
         $isFeed = $segments[$previousIndexSegment] == JApplication::stringURLSafe('rss') ? true : false;
         if ($isFeed) {
             $vars['format'] = 'feed';
             if ($indexLastSegment == 0) {
                 if (is_object($activeMenu) && $activeMenu->component == 'com_judirectory') {
                     $vars = $activeMenu->query;
                     $vars['format'] = 'feed';
                     return $vars;
                 }
             }
             $previousIndexSegment -= 1;
         }
     }
     if (isset($segments[$previousIndexSegment])) {
         $isLayout = JUDirectoryHelperRoute::parseLayout($segments[$previousIndexSegment], $vars, $params);
         if ($isLayout) {
             $previousIndexSegment -= 1;
         }
     }
     if (!empty($segments)) {
         $reverseSegments = array_reverse($segments);
         foreach ($reverseSegments as $segmentItemKey => $segmentItem) {
             if (preg_match('/^\\d+\\-.+/', $segmentItem)) {
                 $indexAlias = $indexLastSegment - $segmentItemKey;
                 break;
             }
         }
         if (isset($indexAlias) && isset($segments[$indexAlias])) {
             if (strpos($segments[$indexAlias], '-') === false) {
                 $itemId = (int) $segments[$indexAlias];
                 $itemAlias = substr($segments[$indexAlias], strlen($itemId) + 1);
             } else {
                 list($itemId, $itemAlias) = explode('-', $segments[$indexAlias], 2);
             }
             if (is_numeric($itemId)) {
                 $categoryObject = JUDirectoryHelper::getCategoryById($itemId);
                 if (is_object($categoryObject) && isset($categoryObject->alias) && $categoryObject->alias == $itemAlias) {
                     $vars['view'] = 'category';
                     $vars['id'] = $itemId;
                     JUDirectoryHelperRoute::parsePagination($vars, $segments, $params);
                     return $vars;
                 }
                 $listingObject = JUDirectoryHelper::getListingById($itemId);
                 if (is_object($listingObject) && isset($listingObject->alias) && $listingObject->alias == $itemAlias) {
                     $vars['id'] = $itemId;
                     if (isset($vars['layout'])) {
                         if ($vars['layout'] == 'edit') {
                             $vars['view'] = 'form';
                         } else {
                             $vars['view'] = 'listing';
                         }
                     }
                     if (!isset($vars['view'])) {
                         $vars['view'] = 'listing';
                     }
                     if ($vars['view'] == 'listing') {
                         if (isset($segments[$indexAlias + 1])) {
                             if ($segments[$indexAlias + 1] == JApplication::stringURLSafe('print')) {
                                 $vars['print'] = 1;
                                 $vars['tmpl'] = 'component';
                                 $vars['layout'] = 'print';
                             }
                         }
                     }
                     JUDirectoryHelperRoute::parsePagination($vars, $segments, $params);
                     return $vars;
                 }
                 if (is_object($categoryObject) && isset($categoryObject->id) && $categoryObject->id) {
                     $vars['view'] = 'category';
                     $vars['id'] = $itemId;
                     JUDirectoryHelperRoute::parsePagination($vars, $segments, $params);
                     return $vars;
                 }
                 if (is_object($listingObject) && isset($listingObject->id) && $listingObject->id) {
                     $vars['id'] = $itemId;
                     if (isset($vars['layout'])) {
                         if ($vars['layout'] == 'edit') {
                             $vars['view'] = 'form';
                         } else {
                             $vars['view'] = 'listing';
                         }
                     }
                     if (!isset($vars['view'])) {
                         $vars['view'] = 'listing';
                     }
                     if ($vars['view'] == 'listing') {
                         if (isset($segments[$indexAlias + 1])) {
                             if ($segments[$indexAlias + 1] == JApplication::stringURLSafe('print')) {
                                 $vars['print'] = 1;
                                 $vars['tmpl'] = 'component';
                                 $vars['layout'] = 'print';
                             } elseif ($segments[$indexAlias + 1] == JApplication::stringURLSafe('changelogs')) {
                                 $vars['layout'] = 'changelogs';
                             } elseif ($segments[$indexAlias + 1] == JApplication::stringURLSafe('versions')) {
                                 $vars['layout'] = 'versions';
                             }
                         }
                     }
                     JUDirectoryHelperRoute::parsePagination($vars, $segments, $params);
                     return $vars;
                 }
             }
         }
     }
     if (is_object($activeMenu) && $activeMenu->component == 'com_judirectory') {
         $vars = $activeMenu->query;
     }
     return $vars;
 }
Ejemplo n.º 27
0
 public function updateComment()
 {
     JSession::checkToken() or die(JText::_('JINVALID_TOKEN'));
     $user = JFactory::getUser();
     $model = $this->getModel();
     $app = JFactory::getApplication();
     $data = $app->input->getArray($_POST);
     $listingId = $data['listing_id'];
     $commentId = $data['comment_id'];
     $canEditComment = JUDirectoryFrontHelperPermission::canEditComment($commentId);
     $redirectUrl = JRoute::_(JUDirectoryHelperRoute::getListingRoute($listingId) . '#comment-item-' . $commentId);
     if (!$canEditComment) {
         $this->setMessage(JText::_('COM_JUDIRECTORY_UPDATE_COMMENT_ERROR'));
         $this->setRedirect($redirectUrl);
         return false;
     }
     $params = JUDirectoryHelper::getParams(null, $listingId);
     $ratingValue = $this->validateCriteria($data);
     if ($ratingValue) {
         $data = array_merge($data, $ratingValue);
     } else {
         $this->setMessage(JText::_('COM_JUDIRECTORY_UPDATE_COMMENT_ERROR'));
         $this->setRedirect($redirectUrl);
         return false;
     }
     JUDirectoryHelper::obCleanData();
     if ($model->updateComment($data, $params)) {
         $logData = array('user_id' => $user->id, 'event' => 'comment.edit', 'item_id' => $commentId, 'listing_id' => $listingId, 'value' => 0, 'reference' => '');
         JUDirectoryFrontHelperLog::addLog($logData);
         $this->setMessage(JText::_('COM_JUDIRECTORY_UPDATE_COMMENT_SUCCESSFULLY'));
         $this->setRedirect($redirectUrl);
         return true;
     } else {
         $this->setMessage(JText::_('COM_JUDIRECTORY_UPDATE_COMMENT_ERROR'));
         $this->setRedirect($redirectUrl);
         return false;
     }
 }
Ejemplo n.º 28
0
/**
 * ------------------------------------------------------------------------
 * JUDirectory for Joomla 2.5, 3.x
 * ------------------------------------------------------------------------
 *
 * @copyright      Copyright (C) 2010-2015 JoomUltra Co., Ltd. All Rights Reserved.
 * @license        GNU General Public License version 2 or later; see LICENSE.txt
 * @author         JoomUltra Co., Ltd
 * @website        http://www.joomultra.com
 * @----------------------------------------------------------------------@
 */
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
$this->setAttribute("src", $image_src, "output");
$this->setAttribute("alt", $this->listing->title, "output");
$this->setAttribute("title", $this->listing->title, "output");
if ($isDetailsView) {
    if ($this->params->get("details_view_set_icon_dimension", 1)) {
        $this->setAttribute("style", 'display: block; max-width:' . $this->params->get("details_view_image_width", 100) . 'px; max-height:' . $this->params->get("details_view_icon_height", 100) . 'px;', "output");
    }
    $html = '<img ' . $this->getAttribute(null, null, "output") . ' />';
    echo $html;
} else {
    $html = '<a href="' . JRoute::_(JUDirectoryHelperRoute::getListingRoute($this->listing->id)) . '">';
    if ($this->params->get("list_view_set_icon_dimension", 1)) {
        $this->setAttribute("style", 'display: block; max-width:' . $this->params->get("details_view_image_width", 100) . 'px; max-height:' . $this->params->get("details_view_icon_height", 100) . 'px;', "output");
    }
    $html .= '<img ' . $this->getAttribute(null, null, "output") . ' />';
    $html .= '</a>';
    echo $html;
}
Ejemplo n.º 29
0
 categories-col-<?php 
        echo $indexColumn + 1;
        ?>
 col-md-<?php 
        echo $this->subcategory_bootstrap_columns[$indexColumn];
        ?>
">



			<div class="panel panel-default">
                             
				<div class="panel-heading category-title">

				<h2 class="blue_text cat-tittle">	<a href="<?php 
        echo JRoute::_(JUDirectoryHelperRoute::getCategoryRoute($category->id));
        ?>
">





 <?php 
        $paramsArray12 = array();
        $paramsArray12 = json_decode($category->images, true);
        $paramsArray12['detail_image'];
        if ($paramsArray12['detail_image'] != '') {
            ?>
					<img src="./media/com_judirectory/images/category/detail/<?php 
            echo $paramsArray12['detail_image'];
Ejemplo n.º 30
0
 */
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
//@todo properties has called in view
$user = JFactory::getUser();
$isOwnDashboard = JUDirectoryFrontHelperPermission::isOwnDashboard();
JLoader::register('JUDirectoryAvatarHelper', JPATH_SITE . '/components/com_judirectory/helpers/avatar.php');
$avatar = JUDirectoryAvatarHelper::getJUAvatar($user->id);
$userId = JUDirectoryFrontHelper::getDashboardUserId();
$linkDashboard = JRoute::_(JUDirectoryHelperRoute::getDashboardRoute($userId));
$linkUserProfile = JRoute::_(JUDirectoryHelperRoute::getUserProfileRoute());
$linkCreateListing = JRoute::_(JUDirectoryHelperRoute::getFormRoute());
$linkUserComments = JRoute::_(JUDirectoryHelperRoute::getUserCommentsRoute($userId));
$linkUserCollection = JRoute::_(JUDirectoryHelperRoute::getCollectionsRoute($userId));
$linkUserListings = JRoute::_(JUDirectoryHelperRoute::getUserListingsRoute($userId));
$linkUserSubscriptions = JRoute::_(JUDirectoryHelperRoute::getUserSubscriptionsRoute($userId));
$linkLogOutReturn = JRoute::_('index.php', false);
?>
	<div class="navbar">
		<div class="navbar-inner">
			<ul class="nav">
				<li class="go-home">
					<a class="hasTooltip" title="<?php 
echo JText::_('COM_JUDIRECTORY_DASHBOARD_HOME');
?>
"
					   href="<?php 
echo $linkDashboard;
?>
">
						<i class="fa fa-home"></i>