|
|
#1 |
|
Moderator
|
Here is the mod orginally created by Eric and Lhotch pre-crash. I had another request for it and decided to make it a little more user friendly.
This mod allows for the display of up to 4 fields (more if you manually add them to the files) on the searchresults.php search results, category.php category ad results, and top/new/featured listings results from toplistings.php. I made another table in the database which has a file to install/remove the table. To install you basically upload the files, navigate to the install page, and open the admin page to select the fields you wish to be globably displayed. You can also uninstall the mod by going to the remove link, deleteing the new mod files, and restoring your original files. I've made it from 3.0.15 Developer files and did a brief test. I am pretty sure I have fixed all the bugs but be sure to post here if you find any. The readme is pretty complete but if you have any questions fire away. custom-fields-showlisting.zip
__________________
John Snyder PHP Developer |
|
|
|
|
#2 |
|
Junior Member
Join Date: Apr 2006
Posts: 10
Rep Power: 14 ![]() |
Hi John. . .
Is this something I should download? |
|
|
|
|
#3 |
|
Moderator
|
Not unless you'd like. It is just the setup you have which is controlled by an admin area instead of manually adding the numbers after looking in the field ids in the database.
The only difference is an admin area where you see a list of the fields availible and you can select as many as you'd like and then these are added to all the files automatically. It is only setup to handle four fields as your's is, however if they want to add in more they just have to make the same change to 3 files.
__________________
John Snyder PHP Developer |
|
|
|
|
#4 |
|
Junior Member
Join Date: Apr 2006
Posts: 2
Rep Power: 0 ![]() |
John,
I have a question regarding your mod. I am looking for a way to add field to the search are. These fields are "Extra Fields" that I have added, to give crucial info and narrow down searches. Will your mod allow this? For now, I don't see a way to add Extra Fields to the Search.php screen. Thanks in advance. OS |
|
|
|
|
#5 |
|
Moderator
|
This mod is for displaying the results - it doesn't really have anything to do with the search criteria, just the way the results are displayed.
It's late here, let me get back to you on the extra fields for search in the am.
__________________
John Snyder PHP Developer |
|
|
|
|
#6 |
|
Moderator
|
By extra fields you are referring to fields created via the admin panel. You'd like to be able to search one or all of these fields?
You would have to create the select/text/check boxes on search.tpl.php Then in searchresults.php you will have to modify the query to include these in the search. What exactly do you have in mind?
__________________
John Snyder PHP Developer |
|
|
|
|
#7 |
|
Junior Member
Join Date: Apr 2006
Posts: 6
Rep Power: 0 ![]() |
Hi John,
Thanks for the Mod, I did install it and it is asking me for a file that I could not find in the folder I downloaded. administration/cfsmodform.tpl.php here is the error: Warning: Smarty error: unable to read resource: "administration/cfsmodform.tpl.php" in /home/apartmen/public_html/includes/template/Smarty.class.php on line 1095 TIA Fernando |
|
|
|
|
#8 |
|
Moderator
|
sorry about that
, I added the wrong template file. I've replaced the zip so it's in there now. upload/templates/administration/cfsmodform.tpl.php. You can just upload the file your missing. If you find any more problems let me know.
__________________
John Snyder PHP Developer |
|
|
|
|
#9 |
|
Junior Member
Join Date: Apr 2006
Posts: 6
Rep Power: 0 ![]() |
Mod works perfect!!
Thanks John, One question: to change the order of the extra fields before the regular fields which file do I have to modify. e.g. I have state, country and then city (city is the extra field). I need to place city, state and country in that order. Thanks |
|
|
|
|
#10 |
|
Moderator
|
They should be displayed in the order the fields where created. I set this up originally to be added on after the fields where created in order they were going to be displayed. Thinking about it now, that probably wasn't such a hot idea.
templates/default/showlistings.tpl.php is the page you need to alter. There are two sections, the title and body for the fields. If you know how many fields you are displaying you can manually enter the names of these fields for the title section and then just move around the 1,2,3,4 (which are in the same order as displayed where you choose them). fields' title section of showlistings.tpl.php, find: HTML Code:
{foreach from=$field_names item="entry"}
<th>{$entry.fName}</th>
{/foreach}
HTML Code:
<th>some title 1</th> <th>some title 2</th> <th>some title 3</th> <th>some title 4</th> HTML Code:
{if $entry.one<>""}
<td{if $entry.class<>""} class="{$entry.class}"{/if}>{$entry.one}</td>
{/if}
{if $entry.two<>""}
<td{if $entry.class<>""} class="{$entry.class}"{/if}>{$entry.two}</td>
{/if}
{if $entry.three<>""}
<td{if $entry.class<>""} class="{$entry.class}"{/if}>{$entry.three}</td>
{/if}
{if $entry.four<>""}
<td{if $entry.class<>""} class="{$entry.class}"{/if}>{$entry.four}</td>
{/if}
__________________
John Snyder PHP Developer |
|
|
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Where is the custom field search function? | MrSpandex | v3.1 Modules & Modifications | 3 | 12-08-2006 06:33 PM |
| viewlistings and custom fields | summer | v3.1 Modules & Modifications | 16 | 10-04-2006 03:44 AM |
| Ad Preview, Search Custom Fields, and more | summer | v3.1 Suggestions and Feedback | 1 | 08-09-2006 02:24 PM |
| Search Ranges on Custom Fields | philmaw | v3.1 Questions & Support | 2 | 08-03-2006 07:55 AM |