public static function _(JRegistry &$params) { $db = JFactory::getDbo(); $now = JFactory::getDate()->toSql(); $query = $db->getQuery(true)->select(array('d.id', 'd.catid', 'd.title', 'd.changelog'))->from('#__phocadownload AS d')->join('INNER', '#__phocadownload_categories AS c ON(d.catid = c.id)')->where('d.catid IN(' . $params->get('categories') . ')')->where('d.published = 1')->where('d.changelog <> ' . $db->quote(''))->where('(d.publish_up = ' . $db->quote($db->getNullDate()) . ' OR d.publish_up <= ' . $db->quote($now) . ')')->where('(d.publish_down = ' . $db->quote($db->getNullDate()) . ' OR d.publish_down >= ' . $db->quote($now) . ')')->where('d.access IN(' . implode(',', JFactory::getUser()->getAuthorisedViewLevels()) . ')')->order('c.ordering')->order('d.ordering'); if (JFactory::getApplication()->getLanguageFilter()) { $query->where('d.language IN(' . $db->quote(JFactory::getLanguage()->getTag()) . ', ' . $db->quote('*') . ')'); } $db->setQuery($query); $rows = $db->loadObjectList(); if (empty($rows)) { return; } foreach ($rows as &$row) { // TODO add alias to links $row->link = PhocaDownloadRoute::getFileRoute($row->id, $row->catid); } return $rows; }
} // IMAGE FILENAME //$imageFileName = ''; //if ($value->image_filename !='') { $imageFileName = $l->getImageFileName($value->image_filename, $value->filename, 2); /*$thumbnail = false; $thumbnail = preg_match("/phocathumbnail/i", $value->image_filename); if ($thumbnail) { $imageFileName = ''; } else { $imageFileName = 'style="background: url(\''.$this->t['cssimgpath'].$value->image_filename.'\') 0 center no-repeat;"'; }*/ //} //$outputFile .= '<div class="pd-document'.$this->t['file_icon_size_md'].'" '.$imageFileName.'>'; $outputFile .= '<li class="bullet-item" ' . $imageFileName['filenamestyle'] . '>'; $outputFile .= '<a href="' . JRoute::_(PhocaDownloadRoute::getCategoryRoute($value->categoryid, $value->categoryalias)) . '">' . $value->title . '</a>' . ' <span class="badge badge-info tip"> | <i class="fa fa-folder"></i> ' . $value->categorytitle . '</span>'; $outputFile .= PhocaDownloadRenderFront::displayNewIcon($value->date, $this->t['displaynew']); $outputFile .= PhocaDownloadRenderFront::displayHotIcon($value->hits, $this->t['displayhot']); $outputFile .= '</li>' . "\n"; } } if ($outputFile != '') { echo '<div class="pd-hr" style="clear:both"> </div>'; echo '<ul class="pricing-table">'; echo '<li class="title">' . JText::_('COM_PHOCADOWNLOAD_MOST_DOWNLOADED_FILES') . '</li>'; echo $outputFile; echo '</ul>'; } } echo '<div class="pd-cb"> </div>'; echo $this->t['pw'];
function display($tpl = null) { $app = JFactory::getApplication(); $user = JFactory::getUser(); $userLevels = implode(',', $user->getAuthorisedViewLevels()); $db = JFactory::getDBO(); $menu = $app->getMenu(); $document = JFactory::getDocument(); $params = $app->getParams(); $moduleId = $app->input->get('id', 0, 'int'); $table =& JTable::getInstance('module'); if ((int) $moduleId > 0) { $db = JFactory::getDBO(); $query = 'SELECT a.params' . ' FROM #__modules AS a' . ' WHERE a.published = 1' . ' AND a.id =' . (int) $moduleId . ' ORDER BY a.ordering'; $db->setQuery($query); if (!$db->query()) { $this->setError($db->getErrorMsg()); return false; } $module = $db->loadObject(); if (isset($module->params) && $module->params != '') { jimport('joomla.html.parameter'); $paramsM = new JRegistry(); $paramsM->loadString($module->params); //$paramsM->loadJSON($module->params); // Params $categories = $paramsM->get('category_ids', ''); $ordering = $paramsM->get('file_ordering', 6); $fileCount = $paramsM->get('file_count', 5); $feedTitle = $paramsM->get('feed_title', JText::_('COM_PHOCADOWNLOAD_DOWNLOAD')); $displayDateType = $paramsM->get('display_date_type', 1); $document->setTitle($this->escape(html_entity_decode($feedTitle))); $wheres = array(); if (is_array($categories) && count($categories) > 0) { JArrayHelper::toInteger($categories); $categoriesString = implode(',', $categories); $wheres[] = ' c.catid IN ( ' . $categoriesString . ' ) '; } else { if ((int) $categories > 0) { $wheres[] = ' c.catid IN ( ' . $categories . ' ) '; } } $wheres[] = ' c.catid= cc.id'; $wheres[] = '( (unaccessible_file = 1 ) OR (unaccessible_file = 0 AND c.access IN (' . $userLevels . ') ) )'; $wheres[] = '( (unaccessible_file = 1 ) OR (unaccessible_file = 0 AND cc.access IN (' . $userLevels . ') ) )'; $wheres[] = ' c.published = 1'; $wheres[] = ' c.approved = 1'; $wheres[] = ' cc.published = 1'; $wheres[] = ' c.textonly = 0'; // Active $jnow = JFactory::getDate(); $now = $jnow->toSql(); $nullDate = $db->getNullDate(); $wheres[] = ' ( c.publish_up = ' . $db->Quote($nullDate) . ' OR c.publish_up <= ' . $db->Quote($now) . ' )'; $wheres[] = ' ( c.publish_down = ' . $db->Quote($nullDate) . ' OR c.publish_down >= ' . $db->Quote($now) . ' )'; $fileOrdering = PhocaDownloadOrdering::getOrderingText($ordering); $query = ' SELECT c.*, cc.id AS categoryid, cc.title AS categorytitle, cc.alias AS categoryalias, cc.access as cataccess, cc.accessuserid as cataccessuserid ' . ' FROM #__phocadownload AS c' . ' LEFT JOIN #__phocadownload_categories AS cc ON cc.id = c.catid' . ' WHERE ' . implode(' AND ', $wheres) . ' ORDER BY c.' . $fileOrdering; $db->setQuery($query, 0, $fileCount); $files = $db->loadObjectList(); foreach ($files as $keyDoc => $valueDoc) { // USER RIGHT - Access of categories (if file is included in some not accessed category) - - - - - // ACCESS is handled in SQL query, ACCESS USER ID is handled here (specific users) $rightDisplay = 0; if (!empty($valueDoc)) { $rightDisplay = PhocaDownloadAccess::getUserRight('accessuserid', $valueDoc->cataccessuserid, $valueDoc->cataccess, $user->getAuthorisedViewLevels(), $user->get('id', 0), 0); } // - - - - - - - - - - - - - - - - - - - - - - if ($rightDisplay == 1) { $item = new JFeedItem(); $title = $this->escape($valueDoc->title . ' (' . PhocaDownloadFile::getTitleFromFilenameWithExt($valueDoc->filename) . ')'); $title = html_entity_decode($title); $item->title = $title; $link = PhocaDownloadRoute::getCategoryRoute($valueDoc->categoryid, $valueDoc->categoryalias); $item->link = JRoute::_($link); // FILEDATE $fileDate = ''; if ((int) $displayDateType > 0) { if ($valueDoc->filename != '') { $fileDate = PhocaDownloadFile::getFileTime($valueDoc->filename, $displayDateType, "Y-m-d H:M:S"); } } else { $fileDate = JHTML::Date($valueDoc->date, "Y-m-d H:i:s"); } if ($fileDate != '') { $item->date = $fileDate; } //$item->description = $valueDoc->description; // $item->description = '<div><img src="media/com_phocadownload/images/phoca-download.png" alt="" /></div><div>New file "' .$valueDoc->title . '" ('. $valueDoc->filename.') released on '. $dateDesc.' is available on <a href="http://www.phoca.cz/download">Phoca download site</a></div>'.$valueDoc->description; $item->description = '<div><img src="media/com_phocadownload/images/phoca-download.png" alt="" /></div>' . $valueDoc->description; $item->category = $valueDoc->categorytitle; // $item->section = $valueDoc->sectiontitle; if ($valueDoc->author != '') { $item->author = $valueDoc->author; } $document->addItem($item); } } } } }
public static function displayReportLink($view = 1, $title = '') { $paramsC = JComponentHelper::getParams( 'com_phocadownload' ); $param['display_report_link'] = $paramsC->get( 'display_report_link', 0 ); $param['report_link_guestbook_id'] = $paramsC->get( 'report_link_guestbook_id', 0 ); $o = ''; $displayL = 0; if ($view == 1) { //Category View if ($param['display_report_link'] == 1 || $param['display_report_link'] == 3) { $displayL = 1; } } else { //File View if ($param['display_report_link'] == 2 || $param['display_report_link'] == 3) { $displayL = 1; } } if ($displayL == 1 && (int)$param['report_link_guestbook_id'] > 0) { $onclick = "window.open(this.href,'win2','width=600,height=500,scrollbars=yes,menubar=no,resizable=yes'); return false;"; //$href = JRoute::_('index.php?option=com_phocaguestbook&view=guestbook&id='.(int)$param['report_link_guestbook_id'].'&reporttitle='.strip_tags($title).'&tmpl=component&Itemid='. JRequest::getVar('Itemid', 0, '', 'int') ); $href = PhocaDownloadRoute::getGuestbookRoute((int)$param['report_link_guestbook_id'],urlencode(strip_tags($title) )); //$href = JRoute::_('index.php?option=com_phocaguestbook&view=guestbook&id='.(int)$param['report_link_guestbook_id'].'&reporttitle='.strip_tags($title).'&tmpl=component'); $o .= '<a href="'.$href.'#pgbTabForm" onclick="'.$onclick.'">'.JText::_('COM_PHOCADOWNLOAD_REPORT').'</a>'; } return $o; }
public function displayTags($fileId) { $o = ''; $db = JFactory::getDBO(); $query = 'SELECT a.id, a.title, a.link_ext, a.link_cat' . ' FROM #__phocadownload_tags AS a' . ' LEFT JOIN #__phocadownload_tags_ref AS r ON r.tagid = a.id' . ' WHERE r.fileid = ' . (int) $fileId; $db->setQuery($query); $fileIdObject = $db->loadObjectList(); if (!$db->query()) { $this->setError($db->getErrorMsg()); return false; } $tl = $this->params->get('tags_links', 0); foreach ($fileIdObject as $k => $v) { $o .= '<span>'; if ($tl == 0) { $o .= $v->title; } else { if ($tl == 1) { if ($v->link_ext != '') { $o .= '<a href="' . $v->link_ext . '">' . $v->title . '</a>'; } else { $o .= $v->title; } } else { if ($tl == 2) { if ($v->link_cat != '') { $query = 'SELECT a.id, a.alias' . ' FROM #__phocadownload_categories AS a' . ' WHERE a.id = ' . (int) $v->link_cat; $db->setQuery($query, 0, 1); $category = $db->loadObject(); if (!$db->query()) { $this->setError($db->getErrorMsg()); return false; } if (isset($category->id) && isset($category->alias)) { $link = PhocaDownloadRoute::getCategoryRoute($category->id, $category->alias); $o .= '<a href="' . $link . '">' . $v->title . '</a>'; } else { $o .= $v->title; } } else { $o .= $v->title; } } else { if ($tl == 3) { $link = PhocaDownloadRoute::getCategoryRouteByTag($v->id); $o .= '<a href="' . $link . '">' . $v->title . '</a>'; } } } } $o .= '</span> '; } return $o; }
} $overlibcontent = str_replace('"', '\'', $overlibcontent); $sA = array(utf8_encode(chr(11)), utf8_encode(chr(160))); $eA = array("\t", "\n", "\r", ""); $overlibcontent = str_replace($sA, ' ', $overlibcontent); $overlibcontent = str_replace($eA, '', $overlibcontent); $textO = htmlspecialchars(addslashes('<div style=\'text-align:left;padding:5px\'>' . $overlibcontent . '</div>')); $overlib = "\n\n" . "onmouseover=\"return overlib('" . $textO . "', CAPTION, '" . JText::_('COM_PHOCADOWNLOAD_DETAILS') . "', BELOW, RIGHT, CSSCLASS, TEXTFONTCLASS, 'fontPhocaPDClass', FGCLASS, 'fgPhocaPDClass', BGCLASS, 'bgPhocaPDClass', CAPTIONFONTCLASS,'capfontPhocaPDClass', CLOSEFONTCLASS, 'capfontclosePhocaPDClass', STICKY, MOUSEOFF, CLOSETEXT, '" . JText::_('COM_PHOCADOWNLOAD_CLOSE') . "');\""; $overlib .= " onmouseout=\"return nd();\"" . "\n"; $pdButtonDetails = '<div class="pd-button-details">'; $pdButtonDetails .= '<a class="btn btn-info" ' . $overlib . ' href="#">' . JText::_('COM_PHOCADOWNLOAD_DETAILS') . '</a>'; $pdButtonDetails .= '</div>'; } else { if ($this->t['display_detail'] == 2) { $buttonDOptions = $this->t['buttond']->options; $detailLink = JRoute::_(PhocaDownloadRoute::getFileRoute($v->id, $this->category[0]->id, $v->alias, $v->categoryalias, 0, 'detail') . $this->t['limitstarturl']); $pdButtonDetails = '<div class="pd-button-details">'; $pdButtonDetails .= '<a class="btn btn-info pd-modal-button" href="' . $detailLink . '" rel="' . $buttonDOptions . '">' . JText::_('COM_PHOCADOWNLOAD_DETAILS') . '</a>'; $pdButtonDetails .= '</div>'; } else { $pdButtonDetails = ''; } } // pdmirrorlink1 $pdMirrorLink1 = ''; $mirrorOutput1 = PhocaDownloadRenderFront::displayMirrorLinks(1, $v->mirror1link, $v->mirror1title, $v->mirror1target); if ($mirrorOutput1 != '') { if ($this->t['display_mirror_links'] == 4 || $this->t['display_mirror_links'] == 6) { $classMirror = 'pd-button-mirror1'; $mirrorOutput1 = str_replace('class=""', 'class="btn"', $mirrorOutput1); } else {
}*/ // Description if ($l->isValueEditor($this->category[0]->description)) { echo '<div class="pd-cdesc">'; echo JHTML::_('content.prepare', $this->category[0]->description); echo '</div>'; } // Subcategories if (!empty($this->subcategories)) { foreach ($this->subcategories as $valueSubCat) { echo '<div class="pd-subcategory">'; echo '<a href="'. JRoute::_(PhocaDownloadRoute::getCategoryRoute($valueSubCat->id, $valueSubCat->alias)) .'">'. $valueSubCat->title.'</a>'; echo ' <small>('.$valueSubCat->numdoc.')</small></div>' . "\n"; $subcategory = 1; } echo '<div class="pd-hr-cb"></div>'; } // ===================================================================================== // BEGIN LAYOUT AREA // ===================================================================================== echo $this->loadTemplate('files'); // =====================================================================================
echo '<li class="title"><i class="fa fa-folder"></i> ' . $this->category[0]->title . '</li>'; // Description /*if ($l->isValueEditor($this->category[0]->description)) { echo '<div class="pd-cdesc">'.$this->category[0]->description.'</div>'; }*/ // Description if ($l->isValueEditor($this->category[0]->description)) { echo '<li class="description">'; echo JHTML::_('content.prepare', $this->category[0]->description); echo '</li>'; } // Subcategories if (!empty($this->subcategories)) { foreach ($this->subcategories as $valueSubCat) { echo '<li class="price">'; echo '<i class="fa fa-folder-o"></i> <a href="' . JRoute::_(PhocaDownloadRoute::getCategoryRoute($valueSubCat->id, $valueSubCat->alias)) . '">' . $valueSubCat->title . '</a>'; echo ' <span class="badge badge-info tip">' . $valueSubCat->numdoc . '</span></li>' . "\n"; $subcategory = 1; } } // ===================================================================================== // BEGIN LAYOUT AREA // ===================================================================================== echo $this->loadTemplate('files'); // ===================================================================================== // END LAYOUT AREA // ===================================================================================== if (count($this->category[0])) { echo $this->loadTemplate('pagination'); } if ($this->t['display_category_comments'] == 1) {
} // IMAGE FILENAME //$imageFileName = ''; //if ($value->image_filename !='') { $imageFileName = $l->getImageFileName($value->image_filename, $value->filename, 2); /*$thumbnail = false; $thumbnail = preg_match("/phocathumbnail/i", $value->image_filename); if ($thumbnail) { $imageFileName = ''; } else { $imageFileName = 'style="background: url(\''.$this->t['cssimgpath'].$value->image_filename.'\') 0 center no-repeat;"'; }*/ //} //$outputFile .= '<div class="pd-document'.$this->t['file_icon_size_md'].'" '.$imageFileName.'>'; $outputFile .= '<div class="pd-filename">' . $imageFileName['filenamethumb'] . '<div class="pd-document' . $this->t['file_icon_size_md'] . '" ' . $imageFileName['filenamestyle'] . '>'; $outputFile .= '<a href="' . JRoute::_(PhocaDownloadRoute::getCategoryRoute($value->categoryid, $value->categoryalias)) . '">' . $value->title . '</a>' . ' <small>(' . $value->categorytitle . ')</small>'; $outputFile .= PhocaDownloadRenderFront::displayNewIcon($value->date, $this->t['displaynew']); $outputFile .= PhocaDownloadRenderFront::displayHotIcon($value->hits, $this->t['displayhot']); $outputFile .= '</div></div>' . "\n"; } } if ($outputFile != '') { echo '<div class="pd-hr" style="clear:both"> </div>'; echo '<div id="phoca-dl-most-viewed-box">'; echo '<div class="pd-documents"><h3>' . JText::_('COM_PHOCADOWNLOAD_MOST_DOWNLOADED_FILES') . '</h3>'; echo $outputFile; echo '</div></div>'; } } echo '<div class="pd-cb"> </div>'; echo $this->t['dw'];
protected function _prepareDocument($category, $file) { $app = JFactory::getApplication(); $menus = $app->getMenu(); $menu = $menus->getActive(); $pathway = $app->getPathway(); $title = null; $this->t['downloadmetakey'] = $this->t['p']->get('download_metakey', ''); $this->t['downloadmetadesc'] = $this->t['p']->get('download_metadesc', ''); if ($menu) { $this->t['p']->def('page_heading', $this->t['p']->get('page_title', $menu->title)); } else { $this->t['p']->def('page_heading', JText::_('JGLOBAL_ARTICLES')); } /*$title = $this->t['p']->get('page_title', ''); if (empty($title) || (isset($title) && $title == '')) { $title = $this->item->title; } if (empty($title) || (isset($title) && $title == '')) { $title = htmlspecialchars_decode($app->getCfg('sitename')); } else if ($app->getCfg('sitename_pagetitles', 0)) { $title = JText::sprintf('JPAGETITLE', htmlspecialchars_decode($app->getCfg('sitename')), $title); } //$this->document->setTitle($title); $this->document->setTitle($title);*/ $title = $this->t['p']->get('page_title', ''); $this->tmpl['display_file_name_title'] = 1; if (empty($title)) { $title = htmlspecialchars_decode($app->getCfg('sitename')); } else { if ($app->getCfg('sitename_pagetitles', 0) == 1) { $title = JText::sprintf('JPAGETITLE', htmlspecialchars_decode($app->getCfg('sitename')), $title); if ($this->tmpl['display_file_name_title'] == 1 && isset($file->title) && $file->title != '') { $title = $title . ' - ' . $file->title; } } else { if ($app->getCfg('sitename_pagetitles', 0) == 2) { if ($this->tmpl['display_file_name_title'] == 1 && isset($file->title) && $file->title != '') { $title = $title . ' - ' . $file->title; } $title = JText::sprintf('JPAGETITLE', $title, htmlspecialchars_decode($app->getCfg('sitename'))); } } } $this->document->setTitle($title); if ($file->metadesc != '') { $this->document->setDescription($file->metadesc); } else { if ($this->t['downloadmetadesc'] != '') { $this->document->setDescription($this->t['downloadmetadesc']); } else { if ($this->t['p']->get('menu-meta_description', '')) { $this->document->setDescription($this->t['p']->get('menu-meta_description', '')); } } } if ($file->metakey != '') { $this->document->setMetadata('keywords', $file->metakey); } else { if ($this->t['downloadmetakey'] != '') { $this->document->setMetadata('keywords', $this->t['downloadmetakey']); } else { if ($this->t['p']->get('menu-meta_keywords', '')) { $this->document->setMetadata('keywords', $this->t['p']->get('menu-meta_keywords', '')); } } } if ($app->getCfg('MetaTitle') == '1' && $this->t['p']->get('menupage_title', '')) { $this->document->setMetaData('title', $this->t['p']->get('page_title', '')); } // Breadcrumbs TODO (Add the whole tree) $pathway = $app->getPathway(); if (isset($category->id)) { if ($category->id > 0) { $pathway->addItem($category->title, JRoute::_(PhocaDownloadRoute::getCategoryRoute($category->id, $category->alias))); } } if (!empty($file->title)) { $pathway->addItem($file->title); } }
public function onContentPrepare($context, &$article, &$params, $page = 0) { $document = JFactory::getDocument(); $db = JFactory::getDBO(); $iSize = $this->params->get('icon_size', 32); $iMime = $this->params->get('file_icon_mime', 0); $component = 'com_phocadownload'; $paramsC = JComponentHelper::getParams($component); $ordering = $paramsC->get('file_ordering', 1); // Start Plugin $regex_one = '/({phocadownload\\s*)(.*?)(})/si'; $regex_all = '/{phocadownload\\s*.*?}/si'; $matches = array(); $count_matches = preg_match_all($regex_all, $article->text, $matches, PREG_OFFSET_CAPTURE | PREG_PATTERN_ORDER); JHTML::stylesheet('media/com_phocadownload/css/main/phocadownload.css'); JHTML::stylesheet('media/plg_content_phocadownload/css/phocadownload.css'); // Start if count_matches if ($count_matches != 0) { $l = new PhocaDownloadLayout(); // Start CSS for ($i = 0; $i < $count_matches; $i++) { $view = ''; $id = ''; $text = ''; $target = ''; $playerwidth = $paramsC->get('player_width', 328); $playerheight = $paramsC->get('player_height', 200); $previewwidth = $paramsC->get('preview_width', 640); $previewheight = $paramsC->get('preview_height', 480); $playerheightmp3 = $paramsC->get('player_mp3_height', 30); $url = ''; $youtubewidth = 448; $youtubeheight = 336; $fileView = $paramsC->get('display_file_view', 0); $previewWindow = $paramsC->get('preview_popup_window', 0); $playWindow = $paramsC->get('play_popup_window', 0); $limit = 5; // Get plugin parameters $phocadownload = $matches[0][$i][0]; preg_match($regex_one, $phocadownload, $phocadownload_parts); $parts = explode("|", $phocadownload_parts[2]); $values_replace = array("/^'/", "/'\$/", "/^'/", "/'\$/", "/<br \\/>/"); foreach ($parts as $key => $value) { $values = explode("=", $value, 2); foreach ($values_replace as $key2 => $values2) { $values = preg_replace($values2, '', $values); } // Get plugin parameters from article if ($values[0] == 'view') { $view = $values[1]; } else { if ($values[0] == 'id') { $id = $values[1]; } else { if ($values[0] == 'text') { $text = $values[1]; } else { if ($values[0] == 'target') { $target = $values[1]; } else { if ($values[0] == 'playerwidth') { $playerwidth = (int) $values[1]; } else { if ($values[0] == 'playerheight') { $playerheight = (int) $values[1]; } else { if ($values[0] == 'playerheightmp3') { $playerheightmp3 = (int) $values[1]; } else { if ($values[0] == 'previewwidth') { $previewwidth = (int) $values[1]; } else { if ($values[0] == 'previewheight') { $previewheight = (int) $values[1]; } else { if ($values[0] == 'youtubewidth') { $youtubewidth = (int) $values[1]; } else { if ($values[0] == 'youtubeheight') { $youtubeheight = (int) $values[1]; } else { if ($values[0] == 'previewwindow') { $previewWindow = (int) $values[1]; } else { if ($values[0] == 'playwindow') { $playWindow = (int) $values[1]; } else { if ($values[0] == 'limit') { $limit = (int) $values[1]; } else { if ($values[0] == 'url') { $url = $values[1]; } } } } } } } } } } } } } } } } switch ($target) { case 'b': $targetOutput = 'target="_blank" '; break; case 't': $targetOutput = 'target="_top" '; break; case 'p': $targetOutput = 'target="_parent" '; break; case 's': $targetOutput = 'target="_self" '; break; default: $targetOutput = ''; break; } $output = ''; /* //Itemid $menu =& JSite::getMenu(); $itemSection= $menu->getItems('link', 'index.php?option=com_phocadownload&view=sections'); if(isset($itemSection[0])) { $itemId = $itemSection[0]->id; } else { $itemId = JRequest::getVar('Itemid', 1, 'get', 'int'); } */ switch ($view) { /* // - - - - - - - - - - - - - - - - // SECTIONS // - - - - - - - - - - - - - - - - case 'sections': if ($text !='') { $textOutput = $text; } else { $textOutput = JText::_('PLG_CONTENT_PHOCADOWNLOAD_DOWNLOAD_SECTIONS'); } $link = PhocaDownloadRoute::getSectionsRoute(); $output .= '<div class="phocadownloadsections'.(int)$iSize.'"><a href="'. JRoute::_($link).'" '.$targetOutput.'>'. $textOutput.'</a></div>'; break; // - - - - - - - - - - - - - - - - // SECTION // - - - - - - - - - - - - - - - - case 'section': if ((int)$id > 0) { $query = 'SELECT a.id, a.title, a.alias,' . ' CASE WHEN CHAR_LENGTH(a.alias) THEN CONCAT_WS(\':\', a.id, a.alias) ELSE a.id END as slug' . ' FROM #__phocadownload_sections AS a' . ' WHERE a.id = '.(int)$id; $db->setQuery($query); $item = $db->loadObject(); if (isset($item->id) && isset($item->slug)) { if ($text !='') { $textOutput = $text; } else if (isset($item->title) && $item->title != '') { $textOutput = $item->title; } else { $textOutput = JText::_('PLG_CONTENT_PHOCADOWNLOAD_DOWNLOAD_SECTION'); } $link = PhocaDownloadRoute::getSectionRoute($item->id, $item->alias); // 'index.php?option=com_phocadownload&view=section&id='.$item->slug.'&Itemid='. $itemId $output .= '<div class="phocadownloadsection'.(int)$iSize.'"><a href="'. JRoute::_($link).'" '.$targetOutput.'>'. $textOutput.'</a></div>'; } } break; */ // - - - - - - - - - - - - - - - - // CATEGORIES // - - - - - - - - - - - - - - - - case 'categories': if ($text != '') { $textOutput = $text; } else { $textOutput = JText::_('PLG_CONTENT_PHOCADOWNLOAD_DOWNLOAD_CATEGORIES'); } $link = PhocaDownloadRoute::getCategoriesRoute(); $output .= '<div class="phocadownloadcategories' . (int) $iSize . '"><a href="' . JRoute::_($link) . '" ' . $targetOutput . '>' . $textOutput . '</a></div>'; break; // - - - - - - - - - - - - - - - - // CATEGORY // - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - // CATEGORY // - - - - - - - - - - - - - - - - case 'category': if ((int) $id > 0) { $query = 'SELECT a.id, a.title, a.alias,' . ' CASE WHEN CHAR_LENGTH(a.alias) THEN CONCAT_WS(\':\', a.id, a.alias) ELSE a.id END as slug' . ' FROM #__phocadownload_categories AS a' . ' WHERE a.id = ' . (int) $id; $db->setQuery($query); $item = $db->loadObject(); if (isset($item->id) && isset($item->slug)) { if ($text != '') { $textOutput = $text; } else { if (isset($item->title) && $item->title != '') { $textOutput = $item->title; } else { $textOutput = JText::_('PLG_CONTENT_PHOCADOWNLOAD_DOWNLOAD_CATEGORY'); } } $link = PhocaDownloadRoute::getCategoryRoute($item->id, $item->alias); //'index.php?option=com_phocadownload&view=category&id='.$item->slug.'&Itemid='. $itemId $output .= '<div class="phocadownloadcategory' . (int) $iSize . '"><a href="' . JRoute::_($link) . '" ' . $targetOutput . '>' . $textOutput . '</a></div>'; } } break; // - - - - - - - - - - - - - - - - // FILELIST // - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - // FILELIST // - - - - - - - - - - - - - - - - case 'filelist': $fileOrdering = PhocaDownloadOrdering::getOrderingText($ordering); $query = 'SELECT a.id, a.title, a.alias, a.filename_play, a.filename_preview, a.link_external, a.image_filename, a.filename, c.id as catid, a.confirm_license, c.title as cattitle, c.alias as catalias,' . ' CASE WHEN CHAR_LENGTH(a.alias) THEN CONCAT_WS(\':\', a.id, a.alias) ELSE a.id END as slug,' . ' CASE WHEN CHAR_LENGTH(c.alias) THEN CONCAT_WS(\':\', c.id, c.alias) ELSE c.id END as catslug' . ' FROM #__phocadownload AS a' . ' LEFT JOIN #__phocadownload_categories AS c ON a.catid = c.id'; if ((int) $id > 0) { $query .= ' WHERE c.id = ' . (int) $id; //$query .= ' WHERE c.id = '.(int)$id . ' AND a.published = 1 AND a.approved = 1'; } else { //$query .= ' WHERE a.published = 1 AND a.approved = 1'; } $query .= ' ORDER BY a.' . $fileOrdering; $query .= ' LIMIT 0, ' . (int) $limit; $db->setQuery($query); $items = $db->loadObjectList(); if (!empty($items)) { $output .= '<div class="phocadownloadfilelist">'; foreach ($items as $item) { $imageFileName = $l->getImageFileName($item->image_filename, $item->filename, 3, (int) $iSize); if (isset($item->id) && isset($item->slug) && isset($item->catid) && isset($item->catslug)) { if ($text != '') { $textOutput = $text; } else { if (isset($item->title) && $item->title != '') { $textOutput = $item->title; } else { $textOutput = JText::_('PLG_CONTENT_PHOCADOWNLOAD_DOWNLOAD_FILE'); } } if (isset($item->confirm_license) && $item->confirm_license > 0 || $fileView == 1) { $link = PhocaDownloadRoute::getFileRoute($item->id, $item->catid, $item->alias, $item->catalias, 0, 'file'); if ($iMime == 1) { $output .= '<div class="pd-filename phocadownloadfilelistitem phoca-dl-file-box-mod">' . $imageFileName['filenamethumb'] . '<div class="pd-document' . (int) $iSize . '" ' . $imageFileName['filenamestyle'] . '><a href="' . JRoute::_($link) . '" ' . $targetOutput . '>' . $textOutput . '</a></div></div>'; } else { $output .= '<div class="phocadownloadfilelist' . (int) $iSize . '"><a href="' . JRoute::_($link) . '" ' . $targetOutput . '>' . $textOutput . '</a></div>'; } } else { if ($item->link_external != '') { $link = $item->link_external; } else { $link = PhocaDownloadRoute::getFileRoute($item->id, $item->catid, $item->alias, $item->catalias, 0, 'download'); } if ($iMime == 1) { $output .= '<div class="pd-filename phocadownloadfilelistitem phoca-dl-file-box-mod">' . $imageFileName['filenamethumb'] . '<div class="pd-document' . (int) $iSize . '" ' . $imageFileName['filenamestyle'] . '><a href="' . JRoute::_($link) . '" ' . $targetOutput . '>' . $textOutput . '</a></div></div>'; } else { $output .= '<div class="phocadownloadfilelist' . (int) $iSize . '"><a href="' . JRoute::_($link) . '" ' . $targetOutput . '>' . $textOutput . '</a></div>'; } } } } $output .= '</div>'; } break; // - - - - - - - - - - - - - - - - // FILE // - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - // FILE // - - - - - - - - - - - - - - - - case 'file': case 'fileplay': case 'fileplaylink': case 'filepreviewlink': if ((int) $id > 0) { $query = 'SELECT a.id, a.title, a.alias, a.filename_play, a.filename_preview, a.link_external, a.image_filename, a.filename, c.id as catid, a.confirm_license, c.title as cattitle, c.alias as catalias,' . ' CASE WHEN CHAR_LENGTH(a.alias) THEN CONCAT_WS(\':\', a.id, a.alias) ELSE a.id END as slug,' . ' CASE WHEN CHAR_LENGTH(c.alias) THEN CONCAT_WS(\':\', c.id, c.alias) ELSE c.id END as catslug' . ' FROM #__phocadownload AS a' . ' LEFT JOIN #__phocadownload_categories AS c ON a.catid = c.id' . ' WHERE a.id = ' . (int) $id; $db->setQuery($query); $item = $db->loadObject(); if (isset($item->id) && isset($item->slug) && isset($item->catid) && isset($item->catslug)) { if ($text != '') { $textOutput = $text; } else { if (isset($item->title) && $item->title != '') { $textOutput = $item->title; } else { if ($view == 'fileplay') { $textOutput = JText::_('PLG_CONTENT_PHOCADOWNLOAD_PLAY_FILE'); } else { $textOutput = JText::_('PLG_CONTENT_PHOCADOWNLOAD_DOWNLOAD_FILE'); } } } $imageFileName = $l->getImageFileName($item->image_filename, $item->filename, 3, (int) $iSize); // - - - - - // PLAY // - - - - - if ($view == 'fileplay') { $play = 1; $fileExt = ''; $filePath = PhocaDownloadPath::getPathSet('fileplay'); $filePath = str_replace('../', JURI::base(true) . '/', $filePath['orig_rel_ds']); if (isset($item->filename_play) && $item->filename_play != '') { $fileExt = PhocaDownloadFile::getExtension($item->filename_play); $canPlay = PhocaDownloadFile::canPlay($item->filename_play); if ($canPlay) { $tmpl['playfilewithpath'] = $filePath . $item->filename_play; $tmpl['playerpath'] = JURI::base() . 'components/com_phocadownload/assets/flowplayer/'; } else { $output .= JText::_('PLG_CONTENT_PHOCADOWNLOAD_NO_CORRECT_FILE_FOR_PLAYING_FOUND'); $play = 0; } } else { $output .= JText::_('PLG_CONTENT_PHOCADOWNLOAD_NO_FILE_FOR_PLAYING_FOUND'); $play = 0; } if ($play == 1) { //Correct MP3 $tmpl['filetype'] = ''; if ($fileExt == 'mp3') { $tmpl['filetype'] = 'mp3'; $playerheight = $playerheightmp3; } $versionFLP = '3.2.2'; $versionFLPJS = '3.2.2'; //Flow Player $document->addScript($tmpl['playerpath'] . 'flowplayer-' . $versionFLPJS . '.min.js'); $output .= '<div style="text-align:center;margin: 10px auto">' . "\n" . '<div style="margin: 0 auto;text-align:center; width:' . $playerwidth . 'px"><a href="' . $tmpl['playfilewithpath'] . '" style="display:block;width:' . $playerwidth . 'px;height:' . $playerheight . 'px" id="pdplayer' . $i . '"></a>' . "\n"; if ($tmpl['filetype'] == 'mp3') { $output .= '<script type="text/javascript">' . "\n" . 'window.addEvent("domready", function() {' . "\n" . 'flowplayer("pdplayer' . $i . '", "' . $tmpl['playerpath'] . 'flowplayer-' . $versionFLP . '.swf",' . '{ ' . "\n" . ' clip: { ' . "\n" . ' url: \'' . $tmpl['playfilewithpath'] . '\',' . "\n" . ' autoPlay: false' . "\n" . ' }, ' . "\n" . ' plugins: { ' . "\n" . ' controls: { ' . "\n" . ' fullscreen: false, ' . "\n" . ' height: ' . $playerheight . "\n" . ' } ' . "\n" . ' } ' . "\n" . '} ' . "\n" . ');' . "\n" . '});' . '</script>' . "\n"; } else { $output .= '<script type="text/javascript">' . "\n" . 'window.addEvent("domready", function() {' . "\n" . 'flowplayer("pdplayer' . $i . '", "' . $tmpl['playerpath'] . 'flowplayer-' . $versionFLP . '.swf",' . "\n" . '{ ' . "\n" . ' clip: { ' . "\n" . ' url: \'' . $tmpl['playfilewithpath'] . '\',' . "\n" . ' autoPlay: false,' . "\n" . ' autoBuffering: true' . "\n" . ' }, ' . "\n" . '} ' . "\n" . ');' . "\n" . '});' . '</script>' . "\n"; } $output .= '</div></div>' . "\n"; } } else { if ($view == 'fileplaylink') { // PLAY - - - - - - - - - - - - $windowWidthPl = (int) $playerwidth + 30; $windowHeightPl = (int) $playerheight + 30; $windowHeightPlMP3 = (int) $playerheightmp3 + 30; //$playWindow = $paramsC->get( 'play_popup_window', 0 ); if ($playWindow == 1) { $buttonPl = new JObject(); $buttonPl->set('methodname', 'js-button'); $buttonPl->set('options', "window.open(this.href,'win2','width=" . $windowWidthPl . ",height=" . $windowHeightPl . ",scrollbars=yes,menubar=no,resizable=yes'); return false;"); $buttonPl->set('optionsmp3', "window.open(this.href,'win2','width=" . $windowWidthPl . ",height=" . $windowHeightPlMP3 . ",scrollbars=yes,menubar=no,resizable=yes'); return false;"); } else { JHTML::_('behavior.modal', 'a.modal-button'); $document->addCustomTag("<style type=\"text/css\"> \n" . " #sbox-window.phocadownloadplaywindow {background-color:#fff;padding:2px} \n" . " #sbox-overlay.phocadownloadplayoverlay {background-color:#000;} \n" . " </style> \n"); $buttonPl = new JObject(); $buttonPl->set('name', 'image'); $buttonPl->set('modal', true); $buttonPl->set('methodname', 'modal-button'); $buttonPl->set('options', "{handler: 'iframe', size: {x: " . $windowWidthPl . ", y: " . $windowHeightPl . "}, overlayOpacity: 0.7, classWindow: 'phocadownloadplaywindow', classOverlay: 'phocadownloadplayoverlay'}"); $buttonPl->set('optionsmp3', "{handler: 'iframe', size: {x: " . $windowWidthPl . ", y: " . $windowHeightPlMP3 . "}, overlayOpacity: 0.7, classWindow: 'phocadownloadplaywindow', classOverlay: 'phocadownloadplayoverlay'}"); } // - - - - - - - - - - - - - - - $fileExt = ''; $filePath = PhocaDownloadPath::getPathSet('fileplay'); $filePath = str_replace('../', JURI::base(true) . '/', $filePath['orig_rel_ds']); if (isset($item->filename_play) && $item->filename_play != '') { $fileExt = PhocaDownloadFile::getExtension($item->filename_play); $canPlay = PhocaDownloadFile::canPlay($item->filename_play); if ($canPlay) { // Special height for music only $buttonPlOptions = $buttonPl->options; if ($fileExt == 'mp3') { $buttonPlOptions = $buttonPl->optionsmp3; } /*if ($text == '') { $text = JText::_('PLG_CONTENT_PHOCADOWNLOAD_PLAY'); }*/ if ($text != '') { $textOutput = $text; //} else if (isset($item->title) && $item->title != '') { // $textOutput = $item->title; } else { $textOutput = JText::_('PLG_CONTENT_PHOCADOWNLOAD_PLAY'); } $playLink = JRoute::_(PhocaDownloadRoute::getFileRoute($item->id, $item->catid, $item->alias, $item->catalias, 0, 'play')); if ($iMime == 1) { $output .= '<div class="pd-filename phocadownloadfile phoca-dl-file-box-mod">' . $imageFileName['filenamethumb'] . '<div class="pd-document' . (int) $iSize . '" ' . $imageFileName['filenamestyle'] . '>'; } else { $output .= '<div><div class="phocadownloadplay' . (int) $iSize . '">'; } if ($playWindow == 1) { $output .= '<a href="' . $playLink . '" onclick="' . $buttonPlOptions . '" >' . $textOutput . '</a>'; } else { $output .= '<a class="modal-button" href="' . $playLink . '" rel="' . $buttonPlOptions . '" >' . $textOutput . '</a>'; } $output .= '</div></div>'; } } else { $output .= JText::_('PLG_CONTENT_PHOCADOWNLOAD_NO_FILE_FOR_PLAYING_FOUND'); } } else { if ($view == 'filepreviewlink') { if (isset($item->filename_preview) && $item->filename_preview != '') { $fileExt = PhocaDownloadFile::getExtension($item->filename_preview); if ($fileExt == 'pdf' || $fileExt == 'jpeg' || $fileExt == 'jpg' || $fileExt == 'png' || $fileExt == 'gif') { $filePath = PhocaDownloadPath::getPathSet('filepreview'); $filePath = str_replace('../', JURI::base(true) . '/', $filePath['orig_rel_ds']); $previewLink = $filePath . $item->filename_preview; //$previewWindow = $paramsC->get( 'preview_popup_window', 0 ); // PREVIEW - - - - - - - - - - - - $windowWidthPr = (int) $previewwidth + 20; $windowHeightPr = (int) $previewheight + 20; if ($previewWindow == 1) { $buttonPr = new JObject(); $buttonPr->set('methodname', 'js-button'); $buttonPr->set('options', "window.open(this.href,'win2','width=" . $windowWidthPr . ",height=" . $windowHeightPr . ",scrollbars=yes,menubar=no,resizable=yes'); return false;"); } else { JHTML::_('behavior.modal', 'a.modal-button'); $document->addCustomTag("<style type=\"text/css\"> \n" . " #sbox-window.phocadownloadpreviewwindow {background-color:#fff;padding:2px} \n" . " #sbox-overlay.phocadownloadpreviewoverlay {background-color:#000;} \n" . " </style> \n"); $buttonPr = new JObject(); $buttonPr->set('name', 'image'); $buttonPr->set('modal', true); $buttonPr->set('methodname', 'modal-button'); $buttonPr->set('options', "{handler: 'iframe', size: {x: " . $windowWidthPr . ", y: " . $windowHeightPr . "}, overlayOpacity: 0.7, classWindow: 'phocadownloadpreviewwindow', classOverlay: 'phocadownloadpreviewoverlay'}"); $buttonPr->set('optionsimg', "{handler: 'image', size: {x: 200, y: 150}, overlayOpacity: 0.7, classWindow: 'phocadownloadpreviewwindow', classOverlay: 'phocadownloadpreviewoverlay'}"); } // - - - - - - - - - - - - - - - /*if ($text == '') { $text = JText::_('PLG_CONTENT_PHOCADOWNLOAD_PREVIEW'); }*/ if ($text != '') { $textOutput = $text; //} else if (isset($item->title) && $item->title != '') { // $textOutput = $item->title; } else { $textOutput = JText::_('PLG_CONTENT_PHOCADOWNLOAD_PREVIEW'); } if ($iMime == 1) { $output .= '<div class="pd-filename phocadownloadfile phoca-dl-file-box-mod">' . $imageFileName['filenamethumb'] . '<div class="pd-document' . (int) $iSize . '" ' . $imageFileName['filenamestyle'] . '>'; } else { $output .= '<div><div class="phocadownloadpreview' . (int) $iSize . '">'; } if ($previewWindow == 1) { $output .= '<a href="' . $previewLink . '" onclick="' . $buttonPr->options . '" >' . $text . '</a>'; } else { if ($fileExt == 'pdf') { // Iframe - modal $output .= '<a class="modal-button" href="' . $previewLink . '" rel="' . $buttonPr->options . '" >' . $textOutput . '</a>'; } else { // Image - modal $output .= '<a class="modal-button" href="' . $previewLink . '" rel="' . $buttonPr->optionsimg . '" >' . $textOutput . '</a>'; } } $output .= '</div></div>'; } } else { $output .= JText::_('PLG_CONTENT_PHOCADOWNLOAD_NO_FILE_FOR_PREVIEWING_FOUND'); } } else { if (isset($item->confirm_license) && $item->confirm_license > 0 || $fileView == 1) { $link = PhocaDownloadRoute::getFileRoute($item->id, $item->catid, $item->alias, $item->catalias, 0, 'file'); //'index.php?option=com_phocadownload&view=file&id='.$item->slug.'&Itemid='.$itemId if ($iMime == 1) { $output .= '<div class="pd-filename phocadownloadfile phoca-dl-file-box-mod">' . $imageFileName['filenamethumb'] . '<div class="pd-document' . (int) $iSize . '" ' . $imageFileName['filenamestyle'] . '><a href="' . JRoute::_($link) . '" ' . $targetOutput . '>' . $textOutput . '</a></div></div>'; } else { $output .= '<div class="phocadownloadfile' . (int) $iSize . '"><a href="' . JRoute::_($link) . '" ' . $targetOutput . '>' . $textOutput . '</a></div>'; } } else { if ($item->link_external != '') { $link = $item->link_external; } else { $link = PhocaDownloadRoute::getFileRoute($item->id, $item->catid, $item->alias, $item->catalias, 0, 'download'); } //$link = PhocaDownloadRoute::getCategoryRoute($item->catid,$item->catalias,$item->sectionid); //'index.php?option=com_phocadownload&view=category&id='. $item->catslug. '&download='. $item->slug. '&Itemid=' . $itemId if ($iMime == 1) { $output .= '<div class="pd-filename phocadownloadfile phoca-dl-file-box-mod">' . $imageFileName['filenamethumb'] . '<div class="pd-document' . (int) $iSize . '" ' . $imageFileName['filenamestyle'] . '><a href="' . JRoute::_($link) . '" ' . $targetOutput . '>' . $textOutput . '</a></div></div>'; } else { $output .= '<div class="phocadownloadfile' . (int) $iSize . '"><a href="' . JRoute::_($link) . '" ' . $targetOutput . '>' . $textOutput . '</a></div>'; } } } } } } } break; // - - - - - - - - - - - - - - - - // YOUTUBE // - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - // YOUTUBE // - - - - - - - - - - - - - - - - case 'youtube': if ($url != '' && PhocaDownloadUtils::isURLAddress($url)) { $l = new PhocaDownloadLayout(); $pdVideo = $l->displayVideo($url, 0, $youtubewidth, $youtubeheight); $output .= $pdVideo; } else { $output .= JText::_('PLG_CONTENT_PHOCADOWNLOAD_WRONG_YOUTUBE_URL'); } break; } $article->text = preg_replace($regex_all, $output, $article->text, 1); } } // end if count_matches return true; }
/** * @param XmapDisplayerInterface $xmap * @param stdClass $parent * @param array $params * @param int $catid */ private static function getDownloads($xmap, stdClass $parent, array &$params, $catid) { self::getCategoryTree($xmap, $parent, $params, $catid); if (!$params['include_downloads']) { return; } $db = JFactory::getDbo(); $now = JFactory::getDate('now', 'UTC')->toSql(); $query = $db->getQuery(true)->select(array('d.id', 'd.alias', 'd.title'))->from('#__phocadownload AS d')->where('d.catid = ' . $db->Quote($catid))->where('d.published = 1')->where('(d.publish_up = ' . $db->quote($db->getNullDate()) . ' OR d.publish_up <= ' . $db->quote($now) . ')')->where('(d.publish_down = ' . $db->quote($db->getNullDate()) . ' OR d.publish_down >= ' . $db->quote($now) . ')')->order('d.ordering'); if (!$params['show_unauth']) { $query->where('d.access IN(' . $params['groups'] . ')'); } if ($params['language_filter']) { $query->where('d.language IN(' . $db->quote(JFactory::getLanguage()->getTag()) . ', ' . $db->quote('*') . ')'); } $db->setQuery($query); $rows = $db->loadObjectList(); if (empty($rows)) { return; } $xmap->changeLevel(1); foreach ($rows as $row) { $node = new stdclass(); $node->id = $parent->id; $node->name = $row->title; $node->uid = $parent->uid . '_' . $row->id; $node->browserNav = $parent->browserNav; $node->priority = $params['download_priority']; $node->changefreq = $params['download_changefreq']; $node->link = PhocaDownloadRoute::getFileRoute($row->id . ':' . $row->alias); if ($params['itemid_workaround'] && !strstr($node->link, 'Itemid=')) { $node->link .= '&Itemid=' . $parent->id; } $xmap->printNode($node); } $xmap->changeLevel(-1); }
protected function _prepareDocument($category) { $app = JFactory::getApplication(); $menus = $app->getMenu(); $pathway = $app->getPathway(); //$this->t['p'] = &$app->getParams(); $title = null; $this->t['downloadmetakey'] = $this->t['p']->get( 'download_metakey', '' ); $this->t['downloadmetadesc'] = $this->t['p']->get( 'download_metadesc', '' ); $menu = $menus->getActive(); if ($menu) { $this->t['p']->def('page_heading', $this->t['p']->get('page_title', $menu->title)); } else { $this->t['p']->def('page_heading', JText::_('JGLOBAL_ARTICLES')); } /* $title = $this->t['p']->get('page_title', ''); if (empty($title) || (isset($title) && $title == '')) { $title = $this->item->title; } if (empty($title) || (isset($title) && $title == '')) { $title = htmlspecialchars_decode($app->getCfg('sitename')); } else if ($app->getCfg('sitename_pagetitles', 0)) { $title = JText::sprintf('JPAGETITLE', htmlspecialchars_decode($app->getCfg('sitename')), $title); } //$this->document->setTitle($title); $this->document->setTitle($title);*/ $title = $this->t['p']->get('page_title', ''); $this->tmpl['display_cat_name_title'] = 1; if (empty($title)) { $title = htmlspecialchars_decode($app->getCfg('sitename')); } else if ($app->getCfg('sitename_pagetitles', 0) == 1) { $title = JText::sprintf('JPAGETITLE', htmlspecialchars_decode($app->getCfg('sitename')), $title); if ($this->tmpl['display_cat_name_title'] == 1 && isset($category->title) && $category->title != '') { $title = $title .' - ' . $category->title; } } else if ($app->getCfg('sitename_pagetitles', 0) == 2) { if ($this->tmpl['display_cat_name_title'] == 1 && isset($category->title) && $category->title != '') { $title = $title .' - ' . $category->title; } $title = JText::sprintf('JPAGETITLE', $title, htmlspecialchars_decode($app->getCfg('sitename'))); } $this->document->setTitle($title); if ($category->metadesc != '') { $this->document->setDescription($category->metadesc); } else if ($this->t['downloadmetadesc'] != '') { $this->document->setDescription($this->t['downloadmetadesc']); } else if ($this->t['p']->get('menu-meta_description', '')) { $this->document->setDescription($this->t['p']->get('menu-meta_description', '')); } if ($category->metakey != '') { $this->document->setMetadata('keywords', $category->metakey); } else if ($this->t['downloadmetakey'] != '') { $this->document->setMetadata('keywords', $this->t['downloadmetakey']); } else if ($this->t['p']->get('menu-meta_keywords', '')) { $this->document->setMetadata('keywords', $this->t['p']->get('menu-meta_keywords', '')); } if ($app->getCfg('MetaTitle') == '1' && $this->t['p']->get('menupage_title', '')) { $this->document->setMetaData('title', $this->t['p']->get('page_title', '')); } // Breadcrumbs TODO (Add the whole tree) /*$pathway = $app->getPathway(); if (isset($this->category[0]->parentid)) { if ($this->category[0]->parentid == 0) { // $pathway->addItem( JText::_('COM_PHOCADOWNLOAD_CATEGORIES'), JRoute::_(PhocaDownloadRoute::getCategoriesRoute())); } else if ($this->category[0]->parentid > 0) { $pathway->addItem($this->category[0]->parenttitle, JRoute::_(PhocaDownloadRoute::getCategoryRoute($this->category[0]->parentid, $this->category[0]->parentalias))); } } if (!empty($this->category[0]->title)) { $pathway->addItem($this->category[0]->title); }*/ // Breadcrumbs TODO (Add the whole tree) // Start comment if problem with duplicated pathway // /* if (isset($this->category[0]->parentid)) { if ($this->category[0]->parentid == 0) { // $pathway->addItem( JText::_('COM_PHOCADOWNLOAD_CATEGORIES'), JRoute::_(PhocaDownloadRoute::getCategoriesRoute())); } else if ($this->category[0]->parentid > 0) { $curpath = $pathway->getPathwayNames(); if(isset($this->category[0]->parenttitle) && isset($curpath[count($curpath)-1]) && $this->category[0]->parenttitle != $curpath[count($curpath)-1]){ $pathway->addItem($this->category[0]->parenttitle, JRoute::_(PhocaDownloadRoute::getCategoryRoute($this->category[0]->parentid, $this->category[0]->parentalias))); } } } // */ // End comment when problem with duplicated pathway if (!empty($this->category[0]->title)) { $curpath = $pathway->getPathwayNames(); if(isset($this->category[0]->title) && isset($curpath[count($curpath)-1]) && $this->category[0]->title != $curpath[count($curpath)-1]){ $pathway->addItem($this->category[0]->title); } } }
$thumbnail = preg_match("/phocathumbnail/i", $value->image_filename); if ($thumbnail) { $imageFileName = ''; } else { $imageFileName = 'style="background: url(\''.$this->t['cssimgpath'].$value->image_filename.'\') 0 center no-repeat;"'; }*/ //} //$outputFile .= '<div class="pd-document'.$this->t['file_icon_size_md'].'" '.$imageFileName.'>'; $outputFile .= '<div class="pd-filename">'. $imageFileName['filenamethumb'] . '<div class="pd-document'.$this->t['file_icon_size_md'].'" ' . $imageFileName['filenamestyle'].'>'; $outputFile .= '<a href="' . JRoute::_(PhocaDownloadRoute::getCategoryRoute($value->categoryid,$value->categoryalias)) .'">'. $value->title.'</a>' .' <small>(' .$value->categorytitle.')</small>'; $outputFile .= PhocaDownloadRenderFront::displayNewIcon($value->date, $this->t['displaynew']); $outputFile .= PhocaDownloadRenderFront::displayHotIcon($value->hits, $this->t['displayhot']); $outputFile .= '</div></div>' . "\n"; } } if ($outputFile != '') { echo '<div class="pd-hr" style="clear:both"> </div>'; echo '<div id="phoca-dl-most-viewed-box">'; echo '<div class="pd-documents"><h3>'. JText::_('COM_PHOCADOWNLOAD_MOST_DOWNLOADED_FILES').'</h3>'; echo $outputFile;
echo '<h3 class="pd-ctitle">' . $this->category[0]->title . '</h3>'; // Description /*if ($l->isValueEditor($this->category[0]->description)) { echo '<div class="pd-cdesc">'.$this->category[0]->description.'</div>'; }*/ // Description if ($l->isValueEditor($this->category[0]->description)) { echo '<div class="pd-cdesc">'; echo JHTML::_('content.prepare', $this->category[0]->description); echo '</div>'; } // Subcategories if (!empty($this->subcategories)) { foreach ($this->subcategories as $valueSubCat) { echo '<div class="pd-subcategory">'; echo '<a href="' . JRoute::_(PhocaDownloadRoute::getCategoryRoute($valueSubCat->id, $valueSubCat->alias)) . '">' . $valueSubCat->title . '</a>'; echo ' <small>(' . $valueSubCat->numdoc . ')</small></div>' . "\n"; $subcategory = 1; } echo '<div class="pd-hr-cb"></div>'; } // ===================================================================================== // BEGIN LAYOUT AREA // ===================================================================================== echo $this->loadTemplate('files'); // ===================================================================================== // END LAYOUT AREA // ===================================================================================== if (count($this->category[0])) { echo $this->loadTemplate('pagination'); }
<?php defined('_JEXEC') or die('Restricted access'); echo '<div id="phoca-dl-file-box" class="pd-file-view'.$this->t['p']->get( 'pageclass_sfx' ).'" >'; if ( $this->t['p']->get( 'show_page_heading' ) ) { echo '<h1>'. $this->escape($this->t['p']->get('page_heading')) . '</h1>'; } if (!empty($this->category[0])) { echo '<div class="pd-file">'; if ($this->t['display_up_icon'] == 1 && $this->t['tmplr'] == 0) { if (isset($this->category[0]->id)) { if ($this->category[0]->id > 0) { $linkUp = JRoute::_(PhocaDownloadRoute::getCategoryRoute($this->category[0]->id, $this->category[0]->alias)); $linkUpText = $this->category[0]->title; } else { $linkUp = '#'; $linkUpText = ''; } echo '<div class="ph-top">' .'<a class="btn btn-default" title="'.$linkUpText.'" href="'. $linkUp.'" ><span class="glyphicon glyphicon-arrow-left"></span> ' . $linkUpText .'</a></div>'; } } } else { echo '<div class="pd-file"><div class="ph-top"></div>'; }
<?php defined('_JEXEC') or die('Restricted access'); echo '<div id="phoca-dl-download-box" class="pd-download-view'.$this->t['p']->get( 'pageclass_sfx' ).'" >'; echo '<div class="pd-download">'; if ($this->t['found'] == 1) { if(isset($this->file[0]->id) && (int)$this->file[0]->id > 0 && isset($this->file[0]->token) && $this->file[0]->token != '') { $v = $this->file[0]; $downloadLink = PhocaDownloadRoute::getDownloadRoute((int)$v->id, (int)$v->catid, $v->token); $l = new PhocaDownloadLayout(); //echo '<h3 class="pdfv-name">'.$l->getName($v->title, $v->filename, 1). '</h3>'; $pdTitle = ''; if ($v->title != '') { $pdTitle .= '<div class="pd-title">'.$v->title.'</div>'; } $pdImage = ''; if ($v->image_download != '') { $pdImage .= '<div class="pd-image">'.$l->getImageDownload($v->image_download).'</div>'; } if ($v->filename != '') { $imageFileName = $l->getImageFileName($v->image_filename, $v->filename); $pdFile = '<div class="pd-filenamebox">'; if ($this->t['filename_or_name'] == 'filenametitle') { $pdFile .= '<div class="pd-title">'. $v->title . '</div>';
$formArray = array('mirror1link', 'mirror1title', 'mirror1target', 'mirror2link', 'mirror2title', 'mirror2target'); echo $r->group($this->form, $formArray); echo '</div>' . "\n"; echo '<div class="tab-pane" id="video">' . "\n"; $formArray = array('video_filename'); echo $r->group($this->form, $formArray); echo '</div>' . "\n"; echo '</div>'; //end tab content echo '</div>'; //end span10 // Second Column echo '<div class="span2">'; if (isset($this->item->id) && isset($this->item->catid) && isset($this->item->token) && (int) $this->item->id > 0 && (int) $this->item->catid > 0 && $this->item->token != '') { phocadownloadimport('phocadownload.path.route'); $downloadLink = PhocaDownloadRoute::getDownloadRoute((int) $this->item->id, (int) $this->item->catid, $this->item->token, 0); $app = JApplication::getInstance('site'); $router = $app->getRouter(); $uri = $router->build($downloadLink); $frontendUrl = JURI::root(false) . str_replace(JURI::root(true) . '/administrator/', '', $uri->toString()); echo '<div>' . JText::_('COM_PHOCADOWNLOAD_UNIQUE_DOWNLOAD_URL') . '</div>'; echo '<textarea rows="7">' . $frontendUrl . '</textarea>'; echo '<div><small>(' . JText::_('COM_PHOCADOWNLOAD_URL_FORMAT_DEPENDS_ON_SEF') . ')</small></div>'; } echo '</div>'; //end span2 echo $r->formInputs(); echo $r->endForm(); /* ?>