|
|
#1 |
|
Member
Join Date: Jun 2009
Posts: 30
Rep Power: 1 ![]() |
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? |
|
|
|
|
|
#2 |
|
68 Classifieds Staff
Join Date: Mar 2006
Location: Belmont, NC
Posts: 5,049
Rep Power: 116 ![]() |
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 Please do not send me a private message asking for support. Instead use these open forums or our ticket system. Customer Area | Issue Tracker | Documentation | 68C Mods | Submit a Ticket | 68 @ Twitter | My Modules |
|
|
|
|
|
#3 |
|
Member
Join Date: Jun 2009
Posts: 30
Rep Power: 1 ![]() |
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. |
|
|
|
|
|
#4 |
|
68 Classifieds Staff
Join Date: Mar 2006
Location: Belmont, NC
Posts: 5,049
Rep Power: 116 ![]() |
It would be something like:
$class_tpl->assign('body','modules/customcats/templates/showcarlistings.tpl');
__________________
Eric Barnes 68 Classifieds Developer Please do not send me a private message asking for support. Instead use these open forums or our ticket system. Customer Area | Issue Tracker | Documentation | 68C Mods | Submit a Ticket | 68 @ Twitter | My Modules |
|
|
|
|
|
#5 |
|
Member
Join Date: Jun 2009
Posts: 30
Rep Power: 1 ![]() |
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. |
|
|
|
|
|
#6 |
|
Member
Join Date: Jun 2009
Posts: 30
Rep Power: 1 ![]() |
Hi Eric,
It works right if I put the template in dir: templates/default/. I don't why isn't following the path. |
|
|
|
|
|
#7 |
|
68 Classifieds Staff
Join Date: Mar 2006
Location: Belmont, NC
Posts: 5,049
Rep Power: 116 ![]() |
I just released a new update on this module to do this automatically:
Custom Cats v2.2 released
__________________
Eric Barnes 68 Classifieds Developer Please do not send me a private message asking for support. Instead use these open forums or our ticket system. Customer Area | Issue Tracker | Documentation | 68C Mods | Submit a Ticket | 68 @ Twitter | My Modules |
|
|
|
|
|
#8 |
|
Member
Join Date: Jun 2009
Posts: 30
Rep Power: 1 ![]() |
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. |
|
|
|
|
|
#9 |
|
68 Classifieds Staff
Join Date: Mar 2006
Location: Belmont, NC
Posts: 5,049
Rep Power: 116 ![]() |
Extra fields can be sorted. It just isn't possible with all the joins in the query.
__________________
Eric Barnes 68 Classifieds Developer Please do not send me a private message asking for support. Instead use these open forums or our ticket system. Customer Area | Issue Tracker | Documentation | 68C Mods | Submit a Ticket | 68 @ Twitter | My Modules |
|
|
|
|
|
#10 |
|
Member
Join Date: Jun 2009
Posts: 30
Rep Power: 1 ![]() |
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; Some advice, I'm not programer. |
|
|
|
| Bookmarks |
| 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 | v4 Questions & Support | 2 | 09-11-2008 02:41 AM |
| US Zip Code Search module for 68classifieds v4 | vissa | v4 Questions & Support | 2 | 03-12-2008 08:32 AM |