Tag Archives: field

How to define specific field as required?

This is currently possible with customization only, but something like that is also on todo list so will be available in future.

For frontend property submission customization can be added to:
templates\bootstrap2-responsive\editproperty.php, lines around 380.
Most simple example can be found here:

Andif you want for specific ID, then you can use something like this:
<?php echo ($val_option['id']==5)?'required':''; ?>

Add field / option manually via phpmyadmin

If you accidentally remove red locked option from the database and now you need it… Now can be added via phpMyAdmin only, SQL queries:

To add option:

INSERT INTO `option` (`id` ,`parent_id` ,`order` ,`type` ,`visible` ,`is_locked` ,`is_frontend` ,`is_hardlocked`
) VALUES ('4', '0', NULL , 'DROPDOWN', '1', '1', '1', '1')

To add translations for option:

INSERT INTO `option_lang` (`option_id`, `language_id`, `option`, `values`, `prefix`, `suffix`) VALUES
(4, 1, 'Purpose', 'Sale,Rent,Sale and Rent', NULL, ''),
(4, 2, 'Namjena', 'Prodaja,Najam,Prodaja i najam', NULL, '');

In this example we adding ID #4,  and 1,2 was languages ID.

Another example for translation with just one language:

INSERT INTO `option_lang` (`option_id`, `language_id`, `option`, `values`, `prefix`, `suffix`) VALUES
(8, 1, 'Short description', '', NULL, '');

In this example we adding ID #8,  and 1 was languages ID because now we have only one language.

By ID of course we mean original field ID which you need to restore.

example query for listing category in classified script:

Category have ID field 79, so based on guide add field with id 79 manually, type is TREE
example query:
INSERT INTO `option` (`id` ,`parent_id` ,`order` ,`type` ,`visible` ,`is_locked` ,`is_frontend` ,`is_hardlocked`
) VALUES ('79', '0', NULL , 'TREE', '1', '1', '1', '1')

To add translations for option:

INSERT INTO `option_lang` (`option_id`, `language_id`, `option`, `values`, `prefix`, `suffix`) VALUES
(79, 1, 'Listing Category', '', NULL, '');


How to add custom field to property preview page?

First you should add new field via your administration:
Admin->Real estate->Fields (You can see # part there, what is field ID)

Then you should add it to your template file property.php


Where # represents field id / key of option

You can also use alternative PHP syntax, for example:

<?php if(!empty($estate_data_option_#))echo $estate_data_option_#; ?>

More details are available in documentation:


To add new category, most simple way is to just copy example code from another category and modify by your needs.

Or use this code example:


    $category_id = 1;


<?php if(isset(${"category_options_$category_id"}) && ${"category_options_count_$category_id"}>0): ?>
<h3 class="page-header"><?php echo ${"options_name_$category_id"} ?></h3>
<div class="property-amenities clearfix">
        <?php foreach(${"category_options_$category_id"} as $key=>$row): ?>
        <?php if(!empty($row['option_value'])): ?>
            <?php if(count($row['is_text']) > 0): ?>
            <div class="panel-row"> 
                <p class="bottom-border"><strong><?php _che($row['option_name']); ?>:</strong> <span><?php echo _che($row['option_prefix']); ?> <?php echo _che($row['option_value']); ?> <?php echo _che($row['option_suffix']); ?></span><br style="clear: both;" /></p>
            <?php elseif(count($row['is_dropdown']) > 0): ?>
            <div class="panel-row"> 
                <p class="bottom-border"><strong><?php _che($row['option_name']); ?>:</strong> <span class="label label-success"><?php echo _che($row['option_prefix']); ?> <?php echo _che($row['option_value']); ?> <?php echo _che($row['option_suffix']); ?></span><br style="clear: both;" /></p>
            <?php endif; ?>
        <?php endif; ?>
        <?php endforeach; ?>
</div><!-- /.property-amenities -->
<?php endif; ?>

How to add custom field to registration form?

New script version (>= 1.6.0) support custom fields for user registration:
For serious customization’s, Programming skills required, or you can contact me for this customization (cost additionaly)!
1. Add field to database table ‘user’
2. Add rules for that field in application\models\user_m.php, line 11, into array variable: $rules_admin
3. Add field to: application\controllers\admin\user.php, line around 162 into:
$data = $this->user_m->array_from_post(array(…
Same thing in: application\controllers\frontend.php, line 642, 1103, 1670 (three times)
4. Add field to: application\views\admin\user\edit.php, oko linije 180
5. Add field to: templates\bootstrap2-responsive\login.php, around line 250
5. Add field to: templates\bootstrap2-responsive\myprofile.php, around line 140