Membership Feature?

6 posts by 2 authors in: Forums > CMS Builder: Plugins & Add-ons
Last Post: July 12, 2012   (RSS)

By KCMedia - July 9, 2012

Hi

I have a website that has the login box on every page and people can get access to each page without having to login but. What i want to do is limit what they can do on the page for example.

On the contact page there is a list of staff members and their email address, what we want to do say someone isnt logged into the site and they click on the link it should take them to a page that says you need to be logged in to access this feature, but if they are logged in they can click on the link and it will access to the mailto function.

Also the same will be for pdf documents that they have. So how do i go about making this work.

thanks

Mark
Thanks



Craig

KC Media Solutions

www.kcmedia.biz

Re: [kcmedia] Membership Feature?

By Jason - July 11, 2012

Hi Mark,

Normally what you would do is redirect them as soon as they come to the page if they are not logged in. In your example, they can still access all the information, it just won't give them the convenience of the mailto: link.

To do what you're looking for, you can check to see if they're logged in and then use a different link in the url.

EXAMPLE:


<?php if ($CURRENT_USER): ?>
<a href = "mailto:<?php echo $record['email'];?>">
<?php else: ?>
<a href = "loginRequired.php">
<?php endif ?>

<?php echo $record['email'];?>
</a>


Hope this gets you started
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

Re: [Jason] Membership Feature?

By KCMedia - July 11, 2012

Hi Jason

thank you very much that is great works 100%.

I have one other question because there is a login box on each page when every someone logs in it takes them back to the home page is there a way of taking them back to the page that they where logging into so they dont have to go back and find the page they where on.

for example if they where on the downloads page when they login it takes them to the index page which is set in the members plugin but we want to take them back to the download page and the same goes for the peoples page and so on.

hope that makes sense.

Mark
Thanks



Craig

KC Media Solutions

www.kcmedia.biz

Re: [Jason] Membership Feature?

By KCMedia - July 11, 2012

Hi Jason

also as per above, is there any way of when someone is not logged in it say one thing and then when they are logged in it will say another

here is the code i have at the moment

<span class="email"><?php if ($CURRENT_USER): ?><a href="mailto:<?php echo htmlencode($investment_teamRecord['email']) ?>"><?php else: ?><a href="login.php"><span style="cursor::Pointer;" title="You need to login to email this person"><?php endif ?><strong>email me</strong></a></span>

and what i want to do is where is says email me i want to replace that with "login to view" and when they login it will say the real email address.

hope this make sence

Thanks

Mark
Thanks



Craig

KC Media Solutions

www.kcmedia.biz

Re: [Jason] Membership Feature?

By KCMedia - July 12, 2012

Hi Jason

thanks you that all works 100% cheers

Mark
Thanks



Craig

KC Media Solutions

www.kcmedia.biz