yf_home_page user moduleHome page handling module.
| File | plugins/home_page/modules/yf_home_page.class.php |
|---|---|
| Use | module('home_page'), URL ?object=home_page |
| Extends | yf_module |
A site sets them in its config with $PROJECT_CONF['home_page']['NAME'] = ...;
| Property | Default | Description |
|---|---|---|
$NEWEST_BLOG_TEXT_LENint |
300 |
|
$NEWEST_FORUM_TEXT_LENint |
300 |
|
$NUM_NEWEST_ARTICLE_POSTint |
4 |
|
$NUM_NEWEST_BLOG_POSTSint |
4 |
|
$NUM_NEWEST_COMMENTSint |
4 |
|
$NUM_NEWEST_FORUM_POSTSint |
4 |
|
$NUM_NEWEST_GALLERY_PHOTOint |
5 |
|
$NUM_NEWEST_NEWSint |
4 |
Number of newest news to show |
$NUM_NEWEST_USERSint |
5 |
Number of newest users to show |
from yf_module: $CAPTCHA, $FORCE_STRIPSLASHES, $USER_GROUP, $USER_ID, $USE_BB_CODES, $USE_CAPTCHA, $USE_PREVIEW, $_boxes, $_comments_params, $_poll_params, $_tags_params
public function show()
public function show()
{
$cache_name = 'home_page_default';
$data = cache_get($cache_name);
if ( ! $data) {
$data = [
'newest_users' => module_safe('users')->_for_home_page($this->NUM_NEWEST_USERS),
'newest_news' => module_safe('news')->_for_home_page(['num_items' => $this->NUM_NEWEST_NEWS]),
'newest_forum_posts' => module_safe('forum')->_for_home_page($this->NUM_NEWEST_FORUM_POSTS, $this->NEWEST_FORUM_TEXT_LEN),
'newest_blog_posts' => module_safe('blog')->_for_home_page($this->NUM_NEWEST_BLOG_POSTS, $this->NEWEST_BLOG_TEXT_LEN),
'newest_gallery_photo' => module_safe('gallery')->_for_home_page($this->NUM_NEWEST_GALLERY_PHOTO),
'newest_article_post' => module_safe('articles')->_for_home_page($this->NUM_NEWEST_ARTICLE_POST),
'newest_comments' => module_safe('comments')->_for_home_page($this->NUM_NEWEST_COMMENTS),
];
cache_set($cache_name, $data);
}
$replace = &$data;
return tpl()->parse(($_GET['object'] ?? null) . '/main', $replace);
}
_ hooks and helpers; not routable as page actionspublic function __call($name, $arguments)
Catch missing method call.
public function __call($name, $arguments)
{
trigger_error(__CLASS__ . ': No method ' . $name, E_USER_WARNING);
return false;
}
from yf_module: _box(), _captcha_block(), _captcha_check(), _captcha_load_code(), _comment_delete_allowed(), _comment_edit_allowed(), _comment_is_allowed(), _display_submit_buttons(), _format_text(), _get_num_comments(), _poll(), _prefetch_rate_infos(), _prepare_preview(), _show_rate_box(), _show_tags(), _view_comments(), add_comment(), captcha_image(), create_poll(), delete_comment(), delete_poll(), display_preview(), edit_comment(), edit_tag(), tag(), view_poll_results()