Forum

Forum - DatingScript

Online dating software

You are not logged in.

#1 2019-10-08 14:39:29

tomlelab
Member
Registered: 2019-10-08
Posts: 2
Website

How to customize search results gallery view ?

Hi,
I would like to add the location in the search results, in gallery mode, just below the age. Also in other pages, like online users. I would also like to get rid of the gender which is generally obvious :-).
First I can't find the right place to do it, I tried in helpers/users , is it the right place to start ?
I just moved to DS, and have already read a lot on this forum to modify and customize a couple of things, so please bear with me !
Thanks for your help

Offline

#2 2019-10-09 05:07:28

moomoocow
Member
Registered: 2014-11-20
Posts: 809

Re: How to customize search results gallery view ?

Welcome to the DS Family TomLeLab.. You did the right thing moving here. Unfortunately I am the least knowledgeable here.. But I am sure someone will post something soon..

Offline

#3 2019-10-09 06:58:16

rdog
Member
Registered: 2016-02-20
Posts: 431

Re: How to customize search results gallery view ?

It's in applications/views/users/index-users.php try this to add city, make sure you save it in yourtemplate/users folder so you don't change it during a upgrade. you can take out what you don't need.
From this


<span class="user">
                            <?=users_helper::anchor($user, array('title' => $user['name']))?>
                        </span>

                        <? if ( isset($user['data_birthday']) && $user['data_birthday'] || isset($user['data_gender']) && $user['data_gender'] ): ?>
                            <span class="info"><?=(isset($user['data_gender']) && $user['data_gender'] ? current($user['data_gender']).(isset($user['data_birthday']) ? ', ' : '') : '').(isset($user['data_birthday']) ? date_helper::getYearsDiff($user['data_birthday']) : '')?></span>
                        <? else: ?>
                            <span class="info">&nbsp;</span>
                        <? endif; ?>
                        <? endif; ?>

To this

<span class="user">
                            <?=users_helper::anchor($user, array('title' => $user['name']))?>
                        </span>

                        <? if ( isset($user['data_birthday']) && $user['data_birthday'] || isset($user['data_gender']) && $user['data_gender'] ): ?>
                            <span class="info"><?=(isset($user['data_gender']) && $user['data_gender'] ? current($user['data_gender']).(isset($user['data_birthday']) ? ', ' : '') : '').(isset($user['data_birthday']) ? date_helper::getYearsDiff($user['data_birthday']) : '')?></span>
                        <? else: ?>
                            <span class="info">&nbsp;</span>
                        <? endif; ?>
                        <?= (isset($user['data_location_city']) && $user['data_location_city'] ? current($user['data_location_city']): '')?>
                        <br>
                      <? if ( $user['ip_country_id'] != 0 && $user['ip_country_id'] != 999 )

Last edited by rdog (2019-10-09 09:15:56)

Offline

#4 2019-10-10 06:45:32

tomlelab
Member
Registered: 2019-10-08
Posts: 2
Website

Re: How to customize search results gallery view ?

Thanks rdog, that's fantastic !

Offline

#5 2019-10-13 14:18:40

littlebit
Member
Registered: 2016-02-21
Posts: 414

Re: How to customize search results gallery view ?

@rdog
Can you explain the last line:
    <? if ( $user['ip_country_id'] != 0 && $user['ip_country_id'] != 999 )

Offline

#6 2019-10-13 18:38:43

rdog
Member
Registered: 2016-02-20
Posts: 431

Re: How to customize search results gallery view ?

littlebit wrote:

@rdog
Can you explain the last line:
    <? if ( $user['ip_country_id'] != 0 && $user['ip_country_id'] != 999 )

It's for showing the country flag

Offline

#7 2019-10-14 03:16:06

moomoocow
Member
Registered: 2014-11-20
Posts: 809

Re: How to customize search results gallery view ?

I have added it to templates/system/view/users/ .. cleared cache.. browser and DS..  but doesn't work.. It works if I replace the original file in applications/views/users/

Am I doing something wrong?

Also, Dog.. How do you show flags please?

Last edited by moomoocow (2019-10-14 03:42:05)

Offline

#8 2019-10-14 04:33:47

rdog
Member
Registered: 2016-02-20
Posts: 431

Re: How to customize search results gallery view ?

moomoocow wrote:

I have added it to templates/system/view/users/ .. cleared cache.. browser and DS..  but doesn't work.. It works if I replace the original file in applications/views/users/

Am I doing something wrong?

Also, Dog.. How do you show flags please?

It's template/users/ 
not   templates/system/view/users/
For flags
You need to make sure you select one of the options in geolocation and geocoding in the CP

Last edited by rdog (2019-10-14 04:42:46)

Offline

#9 2019-10-14 08:09:42

littlebit
Member
Registered: 2016-02-21
Posts: 414

Re: How to customize search results gallery view ?

rdog wrote:
littlebit wrote:

@rdog
Can you explain the last line:
    <? if ( $user['ip_country_id'] != 0 && $user['ip_country_id'] != 999 )

It's for showing the country flag

Thanks for your reply rdog, but Its  little confusing
If I understand it correctly,
OR we shoudl delete the last line because it is not part of the view
OR we should complete it/add another codeline to use it for displaying a country flag.
Correct ?

Offline

#10 2019-10-14 09:41:34

moomoocow
Member
Registered: 2014-11-20
Posts: 809

Re: How to customize search results gallery view ?

Thank you Mr. Brother RDog..

Offline

#11 2019-10-14 12:30:42

rdog
Member
Registered: 2016-02-20
Posts: 431

Re: How to customize search results gallery view ?

littlebit wrote:
rdog wrote:
littlebit wrote:

@rdog
Can you explain the last line:
    <? if ( $user['ip_country_id'] != 0 && $user['ip_country_id'] != 999 )

It's for showing the country flag

Thanks for your reply rdog, but Its  little confusing
If I understand it correctly,
OR we shoudl delete the last line because it is not part of the view
OR we should complete it/add another codeline to use it for displaying a country flag.
Correct ?

If you don't want to show the country flag delete it,
If you want to show the country flag,  leave it as is, that's it, I have no idea what you're talking about entering another code line.

Offline

#12 2019-10-15 16:30:42

littlebit
Member
Registered: 2016-02-21
Posts: 414

Re: How to customize search results gallery view ?

rdog wrote:

If you want to show the country flag,  leave it as is, that's it, I have no idea what you're talking about entering another code line.

Sorry, that line is just not working but needs some extra code lines, something like:

  <? if ( $user['ip_country_id'] != 0 && $user['ip_country_id'] != 999 )
    {
	echo geo_helper::getCountry($user['ip_country_id']);
    }
  ?>

Last edited by littlebit (2019-10-15 16:33:25)

Offline

#13 2019-10-15 19:05:27

rdog
Member
Registered: 2016-02-20
Posts: 431

Re: How to customize search results gallery view ?

littlebit wrote:
rdog wrote:

If you want to show the country flag,  leave it as is, that's it, I have no idea what you're talking about entering another code line.

Sorry, that line is just not working but needs some extra code lines, something like:

  <? if ( $user['ip_country_id'] != 0 && $user['ip_country_id'] != 999 )
    {
	echo geo_helper::getCountry($user['ip_country_id']);
    }
  ?>

I left a part off here it is.


<span class="user">
                            <?=users_helper::anchor($user, array('title' => $user['name']))?>
                        </span>

                        <? if ( isset($user['data_birthday']) && $user['data_birthday'] || isset($user['data_gender']) && $user['data_gender'] ): ?>
                            <span class="info"><?=(isset($user['data_gender']) && $user['data_gender'] ? current($user['data_gender']).(isset($user['data_birthday']) ? ', ' : '') : '').(isset($user['data_birthday']) ? date_helper::getYearsDiff($user['data_birthday']) : '')?></span>
                        <? else: ?>
                            <span class="info">&nbsp;</span>
                        <? endif; ?>
                      <?= (isset($user['data_location_city']) && $user['data_location_city'] ? current($user['data_location_city']): '')?>
                      <br>
                      <? if ( $user['ip_country_id'] != 0 && $user['ip_country_id'] != 999 )
{
    echo '<span class="icon-text" style="background-image:url(' . html_helper::baseURL('assets/images/system/flags/' . geo_helper::countryID2CountryCode($user['ip_country_id']) . '.svg') . ')">' . geo_helper::getCountry($user['ip_country_id']) . '</span>';
}
?>

Offline

Board footer