What dynamic values and functions are available?
phpFanList allows you to use quite a few calculated values and functions to easily display information like the number of members or the last 10 added members.
Note: the values and functions specified here work from version 3.0.0. and up.
Calculated values
These values can easily be used in your pages by simply adding the following code:
<?php echo PHPFANLIST_MEMBERCOUNT; ?>Where PHPFANLIST_MEMBERCOUNT is the calculated value.
List of calculated values
- PHPFANLIST_LASTCHECKED
- The date when you last checked your fanlisting, this is also the date you last accessed the administration section.
(Displayed in the format specified in the settings) - PHPFANLIST_LASTUPDATE
- The date you last updated your fanlisting, meaning when you last approved, declined or updated a member.
(Displayed in the format specified in the settings) - PHPFANLIST_LASTMEMUPDATE
- The date you last updated a member.
(Displayed in the format specified in the settings) - PHPFANLIST_LASTMEMNEW
- The date you last added a new member.
(Displayed in the format specified in the settings) - PHPFANLIST_LASTNEWX
- Last X members that have been added. (New members).
(The number X can be changed in the settings.) - PHPFANLIST_LASTX
- Last X members that have been updated.
(The number X can be changed in the settings.) - PHPFANLIST_MEMBERCOUNT
- Contains the number of members that your listing has.
- PHPFANLIST_NUMDELETE
- Number of people that requested to be deleted and are waiting to be approved/declined. A single member can request more than 1 delete which each counts as a delete.
(If the "allow plural update" is set to no, which it is by default, a member can only request 1 update that has to be approved/declined before another can be made requested) - PHPFANLIST_NUMJOIN
- Number of people that joined and are waiting to be approved/declined. They are not members yet.
- PHPFANLIST_NUMUPDATE
- Number of members that requested an update and are waiting to be approved/declined. A single member can request more than 1 update which each counts as an update.
(If the "allow plural update" is set to no, which it is by default, a member can only request 1 update that has to be approved/declined before another can be made requested) - PHPFANLIST_STARTDATE
- The date on which your fanlisting was started.
(Displayed in the format specified in the settings)
Functions
Using the available phpFanList functions is almost as simple as using the calculated values mentioned above. All you need to do is add the following code:
<?php function(parameters); ?>
Where function is the name of the function, described below with their appropriate parameters.
Note: There can be more than 1 parameter. In case more than 1 is optional, you always need to specify the previous optional parameter in order to specify the consecutive one.
List of phpFanList functions
- ShowAffiliates(perrow, order)
- Show all of your affiliates.
perrow (optional): is the number of affiliates you want per row (if you want to display them on more than 1 line). By default this is 0.
order (optional): the order in which you want to sort your affiliates. By default this is 'name'. Other values are 'name', 'url', 'category', 'dateadd'. - ShowNews(limit)
- Shows your news items.
limit (optional): number of items to show. By default this is NULL, which displays all items. Better would be 10, which displays only the last 10 items. - ShowNewsContent(newsitem)
- Shows the content of the specified newsitem object.
newsitem: newsitem object for which to show the title.
Note: this function is not supposed to be called directly, but can be best used when creating plugins to use default behavior. - ShowNewsTitle(newsitem)
- Shows the title of the specified newsitem object.
newsitem: newsitem object for which to show the title.
Note: this function is not supposed to be called directly, but can be best used when creating plugins to use default behavior.
Note: you need to have the header added for this to work, see "How to build a fanlisting using phpFanList" on how to do this.