Detect if customer is gold member
« on: November 21, 2014, 11:02:59 PM »
How can I detect if a customer is a gold member?
I'm looking for something similar to this: {if $membershipType == "Gold"} ... {/if}
Of course the latter code will not work, but you get the idea.

*

Pharg

  • *****
  • 2,071
  • osDate Version: osDate Evo v1.0
Re: Detect if customer is gold member
« Reply #1 on: November 22, 2014, 11:03:49 PM »
Hi pietje,

What section or page do you wish to place this code?



Regards,
Pharg ( Phill )

REMEMBER: ALWAYS BACKUP BEFORE YOU MAKE ANY CHANGES!!

osDateEvo v1.0 | PHP: 5.3.42 & PHP: 5.6.18 | MySQL: 5.5.35

Re: Detect if customer is gold member
« Reply #2 on: November 23, 2014, 06:50:41 PM »
On the main page after the user has logged in.

*

Pharg

  • *****
  • 2,071
  • osDate Version: osDate Evo v1.0
Re: Detect if customer is gold member
« Reply #3 on: November 24, 2014, 04:52:43 AM »
Hi pietje,
This one below is the only one I know works, however I have never had it work on the main page.
I use to use this in the header of userresultviewsmall.tpl and the main profiles.

I think some changes may be needed to get this to work in the main index.tpl, I did try to get it to work for your but with no luck, it has been ages since I have used this code.
I did make sure it still works in the userresultviewsmall.tpl and the main profiles.

Maybe you or someone else knows what to change?
I have tried $usr.level, $user.level, $UserId.level, $item.id.level, $item.levelend  but none of these worked.
Code: [Select]
{if $item.level == '1'}
        <img src="{$image_dir}Gold.gif" height="17" width="20" alt=" Gold Member" />Gold
{elseif $item.level == '2'}
        <img src="{$image_dir}Silver.gif" height="17" width="20" alt="Silver Member" />Silver
{elseif $item.level == '4'}<img src="{$image_dir}Free.gif" height="17" width="20" alt="Free Member" />Free
   {/if}
Regards,
Pharg ( Phill )

REMEMBER: ALWAYS BACKUP BEFORE YOU MAKE ANY CHANGES!!

osDateEvo v1.0 | PHP: 5.3.42 & PHP: 5.6.18 | MySQL: 5.5.35

*

Vink

  • *****
  • 329
    • NedDate.nl
Re: Detect if customer is gold member
« Reply #4 on: November 24, 2014, 07:01:54 PM »
Hi

Try this:
{if $curlevel} == "Gold"} ... {/if}

most certainly it will work..
Regards
Vink
osDate 2.19a | PHP 5.3.8 | MySQL  5.0.91

Re: Detect if customer is gold member
« Reply #5 on: November 25, 2014, 04:01:40 PM »
Oic... thnx for your help!
That {$curlevel} thing worked for me.   ;)

Re: Detect if customer is gold member
« Reply #6 on: February 18, 2015, 07:55:13 PM »
hi Vink, can you please tell me where i put the code and what code exactly i use to show a gold badge within a members profile that is a gold member? i know it may have been explained above but im not that great on code, thanks,

*

Pharg

  • *****
  • 2,071
  • osDate Version: osDate Evo v1.0
Re: Detect if customer is gold member
« Reply #7 on: February 18, 2015, 09:26:11 PM »
hi Vink, can you please tell me where i put the code and what code exactly i use to show a gold badge within a members profile that is a gold member? i know it may have been explained above but im not that great on code, thanks,

Hi mnarkyp77,

You can have it here like this photo attached
Regards,
Pharg ( Phill )

REMEMBER: ALWAYS BACKUP BEFORE YOU MAKE ANY CHANGES!!

osDateEvo v1.0 | PHP: 5.3.42 & PHP: 5.6.18 | MySQL: 5.5.35

*

Vink

  • *****
  • 329
    • NedDate.nl
Re: Detect if customer is gold member
« Reply #8 on: February 18, 2015, 09:28:57 PM »
Hi mnarkyp,

Its just a little bit different from the code above..
The user level is present (as a number) on each profile you visit.
That number depends on the membership levels you have...
If you have added more levels in your Admin.. than the level numbers are different for your site.

You can easy get your Gold member number by putting this on your nickpage_basic or any nickpage
Code: [Select]
level = {$user.level}and visit a Gold members profile.

If the number is for instance 3 than the code for your gold badge is:
Code: [Select]
{if $user.level == "3"}<img src="{$image_dir}goldbadge.gif" height="24" width="24">{/if}
Put this anywhere you want your Goldbadge to appear.
 
 
Regards
Vink
osDate 2.19a | PHP 5.3.8 | MySQL  5.0.91

*

Pharg

  • *****
  • 2,071
  • osDate Version: osDate Evo v1.0
Re: Detect if customer is gold member
« Reply #9 on: February 18, 2015, 09:40:28 PM »
Thanks Vink,

That's what I did in the pic to show the badge.
Code: [Select]
{if $user.level == '1'}
        <img src="{$image_dir}Gold.gif" height="17" width="20" />
            {elseif $user.level == '2'}
        <img src="{$image_dir}Silver.gif" height="17" width="20" />
         {elseif $user.level == '4'}<img src="{$image_dir}Free.gif" height="17" width="20" />
          {/if}
Regards,
Pharg ( Phill )

REMEMBER: ALWAYS BACKUP BEFORE YOU MAKE ANY CHANGES!!

osDateEvo v1.0 | PHP: 5.3.42 & PHP: 5.6.18 | MySQL: 5.5.35

*

Vink

  • *****
  • 329
    • NedDate.nl
Re: Detect if customer is gold member
« Reply #10 on: February 18, 2015, 10:52:42 PM »
Hi Phill
I complete looked over that but your are right.. awell mnarkyp77 must understand it now 4 shore  ;D
 
Regards
Vink
osDate 2.19a | PHP 5.3.8 | MySQL  5.0.91

*

Pharg

  • *****
  • 2,071
  • osDate Version: osDate Evo v1.0
Re: Detect if customer is gold member
« Reply #11 on: February 18, 2015, 10:58:28 PM »
Hi Vink,

No worries, I had the code for years in my older osdate site.
Regards,
Pharg ( Phill )

REMEMBER: ALWAYS BACKUP BEFORE YOU MAKE ANY CHANGES!!

osDateEvo v1.0 | PHP: 5.3.42 & PHP: 5.6.18 | MySQL: 5.5.35

Re: Detect if customer is gold member
« Reply #12 on: February 18, 2015, 11:04:23 PM »
thanks Vink and Pharg,   if i wanted this to show just under the picture in recent profiles online etc and to show under trhe pic in my matches etc well everywhere really lol, wwhere would i out that code? i have tried loads of places no luck

*

Pharg

  • *****
  • 2,071
  • osDate Version: osDate Evo v1.0
Re: Detect if customer is gold member
« Reply #13 on: February 18, 2015, 11:14:53 PM »
Hi

The thing about osdate coding is that it doesn't user the same code on all pages.
For exmaple on the profile page it's $user.level  but on something like userresultviewsmall.tpl it is $item.level

By the way, now you don't have free you don't have to use the $user.level == '4' as Free is '4'

I hope this makes sense :)
Regards,
Pharg ( Phill )

REMEMBER: ALWAYS BACKUP BEFORE YOU MAKE ANY CHANGES!!

osDateEvo v1.0 | PHP: 5.3.42 & PHP: 5.6.18 | MySQL: 5.5.35

Re: Detect if customer is gold member
« Reply #14 on: April 07, 2015, 03:47:43 PM »
Hi.

I would have fallen in love with him to construct that function, that let the picture appear on the head side beside the present membership level but this function does not work for me unfortunately for something.
« Last Edit: April 07, 2015, 04:07:19 PM by Vargatunde »