- Posts: 17
- Thank you received: 0
OS Property support center
[SOLVED] few mod_ospropertysearch custom fields
- Ng Hong Tien
- Topic Author
- Offline
- New Member
-
Less
More
11 years 1 month ago - 11 years 1 month ago #43067
by Ng Hong Tien
[SOLVED] few mod_ospropertysearch custom fields was created by Ng Hong Tien
Hi Dang
need to have
mod_ospropertysearch
mod_ospropertysearch01
mod_ospropertysearch03
so that
mod_ospropertysearch only shows custom field 1
mod_ospropertysearch01 shows only custom field 2 and 3
mod_ospropertysearch03 shows only custom field 4 and 5
Please advise, thanks !
need to have
mod_ospropertysearch
mod_ospropertysearch01
mod_ospropertysearch03
so that
mod_ospropertysearch only shows custom field 1
mod_ospropertysearch01 shows only custom field 2 and 3
mod_ospropertysearch03 shows only custom field 4 and 5
Please advise, thanks !
Last edit: 11 years 1 month ago by Ng Hong Tien.
Please Log in or Create an account to join the conversation.
- Ng Hong Tien
- Topic Author
- Offline
- New Member
-
Less
More
- Posts: 17
- Thank you received: 0
11 years 1 month ago #43069
by Ng Hong Tien
Replied by Ng Hong Tien on topic few mod_ospropertysearch to display custom fields
i have tried to change the XML and installed mod_osperpertysearch01 but it came out blank

Please Log in or Create an account to join the conversation.
- Mr. Dam
-
- Offline
- Administrator
-
Less
More
- Posts: 13059
- Thank you received: 1696
11 years 1 month ago #43071
by Mr. Dam
Replied by Mr. Dam on topic few mod_ospropertysearch to display custom fields
Hi Tien,
Solution is bellow
1. Add new configure parameter into search form, for example, field IDs (name: field_ids), it contains Id of extra fields, seperated by ,
2. Hack into OS Property search module
modules > mod_ospropertysearch > mod_ospropertysearch.php
find
if($show_customfields == 1){
//checked do search through extra field
//get the list of the field groups
$user = JFactory::getUser();
if(intval($user->id) == 0){
$access_sql = " and `access` = '0'";
}else{
$access_sql = "";
}
$db->setQuery("Select * from #__osrs_fieldgroups where published = '1' $access_sql order by ordering");
$groups = $db->loadObjectList();
if(count($groups) > 0){
$extrafieldSql = array();
for($i=0;$i<count($groups);$i++){
$group = $groups[$i];
$db->setQuery("Select * from #__osrs_extra_fields where group_id = '$group->id' and published = '1' and searchable = '1' $access_sql order by ordering");
$fields = $db->loadObjectList();
$group->fields = $fields;
}
}
}
replace by
$field_ids = $params->get('field_ids','');
if($show_customfields == 1){
//checked do search through extra field
//get the list of the field groups
$user = JFactory::getUser();
if(intval($user->id) == 0){
$access_sql = " and `access` = '0'";
}else{
$access_sql = "";
}
$extra_sql = "";
if($field_ids != ""){
$extra_sql = " and id in ($field_ids)";
}
$db->setQuery("Select * from #__osrs_fieldgroups where published = '1' $access_sql order by ordering");
$groups = $db->loadObjectList();
if(count($groups) > 0){
$extrafieldSql = array();
for($i=0;$i<count($groups);$i++){
$group = $groups[$i];
$db->setQuery("Select * from #__osrs_extra_fields where group_id = '$group->id' and published = '1' and searchable = '1' $access_sql $extra_sql order by ordering");
$fields = $db->loadObjectList();
$group->fields = $fields;
}
}
}
Good luck
Dam
Solution is bellow
1. Add new configure parameter into search form, for example, field IDs (name: field_ids), it contains Id of extra fields, seperated by ,
2. Hack into OS Property search module
modules > mod_ospropertysearch > mod_ospropertysearch.php
find
if($show_customfields == 1){
//checked do search through extra field
//get the list of the field groups
$user = JFactory::getUser();
if(intval($user->id) == 0){
$access_sql = " and `access` = '0'";
}else{
$access_sql = "";
}
$db->setQuery("Select * from #__osrs_fieldgroups where published = '1' $access_sql order by ordering");
$groups = $db->loadObjectList();
if(count($groups) > 0){
$extrafieldSql = array();
for($i=0;$i<count($groups);$i++){
$group = $groups[$i];
$db->setQuery("Select * from #__osrs_extra_fields where group_id = '$group->id' and published = '1' and searchable = '1' $access_sql order by ordering");
$fields = $db->loadObjectList();
$group->fields = $fields;
}
}
}
replace by
$field_ids = $params->get('field_ids','');
if($show_customfields == 1){
//checked do search through extra field
//get the list of the field groups
$user = JFactory::getUser();
if(intval($user->id) == 0){
$access_sql = " and `access` = '0'";
}else{
$access_sql = "";
}
$extra_sql = "";
if($field_ids != ""){
$extra_sql = " and id in ($field_ids)";
}
$db->setQuery("Select * from #__osrs_fieldgroups where published = '1' $access_sql order by ordering");
$groups = $db->loadObjectList();
if(count($groups) > 0){
$extrafieldSql = array();
for($i=0;$i<count($groups);$i++){
$group = $groups[$i];
$db->setQuery("Select * from #__osrs_extra_fields where group_id = '$group->id' and published = '1' and searchable = '1' $access_sql $extra_sql order by ordering");
$fields = $db->loadObjectList();
$group->fields = $fields;
}
}
}
Good luck
Dam
Please Log in or Create an account to join the conversation.
- Ng Hong Tien
- Topic Author
- Offline
- New Member
-
Less
More
- Posts: 17
- Thank you received: 0
11 years 1 month ago - 11 years 1 month ago #43073
by Ng Hong Tien
Replied by Ng Hong Tien on topic few mod_ospropertysearch to display custom fields
<field name="inputbox_width_site" type="text" size="4" default="150" label="Inputbox width size (px)" description="Please enter the width size (pixel) of the inputobx" />
<field name="show_advancesearchform" class="btn-group" type="radio" default="0" label="Show Search form in results" description="After selecting the search criteria, you will be redirected to advance search page. In the top of this page, do you want to show the search form.">
<option value="1">OS_SEARCH_YES</option>
<option value="0">OS_SEARCH_NO</option>
</field>
search form as in XML
using inputbox ?
am i getting close :S
how should i work on this ?
<field name="show_advancesearchform" class="btn-group" type="radio" default="0" label="Show Search form in results" description="After selecting the search criteria, you will be redirected to advance search page. In the top of this page, do you want to show the search form.">
<option value="1">OS_SEARCH_YES</option>
<option value="0">OS_SEARCH_NO</option>
</field>
search form as in XML
using inputbox ?
am i getting close :S
how should i work on this ?
Last edit: 11 years 1 month ago by Ng Hong Tien.
Please Log in or Create an account to join the conversation.
- Ng Hong Tien
- Topic Author
- Offline
- New Member
-
Less
More
- Posts: 17
- Thank you received: 0
11 years 1 month ago #43089
by Ng Hong Tien
Replied by Ng Hong Tien on topic few mod_ospropertysearch to display custom fields
ALL RIGHT !!
figure it out
you the BEST !!!!
figure it out
you the BEST !!!!
Please Log in or Create an account to join the conversation.
Moderators: Mr. Dam, Nguyen Phu Quan
Support
Documentation
Information
Copyright © 2025 Joomla Extensions by Joomdonation. All Rights Reserved.
joomdonation.com is not affiliated with or endorsed by the Joomla! Project or Open Source Matters.
The Joomla! name and logo is used under a limited license granted by Open Source Matters the trademark holder in the United States and other countries.
The Joomla! name and logo is used under a limited license granted by Open Source Matters the trademark holder in the United States and other countries.