Forum

Forum - DatingScript

Online dating software

You are not logged in.

#1 2017-03-02 17:47:38

pzlpieces
Member
Registered: 2017-02-27
Posts: 20

Display Subscription

I'd like to display a member's subscription as part of their avatar, maybe right under it or something. I see that that when a user goes to their Settings, it displays there. I was hoping to figure out what's outputting that and maybe I can use that same variable to write an avatar override in the template.

Has anyone else attempted something like this? Any advice on where to look?

Offline

#2 2017-03-07 06:21:50

moomoocow
Member
From: Amsterdam
Registered: 2014-11-20
Posts: 845

Re: Display Subscription

You can display their membership status on all pages at the top..

We got this code from another poster on here (so we cannot take credit).. Tried to find the post but could not so will try and explain best possible..

Find the file view.php in the following folder.. /public_html/application/views/users

Find this code under the following (around line 12)..

<? view::load('users/elements/picture', array_merge($user, array('user_id' => 0, 'picture_file_name' => '', 'picture_file_suffix' => 'p'))); ?>
            <? endif; ?>
        </figure>

Then add this code directly below..

<? if ( $user['group_id'] == 5 ): // this is my group id admin ?>             
<b>Admin Member</b><BR><BR>
<?php elseif  ( $user['group_id'] == 2 ): // this is my group id paid ?>   
<IMG SRC="https://www.YOURSITE.com/layout_custom_img/vip.png" ALT="VIP MEMBER" > <b><FONT FACE="" SIZE="" COLOR="#ff0000"> VIP Member</FONT></b><BR><BR>
<?php elseif  ( $user['group_id'] == 3 ): // this is my group id free ?>
<BR><b>Free Member</b><BR><BR><BR>
<? endif; ?>


You may need to alter the Group ID.. We also added a little shield to show VIP Member..

Hope it helps..

Last edited by moomoocow (2017-03-07 06:24:32)

Offline

#3 2017-03-07 15:25:36

mael
Member
Registered: 2017-03-07
Posts: 2

Re: Display Subscription

Thank you. This should be an option to set  it by default without IF/ELSE..... this load the server each time a profile is seen.

Offline

#4 2017-03-07 16:54:32

matrimo
Member
From: Brussels (BE) & Bacau (RO)
Registered: 2013-04-04
Posts: 1,294
Website

Re: Display Subscription

You can inspire from /application/views/users/elements/picture.php line 38

			<? if ( $picture_active != 1 || isset($featured) && $featured ): ?>
				<div class="overlay icons light vertical tl">
					<? if ( isset($featured) && $featured ): ?>
						<span class="icon icon-overlay-featured" title="<?=text_helper::chars(__('featured', 'system'))?>" data-tooltip="default"></span>
					<? endif; ?>
					<? if ( $picture_active == 9 ): ?>
						<span class="icon icon-overlay-pending" title="<?=text_helper::chars(__('status_pending_tooltip', 'system'))?>" data-tooltip="default"></span>
					<? elseif ( $picture_active == 0 ): ?>
						<span class="icon icon-overlay-inactive" title="<?=text_helper::chars(__('status_inactive_tooltip', 'system'))?>" data-tooltip="default"></span>
					<? endif; ?>
				</div>
			<? endif; ?>

Near FEATURED image (top left) you could add a small image related to the subscription level and show the name in Tootip or add a short / small text.

Or you can inspire from the Online image to set near it (bottom right) the text or image you want

			<? if ( isset($online) && $online ): ?>
				<div class="overlay icon status-online br <?=($picture_file_suffix == 't' ? 'small' : '')?>" title="<?=__('status_online', 'users')?>"></div>
			<? elseif ( isset($away) && $away ): ?>
				<div class="overlay icon status-away br <?=($picture_file_suffix == 't' ? 'small' : '')?>" title="<?=__('status_away', 'users')?>"></div>
			<? endif; ?>

Then you can add some css in your custom.less file.

Offline

#5 2017-03-08 05:27:35

moomoocow
Member
From: Amsterdam
Registered: 2014-11-20
Posts: 845

Re: Display Subscription

matrimo wrote:

You can inspire from /application/views/users/elements/picture.php line 38

			<? if ( $picture_active != 1 || isset($featured) && $featured ): ?>
				<div class="overlay icons light vertical tl">
					<? if ( isset($featured) && $featured ): ?>
						<span class="icon icon-overlay-featured" title="<?=text_helper::chars(__('featured', 'system'))?>" data-tooltip="default"></span>
					<? endif; ?>
					<? if ( $picture_active == 9 ): ?>
						<span class="icon icon-overlay-pending" title="<?=text_helper::chars(__('status_pending_tooltip', 'system'))?>" data-tooltip="default"></span>
					<? elseif ( $picture_active == 0 ): ?>
						<span class="icon icon-overlay-inactive" title="<?=text_helper::chars(__('status_inactive_tooltip', 'system'))?>" data-tooltip="default"></span>
					<? endif; ?>
				</div>
			<? endif; ?>

Near FEATURED image (top left) you could add a small image related to the subscription level and show the name in Tootip or add a short / small text.

Or you can inspire from the Online image to set near it (bottom right) the text or image you want

			<? if ( isset($online) && $online ): ?>
				<div class="overlay icon status-online br <?=($picture_file_suffix == 't' ? 'small' : '')?>" title="<?=__('status_online', 'users')?>"></div>
			<? elseif ( isset($away) && $away ): ?>
				<div class="overlay icon status-away br <?=($picture_file_suffix == 't' ? 'small' : '')?>" title="<?=__('status_away', 'users')?>"></div>
			<? endif; ?>

Then you can add some css in your custom.less file.

Perfect.. Thanks Matrimo..

Offline

#6 2017-03-08 05:30:26

moomoocow
Member
From: Amsterdam
Registered: 2014-11-20
Posts: 845

Re: Display Subscription

You all have probably done this but it may help someone hopefully, we use this also to display a Upgrade banner to standard members.. So its in their face..

Offline

#7 2017-03-08 19:52:21

pzlpieces
Member
Registered: 2017-02-27
Posts: 20

Re: Display Subscription

matrimo wrote:

You can inspire from /application/views/users/elements/picture.php line 38

			<? if ( $picture_active != 1 || isset($featured) && $featured ): ?>
				<div class="overlay icons light vertical tl">
					<? if ( isset($featured) && $featured ): ?>
						<span class="icon icon-overlay-featured" title="<?=text_helper::chars(__('featured', 'system'))?>" data-tooltip="default"></span>
					<? endif; ?>
					<? if ( $picture_active == 9 ): ?>
						<span class="icon icon-overlay-pending" title="<?=text_helper::chars(__('status_pending_tooltip', 'system'))?>" data-tooltip="default"></span>
					<? elseif ( $picture_active == 0 ): ?>
						<span class="icon icon-overlay-inactive" title="<?=text_helper::chars(__('status_inactive_tooltip', 'system'))?>" data-tooltip="default"></span>
					<? endif; ?>
				</div>
			<? endif; ?>

Near FEATURED image (top left) you could add a small image related to the subscription level and show the name in Tootip or add a short / small text.

Or you can inspire from the Online image to set near it (bottom right) the text or image you want

			<? if ( isset($online) && $online ): ?>
				<div class="overlay icon status-online br <?=($picture_file_suffix == 't' ? 'small' : '')?>" title="<?=__('status_online', 'users')?>"></div>
			<? elseif ( isset($away) && $away ): ?>
				<div class="overlay icon status-away br <?=($picture_file_suffix == 't' ? 'small' : '')?>" title="<?=__('status_away', 'users')?>"></div>
			<? endif; ?>

Then you can add some css in your custom.less file.

This is perfect, thank you!

Offline

#8 2017-03-09 13:52:43

pzlpieces
Member
Registered: 2017-02-27
Posts: 20

Re: Display Subscription

I've noticed this IF statement is blowing up the pictures.php doc. I've done some research and it looks like this statement should work, but it's creating a fatal error. Again the idea is to have a label on each member's profile pic to show what membership level they have.

<? if ( $user['group_id'] == 3 ): ?>
<div class="profile-membership" data-tooltip="default">Free Member</div>
<? endif; ?>

Offline

#9 2017-03-09 15:30:53

jackal
Member
From: Austin, Texas
Registered: 2013-03-12
Posts: 1,789

Offline

#10 2017-03-09 19:09:06

pzlpieces
Member
Registered: 2017-02-27
Posts: 20

Re: Display Subscription

That's a great resource, but it looks like the code I'm using is exactly what you posted. hmm

Offline

#11 2017-03-09 19:33:16

jackal
Member
From: Austin, Texas
Registered: 2013-03-12
Posts: 1,789

Re: Display Subscription

If you're not on the profile page, try the session code

<? if (session::item('group_id') == 3): ?>

Offline

#12 2017-03-09 21:30:14

pzlpieces
Member
Registered: 2017-02-27
Posts: 20

Re: Display Subscription

I've used that, but it shows the user their own membership level. I need a way for users to see each other's membership level.

Offline

#13 2017-03-10 07:14:58

moomoocow
Member
From: Amsterdam
Registered: 2014-11-20
Posts: 845

Re: Display Subscription

pzlpieces wrote:

I've used that, but it shows the user their own membership level. I need a way for users to see each other's membership level.

In /public_html/application/views/users/views.php

Find this code (mine is line 11)

   

<? endif; ?>
		</figure>

And insert this code directly under it..

   

<? if ( $user['group_id'] == 5 ): // this is my group id admin ?>              
<b>Admin Member</b><BR><BR>
<?php elseif  ( $user['group_id'] == 2 ): // this is my group id paid ?>   
<IMG SRC="https://www.YOUR-SITE.com/layout_custom_img/vip.png" ALT="VIP MEMBER" > <b><FONT FACE="" SIZE="" COLOR="#ff0000"> VIP Member</FONT></b><BR><BR>
<?php elseif  ( $user['group_id'] == 3 ): // this is my group id free ?> 
<BR><b>Free Member</b><BR><BR><BR>
<?php elseif  ( $user['group_id'] == 8 ): // this is my group id paid ?>   
<IMG SRC="https://www.YOUR-SITE.com/layout_custom_img/vip.png" ALT="CCD Hostess" > <b><FONT FACE="" SIZE="" COLOR="#8000ff"> CCD Hostess</FONT></b><BR><BR>

<? endif; ?>

You will see we added a VIP Member shield.. Your group ID may be different to ours..

This will show their Membership status on the profile page under their profile image..

Again.. Cant take credit for code as seen it somewhere before on here...

Offline

#14 2017-03-10 15:29:59

pzlpieces
Member
Registered: 2017-02-27
Posts: 20

Re: Display Subscription

AHA! I was adding that code to the wrong page! I was trying to edit /public_html/application/views/users/elements/picture.php

Thanks guys!

Offline

#15 2017-10-15 09:40:31

kingteamdunet
Member
Registered: 2013-11-15
Posts: 63

Re: Display Subscription

Hello,
Not found the picture "vip.png" on the forum,
Remove "from the forum"
Who can send me the image "vip.png"
Thank you

Offline

#16 2017-12-01 07:07:14

dzolaya
Member
Registered: 2016-07-14
Posts: 94

Re: Display Subscription

Would this be removed, after new update is implemented?

Offline

#17 2018-01-26 12:08:25

matrimo
Member
From: Brussels (BE) & Bacau (RO)
Registered: 2013-04-04
Posts: 1,294
Website

Re: Display Subscription

Make it easy. Use the existent Start to spot Paid users in  search results, gallery, sidebar & homepage

Open application/views/users/elements/picture.php
Replace line 112

		<? if ( isset($user['featured']) && $user['featured']) : ?>

   
        with

	
		<? if ( isset($user['featured']) && $user['featured'] || $user['group_id'] == 2 ) : ?>

Matrimo.com

Offline

#18 2018-01-28 04:24:26

edendom
Member
Registered: 2015-08-09
Posts: 130

Re: Display Subscription

Thank you for all your tips!

Offline

#19 2019-10-26 10:12:00

petka11
Member
Registered: 2018-10-23
Posts: 19

Re: Display Subscription

I have been searching for this option, I will try to implement it soon.
:-)

Thank you!

Offline

#20 2019-10-26 14:47:12

matrimo
Member
From: Brussels (BE) & Bacau (RO)
Registered: 2013-04-04
Posts: 1,294
Website

Re: Display Subscription

You are welcome

Offline

#21 2019-11-05 00:18:52

booster34500
Member
From: france
Registered: 2017-09-09
Posts: 54
Website

Re: Display Subscription

I inserted this code

In /public_html/application/views/users/views.php

Find this code (mine is line 11)

   

<? endif; ?>
        </figure>
And insert this code directly under it..

   

<? if ( $user['group_id'] == 5 ): // this is my group id admin ?>             
<b>Admin Member</b><BR><BR>
<?php elseif  ( $user['group_id'] == 2 ): // this is my group id paid ?>   
<IMG SRC="https://www.YOUR-SITE.com/layout_custom_img/vip.png" ALT="VIP MEMBER" > <b><FONT FACE="" SIZE="" COLOR="#ff0000"> VIP Member</FONT></b><BR><BR>
<?php elseif  ( $user['group_id'] == 3 ): // this is my group id free ?>
<BR><b>Free Member</b><BR><BR><BR>
<?php elseif  ( $user['group_id'] == 8 ): // this is my group id paid ?>   
<IMG SRC="https://www.YOUR-SITE.com/layout_custom_img/vip.png" ALT="CCD Hostess" > <b><FONT FACE="" SIZE="" COLOR="#8000ff"> CCD Hostess</FONT></b><BR><BR>

<? endif; ?>

but it shows me the subscription at the bottom of the profile page while I would like to display the subscription at the top of the profile page

Offline

#22 2019-11-05 19:40:29

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

Re: Display Subscription

Just move it where you want on the page, take a look at the view.php and look at the lay out, and place it where you want it to show up. then take a look at the profile to ensure it looks ok,  that's it

Last edited by rdog (2019-11-06 05:40:36)

Offline

#23 2019-11-06 00:43:50

booster34500
Member
From: france
Registered: 2017-09-09
Posts: 54
Website

Re: Display Subscription

I tried to put the code in several places in public_html/application/views/users/views.php
but it does not work

Offline

#24 2019-11-06 05:34:01

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

Re: Display Subscription

It's view.php not views.php

place it right below this
<div class="sidebar">
And make sure your user group ID's are what you are actually using on your site
then make sure you place the view.php file in /templates/yourtemplate/users so when you upgrade you don't lose your modifications

Last edited by rdog (2019-11-06 05:38:44)

Offline

#25 2019-11-06 23:54:55

booster34500
Member
From: france
Registered: 2017-09-09
Posts: 54
Website

Re: Display Subscription

thank you  rdog

I followed your indications and it works very well, it is only in the search results that the display of the subscription and still at the bottom of the profile

Offline

Board footer