Started by svarrer.dk (v. 0.1-1.7),
maintained by ge-webdesign.de (v. 2.0-2.3),
and further evolved to version 3.0 by Svasti.
Memberpages are pages that can only be accessed by users (= members) who have logged into the memberpages area. Members have a USERNAME and a PASSWORD, and optionally an accesslevel and email address.
Username and password accept accented letters, but no ', ", comma or spaces.
Main changes compared to version 2.3 :
New: membersnotice(), member()
Gone: memberswarning(), memberpages()
Changed: accesslevels can have only one value, members list can only have one source, either a standard php-file or a csv-file, and csv-file separator is always a comma.
New features in 3.0: (some available only when using csv members file)
Unzip the zip file and upload the folder "memberpages" into the plugin-folder of your CMSimple installation. Then add an login-form either to your template or to some page of your site.
Open the template file and put this php-code where the login form should be located:
<?php echo memberslogin();?>
Add this code to your page:
#CMSimple $output.=memberslogin();#
or this: {{{PLUGIN:memberslogin();}}}
Note: Using the sourcecode-view of the CMSimple-editor to enter code is recommended.
If you have the login form on a normal page, you should add a logged-in-notice to your template so that members see that they are logged in. The logged in notice is only visible if you are logged in.
Open your template file and add this php-code where the logged-in-notice should be located:
<?php echo membersnotice();?>
… memberslogin(); … will produce a login-area like this:
After login members will see a changed login-area like this:
(This has been simplified compared to former version)
Put on the pages that you want to convert to memberpages, this code:#CMSimple member();#
or this: {{{PLUGIN:member();}}}
.
That's it. These pages are only accessable after login.
You can give a page an accesslevel to restrict it visibility further. Add the number of the level between the parentheses, e.g.
#CMSimple member(3);#
or {{{PLUGIN:member(3);}}}
for level 3.
Different to former versions only one value for the accesslevel can be entered.
Memberpages without access-level (= level 0) are visible to all members. Concerning pages with access level you can choose between the following modes:
You can set automatic login for members. If set, the plugin saves a cookie on the users computer after the user logs in. However, if the user logs off, the cookie will be deleted, and the user has to log in again the next time. Automatic login works only, if the user doesn't log off.
For historical reasons there are two ways to store the members list:
(This double storing method was started in previous versions. Contrary to these versions now only one method can be used at a time.)
You can start using the php-file method (this is the easiest way) and later decide to use a csv-file. The php-data can be imported into the csv-file via the uploading menu. Simply click on upload, without having selected a file. The plugin will lead you to a menu where you can import the php-file data
Choosing the csv-method gives you the following additional possibilities:
The csv file structure consists of simple comma separated values, i.e. per line: user,password,accesslevel,emailadress
The csv-file can be stored in any location on your server. The default location of the csv-file is protected by .htaccess. Without protection the csv-file can be read by anybody on the internet. Therefore don't change things if you are not sure what to do.
For security reasons you cannot change location or name of the csv file in the plugin menu. Open memberpages/config/config.php with an editor and enter the new location behind $plugin_cf['memberpages']['csvfile']="
. The entered value should be the URL part coming after the CMSimple base URL. If you want to have your csv file in, lets say, the subfolder "memberpages" of your userfiles, enter userfiles/memberpages/members.csv
, and copy the .htaccess file from plugins/memberpages/data/ to userfiles/memberpages/ to protect the file.
You can even put members.csv on your server above the CMSimple base, where it is publicly inaccessible. In this case enter in config.php ../members.csv