Changeset 149 for branches

Show
Ignore:
Timestamp:
04/17/06 14:48:59 (3 years ago)
Author:
michiel
Message:

Merged revisions 148 via svnmerge from
https://svn.three-dimensional.net/mvblog/trunk

........

r148 | michiel | 2006-04-17 14:37:54 +0200 (Mon, 17 Apr 2006) | 2 lines


Add phpdoc style documentation for every function

........

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/comment-registration/common/functions_blog.php

    r147 r149  
    8989} 
    9090/* }}} */ 
    91  
    9291/* html_header: {{{ */ 
    9392/** 
     
    140139} 
    141140/* }}} */ 
    142  
    143141/* html_footer() {{{ */ 
    144142/** 
     
    158156} 
    159157/* }}} */ 
    160  
    161 /* show_article($iid) {{{ */ 
     158/* show_article($id) {{{ */ 
    162159/** 
    163160 * Show an article with all comments etc 
     
    302299} 
    303300/* }}} */ 
    304 //{{{ blog_get_description(): get the description from settings table 
    305 //------------------------------------------------------------------- 
     301/* blog_get_description() {{{ */ 
     302/** 
     303 * Get blogsetting description from database 
     304 * 
     305 * @return string The blogdescription 
     306 */ 
    306307function blog_get_description() { 
    307308        $res =& $GLOBALS["db"]->query("SELECT settingvalue FROM settings WHERE settingname='blogdescription'"); 
     
    314315        return $pagedescription; 
    315316} 
    316  
    317 //}}}----------------------------------------------------------------------------- 
    318 //{{{ blog_get_title(): get the blog title. return title or "blog" if no title set 
    319 //-------------------------------------------------------------------------------- 
     317/* }}} */ 
     318/* blog_get_title() {{{ */ 
     319/** 
     320 * get the blog title.  
     321 * 
     322 * @return string title or "blog" if no title set 
     323 */ 
    320324function blog_get_title() { 
    321325        $sql = "SELECT settingvalue FROM settings WHERE settingname='blogtitle'"; 
     
    329333        return $title; 
    330334} 
    331  
    332 //}}}------------------------------------------------------------- 
    333 //{{{ blog_show_menulinks(): get usersupplied sidebar menu entries 
    334 //---------------------------------------------------------------- 
     335/* }}} */ 
     336/* blog_show_menulinks() {{{ */ 
     337/** 
     338 * get usersupplied sidebar menu entries 
     339 */ 
    335340function blog_show_menulinks() { 
    336341        $res =& $GLOBALS["db"]->query("SELECT * FROM menulinks ORDER BY sortorder,linktitle"); 
     
    347352        } 
    348353} 
    349  
    350 //}}}----------------------------------------------------- 
    351 //{{{ blog_show_styleswitcher(): show dropdown with styles 
    352 //-------------------------------------------------------- 
     354/* }}} */ 
     355/* blog_show_styleswitcher() {{{ */ 
     356/** 
     357 * show dropdown with styles 
     358 * 
     359 * This function opens the dir styles/ 
     360 * for every dir in there that contains a file index.css 
     361 * it puts the dirname in the dropdown. It also has an onchange 
     362 * javascript function attached so it will reload the blog with the new 
     363 * style applied. 
     364 * 
     365 * @return bool false if the styledir cannot be opened 
     366 */ 
    353367function blog_show_styleswitcher() { 
    354368        if ($dh = opendir("style")) { 
     
    373387        } 
    374388} 
    375  
    376 //}}}---------------------------------------------------------------------------------------------- 
    377 //{{{ blog_content($start, $limit): main function to give user correct html depending on action etc 
    378 //------------------------------------------------------------------------------------------------- 
     389/* }}} */ 
     390/* blog_content($start, $limit) {{{ */ 
     391/** 
     392 *  main function to give user correct html depending on action etc 
     393 * 
     394 * @param int (optional) Start entry in recordset 
     395 * @param int (optional) Number of records to show 
     396 */ 
    379397function blog_content($start=0, $limit=0) { 
    380398        /* get limit from database, when no limit given by function call */ 
     
    409427        } 
    410428} 
    411  
    412 //}}}---------------------------------------------- 
    413 //{{{ blog_default_links(): show default menu links 
    414 //------------------------------------------------- 
     429/* }}} */ 
     430/* blog_default_links() {{{ */ 
     431/** 
     432 * show default menu links 
     433 */ 
    415434function blog_default_links() { 
    416435        ?> 
     
    426445} 
    427446 
    428 //}}}------------------------------------------------------- 
    429 //{{{ blog_archive_links($amount): show 'archive' menu links 
    430 //---------------------------------------------------------- 
     447/* }}} */ 
     448/* blog_archive_links($amount) {{{ */ 
     449/** 
     450 * show 'month archive' menu links 
     451 * 
     452 * @param int The number of months to show 
     453 */ 
    431454function blog_archive_links($amount=5) { 
    432455        global $db; 
     
    449472        ?></ul><? 
    450473} 
    451  
    452 //}}}-------------------------------------------------------- 
    453 //{{{ blog_cats_links(): show 'categories' archive menu links 
    454 //----------------------------------------------------------- 
     474/* }}} */ 
     475/* blog_cats_links() {{{ */ 
     476/** 
     477 * show 'categories' archive menu links 
     478 * 
     479 * @param int if set to 1 it will sort on the second letter instead of the first ;-) 
     480 */ 
    455481function blog_cats_links($easter_eggie=0) { 
    456482        global $db; 
     
    496522        ?></ul><? 
    497523} 
    498  
    499 //}}}-------------------------------------------------------------------------------------- 
    500 //{{{ post_comment($postdata): store comment in database and optionally mail author of post 
    501 //----------------------------------------------------------------------------------------- 
     524/* }}} */ 
     525/* post_comment($postdata) {{{ */ 
     526/** 
     527 * store comment in database and optionally mail author of post 
     528 * 
     529 * If the user checked the 'mail' box in the admin this 
     530 * function will also send a mail to the author of the post. 
     531 * 
     532 * @todo Make a user database for commenting. 
     533 * @param array postdata, content of the comment entry form 
     534 */ 
    502535function post_comment($postdata) { 
    503536        if ($postdata["comment_save_info"]) { 
     
    545578        show_article($postdata["articles_id"]); 
    546579} 
    547  
    548 //}}}---------------------------------------------------------- 
    549 //{{{ limit_text($text, $length): limit the length of a message 
    550 //------------------------------------------------------------- 
     580/* }}} */ 
     581/* limit_text($text, $length) {{{ */ 
     582/** 
     583 * limit the length of a message 
     584 * 
     585 * @param string the text to limit in length 
     586 * @param int the number of chars to limit to 
     587 * @return int 1 if truncated, 0 if original string is within limits 
     588 */ 
    551589function limit_text($text, $length=4000) { 
    552590        if (strstr($text, "##BREAKPOINT##")) { 
     
    566604        } 
    567605} 
    568  
    569 //}}}--------------------------------------------------------------------------- 
    570 //{{{ get_articles($start, $limit, $archive): show posts in pages or the archive 
    571 // $archive can be: 0 for none, 1 for archive by date, 2 for archive by category 
    572 //------------------------------------------------------------------------------ 
     606/* }}} */ 
     607/* get_articles($start, $limit, $archive) {{{ */ 
     608/** 
     609 * show posts in pages or the archive 
     610 * 
     611 * @param int the starting point in the recordset 
     612 * @param int the ammount of items to show 
     613 * @param int type of archive. 0 = none, 1 = archive by date, 2 = archive by category 
     614 */ 
    573615function get_articles($start, $limit, $archive=0) { 
    574616        global $db; 
     
    737779        } 
    738780} 
    739  
    740 //}}}--------------------------------------- 
    741 //{{{ blog_show_search(): show livesearchbox 
    742 //------------------------------------------ 
     781/* }}} */ 
     782/* blog_show_search() {{{ */ 
     783/** 
     784 * show livesearchbox 
     785 */ 
    743786function blog_show_search() { 
    744787        ?> 
     
    752795        <? 
    753796} 
    754 //}}}--------------------------------------------------------------- 
    755 //{{{ strip_invalid_xml(): strip some stuff leftover from old editor 
    756 //------------------------------------------------------------------ 
     797/* }}} */ 
     798/* strip_invalid_xml() {{{ */ 
     799/** 
     800 * strip some stuff leftover from old editor 
     801 * 
     802 * @param string the text to process 
     803 * @return string the text with invalid xml stripped 
     804 */ 
    757805function strip_invalid_xml($data) { 
    758806        $data = preg_replace("/ ref=\"[^\"].*\"/si", "", $data); 
    759807        return $data; 
    760808} 
    761 //}}}------------------------------------- 
    762 //{{{ load_plugins(): load all the plugins 
    763 //---------------------------------------- 
     809/* }}} */ 
     810/* load_plugins()  {{{ */ 
     811/** 
     812 * load all the plugins 
     813 */ 
    764814function load_plugins() { 
    765815        /* this should become a setting */ 
     
    775825        } 
    776826} 
    777          
     827/* }}} */ 
     828/* register_plugin($name, $type) {{{ */ 
     829/** 
     830 * register the plugin in the global plugin array 
     831 * 
     832 * @param string the plugin name 
     833 * @param string the kind of plugin 
     834 * @todo make more documentation for this 
     835 */ 
    778836function register_plugin($name, $type) { 
    779837        $GLOBALS["plugins"][$type][] = $name; 
    780838} 
    781  
     839/* }}} */ 
     840/* getPluginsByType($type) {{{ */ 
     841/** 
     842 * get plugins from global array that apply on given type 
     843 * 
     844 * @param string the plugintype to get plugins for 
     845 * @return array plugin names matching $type 
     846 */ 
    782847function getPluginsByType($type) { 
    783848        if (is_array($GLOBALS["plugins"][$type])) { 
     
    790855        return $plugs; 
    791856} 
    792 //}}}-------------------------------------------------- 
    793 //{{{ run_plugins($data, $types): run specified plugins 
    794 //----------------------------------------------------- 
     857/* }}} */ 
     858/* run_plugins($data, $types) {{{ */ 
     859/** 
     860 * run specified plugins 
     861 * 
     862 * @param string the data to run the plugins on 
     863 * @param string the type of plugins to run 
     864 * @return string processed version of data 
     865 */ 
    795866function run_plugins($data, $types) { 
    796867        if (!is_array($types)) { 
     
    810881        return $data; 
    811882} 
    812  
    813 //}}}--------------------------------------- 
    814 //{{{ obfuscate_ip($ip): be privacy friendly 
     883/* }}} */ 
     884/* obfuscate_ip($ip)  {{{ */ 
     885/** 
     886 * obfuscate ip addresses so we are privacy friendly 
     887 * 
     888 * @param string the ip address to obfuscate 
     889 * @return string the ip with the last octet replaced by X 
     890 */ 
    815891//------------------------------------------ 
    816892function obfuscate_ip($ip) { 
     
    822898        return $return; 
    823899} 
    824 //}}} 
     900/* }}} */ 
    825901?>