68 Classifieds Forums  

Go Back   68 Classifieds Forums > v3.0.x Help & Support > v3.0 Modifications
Register Projects FAQ Members List Calendar Search Today's Posts Mark Forums Read

v3.0 Modifications Post any modifications you have done to 68 Classifieds Source. Please note these are not supported by 68 Classifieds, and may make future updates more difficult.

 
Thread Tools Display Modes
  #31  
Old 08-27-2006, 03:50 PM
juven14 juven14 is offline
Moderator
 
Join Date: Mar 2006
Location: NJ/NYC Area
Posts: 1,875
Default

By items do you mean categories, right?

Dropdown:

Category:
Homes
Cars
Boats


States:
NJ
NY
TX
TN

Also which version are you using, 3.1.5 Developer?
__________________
Regards,

John
mods.auscity.com
v3.1.7 Developer

�By perseverance, study, and eternal desire, any man can become great.� George S. Patton
Reply With Quote
  #32  
Old 08-27-2006, 03:58 PM
dankellaway dankellaway is offline
Junior Member
 
Join Date: Aug 2006
Posts: 14
Default

sorry, yes you are right.. so a dropdown list for each to search by
Reply With Quote
  #33  
Old 08-27-2006, 03:59 PM
juven14 juven14 is offline
Moderator
 
Join Date: Mar 2006
Location: NJ/NYC Area
Posts: 1,875
Default

Ok, give me about 5 more min
__________________
Regards,

John
mods.auscity.com
v3.1.7 Developer

�By perseverance, study, and eternal desire, any man can become great.� George S. Patton
Reply With Quote
  #34  
Old 08-27-2006, 04:12 PM
juven14 juven14 is offline
Moderator
 
Join Date: Mar 2006
Location: NJ/NYC Area
Posts: 1,875
Default

Ok, on the template you want these to be display place this:
HTML Code:
<form name="search" id="search" method="get" action="searchresults.php">
<table>
    <tr>
        <td>
            <select name="type" id="type">
                <option value=''>{$smarty.const.LANG_SEARCH_ALLCAT}</option>
                {search_category}
            </select>
        </td>
    </tr>
    <tr>
        <td>
            <select name="state" id="state">
                <option value=''>{$smarty.const.LANG_SEARCH_ALLCAT}</option>
                {search_states}    
            </select>
        </td>
    </tr>
    <tr>
        <td><input type="submit" name="Submit" value="{$smarty.const.LANG_SEARCH_BUTTON}" /></td>
    </tr>
</table>
</form>
Then you need to create these 2 plugins and place them in the plugin folder. For 3.1.5 the path is includes/classes/smarty/plugins

create this file and name it: function.search_category.php
PHP Code:
<?PHP
function smarty_function_search_category(){
    global
$db;
    
$arr = array();
    
$sSQL="SELECT id,parent_id,name FROM ".PREFIX."categories WHERE parent_id='0' ORDER BY cOrder";
    
$result=$db->query($sSQL);
    while(
$row = $result->fetch())
    {
        
$row['name'] = $prefix . $row['name'];
        
array_push($arr, $row);
        
$arr = array_merge($arr, cat_tree(""."  » ", $row['id']));
    }
         
     
$loop_count = count($arr);
     for (
$x=0; $x<$loop_count; $x++)
         {
            
$output.="<option value=". $arr[$x][id] .">". $arr[$x][name] ."</option>\n";
         }
    
    return
$output;
}
?>
create this file and name it: function.search_states.php
PHP Code:
<?PHP
function smarty_function_search_states(){
global
$db;
  
$sSQL="SELECT name FROM ".PREFIX."states ORDER BY name ASC";
  
$result=$db->query($sSQL);
  while(
$rs=$result->fetch()){
    
    
$output .= '<option value="'.$rs['name'].'">'.$rs['name'].'</option>\n';
    
  }
  return
$output;
}
?>
Then upload the template and the 2 plugins.
__________________
Regards,

John
mods.auscity.com
v3.1.7 Developer

�By perseverance, study, and eternal desire, any man can become great.� George S. Patton
Reply With Quote
  #35  
Old 08-27-2006, 04:13 PM
dankellaway dankellaway is offline
Junior Member
 
Join Date: Aug 2006
Posts: 14
Default

Thanks for your help John i'll give it a go
Reply With Quote
  #36  
Old 08-27-2006, 09:46 PM
spaceboy spaceboy is offline
Member
 
Join Date: Aug 2006
Posts: 85
Default

The search works well; however, I'd like to take it a step further and add some sort of acknowledgement... currently, once the search button is pressed, the text search field goes blank and there is nothing saying what was searched and # of results.

I'd ideally like to do two things:

1. Have the "search text" field remain entact even after someone presses the search button, instead of being erased. Often users will want to slightly alter or add to their search, or search the same text in different categories.

2. Some sort of line acknowledging the text that was searched and the results found, like this example:
128 items found searching "antique furniture"

3. How do I align the search at the top & right of the layout page

Is this doable?

Last edited by spaceboy : 08-27-2006 at 10:11 PM.
Reply With Quote
  #37  
Old 09-11-2006, 10:19 AM
bgordon bgordon is offline
Senior Member
 
Join Date: Aug 2006
Location: Georgian Bay, Ontario Canada
Posts: 150
Default Where can I get this mod?

The link seems to be broken... or has this already been built into the latest version?
__________________
B.Gordon
v.3.1.5 Developer
www.canadaboatshopper.com
Canada Boat Shopper - Boats For Sale By Owner In And Around Canada
Reply With Quote
  #38  
Old 09-11-2006, 11:49 AM
juven14 juven14 is offline
Moderator
 
Join Date: Mar 2006
Location: NJ/NYC Area
Posts: 1,875
Default

I put up a new link in another post in this thread, or are you talking about the deal that I helped spaceboy with? If so all the code needed is also posted in this thread.

Here is a link to the post in this thread with the zip:
http://www.68classifieds.com/forums/...6&postcount=20

Here is the link to the post with the code in this thread:
http://www.68classifieds.com/forums/...8&postcount=34
__________________
Regards,

John
mods.auscity.com
v3.1.7 Developer

�By perseverance, study, and eternal desire, any man can become great.� George S. Patton
Reply With Quote
  #39  
Old 09-14-2006, 08:58 PM
dankellaway dankellaway is offline
Junior Member
 
Join Date: Aug 2006
Posts: 14
Default Item and total?

I wonder if you can help me out. I'm try to alter the code to include the total of each item at the end (i.e. dog (4), cat (9), rabbit (3) etc..). Would be very handy for those wanting to see if items were actually available in that section before selecting.

I need help on this. So far i've got:


PHP Code:

<?php
function smarty_function_search_category()
{
    global
$db;
    
$arr = array();
    
$sSQL="SELECT id,parent_id,name,total FROM ".PREFIX."categories WHERE parent_id='0' ORDER BY cOrder DESC";
    
$result=$db->query($sSQL);
    while(
$row = $result->fetch())
    {
    
        
$row['name'] = $prefix . $row['name'];
        
$row['total'] = $prefix . $row['total'];
        
array_push($arr, $row);
        
$arr = array_merge($arr, cat_tree(""."  » ", $row['id']));
    }
    
    
$output = "<option value=''>Search All</option>\n";
    
    
    
$loop_count = count($arr);
     for (
$x=0; $x<$loop_count; $x++)
         {
            
$output.="<option value=". $arr[$x][id] .">". $arr[$x]['name'] .' ('.total.') '."</option>\n";
         }
        
    return
$output;
}
?>
Reply With Quote
  #40  
Old 08-12-2007, 09:25 AM
MADKing MADKing is offline
Member
 
Join Date: Aug 2007
Location: Germany
Posts: 84
Default

Hi,

hope you cn help me.
How can I put the extra_search_fields into your little search module on the home.tpl ?

Thank you
Reply With Quote


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Quick SEO optimization for showlistings civ v3.1 Modifications 2 01-03-2007 09:26 AM
Search in Navigation bar marketingsolutions v3.1 Questions & Support 0 11-02-2006 12:10 PM
Aligning the "zip code," etc. search fields spaceboy v3.1 Modifications 5 09-09-2006 02:27 PM
Adding Search to sleepy HTML, CSS, and Design Help 8 04-09-2006 12:12 PM
Advanced Search Template sporthorsebreeder HTML, CSS, and Design Help 6 04-05-2006 04:25 PM


All times are GMT -4. The time now is 04:17 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2007, Jelsoft Enterprises Ltd.