protected static function _findItem($needles = null) { $app = JFactory::getApplication(); $menus = $app->getMenu('site'); // Prepare the reverse lookup array. if (self::$lookup === null) { self::$lookup = array(); $component = JComponentHelper::getComponent('com_djclassifieds'); $items = $menus->getItems('component_id', $component->id); if (count($items)) { foreach ($items as $item) { if (isset($item->query) && isset($item->query['view'])) { $parameter = 'id'; if ($item->query['view'] == 'items') { $parameter = 'cid'; } $view = $item->query['view']; if (isset($item->query['layout'])) { if ($item->query['layout'] == 'blog') { $view = $view . "_blog"; } elseif ($item->query['layout'] == 'favourites') { $view = $view . "_favourites"; } } if (isset($item->query[$parameter])) { self::$lookup[$view][$item->query[$parameter]] = $item->id; } else { if (!isset(self::$lookup[$view])) { self::$lookup[$view] = array($item->id); } } } } } } //echo '<pre>';print_r($needles);print_R(self::$lookup);die(); if ($needles) { foreach ($needles as $view => $ids) { //if (isset(self::$lookup[$view])){ foreach ($ids as $id) { if (isset(self::$lookup[$view][(int) $id])) { return self::$lookup[$view][(int) $id]; } else { if (isset(self::$lookup[$view . '_blog'][(int) $id])) { return self::$lookup[$view . '_blog'][(int) $id]; } } } //} } if (isset($needles['items']) || isset($needles['items'])) { if (isset(self::$lookup['categories'][0])) { return self::$lookup['categories'][0]; } } } //else { $active = $menus->getActive(); if ($active && $active->component == 'com_djclassifieds') { return $active->id; } else { $default = $menus->getDefault(); return $default->id; } //} return null; }
} } ?> </span> </div> <?php } ?> <?php if ($par->get('profile_social_link', '')) { ?> <div class="profile_row row_social_link"> <span class="profile_row_label"></span> <span class="profile_row_value"> <a href="<?php echo DJClassifiedsSocial::getUserProfileLink($this->profile['id'], $par->get('profile_social_link', '')); ?> " alt="" > <?php echo JText::_('COM_DJCLASSIFIEDS_VISIT_SOCIAL_PROFILE'); ?> </a> </span> </div> <?php } ?> </div> <?php }
<?php if ($par->get('profile_social_link', '')) { ?> <div class="profile_adverts_link"> <a href="index.php?option=com_djclassifieds&view=profile&uid=<?php echo $uid_slug . DJClassifiedsSEO::getMainAdvertsItemid(); ?> " alt="" > <?php echo JText::_('COM_DJCLASSIFIEDS_VIEW_ALL_ADS'); ?> </a> </div> <div class="profile_social_link"> <a href="<?php echo DJClassifiedsSocial::getUserProfileLink($item->user_id, $par->get('profile_social_link', '')); ?> " alt="" > <?php echo JText::_('COM_DJCLASSIFIEDS_VISIT_SOCIAL_PROFILE'); ?> </a> </div> <?php } ?> </div> </div> <?php if ($item->event->onAfterDJClassifiedsDisplayAdvertAuthor) {