Support Forums

CustomCats module and search

This is a discussion on CustomCats module and search within the Technical Support forums, part of the Technical Support Forums category; Hi, I have a customcats template for category cars, but when I search by category cars, I got the results ...


Go Back   68 Classifieds Forums > Technical Support Forums > Technical Support

This topic is resolved.

If you have a similar issue that this thread does not address, open a new related support topic.

 
Thread Tools Display Modes
Old 07-14-2009, 12:38 PM   #1
Customer
 
Join Date: Jun 2009
Posts: 127
Rep Power: 7
pipelin is on a distinguished road
Default CustomCats module and search

Hi,

I have a customcats template for category cars, but when I search by category cars, I got the results on showlistings.tpl.

I'm trying to direct the category cars to my customcats template "showcarlistings.tpl" on the searchresults.php, but I'm doing something wrong in the code. This is I have:

$class_tpl->assign('sDisCity',$canViewSearchCity);
$class_tpl->assign('sDisState',$canViewSearchState);
$class_tpl->assign('sDisCountry',$canViewSearchCountry);
$class_tpl->assign('file', 'searchresults.php');
if($settings['sTemplate']==1)
If($cat['id']==3) //3 is categoryID for cars
{
$class_tpl->assign('body','showcarlistings.tpl'); //custom template for cars
}
else
{
$class_tpl->assign('body','showlistings.tpl');

}
else
{
$class_tpl->assign('body','showlistings2.tpl');
}
$modules->call_hook('search_end', ''); // Call any module functions
$class_tpl->displayTemplate();
$db->disconnect();


Can somebody help me, please?
pipelin is offline  
Old 07-14-2009, 01:03 PM   #2
68 Classifieds Staff
 
Eric Barnes's Avatar
 
Join Date: Mar 2006
Location: Belmont, NC
Posts: 5,471
Rep Power: 130
Eric Barnes is just really nice Eric Barnes is just really nice
Default

Try this. Change:
If($cat['id']==3) //3 is categoryID for cars
to:
if(isset($_GET['type']) && $_GET['type'] == 3)
__________________
Eric Barnes
68 Classifieds Developer
Customer Area | Issue Tracker | Documentation | 68C Mods | 68 @ Twitter | My Modules
Eric Barnes is online now  
Old 07-14-2009, 01:32 PM   #3
Customer
 
Join Date: Jun 2009
Posts: 127
Rep Power: 7
pipelin is on a distinguished road
Default

Hi Eric,

I think it works, But now I got this Warning: Smarty error: unable to read resource: "showcarlistings.tpl" .

I checked the spelling and is right.
pipelin is offline  
Old 07-14-2009, 01:35 PM   #4
68 Classifieds Staff
 
Eric Barnes's Avatar
 
Join Date: Mar 2006
Location: Belmont, NC
Posts: 5,471
Rep Power: 130
Eric Barnes is just really nice Eric Barnes is just really nice
Default

It would be something like:
$class_tpl->assign('body','modules/customcats/templates/showcarlistings.tpl');
__________________
Eric Barnes
68 Classifieds Developer
Customer Area | Issue Tracker | Documentation | 68C Mods | 68 @ Twitter | My Modules
Eric Barnes is online now  
Old 07-14-2009, 02:17 PM   #5
Customer
 
Join Date: Jun 2009
Posts: 127
Rep Power: 7
pipelin is on a distinguished road
Default

I tried this:


$class_tpl->assign('body','modules/customcats/templates/showcarlistings.tpl');

and this:

$class_tpl->assign('body','modules/customcats/templates/cattemplates/showcarlistings.tpl');

but I got the same
* Warning: Smarty error: unable to read resource: "modules/customcats/templates/showcarlistings.tpl"
* Warning: Smarty error: unable to read resource: "modules/customcats/templates/cattemplates/showcarlistings.tpl"

I checked the file name again and the spelling is right, also the path is right too.
pipelin is offline  
Old 07-14-2009, 07:52 PM   #6
Customer
 
Join Date: Jun 2009
Posts: 127
Rep Power: 7
pipelin is on a distinguished road
Default

Hi Eric,

It works right if I put the template in dir: templates/default/. I don't why isn't following the path.
pipelin is offline  
Old 07-14-2009, 09:37 PM   #7
68 Classifieds Staff
 
Eric Barnes's Avatar
 
Join Date: Mar 2006
Location: Belmont, NC
Posts: 5,471
Rep Power: 130
Eric Barnes is just really nice Eric Barnes is just really nice
Default

I just released a new update on this module to do this automatically:
Custom Cats v2.2 released
__________________
Eric Barnes
68 Classifieds Developer
Customer Area | Issue Tracker | Documentation | 68C Mods | 68 @ Twitter | My Modules
Eric Barnes is online now  
Old 07-15-2009, 09:24 AM   #8
Customer
 
Join Date: Jun 2009
Posts: 127
Rep Power: 7
pipelin is on a distinguished road
Default

Thanks Eric, it works perfect!!!

This is something else, I inserted a new extrafield in the showcarlisting, but I can't get it sorts right, this is the code:

<th scope="col"><a rel="nofollow" href="{$file}?{$querystring_fid}" class="sortheader">Kilometre</a> {if $sqlsort=="fid"}<img src="templates/{$smarty.const.MAIN_TEMPLATE}/images/sort{$oppositesort}.gif" border="0" alt="Sort" />{/if}</th>

Also, if the field is a Featured Listing it remains in white color.
pipelin is offline  
Old 07-15-2009, 12:29 PM   #9
68 Classifieds Staff
 
Eric Barnes's Avatar
 
Join Date: Mar 2006
Location: Belmont, NC
Posts: 5,471
Rep Power: 130
Eric Barnes is just really nice Eric Barnes is just really nice
Default

Extra fields can be sorted. It just isn't possible with all the joins in the query.
__________________
Eric Barnes
68 Classifieds Developer
Customer Area | Issue Tracker | Documentation | 68C Mods | 68 @ Twitter | My Modules
Eric Barnes is online now  
Old 07-15-2009, 08:50 PM   #10
Customer
 
Join Date: Jun 2009
Posts: 127
Rep Power: 7
pipelin is on a distinguished road
Default

I found the query in listing.php

code
HTML Code:
$sSQL = "SELECT p.id, p.owner, p.title, p.featured, p.section, p.shortDescription, p.description, p.price, p.dateadded, p.expiration, p.display, p.pHighlighted, p.pBold, p.hitcount, p.url, u.username, u.state, u.city, u.country ". $select ." FROM ".PREFIX."listings AS p LEFT JOIN ".PREFIX."users AS u ON p.owner = u.id " . $joins;
I wonder how insert the extrafield there (kilometres ID=9).

Some advice, I'm not programer.
pipelin is offline  
Closed Thread

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Search Module seymourjames Modification Release 9 03-10-2009 05:05 PM
search module Bronxgodzilla Modules / Plugins / Modifications 2 02-27-2009 03:19 AM
US Zip Code Search module rvanwagoner Modules / Plugins / Modifications 1 09-16-2008 06:35 PM
Maffo Search Module - Problem Help Needed bowers01 Technical Support 2 09-11-2008 02:41 AM
US Zip Code Search module for 68classifieds v4 vissa Technical Support 2 03-12-2008 08:32 AM


All times are GMT -4. The time now is 01:35 PM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0