OS Property support center

[SOLVED] few mod_ospropertysearch custom fields

  • Ng Hong Tien
  • Topic Author
  • Offline
  • New Member
  • New Member
More
11 years 1 month ago - 11 years 1 month ago #43067 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 !
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
  • New Member
More
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.

More
11 years 1 month ago #43071 by Mr. Dam
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

Please Log in or Create an account to join the conversation.

  • Ng Hong Tien
  • Topic Author
  • Offline
  • New Member
  • New Member
More
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 ?
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
  • New Member
More
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 !!!!

Please Log in or Create an account to join the conversation.

Moderators: Mr. DamNguyen Phu Quan