Date: 2007-03-01 19:54
Posted By: Laurentiu Traineanu (neis)
This is how I implemented a 'noerror' parameter:
1. I modified the file Banners.module.php by adding the following code in the
function definition for _DisplayErrorPage
if ( isset($params['noerror']) && $params['noerror'] == true )
{
$this->smarty->assign('noerror', 'true');
}
2. I modified the file error.tpl like this:
{if $noerror == true}
{else}
<h3>{$title_error}</h3>
<p>{$admin_nav}</p>
{if $message!=''}<p>{$message}</p>{/if}
{/if}
3. in my CMS templates, I add the parameter noerror=true like this:
<div id="pagepicture">{cms_module module='Banners'
category='My_Banners_Category' name='my_banner_name' noerror=true}
Date: 2007-03-01 20:02
Posted By: Laurentiu Traineanu (neis)
A related bug fix that I had to do so the above modification is this change in
file action.default.php
1. Find the following code:
// query worked, but no results, now what do we do
// for debug purposes, return an error
$this->_DisplayErrorPage ($id, $params, $returnid,
$this->Lang ('error_noresults'));
echo "</br>$query</br>";
return;
2. and replace it with:
// query worked, but no results, now what do we do
// for debug purposes, return an error
$this->_DisplayErrorPage ($id, $params, $returnid,
$this->Lang ('error_noresults')."</br>".$query."</br>");
return;
Note: this change moves the display of the $query inside the function call so is
consistent with the rest.