Re: [zip222] Membership Plugin Guidance
Hi,
Yes, this can be done. Try this:
Edit the User Accounts section and add a checkbox field called display_record. Go through the user accounts and check the box for users you want to display as an option in the other sections.
Next, edit the section where you would like to select users to view certain records. Add a list field called display_record. For "Display As" you can select either pulldown (multi value) or checkboxes (multi value). For "List Options" select "Get options from MYSQL Query (advanced)". In the box below, add this code:
SELECT num, username
FROM `<?php echo $TABLE_PREFIX ?>accounts` WHERE display_record=1
Then save. When you go into records in that section now, you can select which users will be able to see those records.
Finally, when using the getRecords function on your viewer page, you can use code that looks like this:
list($listingsRecords,$listingsMetaData)=getRecords(array(
'tableName' => 'listings',
'allowSearch' => false,
'where' => "display_record LIKE '%\t".intval($CURRENT_USER['num'])."\t%'",
));
This code will only select records from the listing table where the current user has been selected from the list field we created.
Give that a try.
Hope this helps.
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com
Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/