OS Property support center

SOLVED !!! Showing unique system property ID

  • Z Eshel
  • Topic Author
  • Offline
  • New Member
  • New Member
More
10 years 6 months ago - 10 years 6 months ago #58320 by Z Eshel
Hi,

Working on a site that uses OS Property extension.
Would like to display the unique property ID that is generated automatically by the system for every property entry and show it on the front end. What code do I need to add? / where? - any tips to get me started would be great.

Tnx
Last edit: 10 years 6 months ago by Dang Thuc Dam.

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

More
10 years 6 months ago #58337 by Dang Thuc Dam
Replied by Dang Thuc Dam on topic Showing unique system property ID on the front end
Hi,
The Property ID is auto-increasement field. So i think you want to mention to the Ref field. So the solution here is making the modification on function "save property details" to set the Ref field = Property ID.
Thanks
Dam

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

More
10 years 6 months ago #58534 by cora
Hi Dam,

I need same feature (display an automatic ref number to all properties)

where I could modify settings, you mentioned:
""save property details" to set the Ref field = Property ID"

Thanks!
Frank

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

More
10 years 6 months ago #58535 by Dang Thuc Dam
Replied by Dang Thuc Dam on topic Showing unique system property ID on the front end
To make the Ref field is Property ID, please following these steps
1. Open file
components > com_osproperty > classes > listing.php
and
administrator > components > com_osproperty > classes > property.php
2. find
if($isNew == 1){
$id = $db->insertID();
JFolder::create(JPATH_ROOT.DS."images".DS."osproperty".DS."properties".DS.$id);
JFolder::create(JPATH_ROOT.DS."images".DS."osproperty".DS."properties".DS.$id.DS."thumb");
JFolder::create(JPATH_ROOT.DS."images".DS."osproperty".DS."properties".DS.$id.DS."medium");

and add this bellow

$db->setQuery("Update #__osrs_properties set ref = '$id' where id = '$id'");
$db->query();

Good luck
Dam

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

More
10 years 6 months ago #58536 by cora
Thank you for your very fast answer!

Thanks!

Frank!

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

Moderators: Dang Thuc DamNguyen Phu Quan