if ($this->params->get('show_producer_name_item') == 3) { echo JText::_('COM_DJCATALOG2_PRODUCER') . ': '; ?> <a class="modal" rel="{handler: 'iframe', size: {x: 800, y: 450}}" href="<?php echo JRoute::_(DJCatalogHelperRoute::getProducerRoute($this->item->prodslug) . '&tmpl=component'); ?> "><span><?php echo $this->item->producer; ?> </span></a> <?php } else { echo JText::_('COM_DJCATALOG2_PRODUCER') . ': '; ?> <a href="<?php echo JRoute::_(DJCatalogHelperRoute::getProducerRoute($this->item->prodslug)); ?> "><span><?php echo $this->item->producer; ?> </span></a> <?php } } ?> <?php if ($this->params->get('show_producers_items_item', 1)) { ?> <a class="djc_producer_items_link btn btn-mini button" href="<?php echo JRoute::_(DJCatalogHelperRoute::getCategoryRoute(0) . '&cm=0&pid=' . $this->item->producer_id); ?>
protected function _prepareDocument() { $app = JFactory::getApplication(); $menus = $app->getMenu(); $pathway = $app->getPathway(); $title = null; $heading = null; $menu = $menus->getActive(); $cid = (int) @$menu->query['cid']; $pid = (int) @$menu->query['pid']; if ($menu) { $this->params->def('page_heading', $this->params->get('page_title', $menu->title)); } $title = $this->params->get('page_title', ''); $metakeys = null; $metadesc = null; if ($menu && ($menu->query['option'] != 'com_djcatalog2' || $menu->query['view'] != 'producer' || $pid != $this->item->id)) { if ($this->item->metatitle) { $title = $this->item->metatitle; } else { if ($this->item->name) { $title = $this->item->name; } } $path = array(array('title' => $this->item->name, 'link' => '')); foreach ($path as $item) { $pathway->addItem($item['title'], $item['link']); } } else { if (!empty($menu)) { if ($this->params->get('menu-meta_description')) { $metadesc = $this->params->get('menu-meta_description'); } if ($this->params->get('menu-meta_keywords')) { $metakeys = $this->params->get('menu-meta_keywords'); } } } if (empty($title)) { $title = $app->getCfg('sitename'); } elseif ($app->getCfg('sitename_pagetitles', 0)) { if ($app->getCfg('sitename_pagetitles', 0) == '2') { $title = JText::sprintf('JPAGETITLE', $title, $app->getCfg('sitename')); } else { $title = JText::sprintf('JPAGETITLE', $app->getCfg('sitename'), $title); } } $this->document->setTitle($title); foreach ($this->document->_links as $key => $headlink) { if ($headlink['relation'] == 'canonical') { unset($this->document->_links[$key]); } } $this->document->addHeadLink(JRoute::_(DJCatalogHelperRoute::getProducerRoute($this->item->prodslug)), 'canonical'); if (!empty($this->item->metadesc)) { $this->document->setDescription($this->item->metadesc); } elseif (!empty($metadesc)) { $this->document->setDescription($metadesc); } if (!empty($this->item->metakey)) { $this->document->setMetadata('keywords', $this->item->metakey); } elseif (!empty($metakeys)) { $this->document->setMetadata('keywords', $metakeys); } if ($this->params->get('robots')) { $this->document->setMetadata('robots', $this->params->get('robots')); } $this->document->addCustomTag('<meta property="og:title" content="' . trim($title) . '" />'); $this->document->addCustomTag('<meta property="og:url" content="' . JRoute::_(DJCatalogHelperRoute::getProducerRoute($this->item->id . ':' . $this->item->alias)) . '" />'); if ($item_images = DJCatalog2ImageHelper::getImages('producer', $this->item->id)) { if (isset($item_images[0])) { $this->document->addCustomTag('<meta property="og:image" content="' . $item_images[0]->large . '" />'); } } }
?> <a class="modal" rel="{handler: 'iframe', size: {x: 800, y: 600}}" href="<?php echo JRoute::_(DJCatalogHelperRoute::getProducerRoute($relateditem->prodslug) . '&tmpl=component'); ?> "> <span><?php echo $relateditem->producer; ?> </span> </a> <?php } else { echo JText::_('COM_DJCATALOG2_PRODUCER') . ': '; ?> <a href="<?php echo JRoute::_(DJCatalogHelperRoute::getProducerRoute($relateditem->prodslug)); ?> "> <span><?php echo $relateditem->producer; ?> </span> </a> <?php } } ?> </div> <?php } ?>
if (count($producers) > 0) { $jinput = JFactory::getApplication()->input; $active = $jinput->get('pid', null, 'int') > 0 && $jinput->get('option', '', 'string') == 'com_djcatalog2' ? $jinput->get('pid', null, 'int') : 0; ?> <ul class="menu nav mod_djc2_producer_list"> <?php foreach ($producers as $producer) { $class = 'level0 djc_prodid-' . $producer['id']; if ($active > 0 && $active == (int) $producer['id']) { $class .= ' active current'; } $class = 'class="' . $class . '"'; if ($params->get('type', '0') == '0') { $url = DJCatalogHelperRoute::getCategoryRoute($cid, $producer['id'] . ':' . $producer['alias']) . '&cm=0'; } else { $url = DJCatalogHelperRoute::getProducerRoute($producer['id'] . ':' . $producer['alias']); } ?> <li <?php echo $class; ?> ><a href="<?php echo JRoute::_($url); ?> "><span><?php echo $producer['name']; ?> </span></a></li> <?php } ?>
function producersearch() { $app = JFactory::getApplication(); //$post = JRequest::get('post'); $post = $app->input->getArray($_POST); $params = array(); foreach ($post as $key => $value) { if ($key != 'task' && $key != 'option' && $key != 'view' && $key != 'pid' && $key != 'cid' && $key != 'Itemid') { if ($key == 'search') { $params[] = $key . '=' . urlencode($value); } else { if (is_array($value)) { foreach ($value as $k => $v) { $params[] = $key . '[]=' . $v; } } else { $params[] = $key . '=' . $value; } } } } $producer_id = $app->input->get('pid', null, 'string'); if ((int) $producer_id == 0) { return $this->search(); } else { if (strpos($producer_id, ':') === false) { $db = JFactory::getDbo(); $db->setQuery('select alias from #__djc2_producers where id =' . (int) $producer_id); if ($alias = $db->loadResult()) { $producer_id = (int) $producer_id . ':' . $alias; } } } $menu = JFactory::getApplication('site')->getMenu('site'); $uri = DJCatalogHelperRoute::getProducerRoute($producer_id); if (strpos($uri, '?') === false) { $get = count($params) ? '?' . implode('&', $params) : ''; } else { $get = count($params) ? '&' . implode('&', $params) : ''; } $app->redirect(JRoute::_($uri . $get, false) . '#tlb'); }
static function getDJCatalog2Producer(&$xmap, &$parent, &$params, &$producerid) { $database = JFactory::getDBO(); $query = " SELECT a.name, a.alias, a.id, UNIX_TIMESTAMP(a.created) as `created` \n" . " FROM #__djc2_producers AS a \n" . " WHERE a.id = " . (int) $producerid . " AND a.published=1"; $database->setQuery($query); $row = $database->loadObject(); $node = new stdclass(); $node->name = $row->name; $node->link = DJCatalogHelperRoute::getProducerRoute($row->id . ':' . $row->alias); $node->id = $parent->id; $node->uid = 'com_djcatalog2p' . $row->id; $node->browserNav = $parent->browserNav; $node->modified = $row->created; $node->priority = $params['link_priority']; $node->changefreq = $params['link_changefreq']; $node->expandible = false; $node->secure = $parent->secure; $xmap->printNode($node); return true; }
} else { echo $item->description; } ?> </div> <?php } ?> </div> <?php if ($this->params->get('producers_readmore', '0') == '1') { ?> <div class="clear"></div> <div class="djc_readon"> <a class="btn button readmore" href="<?php echo JRoute::_(DJCatalogHelperRoute::getProducerRoute($item->slug)); ?> " class="readmore"><?php echo JText::sprintf('COM_DJCATALOG2_READMORE'); ?> </a> </div> <?php } ?> </div> </div> <div class="djc_clear"></div> </div> <?php if ($newrow_close) {