Re:Errors occurring...
Sunday, 04 January 2009 10:59
I fixed the errors by adding in quite a few logic statements into the code so that there would be a check as to whether descriptions, thumbnails, etc. are set to yes or no.
in helper.php, starting at line 96 changed:
if($group){
foreach($rows as $row){
$temp[$row->catid][''title''] = $row->cattitle;
$temp[$row->catid][''description''] = $row->catdescription;
$temp[$row->catid][''image''] = $row->image;
$row->link = JRoute::_( ''index.php?option=com_weblinks&view=weblink&catid=''.$row->catslug.''&id=''. $row->slug);
$row->thumbnail = '''';
JWebLink_Information::makeThumbnail($row, $thumbAPI, $width, $height, $snapcasacode, $snapcasasize);
$temp[$row->catid][''list''][] = $row;
}to
if($group){
foreach($rows as $row){
$temp[$row->catid][''title''] = $row->cattitle;
if ($params->get(''showcatdesc'', 1)){
$temp[$row->catid][''description''] = $row->catdescription;
}
if ($params->get(''showcatimage'', 1)){
$temp[$row->catid][''image''] = $row->image;
}
$row->link = JRoute::_( ''index.php?option=com_weblinks&view=weblink&catid=''.$row->catslug.''&id=''. $row->slug);
if($params->get(''showthumb'', 1)){
$row->thumbnail = '''';
JWebLink_Information::makeThumbnail($row, $thumbAPI, $width, $height, $snapcasacode, $snapcasasize);
}
$temp[$row->catid][''list''][] = $row;
}and in default.php, starting at line 81, changed:
<a href="<?php echo $link->link; ?>" title="<?php echo $link->title; ?>" target="<?php echo $weblinkparams[''target'']; ?>">
<?php echo $link->thumbnail. $link->title. $hits;?>
</a>to:
<a href="<?php echo $link->link; ?>" title="<?php echo $link->title; ?>" target="<?php echo $weblinkparams[''target'']; ?>">
<?php if ($weblinkparams[''showthumb'']){
echo $link->thumbnail. $link->title. $hits;
}
echo $link->title. $hits;?>
</a>