?> " src="<?php echo DJCatalog2ImageHelper::getImageUrl($item->image_fullpath, 'medium'); ?> "/></a> <?php } else { ?> <a href="<?php echo JRoute::_(DJCatalogHelperRoute::getItemRoute($item->slug, !isset($this->item) || empty($this->item->catslug) ? $item->catslug : $this->item->catslug)); ?> "><img class="img-polaroid" alt="<?php echo $item->image_caption; ?> " src="<?php echo DJCatalog2ImageHelper::getImageUrl($item->image_fullpath, 'medium'); ?> "/></a> <?php } ?> </div> <?php } ?> <?php if ((int) $this->params->get('show_item_name', '1') > 0) { ?> <div class="djc_title"> <h3> <?php
<div class="control-label"> <?php echo $this->form->getLabel('id'); ?> </div> <div class="controls"> <?php echo $this->form->getInput('id'); ?> </div> </div> </div> <div class="tab-pane" id="images"> <?php echo DJCatalog2ImageHelper::renderInput('item', JFactory::getApplication()->input->getInt('id', null), (bool) JComponentHelper::getParams('com_djcatalog2')->get('multiple_image_upload', true)); ?> </div> <div class="tab-pane" id="files"> <?php echo DJCatalog2FileHelper::renderInput('item', JFactory::getApplication()->input->getInt('id', null), (bool) JComponentHelper::getParams('com_djcatalog2')->get('multiple_file_upload', true)); ?> </div> <div class="tab-pane" id="location"> <?php foreach ($this->form->getGroup('location') as $field) { ?> <div class="control-group"> <div class="control-label"><?php echo $field->label;
"> <?php if (in_array('producer', $this->params->get('social_code_views', array())) && $this->params->get('social_code_position', 'top') == 'top' && $this->params->get('social_code', '') != '') { ?> <div class="djc_clearfix djc_social_t"> <?php echo $this->params->get('social_code'); ?> </div> <?php } ?> <?php if ($this->item->images = DJCatalog2ImageHelper::getImages('producer', $this->item->id)) { echo $this->loadTemplate('images'); } ?> <h2 class="djc_title"><?php echo $this->item->name; ?> </h2> <?php if (in_array('producer', $this->params->get('social_code_views', array())) && $this->params->get('social_code_position', 'top') == 'aft_title' && $this->params->get('social_code', '') != '') { ?> <div class="djc_clearfix djc_social_at"> <?php echo $this->params->get('social_code'); ?>
<div class="djc_image"> <?php if ($params->get('linkimage', '1') == '1') { ?> <a href="<?php echo $product_url; ?> "> <?php } ?> <img class="img-polaroid" alt="<?php echo $item->image_caption; ?> " src="<?php echo DJCatalog2ImageHelper::getProcessedImage($item->item_image, (int) $params->get('imagewidth', '120'), (int) $params->get('imageheight', '120'), !(bool) $params->get('imageprocess', true), $item->image_path); ?> "/> <?php if ($params->get('linkimage', '1') == '1') { ?> </a> <?php } ?> </div> <?php } ?> <?php if ($params->get('showtitle', '1') == '1') {
?> " src="<?php echo DJCatalog2ImageHelper::getImageUrl($item->image_fullpath, 'small'); ?> "/></a> <?php } else { ?> <a href="<?php echo JRoute::_(DJCatalogHelperRoute::getItemRoute($item->slug, !isset($this->item) || empty($this->item->catslug) ? $item->catslug : $this->item->catslug)); ?> "><img class="img-polaroid" alt="<?php echo $item->image_caption; ?> " src="<?php echo DJCatalog2ImageHelper::getImageUrl($item->image_fullpath, 'small'); ?> "/></a> <?php } ?> </div> <?php } ?> </td> <?php } ?> <?php if ((int) $this->params->get('show_item_name', '1') > 0) {
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 . '" />'); } } }
function display($tpl = null) { $app = JFactory::getApplication(); $document = JFactory::getDocument(); $model = $this->getModel(); $config = JFactory::getConfig(); $siteEmail = $config->get('mailfrom'); $fromName = $config->get('fromname'); $feedEmail = $config->get('feed_email', 'author'); $document->editor = $fromName; if ($feedEmail != 'none') { $document->editorEmail = $siteEmail; } $menus = $app->getMenu('site'); $menu = $menus->getActive(); $mOption = empty($menu->query['option']) ? null : $menu->query['option']; $mCatid = empty($menu->query['cid']) ? null : (int) $menu->query['cid']; $mProdid = empty($menu->query['pid']) ? null : (int) $menu->query['pid']; $filter_catid = $app->input->get('cid', null, 'int'); if ($filter_catid === null && $mOption == 'com_djcatalog2' && $mCatid) { $filter_catid = $mCatid; $app->input->set('cid', $filter_catid); } $filter_producerid = $app->input->get('pid', null, 'string'); if ($filter_producerid === null && $mOption == 'com_djcatalog2' && $mProdid) { $filter_producerid = $mProdid; $app->input->set('pid', $filter_producerid); } $params = Djcatalog2Helper::getParams(); $params->set('product_catalogue', false); $filter_order = $params->get('rss_items_default_order', 'i.date'); $filter_order_Dir = $params->get('rss_items_default_order_dir', 'desc'); $limitstart = $app->input->get('limitstart', 0, 'int'); $limit_items_show = $params->get('rss_limit_items_show', $config->get('feed_limit', 10)); $app->input->set('limit', $limit_items_show); $dispatcher = JDispatcher::getInstance(); $categories = Djc2Categories::getInstance(array('state' => '1')); // current category $category = $categories->get((int) $app->input->get('cid', 0, 'default')); $subcategories = null; if (!empty($category)) { $subcategories = $category->getChildren(); } /* If Cateogory not published set 404 */ if ($category && $category->id > 0 && $category->published == 0 || empty($category)) { throw new Exception(JText::_('COM_DJCATALOG2_PRODUCT_NOT_FOUND'), 404); } $title = $params->get('page_title', ''); if ($menu && ($menu->query['option'] != 'com_djcatalog2' || $menu->query['view'] != 'items' || $id != $category->id)) { if (!empty($category->metatitle)) { $title = $category->metatitle; } else { if ($category->name && $category->id > 0) { $title = $category->name; } } } if (empty($title)) { $title = $config->get('sitename'); } $document->setTitle($title); $rows = $model->getItems(); $document->link = JRoute::_(DJCatalogHelperRoute::getCategoryRoute($category->catslug)); foreach ($rows as $row) { // Strip html from feed item title $title = $this->escape($row->name); $title = html_entity_decode($title, ENT_COMPAT, 'UTF-8'); // Compute the article slug $row->slug = $row->alias ? $row->id . ':' . $row->alias : $row->id; // Url link to article $link = JRoute::_(DJCatalogHelperRoute::getItemRoute($row->slug, $category->id == 0 ? $row->catslug : $category->catslug)); // Get description, author and date $date = $row->created; // Load individual item creator class $item = new JFeedItem(); $item->title = $title; $item->link = $link; $item->date = $date; $item->author = $row->author; $item->category = $category->id == 0 ? $row->category : $category->name; //$item->authorEmail = $siteEmail; if ($feedEmail == 'site') { $item->authorEmail = $siteEmail; } else { if ($feedEmail === 'author') { $item->authorEmail = $row->author_email; } } $description = ''; if ($row->item_image && (int) $params->get('rss_image_link_item', '1')) { //$item->image = new JFeedImage(); //$item->image->url = DJCatalog2ImageHelper::getImageUrl($row->item_image,'small'); //$item->image->link = $item->link; //$item->image->title = $row->image_caption; $description .= '<img src="' . DJCatalog2ImageHelper::getImageUrl($row->image_fullpath, 'small') . '" alt="' . $row->image_caption . '"/>'; } if ($params->get('rss_description_type', '1') != '0') { $description .= $params->get('rss_description_type', '1') == '1' && $row->intro_desc ? $row->intro_desc : $row->description; if ($params->get('rss_showreadmore_item', '1')) { $description .= '<p class="feed-readmore"><a target="_blank" href ="' . $item->link . '">' . JText::_('COM_DJCATALOG2_READMORE') . '</a></p>'; } } // Load item description and add div $item->description = '<div class="feed-description">' . $description . '</div>'; // Loads item info into rss array $document->addItem($item); } }
function getXml() { $app = JFactory::getApplication(); $jinput = $app->input; $this->_cparams = $app->getParams('com_djcatalog2'); $moduleclass_sfx = $jinput->get('moduleclass_sfx', null, 'string'); $mid = (int) $jinput->get('moduleId', null, 'int'); $stitle = $jinput->get('stitle', '1', 'string'); $ltitle = $jinput->get('ltitle', '1', 'string'); $modal = $jinput->get('modal', 1, 'int'); $scattitle = $jinput->get('scattitle', null, 'string'); $sproducer = $jinput->get('sproducer', '0', 'string'); $sprice = $jinput->get('sprice', '0', 'string'); $spag = $jinput->get('spag', null, 'int'); //$orderby = $jinput->get( 'orderby', null, 'get', 'int', 0); //$orderdir = $jinput->get( 'orderdir', 0, 'get', 'int', 0); //$featured_only = $jinput->get( 'featured_only', 0, 'get', 'int', 0); //$featured_first = $jinput->get( 'featured_first', 0, 'get', 'int', 0); $cols = (int) $jinput->get('cols', null, 'int'); $rows = (int) $jinput->get('rows', null, 'int'); //$mainimage = $jinput->get( 'mainimg', 'large', 'get', 'string', 0); $trunc = (int) $jinput->get('trunc', '0', 'int'); $trunclimit = (int) $jinput->get('trunclimit', '0', 'int'); $showreadmore = (int) $jinput->get('showreadmore', '1', 'int'); $readmoretext = $jinput->get('readmoretext', '', 'string'); $readmoretext = $readmoretext != '' ? urldecode($readmoretext) : JText::_('COM_DJCATALOG2_READMORE'); $paginationStart = (int) $jinput->get('pagstart', null, 'int'); $categories = $jinput->get('categories', null, 'string'); $catsw = $jinput->get('catsw', 0, 'int'); $categories = explode('|', $categories); $largewidth = $jinput->get('largewidth', '400', 'int'); $largeheight = $jinput->get('largeheight', '240', 'int'); $largecrop = $jinput->get('largecrop', 1, 'int') ? true : false; $smallwidth = $jinput->get('smallwidth', '90', 'int'); $smallheight = $jinput->get('smallheight', '70', 'int'); $smallcrop = $jinput->get('smallcrop', 1, 'int') ? true : false; $Itemid = $jinput->get('Itemid', 0, 'int'); $path = JURI::base(); $itemsCount = $this->getTotal(); $itemsPerPage = $rows * $cols; $paginationBar = null; //if ($spag == 1) { $paginationBar = '<pagination><![CDATA['; if ($itemsCount > $itemsPerPage && $itemsPerPage > 0) { if ((int) $spag == 1) { for ($i = 0; $i < $itemsCount; $i = $i + $itemsPerPage) { $counter = (int) (($i + $itemsPerPage) / $itemsPerPage); if ($paginationStart == $i) { $active = ' active'; } else { $active = ''; } $paginationBar .= '<span class="btn' . $active . ' button" style="cursor: pointer;" onclick="DJFrontpage_' . $mid . '.loadPage(' . $i . '); return false;">' . $counter . '</span> '; } } else { $prevPage = $paginationStart - $itemsPerPage; $nextPage = $paginationStart + $itemsPerPage; $firstPage = 0; $lastPage = $itemsPerPage * (ceil($itemsCount / $itemsPerPage) - 1); if ($paginationStart == 0) { $prevPage = $lastPage; } if ($paginationStart == $lastPage) { $nextPage = $firstPage; } $paginationBar .= '<span class="djcf_prev_button" style="cursor: pointer;" onclick="DJFrontpage_' . $mid . '.loadPage(' . $prevPage . '); return false;"></span> '; $paginationBar .= '<span class="djcf_next_button" style="cursor: pointer;" onclick="DJFrontpage_' . $mid . '.loadPage(' . $nextPage . '); return false;"></span>'; } } $paginationBar .= ']]></pagination>'; //} $items = $this->getList($paginationStart, $itemsPerPage); $output = '<?xml version="1.0" encoding="utf-8" ?><contents>'; $gallery = ''; for ($i = 0; $i < count($items); $i++) { $title = ''; $readmore = JRoute::_(DJCatalogHelperRoute::getItemRoute($items[$i]->slug, $items[$i]->catslug)); if ($stitle == '1') { if ($ltitle) { $title = '<h3><a href="' . $readmore . '">' . $items[$i]->name . '</a></h3>'; } else { $title = '<h3>' . $items[$i]->name . '</h3>'; } } $cattitle = ''; if ($scattitle == 1) { $cattitle = '<h2>' . $items[$i]->category . '</h2>'; } $producer = ''; if ($sproducer == 1 && $items[$i]->producer) { $producer = '<div class="djc_producer">' . JText::_('COM_DJCATALOG2_PRODUCER') . ': ' . $items[$i]->producer . '</div>'; } $price = ''; if ($sprice == 1 && $items[$i]->price > 0) { if ($items[$i]->special_price) { $price = JText::_('COM_DJCATALOG2_PRICE') . ': <span class="djc_price_old">' . $items[$i]->price . '</span> <span class="djc_price_new">' . $items[$i]->special_price . '</span>'; } else { $price = JText::_('COM_DJCATALOG2_PRICE') . ': <span class="djc_price">' . $items[$i]->price . '</span>'; } $price = '<div class="djc_price">' . $price . '</div>'; } if ($trunc > 0 && $trunclimit > 0) { $items[$i]->intro_desc = DJCatalog2HtmlHelper::trimText($items[$i]->intro_desc, $trunclimit); } else { if ($trunc > 0 && $trunclimit == -1) { $items[$i]->intro_desc = ''; } } $items[$i]->intro_desc = $producer . $price . $items[$i]->intro_desc; $output .= '<content>'; if ($scattitle == 1) { $output .= '<category><![CDATA[' . $cattitle . ']]></category>'; } $output .= '<text><![CDATA[' . $title . '<div class="djf_desc">' . $items[$i]->intro_desc . '</div>'; if ($showreadmore == '1') { $output .= '<a class="btn btn-primary btn-large" href="' . $readmore . '">' . $readmoretext . '</a>'; } $output .= ']]></text>'; $output .= '<image><![CDATA[' . DJCatalog2ImageHelper::getProcessedImage($items[$i]->item_image, $largewidth, $largeheight, !$largecrop, $items[$i]->image_path) . ']]></image>'; if ($modal == 1) { $output .= '<src><![CDATA[' . DJCatalog2ImageHelper::getImageUrl($items[$i]->image_fullpath, 'fullscreen') . ']]></src>'; } else { $output .= '<src><![CDATA[' . $readmore . ']]></src>'; } $output .= '</content>'; if ($items[$i]->item_image) { $gallery .= '<thumb><![CDATA[<div class="djf_cell img-polaroid"><a href="' . $readmore . '" onclick="DJFrontpage_' . $mid . '.loadItem(' . $i . '); return false;"><img src="' . DJCatalog2ImageHelper::getProcessedImage($items[$i]->item_image, $smallwidth, $smallheight, !$smallcrop, $items[$i]->image_path) . '" alt="' . $items[$i]->image_caption . '" /></a></div>]]></thumb>'; } else { $gallery .= '<thumb><![CDATA[]]></thumb>'; } } $all = $output . $gallery . $paginationBar; $all .= '</contents>'; return $all; }
</div> <div class="control-group"> <div class="control-label"><?php echo $this->form->getLabel('metakey'); ?> </div> <div class="controls"><?php echo $this->form->getInput('metakey'); ?> </div> </div> </div> <div class="tab-pane" id="images"> <?php echo DJCatalog2ImageHelper::renderInput('category', $app->input->get('id', null, 'int'), (bool) JComponentHelper::getParams('com_djcatalog2')->get('multiple_image_upload', true)); ?> </div> <?php echo $this->loadTemplate('params'); ?> </div> </fieldset> </div> </div> <input type="hidden" name="task" value="" /> <?php echo JHtml::_('form.token'); ?> </form>
?> " src="<?php echo DJCatalog2ImageHelper::getImageUrl($subcategory->image_fullpath, 'medium'); ?> "/></a> <?php } else { ?> <a href="<?php echo JRoute::_(DJCatalogHelperRoute::getCategoryRoute($subcategory->id . ':' . $subcategory->alias)); ?> "><img class="img-polaroid" alt="<?php echo $subcategory->image_caption; ?> " src="<?php echo DJCatalog2ImageHelper::getImageUrl($subcategory->image_fullpath, 'medium'); ?> "/></a> <?php } ?> </div> <?php } ?> <div class="djc_title"> <h3> <a href="<?php echo JRoute::_(DJCatalogHelperRoute::getCategoryRoute($subcategory->id . ':' . $subcategory->alias)); ?> ">
echo JHtml::_('tabs.panel', JText::_('COM_DJCATALOG2_FORM_IMAGES'), 'product-images'); ?> <p class="djc_fileupload_tip"> <?php $img_count_limit = (int) $this->params->get('fed_max_images', 6); $img_size_limit = (int) $this->params->get('fed_max_image_size', 2048); ?> <?php echo JText::sprintf('COM_DJCATALOG2_IMAGE_MAX_COUNT', $img_count_limit); if ($img_size_limit > 0) { echo ' | ' . JText::sprintf('COM_DJCATALOG2_IMAGE_MAX_SIZE', DJCatalog2FileHelper::formatBytes($img_size_limit * 1024)); } ?> </p> <?php echo DJCatalog2ImageHelper::renderInput('item', JFactory::getApplication()->input->getInt('id', null), (bool) $this->params->get('fed_multiple_image_upload', true)); ?> <?php } ?> <?php if ((int) $this->params->get('fed_max_files', 6) > 0) { ?> <?php echo JHtml::_('tabs.panel', JText::_('COM_DJCATALOG2_FORM_FILES'), 'product-files'); ?> <p class="djc_fileupload_tip"> <?php $file_count_limit = (int) $this->params->get('fed_max_files', 6); $file_size_limit = (int) $this->params->get('fed_max_file_size', 2048);
protected function _prepareDocument() { $app = JFactory::getApplication(); $menus = $app->getMenu(); $pathway = $app->getPathway(); $title = null; $heading = null; $menu = $menus->getActive(); $id = (int) @$menu->query['cid']; $pid = $app->input->get('pid', null, 'string'); $limitstart = $app->input->get('limitstart', 0, 'int'); 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'] != 'items' || $id != $this->item->id)) { if (!empty($this->item->metatitle)) { $title = $this->item->metatitle; } else { if ($this->item->name && $this->item->id > 0) { $title = $this->item->name; } } $path = array(); if ($this->item->id == 0) { //$path = array(array('title' => $title, 'link' => '')); } else { $path = array(array('title' => $this->item->name, 'link' => '')); } $category = $this->categories->get($this->item->parent_id); if ($category) { while (($menu->query['option'] != 'com_djcatalog2' || $menu->query['view'] == 'item' || $id != $category->id) && $category->id > 0) { $path[] = array('title' => $category->name, 'link' => DJCatalogHelperRoute::getCategoryRoute($category->catslug)); $category = $this->categories->get($category->parent_id); } } $path = array_reverse($path); 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); $uri = JFactory::getURI(); $vars = $uri->getQuery(true); unset($vars['order']); unset($vars['dir']); unset($vars['l']); $canonical = DJCatalogHelperRoute::getCategoryRoute($this->item->catslug, $pid); /*if ($limitstart > 0) { $canonical .= '&limitstart='.$limitstart; }*/ if (!empty($vars)) { $canonical .= '&' . $uri->buildQuery($vars); } foreach ($this->document->_links as $key => $headlink) { if ($headlink['relation'] == 'canonical') { unset($this->document->_links[$key]); } } $this->document->addHeadLink(JRoute::_($canonical), '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 ($app->input->get('filtering', false)) { $this->document->setMetadata('robots', 'noindex, follow'); } else { 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::getCategoryRoute($this->item->catslug)) . '" />'); if ($item_images = DJCatalog2ImageHelper::getImages('category', $this->item->id)) { if (isset($item_images[0])) { $this->document->addCustomTag('<meta property="og:image" content="' . $item_images[0]->large . '" />'); //$this->document->setMetadata('og:image', $item_images[0]->large); } } if ($this->params->get('rss_enabled', '1') == '1') { $this->feedlink = JRoute::_(DJCatalogHelperRoute::getCategoryRoute($this->item->catslug, $pid) . '&format=feed&type=rss&limitstart=0'); //$link = '&format=feed&limitstart='; $attribs = array('type' => 'application/rss+xml', 'title' => 'RSS 2.0'); $this->document->addHeadLink(JRoute::_(DJCatalogHelperRoute::getCategoryRoute($this->item->catslug, $pid) . '&format=feed&type=rss'), 'alternate', 'rel', $attribs); $attribs = array('type' => 'application/atom+xml', 'title' => 'Atom 1.0'); $this->document->addHeadLink(JRoute::_(DJCatalogHelperRoute::getCategoryRoute($this->item->catslug, $pid) . '&format=feed&type=atom'), 'alternate', 'rel', $attribs); } }
public function onItemAfterDelete($context, $table) { $params = JComponentHelper::getParams('com_djcatalog2'); $app = JFactory::getApplication(); $db = JFactory::getDbo(); $db->setQuery('DELETE FROM #__djc2_items_categories WHERE item_id=\'' . $table->id . '\''); $db->query(); $db->setQuery('DELETE FROM #__djc2_items_related WHERE item_id=\'' . $table->id . '\' OR related_item=\'' . $table->id . '\''); $db->query(); $db->setQuery('DELETE FROM #__djc2_items_extra_fields_values_text WHERE item_id=\'' . $table->id . '\''); $db->query(); $db->setQuery('DELETE FROM #__djc2_items_extra_fields_values_int WHERE item_id=\'' . $table->id . '\''); $db->query(); if (!DJCatalog2ImageHelper::deleteImages('item', $table->id)) { $app->enqueueMessage(JText::_('COM_DJCATALOG2_ERROR_DELETING_IMAGES'), 'error'); } if (!DJCatalog2FileHelper::deleteFiles('item', $table->id)) { $app->enqueueMessage(JText::_('COM_DJCATALOG2_ERROR_DELETING_FILE'), 'error'); } }
public function onProducerAfterDelete($context, $table) { $params = JComponentHelper::getParams('com_djcatalog2'); $app = JFactory::getApplication(); if (!DJCatalog2ImageHelper::deleteImages('producer', $table->id)) { $app->enqueueMessage(JText::_('COM_DJCATALOG2_ERROR_DELETING_IMAGES'), 'error'); } }
<?php } ?> <?php if (in_array('item', $this->params->get('social_code_views', array())) && $this->params->get('social_code_position', 'top') == 'top' && $this->params->get('social_code', '') != '') { ?> <div class="djc_clearfix djc_social_t"> <?php echo $this->params->get('social_code'); ?> </div> <?php } ?> <?php $this->item->images = DJCatalog2ImageHelper::getImages('item', $this->item->id); if ($this->item->images && (int) $this->params->get('show_image_item', 1) > 0) { echo $this->loadTemplate('images'); } ?> <h2 class="djc_title"> <?php if ($this->item->featured == 1) { echo '<img class="djc_featured_image" alt="' . JText::_('COM_DJCATALOG2_FEATURED_ITEM') . '" title="' . JText::_('COM_DJCATALOG2_FEATURED_ITEM') . '" src="' . DJCatalog2ThemeHelper::getThemeImage('featured.png') . '" />'; } ?> <?php if ((int) $this->params->get('fed_edit_button', 0) == 1 && $edit_auth) { ?> <a class="btn btn-primary btn-mini button djc_edit_button" href="<?php echo JRoute::_('index.php?option=com_djcatalog2&task=itemform.edit&id=' . $this->item->id);
function recreateThumbnails($cid = array()) { if (count($cid)) { JArrayHelper::toInteger($cid); $cids = implode(',', $cid); $query = 'SELECT fullname FROM #__djc2_images' . ' WHERE item_id IN ( ' . $cids . ' )' . ' AND type=\'category\''; $this->_db->setQuery($query); if (!$this->_db->query()) { $this->setError($this->_db->getErrorMsg()); return false; } $items = $this->_db->loadObjectList(); $params = JComponentHelper::getParams('com_djcatalog2'); foreach ($items as $item) { DJCatalog2ImageHelper::processImage(DJCATIMGFOLDER, $item->fullname, 'category', $params); } } return true; }
?> "> <td class="center"> <?php echo JHtml::_('grid.id', $i, $item->id); ?> </td> <td align="center"> <?php if ($item->item_image) { ?> <img alt="<?php echo $item->image_caption; ?> " src="<?php echo DJCatalog2ImageHelper::getImageUrl($item->image_fullpath, 'thumb', $item->image_path); ?> "/><?php } else { ?> <img src="<?php echo str_replace('/administrator', '', JURI::base()) . 'components/com_djcatalog2/assets/images/noimage.jpg'; ?> " alt="" /><?php } ?> </td> <td> <?php if ($item->checked_out) { ?>
protected function _prepareDocument() { $app = JFactory::getApplication(); $menus = $app->getMenu(); $pathway = $app->getPathway(); $title = null; $heading = null; $document = JFactory::getDocument(); $menu = $menus->getActive(); $id = (int) @$menu->query['id']; $cid = (int) @$menu->query['cid']; 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'] == 'items' || $id != $this->item->id)) { if ($this->item->metatitle) { $title = $this->item->metatitle; } else { if ($this->item->name) { $title = $this->item->name; } } $category = $this->categories->get($this->item->cat_id); $path = array(array('title' => $this->item->name, 'link' => '')); while (($menu->query['option'] != 'com_djcatalog2' || $menu->query['view'] == 'items' && $cid != $category->id) && $category->id > 0) { $path[] = array('title' => $category->name, 'link' => DJCatalogHelperRoute::getCategoryRoute($category->catslug)); $category = $this->categories->get($category->parent_id); } $path = array_reverse($path); 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); 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="twitter:title" content="' . trim($title) . '" />'); if ($metadesc) { $this->document->addCustomTag('<meta property="og:description" content="' . trim($metadesc) . '" />'); $this->document->addCustomTag('<meta property="twitter:description" content="' . trim($metadesc) . '" />'); } $this->document->addCustomTag('<meta property="og:url" content="' . JRoute::_(DJCatalogHelperRoute::getItemRoute($this->item->slug, $this->item->catslug), true, -1) . '" />'); if ($item_images = DJCatalog2ImageHelper::getImages('item', $this->item->id)) { if (isset($item_images[0])) { $this->document->addCustomTag('<meta property="og:image" content="' . $item_images[0]->large . '" />'); $this->document->addCustomTag('<meta property="twitter:image:src" content="' . $item_images[0]->large . '" />'); } } }
public function moveToFolders() { die('NO NO NO!'); $db = JFactory::getDbo(); $errors = array(); $db->setQuery('select * from #__djc2_images'); $images = $db->loadObjectList(); foreach ($images as $image) { if (!empty($image->path)) { continue; } $dest = DJCatalog2ImageHelper::getDestinationFolder(DJCATIMGFOLDER, $image->item_id, $image->type); if (!JFolder::exists($dest)) { JFolder::create($dest); } if (JFile::copy(DJCATIMGFOLDER . DS . $image->fullname, $dest . DS . $image->fullname)) { $path = DJCatalog2ImageHelper::getDestinationPath($image->item_id, $image->type); $fullpath = $path . '/' . $image->fullname; $db->setQuery('update #__djc2_images set fullpath=' . $db->quote($fullpath) . ', path=' . $db->quote($path) . ' where id=' . $image->id); if (!$db->query()) { $errors[] = array('DB', $image->fullname); continue; } JFile::delete(DJCATIMGFOLDER . DS . $image->fullname); } else { $errors['images'] = array('COPY', $image->fullname); } } $db->setQuery('select * from #__djc2_files'); $files = $db->loadObjectList(); foreach ($files as $file) { if (!empty($file->path)) { continue; } $dest = DJCatalog2FileHelper::getDestinationFolder(DJCATATTFOLDER, $file->item_id, $file->type); if (!JFolder::exists($dest)) { JFolder::create($dest); } if (JFile::copy(DJCATATTFOLDER . DS . $file->fullname, $dest . DS . $file->fullname)) { $path = DJCatalog2ImageHelper::getDestinationPath($file->item_id, $file->type); $fullpath = $path . '/' . $file->fullname; $db->setQuery('update #__djc2_files set fullpath=' . $db->quote($fullpath) . ', path=' . $db->quote($path) . ' where id=' . $file->id); if (!$db->query()) { $errors[] = array('DB', $file->fullname); continue; } JFile::delete(DJCATATTFOLDER . DS . $file->fullname); } else { $errors['files'] = array('COPY', $file->fullname); } } echo '<pre>'; print_r($errors); echo '</pre>'; die; }
if ($this->params->get('showcatdesc') && $this->item && $this->item->id > 0) { ?> <div class="djc_category djc_clearfix"> <?php if (in_array('category', $this->params->get('social_code_views', array())) && $this->params->get('social_code_position', 'top') == 'top' && $this->params->get('social_code', '') != '') { ?> <div class="djc_clearfix djc_social_t"> <?php echo $this->params->get('social_code'); ?> </div> <?php } ?> <?php $this->item->images = DJCatalog2ImageHelper::getImages('category', $this->item->id); if ((int) $this->params->get('showcatimg', 1) > 0 && $this->item->images) { echo $this->loadTemplate('images'); } ?> <h2 class="djc_title"> <?php echo $this->item->name; ?> <?php if (!empty($this->feedlink) && $this->params->get('rss_feed_icon', 0) == '1' && $this->params->get('rss_enabled', '1') == '1') { ?> <a class="djc_rss_link" href="<?php echo $this->feedlink; ?> "><img alt="RSS" src="<?php