Support Forums


Go Back   68 Classifieds Forums > Help & Support > v4.1 Questions & Support

Notices

 
LinkBack Thread Tools Display Modes
Old 07-14-2009, 12:38 PM   #1
Member
 
Join Date: Jun 2009
Posts: 30
Rep Power: 1
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   Reply With Quote
Old 07-14-2009, 01:03 PM   #2
68 Classifieds Staff
 
 
Join Date: Mar 2006
Location: Belmont, NC
Posts: 5,049
Rep Power: 116
Eric Barnes is a jewel in the rough
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
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
Eric Barnes is offline   Reply With Quote
Old 07-14-2009, 01:32 PM   #3
Member
 
Join Date: Jun 2009
Posts: 30
Rep Power: 1
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   Reply With Quote
Old 07-14-2009, 01:35 PM   #4
68 Classifieds Staff
 
 
Join Date: Mar 2006
Location: Belmont, NC
Posts: 5,049
Rep Power: 116
Eric Barnes is a jewel in the rough
Default

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
Eric Barnes is offline   Reply With Quote
Old 07-14-2009, 02:17 PM   #5
Member
 
Join Date: Jun 2009
Posts: 30
Rep Power: 1
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   Reply With Quote
Old 07-14-2009, 07:52 PM   #6
Member
 
Join Date: Jun 2009
Posts: 30
Rep Power: 1
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   Reply With Quote
Old 07-14-2009, 09:37 PM   #7
68 Classifieds Staff
 
 
Join Date: Mar 2006
Location: Belmont, NC
Posts: 5,049
Rep Power: 116
Eric Barnes is a jewel in the rough
Default

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
Eric Barnes is offline   Reply With Quote
Old 07-15-2009, 09:24 AM   #8
Member
 
Join Date: Jun 2009
Posts: 30
Rep Power: 1
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   Reply With Quote
Old 07-15-2009, 12:29 PM   #9
68 Classifieds Staff
 
 
Join Date: Mar 2006
Location: Belmont, NC
Posts: 5,049
Rep Power: 116
Eric Barnes is a jewel in the rough
Default

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
Eric Barnes is offline   Reply With Quote
Old 07-15-2009, 08:50 PM   #10
Member
 
Join Date: Jun 2009
Posts: 30
Rep Power: 1
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   Reply With Quote

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


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


All times are GMT -4. The time now is 01:24 AM.


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