1

I downloaded and installed a module called rQuotes which I'm trying to tweak using an alternative layout. At first I just copied over the default.php to a appropriate folder mod_rquotes under html in my template directory, changed it's name to testimonials.php and made my changes. The alternative layout appears correctly in the admin but when selected, the alternative layout is not used, instead it continues to use the default.php layout.

Following some notes on article templates, I tried copying over the mod_rquotes.xml and calling it testimonials.xml but that had no effect. I'm placing the module using the modules anywhere component to drop it directly into an article so I don't think the menu restriction should have any effect.

The mod_rquotes.php by request:

<?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.');


}
?> 
Dylan Glockler
  • 1,115
  • 1
  • 20
  • 40
  • Can you copy mod_rqoutes.php file contents here? – di3sel Oct 17 '13 at 09:05
  • Sure thing - I added it to the original post - although, that should be as originally installed - I made no changes. Somewhat new to Joomla so trying to figure this all out! – Dylan Glockler Oct 20 '13 at 01:26

1 Answers1

0

This module is buggy, that's all. Looking at the code it does hardcode the layout to the textfile layout in its helper if you are using a textfile as source. If you're using the database as source it doesn't get better. It looks like it does get the module chrome (style) setting and applies this to the layout, which is bound to fail as well.

Personally I wouldn't use this module as it is written horrible. But if you need it you can just override the textfile layout with your own in your template. Name the file textfile.php as well and do your changes and it will work.

Bakual
  • 2,731
  • 1
  • 13
  • 16
  • I'm using the database option. Anyone know of a better quotes manager? I like the simplicity of this one - just categories and quotes. Although now that I think about it - what I'd love is one that lets me add categorized collections of items - like quotes or other lists of individually catalogued items. – Dylan Glockler Oct 20 '13 at 01:28
  • Try to override the default layout then. The database option didn't work for me due a wrong query or something. So I couldn't test this. – Bakual Oct 20 '13 at 09:28
  • Are you using K2? I noticed if I have K2 elements published then this module generates a SQL error in the list admin, but not in the category admin. Maybe that's the issue you had? – Dylan Glockler Oct 20 '13 at 19:43
  • Don't have K2. Just a Joomla testing enviroment. I'm sure I could have figured out what is wrong, but I only wanted to see what's wrong in your case, and it's obviously the buggy module :) – Bakual Oct 21 '13 at 10:40
  • Btw: You can try replacing `$style = $params->get('style', 'default'); ` with `$style = $params->get('layout', 'default');`. Maybe that works then. – Bakual Oct 21 '13 at 10:42