Hi,

I'm wanting to make a kind of niche site for users who will not want their profiles to be viewable by non-members.  Is it possible with OSdate to restrict all site features to members only?

Thank you.

Yes, what I did was add a new landing page, then add code to show only to signed in members, I will dig the code out later for you, or u can search posts under my username and I think u will find the thread, if u search homepage help u should find it,

*

Pharg

  • *****
  • 2,071
  • osDate Version: osDate Evo v1.0
Hi awkward9,

It's very easy to hide the profiles on the homepage if not logged in and when they login they can now see the profiles.
There is not point in deleting or changing there names as you wont have anything for your members to look at after they login.

Here is how you hide something to quest / visitors:
Code: [Select]
{if $smarty.session.UserId != ''}
  { if $config.iplocation_profcnt > 0 && count($iplusers) > 0 }
{* This is for showing the IP Location based Profiles  *}
{include file='iplocation_profiles.tpl'}
{ /if }
    {/if}
  {if $smarty.session.UserId != ''}
{ if $config.newest_profpics_dispcnt > 0 && count($profpicsusers) > 0 }
{* This is for showing the Featured Profiles  *}
{include file='newest_profpics.tpl'}
{ /if }
   {/if}
  {if $smarty.session.UserId != ''}
{ if $config.show_random_profiles > 0 }
{* This is for showing the Featured Profiles  *}
{include file='random_profiles.tpl'}
{ /if }
    {/if}
   {if $smarty.session.UserId != ''}
{ 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}
  {if $smarty.session.UserId != ''}
{if $config.list_newmembers > 0 && $nulusers }
{* Now show the latest members names *}
{include file='home_newuserlist.tpl'}
{/if}
   {/if}
  {if $smarty.session.UserId != ''}
{if $config.no_last_new_users > 0 && count($npusers) > 0 }
{* Now show newest profiles       *}
{include file='home_membersincelastlogin.tpl'}
{/if}
   {/if}
  {if $smarty.session.UserId != ''}
{if $config.show_recent_active_profiles > 0 }
{* Now show recently active profiles       *}
  {include file='recent_active_profiles.tpl'}
{/if}
  {/if}


Now none of these will show on the homepage on the outside, but will be there when logged in.
The use of this code can be applied to most files:
Code: [Select]
{if $smarty.session.UserId != ''}
<--- all files go here and must have the {/if} at the end ---->
      Hiding files from the visitors not the members
{/if}

I hope this helps you and others in future.  ;)
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