Links
[ class tree: Links ] [ index: Links ] [ all elements ]

Procedural File: functions.inc

Source Location: /plugins/links/functions.inc



Page Details:

Implementation of the Plugin API for the Links plugin



Includes:

require_once($langfile) [line 56]
Language file include

require_once($_CONF['path_system'].'classes/config.class.php') [line 65]
Check and see if we need to load the plugin configuration

require_once($plugin_path.'language/english.php') [line 58]






links_breadcrumbs [line 1409]

void links_breadcrumbs( $root, $cid)



Parameters

   $root  
   $cid  
[ Top ]



links_buildSql [line 581]

string links_buildSql( string $cid, string $limits)

Helper function: Build part of an SQL request



Tags:

return:  part of an SQL request


Parameters

string   $cid   category id
string   $limits   limit (number of entries or number of hours)
[ Top ]



LINKS_countLinksAndClicks [line 270]

array(number LINKS_countLinksAndClicks( )

Helper function: count number of links and total number of clicks



Tags:

return:  of links, number of clicks);


[ Top ]



LINKS_getCategorySQL [line 1673]

string LINKS_getCategorySQL( [string $type = 'WHERE'], [int $u_id = 0], [string $table = ''])

Return SQL expression to check for allowed categories.

Creates part of an SQL expression that can be used to only request links from categories to which the user has access to.

Note that this function does SQL requests, so you should cache the resulting SQL expression if you need it more than once.




Tags:

return:  SQL expression string (may be empty)
see:  COM_getTopicSQL()


Parameters

string   $type   part of the SQL expr. e.g. 'WHERE', 'AND'
int   $u_id   user id or 0 = current user
string   $table   table name if ambiguous (e.g. in JOINs)
[ Top ]



links_select_box [line 1349]

void links_select_box( $access, [ $sel = ''])



Parameters

   $access  
   $sel  
[ Top ]



links_select_box_recursive [line 1369]

void links_select_box_recursive( &$menu, $cid, $sel, $indent, $access)



Parameters

   &$menu  
   $cid  
   $sel  
   $indent  
   $access  
[ Top ]



LINKS_sendNotification [line 1098]

void LINKS_sendNotification( string $table, array $A)

Send an email notification for a new submission.



Parameters

string   $table   Table where the new submission can be found
array   $A   submission data
[ Top ]



links_validateUrl [line 1250]

void links_validateUrl( $url)



Parameters

   $url  
[ Top ]



phpblock_topic_categories [line 1495]

void phpblock_topic_categories( )

Returns a list of categories that are associated with the current topic

Relies on the fact that $topic is set (and sanitized) in lib-common.php




[ Top ]



phpblock_topic_links [line 1463]

void phpblock_topic_links( )

Returns a list of links that belong to categories associated with the current topic

Relies on the fact that $topic is set (and sanitized) in lib-common.php




[ Top ]



plugin_autotags_links [line 183]

void plugin_autotags_links( string $op, [string $content = ''], [array $autotag = ''], mixed 3)

Implements the [link:] autotag.



Parameters

string   $op   operation to perform
string   $content   item (e.g. story text), including the autotag
array   $autotag   parameters used in the autotag
mixed   3   tag names (for $op='tagname') or formatted content
[ Top ]



plugin_autouninstall_links [line 1312]

array plugin_autouninstall_links( )

Automatic uninstall function for plugins



Tags:

return:  This code is automatically uninstalling the plugin. It passes an array to the core code function that removes tables, groups, features and php blocks from the tables. Additionally, this code can perform special actions that cannot be foreseen by the core code (interactions with other plugins for example)


[ Top ]



plugin_cclabel_links [line 434]

mixed plugin_cclabel_links( )

This will put an option for links in the command and control block on moderation.php



Tags:

return:  array(title, url, icon), or boolean false when not allowed


[ Top ]



plugin_chkVersion_links [line 253]

string plugin_chkVersion_links( )

Called by the plugin Editor to display the current plugin code version This may be different than the version installed and registered currently.

If newer then you may want to run the update




Tags:

return:  version number


[ Top ]



plugin_dopluginsearch_links [line 394]

object search plugin_dopluginsearch_links( string $query, date $datestart, date $dateend, string $topic, string $type, int $author, string $keyType, int $page, int $perpage)

This searches for links matching the user query and returns an array for the header and table rows back to search.php where it will be formated and printed



Tags:

return:  result object


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)
[ Top ]



plugin_enablestatechange_links [line 772]

void plugin_enablestatechange_links( boolean $enable)

Geeklog informs us that we're about to be enabled or disabled



Parameters

boolean   $enable   true = we're being enabled, false = disabled
[ Top ]



plugin_feedupdatecheck_links [line 630]

boolean plugin_feedupdatecheck_links( int $feed, string $topic, string $update_data, string $limit, [string $updated_type = ''], [string $updated_topic = ''], [string $updated_id = ''])

Checking if links feeds are up to date



Tags:

return:  true: feed data is up to date; false: isn't


Parameters

int   $feed   id of feed to be checked
string   $topic   topic (actually: cid)
string   $update_data   data describing current feed contents
string   $limit   number of entries or number of hours
string   $updated_type   (optional) type of feed to be updated
string   $updated_topic   (optional) feed's "topic" to be updated
string   $updated_id   (optional) id of entry that has changed
[ Top ]



plugin_getadminoption_links [line 453]

mixed plugin_getadminoption_links( )

returns the administrative option for this plugin



Tags:

return:  array(title, url, num. links), or void when not allowed


[ Top ]



plugin_getconfigtooltip_links [line 1776]

mixed plugin_getconfigtooltip_links( string $id)

Provides text for a Configuration tooltip



Tags:

return:  Text to use regular tooltip, NULL to use config tooltip hack, or empty string when not available


Parameters

string   $id   Id of config value
[ Top ]



plugin_getdocumentationurl_links [line 1737]

mixed plugin_getdocumentationurl_links( string $file)

Provide URL of a documentation file



Tags:

return:  URL or false when not available


Parameters

string   $file   documentation file being requested, e.g. 'config'
[ Top ]



plugin_getfeedcontent_links [line 533]

array plugin_getfeedcontent_links( int $feed, &$link, &$update, ref $link, ref $update)

Provide feed data



Tags:

return:  feed entries


Parameters

int   $feed   feed ID
ref   $link  
ref   $update  
   &$link  
   &$update  
[ Top ]



plugin_getfeednames_links [line 503]

array plugin_getfeednames_links( )

Do we support feeds?



Tags:

return:  id/name pairs of all supported feeds


[ Top ]



plugin_geticon_links [line 1129]

string plugin_geticon_links( )

Returns the URL of the plugin's icon



Tags:

return:  URL of the icon


[ Top ]



plugin_getiteminfo_links [line 1529]

mixed plugin_getiteminfo_links( string $lid, string $what, [int $uid = 0], [array $options = array()])

Return information for a link



Tags:

return:  string or array of strings with the information


Parameters

string   $lid   link ID or '*'
string   $what   comma-separated list of properties
int   $uid   user ID or 0 = current user
array   $options   (reserved for future extensions)
[ Top ]



plugin_getListField_categories [line 1190]

void plugin_getListField_categories( $fieldname, $fieldvalue, $A, $icon_arr)



Parameters

   $fieldname  
   $fieldvalue  
   $A  
   $icon_arr  
[ Top ]



plugin_getListField_links [line 1136]

void plugin_getListField_links( $fieldname, $fieldvalue, $A, $icon_arr)



Parameters

   $fieldname  
   $fieldvalue  
   $A  
   $icon_arr  
[ Top ]



plugin_getmenuitems_links [line 85]

mixed plugin_getmenuitems_links( )

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>




Tags:

return:  menu entry, or boolean false if disabled / hidden


[ Top ]



plugin_getwhatsnew_links [line 128]

string plugin_getwhatsnew_links( )

Return new links for the What's New block



Tags:

return:  HTML list of new links


[ Top ]



plugin_ismoderator_links [line 808]

boolean plugin_ismoderator_links( )

Checks that the current user has the rights to moderate the plugin, returns true if this is the case, false otherwise



Tags:

return:  Returns true if moderator


[ Top ]



plugin_itemlist_links [line 820]

mixed plugin_itemlist_links( )

Returns SQL & Language texts to moderation.php



Tags:

return:  Plugin object or void if not allowed


[ Top ]



plugin_migrate_links [line 748]

void plugin_migrate_links( 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
[ Top ]



plugin_moderationapprove_links [line 868]

string plugin_moderationapprove_links( string $id)

Performs plugin exclusive work for items approved by moderation

While moderation.php handles the actual move from linkssubmission to links tables, within the function we handle all other approval relate tasks




Tags:

return:  Any wanted HTML output


Parameters

string   $id   Identifying string
[ Top ]



plugin_moderationdelete_links [line 900]

string plugin_moderationdelete_links( string $id)

Performs plugin exclusive work for items deleted by moderation

While moderation.php handles the actual removal from <plugin>submission table, within this function we handle all other deletion related tasks




Tags:

return:  Any wanted HTML output


Parameters

string   $id   Identifying string
[ Top ]



plugin_moderationvalues_links [line 846]

array plugin_moderationvalues_links( )

returns list of moderation values

The array returned contains (in order): the row 'id' label, main plugin table, moderation fields (comma seperated), and plugin submission table




Tags:

return:  Returns array of useful moderation values


[ Top ]



plugin_savesubmission_links [line 918]

string plugin_savesubmission_links( array $A)

Check submission form values and save if OK. Else show form again



Tags:

return:  Any wanted HTML output


Parameters

array   $A   The link record
[ Top ]



plugin_save_submit_links [line 983]

string plugin_save_submit_links( array $A)

Saves a link submission



Tags:

return:  HTML redirect


Parameters

array   $A   Data for that submission
[ Top ]



plugin_searchtypes_links [line 368]

array plugin_searchtypes_links( )

Geeklog is asking us to provide any items that show up in the type drop-down on search.php. Let's users search for links.



Tags:

return:  (plugin name/entry title) pair for the dropdown


[ Top ]



plugin_showstats_links [line 294]

void plugin_showstats_links( $showsitestats, int $showsitestate, string 1)

Shows the statistics for the links 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   $showsitestate   Flag to let us know which stats to get
string   1   HTML for the stats section
   $showsitestats  
[ Top ]



plugin_statssummary_links [line 348]

array(item plugin_statssummary_links( )

New stats plugin API function for proper integration with the site stats



Tags:

return:  text, item count);


[ Top ]



plugin_submissioncount_links [line 788]

int plugin_submissioncount_links( )

Counts the items that are submitted



Tags:

return:  number of items in submission queue


[ Top ]



plugin_submit_links [line 946]

string plugin_submit_links( )

Shows link submission form



Tags:

return:  HTML for the link submission form


[ Top ]



plugin_templatesetvars_links [line 1291]

void plugin_templatesetvars_links( string $templatename, &$template, ref $template)

Set template variables



Tags:

return:  Note: A plugin should use its name as a prefix for the names of its template variables, e.g. 'links_xxx' and 'lang_links_xxx'. 'button_links' is an exception, as such a variable existed for header.thtml in Geeklog 1.3.11 and earlier, where the Links section was an integral part of Geeklog. It is added here for backward-compatibility.


Parameters

string   $templatename   name of template, e.g. 'header'
ref   $template   reference of actual template
   &$template  
[ Top ]



plugin_upgrade_links [line 669]

int plugin_upgrade_links( )

Update the Links plugin



Tags:

return:  Number of message to display (true = generic success msg)


[ Top ]



plugin_user_delete_links [line 475]

void plugin_user_delete_links( int $uid)

A user is about to be deleted. Update ownership of any links owned by that user or delete them.



Parameters

int   $uid   User id of deleted user
[ Top ]



plugin_whatsnewsupported_links [line 106]

mixed plugin_whatsnewsupported_links( )

Return headlines for New Links section in the What's New block, if enabled



Tags:

return:  array(headline, byline), or boolean false if disabled


[ Top ]



Documentation generated on Sat, 11 Feb 2012 02:07:35 -0500 by phpDocumentor 1.4.3