Questions about forms
1: To use the form to edit a record, you need to specify the record num in the URL, e.g. "various-form.php?num=123". A simple way to have a list of all entries with edit links would be to create a List Page for the Various section, and generate an edit link something like this:
<a href="various-form.php?num=<?php echo $record['num']; ?>">Edit</a>
2: You should be able to replace that message with the following Website Membership function to redirect to the login page:
Let me know if you have any other questions!
Thank you for you help. All your advice works great.
By the way, I just noticed that when I create a viewer list page I get back all the records stored in the section. I would expect to get back only those ones that have been created by the specific user who asks it, as it happens when the user logs into the CMSB. Is it something that can be done?
To accomplish what you're asking you can use the createdBy function built into CMSB to return only those records created by the specific user who is logged in at the moment.
Do a search for createdBy in the CMSB Cookbook > 'Subscribers Only' > 'Access the complete cookbook' and you'll find a number of examples that can be easily modified to give you the result you're after.
Hope that helps and have a safe, healthy and prosperous New Year
Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php
As Jerry says, to load only records created by the current user, you'll need to filter using the createdByUserNum field. The most simple version would just be adding something like this to the getRecords options:
'where' => mysql_escapef('createdByUserNum = ?', $CURRENT_USER['num']),
Note that there are some cases where this might not work as expected depending on your Website Membership plugin config (e.g. using a different member table than default) but if users are both adding and viewing the entries on the front-end this should generally work just fine.
As well, this doesn't account for any permissions - if you want particular users to be able to view all records that would require some additional logic.
Let me know any other questions!