1

別のレイアウトを使用して微調整しようとしている rQuotes というモジュールをダウンロードしてインストールしました。最初に、default.php をテンプレート ディレクトリの html の下にある適切なフォルダー mod_rquotes にコピーし、その名前を testimonials.php に変更して、変更を加えました。代替レイアウトは管理画面に正しく表示されますが、選択すると代替レイアウトは使用されず、代わりに default.php レイアウトが使用され続けます。

記事のテンプレートに関するメモに従って、mod_rquotes.xml をコピーして testimonials.xml と呼んでみましたが、効果はありませんでした。モジュールのどこでもコンポーネントを使用してモジュールを記事に直接ドロップするようにモジュールを配置しているため、メニューの制限が影響することはないと思います。

リクエストによる mod_rquotes.php:

<?php

 /**
 * Rquotes main file
 * 
 * @package    Joomla.Rquotes
 * @subpackage Modules
 * @link www.mytidbits.us
 * @license     GNU/GPL-2
 */

 //no direct access
defined('_JEXEC') or die('Restricted access'); 
if(!defined('DS')){
define('DS',DIRECTORY_SEPARATOR);
error_reporting(0);
}

    //include helper file   
    require_once(dirname(__FILE__).DS.'helper.php'); 

$source=$params->get('source');
//text file params
$filename=$params->get('filename','rquotes.txt');
$randomtext=$params->get('randomtext');
//database params
$style = $params->get('style', 'default'); 
$category=$params->get('category','');
$rotate = $params->get('rotate');
$num_of_random= $params->get('num_of_random');


switch ($source) 
{
case 'db':
if($rotate=='single_random')
{

 $list = modRquotesHelper::getRandomRquote($category,$num_of_random);

}


elseif($rotate=='multiple_random')
{

 $list = modRquotesHelper::getMultyRandomRquote($category,$num_of_random);

}
elseif($rotate=='sequential') 

{

    $list = modRquotesHelper::getSequentialRquote($category);

}
elseif($rotate=='daily')
{

$list= getDailyRquote($category);


}

elseif($rotate=='weekly')
{

    $list= getWeeklyRquote($category);

}
elseif($rotate=='monthly')
{

    $list= getMonthlyRquote($category);

}
elseif($rotate=='yearly')
{

    $list= getYearlyRquote($category);

}
//start
elseif($rotate=='today')
{

    $list= getTodayRquote($category);

}

//end
require(JModuleHelper::getLayoutPath('mod_rquotes', $style,'default'));
break;

case 'text':
if (!$randomtext)
{
$list=getTextFile($params,$filename);
}
else
{
$list=getTextFile2($params,$filename);
}
break;
default:
echo('Please choose a text file and Daily or Every page load and save it to display information.');


}
?> 
4

1 に答える 1

0

このモジュールにはバグがあります。それだけです。textfileソースとしてテキストファイルを使用している場合、コードを見ると、ヘルパーのレイアウトにレイアウトがハードコーディングされています。データベースをソースとして使用している場合は、改善されません。モジュールのクロム(スタイル)設定を取得し、これをレイアウトに適用しているように見えますが、これも失敗するはずです。

個人的には、このモジュールはひどく書かれているので使用しません。ただし、必要な場合は、テンプレートでテキストファイルのレイアウトを独自のものでオーバーライドできます。ファイルにも名前textfile.phpを付けて変更を加えると、機能します。

于 2013-10-19T19:09:38.673 に答える