Procedural File: functions.inc
Source Location: /plugins/staticpages/functions.inc
Page Details:
Implementation of the Plugin API for the Static Pages plugin
Includes:
plugin_autotags_staticpages [line 1125]
void plugin_autotags_staticpages(
$op, [ $content = ''], [ $autotag = ''])
|
|
Implements the [staticpage:] autotag.
Parameters
plugin_autouninstall_staticpages [line 1346]
array plugin_autouninstall_staticpages(
)
|
|
Automatic uninstall function for plugins
Tags:
plugin_cclabel_staticpages [line 822]
void plugin_cclabel_staticpages(
)
|
|
This will put an option for static pages in the command and control block on moderation.php
plugin_centerblock_staticpages [line 914]
string plugin_centerblock_staticpages(
[where $where = 1], [page $page = 1], [topic $topic = ''])
|
|
Display static pages in the center block.
Tags:
Parameters
| where |
$where |
int where the static page will be displayed (0..3) |
| page |
$page |
int page number |
| topic |
$topic |
string topic ID |
plugin_chkVersion_staticpages [line 1110]
void plugin_chkVersion_staticpages(
)
|
|
Return the current version of code. Used in the Plugin Editor to show the registered version and code version
plugin_deletecomment_staticpages [line 213]
mixed plugin_deletecomment_staticpages(
int $cid, string $id)
|
|
staticpages: delete a comment
Tags:
Parameters
| int |
$cid |
Comment to be deleted |
| string |
$id |
Item id to which $cid belongs |
plugin_displaycomment_staticpages [line 130]
mixed plugin_displaycomment_staticpages(
string $id, int $cid, string $title, string $order, string $format, int $page, boolean $view)
|
|
Plugin should display [a] comment[s]
Tags:
Parameters
| string |
$id |
Unique idenifier for item comment belongs to |
| int |
$cid |
Comment id to display (possibly including sub-comments) |
| string |
$title |
Page/comment title |
| string |
$order |
'ASC' or 'DSC' or blank |
| string |
$format |
'threaded', 'nested', or 'flat' |
| int |
$page |
Page number of comments to display |
| boolean |
$view |
True to view comment (by cid), false to display (by $pid) |
plugin_dopluginsearch_staticpages [line 742]
void plugin_dopluginsearch_staticpages(
string $query, date $datestart, date $dateend, string $topic, string $type, int $author, string $keyType, int $page, int $perpage)
|
|
this searches for static pages matching the user query and returns an array of for the header and table rows back to search.php where it will be formated and printed
Parameters
| string |
$query |
Keywords user is looking for |
| date |
$datestart |
Start date to get results for |
| date |
$dateend |
End date to get results for |
| string |
$topic |
The topic they were searching in |
| string |
$type |
Type of items they are searching, or 'all' (deprecated) |
| int |
$author |
Get all results by this author |
| string |
$keyType |
search key type: 'all', 'phrase', 'any' |
| int |
$page |
page number of current search (deprecated) |
| int |
$perpage |
number of results per page (deprecated) |
plugin_getadminoption_staticpages [line 839]
void plugin_getadminoption_staticpages(
)
|
|
returns the administrative option for this plugin
plugin_getcommenturlid_staticpages [line 1883]
array plugin_getcommenturlid_staticpages(
)
|
|
Provide URL and ID for the link to a comment's parent NOTE: The Plugin API does not support $_CONF['url_rewrite'] here, so we'll end up with a non-rewritten URL ...
Tags:
plugin_getconfigtooltip_staticpages [line 1868]
mixed plugin_getconfigtooltip_staticpages(
string $id)
|
|
Provides text for a Configuration tooltip
Tags:
Parameters
| string |
$id |
Id of config value |
plugin_getdocumentationurl_staticpages [line 1829]
mixed plugin_getdocumentationurl_staticpages(
string $file)
|
|
Provide URL of a documentation file
Tags:
Parameters
| string |
$file |
documentation file being requested, e.g. 'config' |
plugin_geticon_staticpages [line 1203]
string plugin_geticon_staticpages(
)
|
|
Returns the URL of the plugin's icon
Tags:
plugin_getiteminfo_staticpages [line 1692]
mixed plugin_getiteminfo_staticpages(
string $sp_id, string $what, [int $uid = 0], [array $options = array()])
|
|
Return information for a static page
Tags:
Parameters
| string |
$sp_id |
static page ID or '*' |
| string |
$what |
comma-separated list of properties |
| int |
$uid |
user ID or 0 = current user |
| array |
$options |
(reserved for future extensions) |
plugin_getListField_staticpages [line 1402]
void plugin_getListField_staticpages(
$fieldname, $fieldvalue, $A, $icon_arr)
|
|
Parameters
| |
$fieldname |
|
| |
$fieldvalue |
|
| |
$A |
|
| |
$icon_arr |
|
plugin_getmenuitems_staticpages [line 87]
void plugin_getmenuitems_staticpages(
)
|
|
Returns the items for this plugin that should appear on the main menu NOTE: this MUST return the url/value pairs in the following format $<arrayname>[<label>] = <url>
plugin_getwhatsnewcomment_staticpages [line 1647]
array plugin_getwhatsnewcomment_staticpages(
[string $numreturn = 0], [string $uid = 0])
|
|
Return new Static Page comments for the What's New block
Tags:
Parameters
| string |
$numreturn |
If 0 will return results for What's New Block. If > 0 will return last X new comments for User Profile. |
| string |
$uid |
ID of the user to return results for. 0 = all users. |
plugin_getwhatsnew_staticpages [line 1570]
string plugin_getwhatsnew_staticpages(
)
|
|
Return new Static Pages for the What's New block
Tags:
plugin_itemsaved_staticpages [line 1905]
void plugin_itemsaved_staticpages(
string $id, string $type, string $old_id)
|
|
Callback function when an item was saved
Tags:
Parameters
| string |
$id |
(unused) ID of item being saved |
| string |
$type |
type of item ('article', 'staticpages', ...) |
| string |
$old_id |
(unused) previous ID of item, if != $id |
plugin_migrate_staticpages [line 1319]
void plugin_migrate_staticpages(
array $old_conf, boolean 1)
|
|
Called during site migration - handle changed URLs or paths
Parameters
| array |
$old_conf |
contents of the $_CONF array on the old site |
| boolean |
1 |
true on success, otherwise false |
plugin_savecomment_staticpages [line 173]
mixed plugin_savecomment_staticpages(
string $title, string $comment, string $id, int $pid, string $postmode)
|
|
Static Page saves a comment
Tags:
Parameters
| string |
$title |
comment title |
| string |
$comment |
comment text |
| string |
$id |
Item id to which $cid belongs |
| int |
$pid |
comment parent |
| string |
$postmode |
'html' or 'text' |
plugin_searchtypes_staticpages [line 714]
void plugin_searchtypes_staticpages(
)
|
|
Geeklog is asking us to provide any new items that show up in the type drop-down on search.php. Let's let users search static pages!
plugin_showstats_staticpages [line 640]
void plugin_showstats_staticpages(
int $showsitestats)
|
|
Shows the statistics for the Static Pages plugin on stats.php. If $showsitestats is 1 then we are to only print the overall stats in the 'site statistics box' otherwise we show the detailed stats
Parameters
| int |
$showsitestats |
showsitestate Flag to let us know which stats to get |
plugin_statssummary_staticpages [line 700]
array(item plugin_statssummary_staticpages(
)
|
|
New stats plugin API function for proper integration with the site stats
Tags:
plugin_upgrade_staticpages [line 1216]
int plugin_upgrade_staticpages(
)
|
|
Update the Static Pages plugin
Tags:
plugin_user_delete_staticpages [line 1082]
void plugin_user_delete_staticpages(
uid $uid)
|
|
A user is about to be deleted. Update ownership of any static pages owned by that user or delete them.
Parameters
| uid |
$uid |
int User id of deleted user |
plugin_whatsnewsupported_staticpages [line 1548]
mixed plugin_whatsnewsupported_staticpages(
)
|
|
Return headlines for New Static Pages section in the What's New block, if enabled
Tags:
plugin_wsEnabled_staticpages [line 1537]
boolean plugin_wsEnabled_staticpages(
)
|
|
Return true since this plugin supports webservices
Tags:
SP_countVisiblePages [line 245]
int SP_countVisiblePages(
)
|
|
Helper function: Count static pages visible to the current user
Tags:
SP_displayPage [line 279]
string SP_displayPage(
string $page, array $A, [string $comment_order = 'ASC'], [string $comment_mode = 'nested'], [ $comment_page = 1], [int $msg = 0], [string $query = ''])
|
|
Prepare static page for display.
Tags:
Parameters
| string |
$page |
static page id |
| array |
$A |
static page data |
| string |
$comment_order |
sorting of comments |
| string |
$comment_mode |
comment mode (nested, flat, etc.) |
| int |
$msg |
optional message number |
| string |
$query |
optional search query string to highlight |
| |
$comment_page |
|
SP_getPerms [line 872]
string SP_getPerms(
[string $table = ''], [int $access = '2'], [int $u_id = ''])
|
|
Return SQL where statement with appropriate permissions Takes User id and permission and returns SQL where clause which will return the appropriate objects. This assumes that the table has the following security structure: owner_id | mediumint(8) group_id | mediumint(8) perm_owner | tinyint(1) unsigned perm_group | tinyint(1) unsigned perm_members | tinyint(1) unsigned perm_anon | tinyint(1) unsigned This will work with the standard GL tables
Tags:
Parameters
| string |
$table |
Table name (used in joins) |
| int |
$access |
Access if blank read access 2 = read 3 = read/edit |
| int |
$u_id |
User ID if blank current user |
SP_printPage [line 481]
string SP_printPage(
string $page, array $A)
|
|
Prepare static page for print (i.e. display as "printable version").
Tags:
Parameters
| string |
$page |
static page id |
| array |
$A |
static page data |
SP_render_content [line 1495]
string SP_render_content(
string $sp_content, int $sp_php, [string $query = ''])
|
|
Render the actual content of a static page (without any surrounding blocks)
Tags:
Parameters
| string |
$sp_content |
the content (HTML or PHP source) |
| int |
$sp_php |
flag: 1 = content is PHP source, 0 = is HTML |
| string |
$query |
optional search query string to highlight |
SP_returnStaticpage [line 603]
string SP_returnStaticpage(
[string $page = ''], [string $mode = ''], [string $comment_order = 'ASC'], [string $comment_mode = 'nested'], [ $comment_page = 1], [int $msg = 0], [string $query = ''])
|
|
Prepare static page for display
Tags:
Parameters
| string |
$page |
static page id |
| string |
$mode |
type of display to return ('', 'print', 'autotag' |
| string |
$comment_order |
sorting of comments |
| string |
$comment_mode |
comment mode (nested, flat, etc.) |
| int |
$msg |
optional message number |
| string |
$query |
optional search query string to highlight |
| |
$comment_page |
|
staticpages_templatePath [line 1380]
string staticpages_templatePath(
[string $path = ''])
|
|
Get path for the template files.
Tags:
Parameters
| string |
$path |
subdirectory within the base template path |
|
|