make page membership plugin ready

3 posts by 2 authors in: Forums > CMS Builder
Last Post: August 13, 2012   (RSS)

Re: [jimmy.g] make page membership plugin ready

By gkornbluth - August 13, 2012 - edited: August 13, 2012

Hi Jimmy,

To allow a user to see only his or her own records you might try something like this inside your foreach loop:
<?php if ($record['createdByUserNum']== @$CURRENT_USER['num']): ?>

Your record listing code goes here

<?php endif ?>


To restrict access to the page to registered users only you might try this after the load records code at the top of your page. It will direct visitors to your login page before they can access the restricted page:

<?php if (!$CURRENT_USER) { websiteLogin_redirectToLogin(); } ?>

Hope that gets you going.

Jerry Kornbluth
The first CMS Builder reference book is now available on-line!







Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php

Re: [gkornbluth] make page membership plugin ready

By jimmy.g - August 13, 2012

Thank you so much you made me understand how it work and made what I wanted to do work :)

thanks again

cheer mate