本文整理汇总了PHP中Sections::post_default方法的典型用法代码示例。如果您正苦于以下问题:PHP Sections::post_default方法的具体用法?PHP Sections::post_default怎么用?PHP Sections::post_default使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Sections
的用法示例。
在下文中一共展示了Sections::post_default方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: lookup
/**
* get the id of one section knowing its nick name
*
* At the moment following section nick names are used throughout yacs:
* - 'clicks' - to host external link that are embed into ordinary pages
* - 'covers' - pages to be displayed as introductory articles at the front page
* - 'forum' - the coffee machine, for those that are not drinking so much coffee
* - 'extra_boxes' - page to be displayed as small boxes at the front page
* - 'letters' - pages sent by e-mail to subscribers
* - 'menus' - page to be displayed on all pages as the main site menu
* - 'my_section' - sample section for demonstrattion purpose
* - 'navigation_boxes' - pages to be displayed as small boxes on all pages
* - 'partners' - pages dedicated to external partners
* - 'queries' - pages sent by surfers to submit their queries to the webmaster
*
* @param string the nick name looked for
* @return string either 'section:<id>', or NULL
*
* @see articles/populate.php
* @see articles/review.php
* @see index.php
* @see letters/index.php
* @see letters/new.php
* @see links/index.php
* @see links/links.php
*/
public static function lookup($nick_name)
{
global $context;
// the section already exists
if ($item = Sections::get($nick_name)) {
return 'section:' . $item['id'];
}
// attempt to create a default item
Sections::post_default($nick_name);
// do the check again
if ($item = Sections::get($nick_name)) {
return 'section:' . $item['id'];
}
// tough luck
return NULL;
}