0 Пользователей и 1 Гость просматривают эту тему.
  • 0 Ответов
  • 2635 Просмотров
*

Elimelech

  • Захожу иногда
  • 261
  • 2 / 0
Есть Модуль PhocaDownload Latest. Хочу спрятать ссылки от индексации, которые выводит этот модуль.
Но не как не пойму как же это сделать?
Залел в файл mod_phocadownload_latest.php, пробую ставить и тут и там <noindex> - не получается!
Может я не там ищу и не то делаю? Подскажите, плз. Спасибо!


Код
<?php
/*
 * @package Joomla 1.5
 * @copyright Copyright (C) 2005 Open Source Matters. All rights reserved.
 * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
 *
 * @module Phoca - Phoca Module
 * @copyright Copyright (C) Joomla-R-Us, http://Joomla-R-Us.com
 * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
 *
 * Module  : PhocaDownload Latest
 * Version : 0.9.4
 * Date    : May 5 2009
 * Joomla-R-Us.com
 */
 
defined('_JEXEC') or die('Restricted access');// no direct access

require_once(JPATH_BASE.DS.'modules'.DS.'mod_phocadownload_latest'.DS.'helpers'.DS.'phocalatest.php');

// PhocaDownload Parameters
$cmpParms =& JComponentHelper::getParams( 'com_phocadownload' );
$display_description = $cmpParms->get( 'display_description', 3 );

$user =& JFactory::getUser();
$aid = $user->get('aid', 0);
$db =& JFactory::getDBO();
$menu =& JSite::getMenu();
$document =& JFactory::getDocument();


// Request parameters
$option = JRequest::getVar('option');
$view  = JRequest::getVar('view');
$id  = JRequest::getVar('id');

// Module Parameters
$autofilter = $params->get( 'autofilter', 'yes' );
$display_sections = $params->get( 'display_sections', '' );
$hide_sections = $params->get( 'hide_sections', '' );
$display_categories = $params->get( 'display_categories', '' );
$hide_categories = $params->get( 'hide_categories', '' );
$maxlen = $params->get( 'maxlen', '40' );
$sort_by = $params->get( 'sort_by', 'date' );
$sort_order = $params->get( 'sort_order', 'DESC' );
$number_to_show = $params->get( 'number_to_show', '5' );
$link_to = $params->get( 'link_to', 'download' );
$listclass = $params->get( 'listclass', '' );
$fileorname = $params->get( 'fileorname', 'title' );
$showdate = $params->get( 'showdate', '0' );
$dateformat = $params->get( 'dateformat', 'm/d/y' );
$showdownloads = $params->get( 'showdownloads', '0' );
$tooltipstyle = $params->get( 'tooltip', 'off' );
$itemID = PhocaLatestHelper::getPhocaItemID($params, $menu);
$showdescr = $params->get( 'showdescr', '0' );

// Override PhocaDownload Description Setting?
if ( $showdescr == 1 ) {
$display_description = 3;
} elseif ( $showdescr == 2 ) {
$display_description = 0;
}

// Include Tooltip, if needed
if ( substr($tooltipstyle,0,5) == 'phoca' ) {
$document->addCustomTag('<script type="text/javascript" src="'.JURI::root().'includes/js/overlib_mini.js"></script>');
} elseif ( $tooltipstyle == 'joomla' ) {
JHTML::_('behavior.tooltip');
}

// Download Folder
$db->setQuery( "SELECT value FROM #__phocadownload_settings WHERE title='download_folder'" );
$dlFolder = $db->loadResult();


// SQL, QUERY
$wheres[] = " a.catid = b.id ";
$wheres[] = " a.published = 1";
$wheres[] = " b.published = 1";
$wheres[] = " c.id = b.section";
$wheres[] = " c.published = 1";


if ( $autofilter == 'yes' && $option == 'com_phocadownload'  ) {
if ( $id != '' ) {
$id = explode(':', $id);
$id = $id[0];
}
  
if ( $view != '' ) {
$view = explode(':', $view);
$view = $view[0];
}

if ( $view == 'section' ) {
$wheres[] = 'a.sectionid=' . $id;
}  elseif ( $view == 'category' ) {
$wheres[] = 'a.catid=' . $id;
}
}

if ( $display_sections != '' ) {
$section_ids_where = " AND a.sectionid IN (".$display_sections.")";
} else {
$section_ids_where = '';
}

if ( $hide_sections != '' ) {
$section_ids_not_where = " AND a.sectionid NOT IN (".$hide_sections.")";
} else {
$section_ids_not_where = '';
}

if ( $display_categories != '' ) {
$category_ids_where = " AND a.catid IN (".$display_categories.")";
} else {
$category_ids_where = '';
}

if ( $hide_categories != '' ) {
$category_ids_not_where = " AND a.catid NOT IN (".$hide_categories.")";
} else {
$category_ids_not_where = '';
}


if ($aid !== null) {
$wheres[] = " ( a.unaccessible_file=1 OR a.access <= " . (int) $aid . ") ";
$wheres[] = " b.access <= " . (int) $aid;
$wheres[] = " c.access <= " . (int) $aid;
}

$query =  " SELECT a.id, a.title, a.filename, a.catid, a.author, a.author_email, a.hits, a.date, UNIX_TIMESTAMP(a.date) as utime, a.version, a.license, a.alias, a.link_external, a.description, b.alias as catalias"
. " FROM #__phocadownload a, #__phocadownload_categories b, #__phocadownload_sections c"
. " WHERE " . implode( " AND ", $wheres )
. $section_ids_where
. $section_ids_not_where
. $category_ids_where
. $category_ids_not_where
. " ORDER BY a.$sort_by $sort_order"
. " LIMIT 0,$number_to_show";

$db->setQuery( $query );
$downloads = $db->loadObjectList();

// DISPLAY
$output = '<div id="phoca-dl-latest-module">';
if (!empty($downloads)) {
if ( trim($listclass)!= '' ) {
$output .= '<ul class="' . trim($listclass). '">';
} else {
$output .= '<ul>';
}
foreach ($downloads as $value) {
  if ( $fileorname == 'filename' ) {
  $dltitle = $value->filename;
  } else {
  $dltitle = $value->title;
  }
       if ( strlen($dltitle) > $maxlen )  {
        $dltitle = substr($dltitle,0,$maxlen). '...';
       }
       
       // Get ToolTip, if applicable
       $toolTip = PhocaLatestHelper::getTooltip($tooltipstyle, $dlFolder, $value, date($dateformat,$value->utime),$display_description);


// EXTERNAL LINK
if ($value->link_external != '') {

$linkDownloadB = '<a href="'.$value->link_external.'" ' . $toolTip . '>';
$linkDownloadE ='</a>';

} else {
if ( $itemID != '' ) { $itemID = '&Itemid=' . $itemID; }
if ( $link_to == 'category' ) {
$linkDownloadB = '<a href="'. JRoute::_('index.php?option=com_phocadownload&view=category&id='.$value->catid.':'.$value->catalias.$itemID).'" ' . $toolTip . '>';
} else {
$linkDownloadB = '<a href="'. JRoute::_('index.php?option=com_phocadownload&view=category&id='.$value->catid.':'.$value->catalias.'&download='.$value->id.':'.$value->alias.$itemID).'" ' . $toolTip . '>';
}
$linkDownloadE ='</a>';
if ( $showdate ) {
  $linkDownloadE .=' <span class="small">[' . date($dateformat, $value->utime). ']</span>';
}
if ( $showdownloads ) {
  $linkDownloadE .=' <span class="small">[' . $value->hits . ']</span>';
}
}        
$output .= '<li>' . $linkDownloadB . $dltitle . $linkDownloadE . '</li>';
}
$output .= '</ul>';
}
$output .= '</div>';

require(JModuleHelper::getLayoutPath('mod_phocadownload_latest'));
?>
Чтобы оставить сообщение,
Вам необходимо Войти или Зарегистрироваться
 

Как изменить title материалов PhocaDownload?

Автор philip

Ответов: 2
Просмотров: 1548
Последний ответ 12.10.2020, 21:22:27
от AlexB
PhocaDownload в многоязычном сайте

Автор philip

Ответов: 0
Просмотров: 1960
Последний ответ 22.07.2020, 20:54:12
от philip
Русская локализация PhocaDownload + плагины + модуль (обновляется)

Автор Kostelano

Ответов: 2
Просмотров: 2716
Последний ответ 19.04.2020, 01:20:11
от Kostelano
PhocaDownload latest module

Автор dimon68

Ответов: 3
Просмотров: 4607
Последний ответ 10.09.2019, 11:29:54
от dron
Ошибки вида Cannot assign an empty string после установки PhocaDownload

Автор Solvedor

Ответов: 1
Просмотров: 3106
Последний ответ 22.09.2017, 11:07:58
от Solvedor