[ Index ]
 

Code source de Serendipity 1.2

Accédez au Source d'autres logiciels libres

title

Body

[fermer]

/include/ -> functions.inc.php (sommaire)

(pas de description)

Poids: 1174 lignes (40 kb)
Inclus ou requis: 2 fois
Référencé: 1 fois
Nécessite: 11 fichiers
 include/functions_config.inc.php
 include/compat.inc.php
 include/functions_entries.inc.php
 include/db/db.inc.php
 include/functions_smarty.inc.php
 include/functions_images.inc.php
 include/functions_comments.inc.php
 include/functions_permalinks.inc.php
 include/functions_calendars.inc.php
 include/functions_installer.inc.php
 include/plugin_api.inc.php

Définit 34 fonctions

  serendipity_truncateString()
  serendipity_gzCompression()
  serendipity_serverOffsetHour()
  serendipity_convertToTimestamp()
  serendipity_strftime()
  serendipity_formatTime()
  serendipity_fetchTemplates()
  serendipity_fetchTemplateInfo()
  serendipity_walkRecursive()
  serendipity_fetchUsers()
  serendipity_sendMail()
  serendipity_fetchReferences()
  serendipity_utf8_encode()
  serendipity_rss_getguid()
  xhtml_cleanup()
  serendipity_fetchAuthor()
  serendipity_parseFileName()
  serendipity_track_referrer()
  serendipity_track_referrer_gc()
  serendipity_track_url()
  serendipity_displayTopReferrers()
  serendipity_displayTopExits()
  serendipity_displayTopUrlList()
  serendipity_xhtml_target()
  serendipity_discover_rss()
  serendipity_isResponseClean()
  serendipity_addCategory()
  serendipity_updateCategory()
  serendipity_request_start()
  serendipity_request_end()
  microtime_float()
  serendipity_build_query()
  serendipity_pickKey()
  serendipity_db_time()

Fonctions
Fonctions qui ne font pas partie d'une Classe:

serendipity_truncateString($s, $len)   X-Ref
Truncate a string to a specific length, multibyte aware. Appends '...' if successfully truncated

param: string  Input string
param: int     Length the final string should have
return: string  Truncated string

serendipity_gzCompression()   X-Ref
Optionally turn on GZip Compression, if configured


serendipity_serverOffsetHour($timestamp = null, $negative = false)   X-Ref
Returns a timestamp formatted according to the current Server timezone offset

param: int      The timestamp you want to convert into the current server timezone. Defaults to "now".
param: boolean  A toggle to indicate, if the timezone offset should be ADDED or SUBSTRACTED from the timezone. Substracting is required to restore original time when posting an entry.
return: int      The final timestamp

serendipity_convertToTimestamp($in)   X-Ref
Pas de description

serendipity_strftime($format, $timestamp = null, $useOffset = true, $useDate = false)   X-Ref
Format a timestamp

This function can convert an input timestamp into specific PHP strftime() outputs, including applying necessary timezone calculations.

param: string      Output format for the timestamp
param: int         Timestamp to use for displaying
param: boolean     Indicates, if timezone calculations shall be used.
param: boolean     Whether to use strftime or simply date
return: string      The formatted timestamp

serendipity_formatTime($format, $time, $useOffset = true, $useDate = false)   X-Ref
A wrapper function call for formatting Timestamps.

Utilizes serendipity_strftime() and prepares the output timestamp with a few tweaks, and applies automatic uppercasing of the return.

param: string      Output format for the timestamp
param: int         Timestamp to use for displaying
param: boolean     Indicates, if timezone calculations shall be used.
param: boolean     Whether to use strftime or simply date
return: string      The formatted timestamp

serendipity_fetchTemplates($dir = '')   X-Ref
Fetches the list of available templates/themes/styles.

param: string  Directory to search for a template [recursive use]
return: array   Sorted array of available template names

serendipity_fetchTemplateInfo($theme, $abspath = null)   X-Ref
Get information about a specific theme/template/style

param: string  Directory name of a theme
param: string  Absolute path to the templates [for use on CVS mounted directories]
return: array   Associative array if template information

serendipity_walkRecursive($ary, $child_name = 'id', $parent_name = 'parent_id', $parentid = 0, $depth = 0)   X-Ref
Recursively walks an 1-dimensional array to map parent IDs and depths, depending on the nested array set.

Used for sorting a list of comments, for example. The list of comment is iterated, and the nesting level is calculated, and the array will be sorted to represent the amount of nesting.

param: array   Input array to investigate [consecutively sliced for recursive calls]
param: string  Array index name to indicate the ID value of an array index
param: string  Array index name to indicate the PARENT ID value of an array index, matched against the $child_name value
param: int     The parent id to check an element against for recursive nesting
param: int     The current depth of the cycled array
return: array   The sorted and shiny polished result array

serendipity_fetchUsers($user = '', $group = null, $is_count = false)   X-Ref
Fetch the list of Serendipity Authors

param: int     Fetch only a specific User
param: array   Can contain an array of group IDs you only want to fetch authors of.
param: boolean If set to TRUE, the amount of entries per author will also be returned
return: array   Result of the SQL query

serendipity_sendMail($to, $subject, $message, $fromMail, $headers = NULL, $fromName = NULL)   X-Ref
Sends a Mail with Serendipity formatting

param: string  The recipient address of the mail
param: string  The subject of the mail
param: string  The body of the mail
param: string  The sender mail address of the mail
param: array   additional headers to pass to the E-Mail
param: string  The name of the sender
return: int     Return code of the PHP mail() function

serendipity_fetchReferences($id)   X-Ref
Fetch all references (links) from a given entry ID

param: int     The entry ID
return: array   The SQL result containing the references/links of an entry

serendipity_utf8_encode($string)   X-Ref
Encode a string to UTF-8, if not already in UTF-8 format.

param: string  The input string
return: string  The output string

serendipity_rss_getguid($entry, $comments = false)   X-Ref
Create a link that can be used within a RSS feed to indicate a permalink for an entry or comment

param: array       The input entry array
param: boolean     Toggle whether the link will be for a COMMENT [true] or an ENTRY [false]
return: string      A permalink for the given entry

xhtml_cleanup($html)   X-Ref
Perform some replacement calls to make valid XHTML content

jbalcorn: starter function to clean up xhtml for atom feed.  Add things to this as we find common
mistakes, unless someone finds a better way to do this.
DONE:
since someone encoded all the urls, we can now assume any amp followed by
whitespace or a HTML tag (i.e. &<br /> )should be
encoded and most not with a space are intentional

param: string  Input HTML code
return: string  Cleaned HTML code

serendipity_fetchAuthor($author)   X-Ref
Fetch user data for a specific Serendipity author

param: int     The requested author id
return: array   The SQL result array

serendipity_parseFileName($file)   X-Ref
Split a filename into basename and extension parts

param: string  Filename
return: array   Return array containing the basename and file extension

serendipity_track_referrer($entry = 0)   X-Ref
Track the referer to a specific Entry ID

param: int     Entry ID
return: null

serendipity_track_referrer_gc()   X-Ref
Garbage Collection for suppressed referrers

"Bad" referrers, that only occured once to your entry are put within a
SUPPRESS database table. Entries contained there will be cleaned up eventually.

return: null

serendipity_track_url($list, $url, $entry_id = 0)   X-Ref
Track a URL used in your Blog (Exit-Tracking)

param: string   Name of the DB table where to store the link (exits|referrers)
param: string   The URL to track
param: int      The Entry ID to relate the track to
return: null

serendipity_displayTopReferrers($limit = 10, $use_links = true, $interval = 7)   X-Ref
Display the list of top referrers

param: int      Number of referrers to show
param: boolean  Whether to use HTML links for URLs
param: int      Interval for which the top referrers are aggregated
return: string   List of Top referrers

serendipity_displayTopExits($limit = 10, $use_links = true, $interval = 7)   X-Ref
Display the list of top exits

param: int      Number of exits to show
param: boolean  Whether to use HTML links for URLs
param: int      Interval for which the top exits are aggregated
return: string   List of Top exits

serendipity_displayTopUrlList($list, $limit, $use_links = true, $interval = 7)   X-Ref
Display HTML output data of a Exit/Referrer list

param: string      Name of the DB table to show data from (exits|referrers)
param: boolean  Whether to use HTML links for URLs
param: int      Interval for which the top exits are aggregated
return:

serendipity_xhtml_target($target)   X-Ref
Return either HTML or XHTML code for an '<a target...> attribute.

param: string  The target to use (_blank, _parent, ...)
return: string  HTML string containig the valid markup for the target attribute.

serendipity_discover_rss($name, $ext)   X-Ref
Parse a URI portion to return which RSS Feed version was requested

param: string  Name of the core URI part
param: string  File extension name of the URI
return: string  RSS feed type/version

serendipity_isResponseClean($d)   X-Ref
Check whether an input string contains "evil" characters used for HTTP Response Splitting

param: string      String to check for evil characters
return: boolean     Return true on success, false on failure

serendipity_addCategory($name, $desc, $authorid, $icon, $parentid)   X-Ref
Create a new Category

param: string  The new category name
param: string  The new category description
param: int     The category owner
param: string  An icon representing the category
param: int     A possible parentid to a category
return: int     The new category's ID

serendipity_updateCategory($cid, $name, $desc, $authorid, $icon, $parentid, $sort_order = 0, $hide_sub = 0)   X-Ref
Update an existing category

param: int     Category ID to update
param: string  The new category name
param: string  The new category description
param: int     The new category owner
param: string  The new category icon
param: int     The new category parent ID
param: int     The new category sort order
param: int     The new category subcat hiding
return: null

serendipity_request_start()   X-Ref
Ends a session, so that while a file requests happens, Serendipity can work on in that session


serendipity_request_end()   X-Ref
Continues a session after a file request


microtime_float()   X-Ref
Get current timestamp as microseconds

return: float    the time

serendipity_build_query(&$array, $array_prefix = null, $comb_char = '&amp;')   X-Ref
Converts Array data to be used as a GET string

param: array   The input array
param: string  An array prefix
param: string  How to join the array
return: string  The HTTP query string

serendipity_pickKey(&$array, $key, $default)   X-Ref
Pas de description

serendipity_db_time()   X-Ref
Pas de description



Généré le : Sat Nov 24 09:00:37 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics