Home « Server software «
Documentation: categories/members.php
Class Members - The database abstraction layer for membership
// link a member to several anchors
Members::set_anchors($fields);
// break the association of one member with one anchor
Members::unlink($anchor, $member);
// to get the list of members for one anchor, ordered by id
Members::list_members_for_anchor($anchor, $offset, $count);
// to get ordered articles linked with some anchor
Members::list_articles_by_date_for_anchor($anchor, $offset, $count, $variant);
Members::list_articles_by_title_for_anchor($anchor, $offset, $count, $variant);
// to get the list of anchors for one member, ordered by id
Members::list_anchors_for_member($member);
// to get ordered categories linked with some member
Members::list_categories_by_title_for_member($member, $offset, $count, $variant);
// to get ordered sections linked with some member
Members::list_sections_by_title_for_anchor($anchor, $offset, $count, $variant);
This script is a reference file of this system.
Licence: GNU Lesser General Public License
Auteurs:
- Bernard Paques bernard.paques@bigfoot.com
anchor() - Link one anchor with another item
function anchor($anchor, $member)
- $anchor - string the anchor id (e.g., 'article:12')
- $member - string the member id (e.g., 'file:23')
- returns string either a null string, or some text describing an error to be inserted into the html response
Voir aussi:
- articles/articles.php
- categories/categories.php
- categories/set_keyword.php
- control/import.php
- services/blog.php
check() - Check whether an anchor is linked to another item
function check($anchor, $member)
- $anchor - string the anchor id (e.g., 'article:12')
- $member - string the member id (e.g., 'file:23')
- returns boolean either TRUE or FALSE
Voir aussi:
list_anchors_for_member() - List all anchors for one member
function list_anchors_for_member($member, $offset=0, $count=10)
- $member - the member (e.g., 'article:42')
- $offset=0 - the offset from the beginning of the list - default is 0
- $count=10 - the maximum size of the returned list - default is 10
- returns an array of members anchors
list_articles_by_date_for_anchor() - List most recent articles related to a given category or to any other anchor
function &list_articles_by_date_for_anchor($anchor, $offset=0, $count=10, $variant=NULL)
- $anchor - the target anchor
- $offset=0 - int the offset from the start of the list; usually, 0 or 1
- $count=10 - int the number of items to display
- $variant=NULL - string the list variant, if any
- returns NULL on error, else an ordered array with $url => ($prefix, $label, $suffix, $icon)
Only articles matching following criteria are returned:
- article is visible (active='Y')
- article is restricted (active='R'), but surfer is a logged user
- article is restricted (active='N'), but surfer is an associate
- article has been officially published
- an expiry date has not been defined, or is not yet passed
Voir aussi:
- index.php
- articles/index.php
- categories/feed.php
- categories/print.php
- categories/view.php
- files/index.php
- links/index.php
- sections/index.php
- users/index.php
- users/print.php
- users/view.php
list_articles_by_title_for_anchor() - List alphabetically ordered articles related to a given category or to any other anchor
function &list_articles_by_title_for_anchor($anchor, $offset=0, $count=10, $variant=NULL)
- $anchor - the target anchor
- $offset=0 - int the offset from the start of the list; usually, 0 or 1
- $count=10 - int the number of items to display
- $variant=NULL - string the list variant, if any
- returns NULL on error, else an ordered array with $url => ($prefix, $label, $suffix, $icon)
Only articles matching following criteria are returned:
- article is visible (active='Y')
- article is restricted (active='R'), but surfer is a logged user
- article is restricted (active='N'), but surfer is an associate
- article has been officially published
- an expiry date has not been defined, or is not yet passed
Voir aussi:
list_members_for_anchor() - List all members for one anchor
function list_members_for_anchor($anchor, $offset=0, $count=10)
- $anchor - the anchor (e.g., 'category:23')
- $offset=0 - the offset from the beginning of the list
- $count=10 - the maximum size of the returned list
- returns an array of member references
Voir aussi:
list_categories_by_title_for_member() - List alphabetically ordered categories related to a given article or to any other anchor
function &list_categories_by_title_for_member($member, $offset=0, $count=10, $variant='full', $capability=NULL)
- $member - the target anchor
- $offset=0 - int the offset from the start of the list; usually, 0 or 1
- $count=10 - int the number of items to display
- $variant='full' - string the list variant, if any
- $capability=NULL - string to impersonate the actual user through services/blog.php
- returns NULL on error, else an ordered array with $url => ($prefix, $label, $suffix, $icon)
Only categories matching following criteria are returned:
- category is visible (active='Y')
- category is restricted (active='R'), but surfer is a logged user
- category is restricted (active='N'), but surfer is an associate
- an expiry date has not been defined, or is not yet passed
Voir aussi:
- articles/view.php
- articles/layout_articles.php
- articles/layout_articles_as_boxesandarrows.php
- articles/layout_articles_as_daily.php
- articles/layout_articles_as_slashdot.php
- categories/select.php
- services/blog.php
list_editors_by_name_for_member() - List alphabetically ordered editors related to a given member
function &list_editors_by_name_for_member($member, $offset=0, $count=10, $variant=NULL, $capability=NULL)
- $member - the target anchor
- $offset=0 - int the offset from the start of the list; usually, 0 or 1
- $count=10 - int the number of items to display
- $variant=NULL - string the list variant, if any
- $capability=NULL - string to impersonate the actual user through services/blog.php
- returns NULL on error, else an ordered array with $url => ($prefix, $label, $suffix, $icon)
Only users matching following criteria are returned:
- user is visible (active='Y')
- user is restricted (active='R'), but surfer is a logged user
- user is restricted (active='N'), but surfer is an associate
- user is a member or an associate
Voir aussi:
list_sections_by_title_for_anchor() - List alphabetically ordered sections related to any anchor
function &list_sections_by_title_for_anchor($anchor, $offset=0, $count=10, $variant='compact', $capability=NULL)
- $anchor - the target anchor
- $offset=0 - int the offset from the start of the list; usually, 0 or 1
- $count=10 - int the number of items to display
- $variant='compact' - string the list variant, if any
- $capability=NULL - string to impersonate the actual user through services/blog.php
- returns NULL on error, else an ordered array with $url => ($prefix, $label, $suffix, $icon)
Only sections matching following criteria are returned:
- section is visible (active='Y')
- section is restricted (active='R'), but surfer is a logged user
- section is restricted (active='N'), but surfer is an associate
- an expiry date has not been defined, or is not yet passed
Voir aussi:
list_readers_by_name_for_member() - List alphabetically ordered readers related to a given member
function &list_readers_by_name_for_member($member, $offset=0, $count=10, $variant=NULL, $capability=NULL)
- $member - the target anchor
- $offset=0 - int the offset from the start of the list; usually, 0 or 1
- $count=10 - int the number of items to display
- $variant=NULL - string the list variant, if any
- $capability=NULL - string to impersonate the actual user through services/blog.php
- returns NULL on error, else an ordered array with $url => ($prefix, $label, $suffix, $icon)
Only users matching following criteria are returned:
- user is visible (active='Y')
- user is restricted (active='R'), but surfer is a logged user
- user is restricted (active='N'), but surfer is an associate
- user is a subscriptor
Voir aussi:
set_anchors() - Set the associations with anchors for one member
function set_anchors($fields)
- $fields - fields from a form
- returns string either a null string, or some text describing an error to be inserted into the html response
stat_articles_for_anchor() - Get some statistics for articles linked to one anchor
function &stat_articles_for_anchor($anchor)
- $anchor - the selected anchor (e.g., 'category:12')
- returns the resulting ($count, $min_date, $max_date) array
- article is visible (active='Y')
- article is restricted (active='R'), but surfer is a logged user
- article is restricted (active='N'), but surfer is an associate
- article has been officially published
- an expiry date has not been defined, or is not yet passed
Voir aussi:
stat_for_anchor() - Get some statistics for one anchor
function &stat_for_anchor($anchor)
- $anchor - the selected anchor (e.g., 'category:12')
- returns the resulting ($count, $min_date, $max_date) array
stat_sections_for_anchor() - Get some statistics for sections linked to one anchor
function &stat_sections_for_anchor($anchor)
- $anchor - the selected anchor (e.g., 'category:12')
- returns the resulting ($count, $min_date, $max_date) array
- section is visible (active='Y')
- section is restricted (active='R'), but surfer is a logged user
- section is restricted (active='N'), but surfer is an associate
- section has been officially published
- an expiry date has not been defined, or is not yet passed
Voir aussi:
toggle() - Toggle a membership
function toggle($anchor, $member, $father=NULL)
- $anchor - string the anchor id (e.g., 'category:123')
- $member - string the member id (e.g., 'article:456')
- $father=NULL - string the father id, if any (e.g., 'category:456')
- returns string either a null string, or some text describing an error to be inserted into the html response
Voir aussi:
unlink() - Unlink one anchor with another item
function unlink($anchor, $member)
- $anchor - string the anchor id (e.g., 'article:12')
- $member - string the member id (e.g., 'file:23')
- returns string either a null string, or some text describing an error to be inserted into the html response
unlink_for_anchor() - Delete all members for a given anchor
function unlink_for_anchor($anchor)
- $anchor - the anchor to check
- returns an error message, if any
unlink_for_member() - Clear all anchor member associations for one member
function unlink_for_member($member)
- $member - the linked member
- returns an error message, if any