*

michelontour

  • *
  • 28
  • PerfectMatch.nu
    • PerfectMatch
disable profiles for visitors
« on: March 06, 2013, 12:56:54 PM »
Can anyone tell me how to disable profile views for visitors? I mean, I don't want to display any profiles (new ones, latest onlin etc) on the homepage when you enter the site and are not a member.

I found the homepagefile where i can delete those, but then when you are logged in, they are gone as well.
So, how do i manage profiles visible for logged in users and disable them for visitors?
OSDATE 2.5.4

Michelontour

Twitter @perfectmatchnu

*

wp180

  • **
  • 74
    • Punk-Noz.fr
Re: disable profiles for visitors
« Reply #1 on: March 06, 2013, 06:25:22 PM »
In the homepage.tpl:

Code: [Select]
{ if $smarty.session.UserId != '' }
{* This is for showing the Featured Profiles  *}
{include file='random_profiles.tpl'}
{ /if }

A non-logged-in user don't have a session id, so he can not see the random profiles. Do the same for new profiles, latest.....

Osdate 2.6
PHP 5.4.21
MsSQL 5.1.72

*

michelontour

  • *
  • 28
  • PerfectMatch.nu
    • PerfectMatch
Re: disable profiles for visitors
« Reply #2 on: March 06, 2013, 06:39:33 PM »
thx for your reply. I tried, but it doesn't work. Can you send the homepage file code complete?
OSDATE 2.5.4

Michelontour

Twitter @perfectmatchnu

*

wp180

  • **
  • 74
    • Punk-Noz.fr
Re: disable profiles for visitors
« Reply #3 on: March 06, 2013, 06:51:55 PM »
Code: [Select]
{strip}
<div align="center">
{if $smarty.session.UserId == ''}
{include file='special_offer.tpl'}
{elseif $smarty.session.UserId > 0 }
{* Show the statistics since last login  *}
{include file='user_home_stats.tpl'}
<br />
{if count($bdpusers) > 0}
{include file='birthday_profiles.tpl'}
{/if}
{/if}
{ if $config.iplocation_profcnt > 0 && count($iplusers) > 0 }
{* This is for showing the IP Location based Profiles  *}
{include file='iplocation_profiles.tpl'}
{ /if }

{ if $config.newest_profpics_dispcnt > 0 && count($profpicsusers) > 0 }
{* This is for showing the Featured Profiles  *}
{include file='newest_profpics.tpl'}
{ /if }


{ if $smarty.session.UserId != '' }
{* This is for showing the Featured Profiles  *}
{include file='random_profiles.tpl'}
{ /if }


{ if $config.show_featured_profiles > 0 && count($featured_profiles) > 0}
{* This is for showing the Featured Profiles  *}
{include file='home_featured_profiles.tpl'}
{ /if }
{if $config.list_newmembers > 0 && $nulusers }
{* Now show the latest members names *}
{include file='home_newuserlist.tpl'}
{/if}
{if $config.no_last_new_users > 0 && count($npusers) > 0 }
{* Now show newest profiles       *}
{include file='home_membersincelastlogin.tpl'}
{/if}
{if $config.show_recent_active_profiles > 0 }
{* Now show recently active profiles       *}
{include file='recent_active_profiles.tpl'}
{/if}

<br /><br />
</div>
{/strip}

This is my homepage.tpl. But important for you is the code i posted last time.
Osdate 2.6
PHP 5.4.21
MsSQL 5.1.72

*

michelontour

  • *
  • 28
  • PerfectMatch.nu
    • PerfectMatch
Re: disable profiles for visitors
« Reply #4 on: March 06, 2013, 06:55:41 PM »
Thanks again. It was a bit of searching, but it works now. This is my homepage where it works perfect.
OSDATE 2.5.4

Michelontour

Twitter @perfectmatchnu

*

wp180

  • **
  • 74
    • Punk-Noz.fr
Re: disable profiles for visitors
« Reply #5 on: March 06, 2013, 07:03:38 PM »
Wrong file? :D But if it works now, then its perfect :)
Osdate 2.6
PHP 5.4.21
MsSQL 5.1.72

*

michelontour

  • *
  • 28
  • PerfectMatch.nu
    • PerfectMatch
Re: disable profiles for visitors
« Reply #6 on: March 06, 2013, 07:22:53 PM »
yes stupid, i uploaded the wrong file and didn't back up the homepage file. Now I can not find the fix anymore and it's again not working.
Your homepage shows profiles even offline, so give me another hint....
OSDATE 2.5.4

Michelontour

Twitter @perfectmatchnu

*

wp180

  • **
  • 74
    • Punk-Noz.fr
Re: disable profiles for visitors
« Reply #7 on: March 06, 2013, 07:27:59 PM »
Maybe start with the original file again. Because i changed to much things in it...
Osdate 2.6
PHP 5.4.21
MsSQL 5.1.72

*

michelontour

  • *
  • 28
  • PerfectMatch.nu
    • PerfectMatch
Re: disable profiles for visitors
« Reply #8 on: March 06, 2013, 07:29:52 PM »
i did.... :(
OSDATE 2.5.4

Michelontour

Twitter @perfectmatchnu

*

wp180

  • **
  • 74
    • Punk-Noz.fr
Re: disable profiles for visitors
« Reply #9 on: March 06, 2013, 07:36:32 PM »
Sometimes its a good idea to clear the browser cache and the /temp/templates_c/

No more ideas then.
Osdate 2.6
PHP 5.4.21
MsSQL 5.1.72

*

michelontour

  • *
  • 28
  • PerfectMatch.nu
    • PerfectMatch
Re: disable profiles for visitors
« Reply #10 on: March 06, 2013, 07:38:45 PM »
It's recommended to use the right Homepage.tpl file!! It's the one in the template folder of the template you use of course. Not the one in the default template folder when you use a different one. This is the code...

Code: [Select]
{strip}
<div align="center">
{if $smarty.session.UserId == ''}
{include file='special_offer.tpl'}
{elseif $smarty.session.UserId == '' }
{* Show the statistics since last login  *}
{include file='user_home_stats.tpl'}
<br />
{if count($bdpusers) == ''}
{include file='birthday_profiles.tpl'}
{/if}
{/if}
{ if $smarty.session.UserId != '' }
{* This is for showing the IP Location based Profiles  *}
{include file='iplocation_profiles.tpl'}
{ /if }

{ if $smarty.session.UserId != '' }
{* This is for showing the Featured Profiles  *}
{include file='newest_profpics.tpl'}
{ /if }


{ if $smarty.session.UserId != '' }
{* This is for showing the Featured Profiles  *}
{include file='random_profiles.tpl'}
{ /if }


{ if $smarty.session.UserId != '' }
{* This is for showing the Featured Profiles  *}
{include file='home_featured_profiles.tpl'}
{ /if }
{ if $smarty.session.UserId != '' }
{* Now show the latest members names *}
{include file='home_newuserlist.tpl'}
{/if}
{ if $smarty.session.UserId != '' }
{* Now show newest profiles       *}
{include file='home_membersincelastlogin.tpl'}
{/if}
{ if $smarty.session.UserId != '' }
{* Now show recently active profiles       *}
{include file='recent_active_profiles.tpl'}
{/if}

<br /><br />
</div>
{/strip}
OSDATE 2.5.4

Michelontour

Twitter @perfectmatchnu

*

michelontour

  • *
  • 28
  • PerfectMatch.nu
    • PerfectMatch
Re: disable profiles for visitors
« Reply #11 on: March 06, 2013, 07:49:05 PM »
change:

Code: [Select]
<div align="center">
{if $smarty.session.UserId == ''}
{include file='special_offer.tpl'}
{elseif $smarty.session.UserId ==''}

to:

Code: [Select]
<div align="center">
{if $smarty.session.UserId == ''}
{include file='special_offer.tpl'}
{elseif $smarty.session.UserId > '0' }
OSDATE 2.5.4

Michelontour

Twitter @perfectmatchnu

*

wp180

  • **
  • 74
    • Punk-Noz.fr
Re: disable profiles for visitors
« Reply #12 on: March 06, 2013, 08:46:57 PM »
OK, so now all is working?
Osdate 2.6
PHP 5.4.21
MsSQL 5.1.72

*

michelontour

  • *
  • 28
  • PerfectMatch.nu
    • PerfectMatch
Re: disable profiles for visitors
« Reply #13 on: March 07, 2013, 04:13:26 PM »
Yes it's working! Up to the next challenges :)
OSDATE 2.5.4

Michelontour

Twitter @perfectmatchnu