====== public/themes/blog/functions-post.php ======
**Source:** ''public/themes/blog/functions-post.php'' · 935 lines, ~5022 statements · namespace: //(global)// · `declare(strict_types=1)`: no
----
Blog Theme Post Helpers
Post retrieval, topic, tag, page and archive helpers for the Bootstrap
Blog theme. Extracted from the monolithic functions.php (Phase 5
remediation). Raw SQL has been routed through PostDao so templates never
reach into the database layer directly. All functions use
function_exists() guards to avoid redeclaration errors.
======= Functions (41) =======
^ Function ^ Line ^ Params ^ Returns ^ Summary ^
| ''previous_post'' | 22 | 1 | | previous_post() - Get previous post link |
| ''next_post'' | 50 | 1 | | next_post() - Get next post link |
| ''initialize_page'' | 78 | 0 | | initialize_page() |
| ''initialize_post'' | 88 | 0 | | initialize_post() |
| ''initialize_comment'' | 98 | 0 | | initialize_comment() |
| ''initialize_archive'' | 108 | 0 | | initialize_archive() |
| ''initialize_topic'' | 118 | 0 | | initialize_topic() |
| ''initialize_tag'' | 128 | 0 | | initialize_tag() |
| ''initialize_gallery'' | 138 | 0 | | initialize_gallery() |
| ''featured_post'' | 148 | 0 | | featured_post() - Get random headline posts |
| ''sticky_page'' | 159 | 0 | | sticky_page() - Get random sticky page |
| ''random_posts'' | 170 | 2 | | random_posts() - Get random posts |
| ''latest_posts'' | 181 | 2 | | latest_posts() - Get latest posts |
| ''prepare_post_card'' | 203 | 1 | ''\Scriptlog\Core\Theme\PostViewModel'' | prepare_post_card() - Normalize a raw post row into a display-ready card. |
| ''theme_post_url'' | 260 | 1 | ''string'' | theme_post_url() - Build a post URL without a per-row database round-trip. |
| ''theme_topic_url'' | 297 | 1 | ''string'' | theme_topic_url() - Build a category URL without a per-row DB round-trip. |
| ''theme_page_url'' | 335 | 1 | ''string'' | theme_page_url() - Build a static page URL without a per-row DB round-trip. |
| ''theme_search_url'' | 373 | 0 | ''string'' | theme_search_url() - Build the front-end search URL honoring the permalink setting. |
| ''theme_tag_url'' | 399 | 1 | ''string'' | theme_tag_url() - Build a tag archive URL without a per-row DB round-trip. |
| ''theme_month_name'' | 424 | 1 | ''string'' | theme_month_name() - Localized month number to English month name. |
| ''theme_archive_url'' | 451 | 2 | ''string'' | theme_archive_url() - Build a monthly archive URL without a per-row DB |
| ''prepare_page'' | 484 | 1 | | prepare_page() - Normalize a raw page row into a display-ready PageViewModel. |
| ''prepare_archive'' | 528 | 1 | | prepare_archive() - Normalize a raw archive row into a display-ready |
| ''prepare_sidebar'' | 555 | 0 | | prepare_sidebar() - Normalize raw sidebar aggregates into a display-ready |
| ''format_topics'' | 639 | 1 | | Format topics data into HTML category links |
| ''retrieves_topic_simple'' | 688 | 1 | | retrieves_topic_simple() - Get topic links for post |
| ''retrieves_topic_prepared'' | 717 | 1 | | retrieves_topic_prepared() - Get topic links with status check |
| ''sidebar_topics'' | 741 | 0 | | sidebar_topics() - Get topics for sidebar |
| ''retrieve_tags'' | 752 | 0 | | retrieve_tags() - Get tags for sidebar |
| ''link_tag'' | 762 | 1 | | link_tag() - Generate tag links |
| ''link_topic'' | 778 | 1 | ''string'' | link_topic() - Generate topic link |
| ''retrieve_blog_posts'' | 799 | 0 | | retrieve_blog_posts() - Get all blog posts |
| ''retrieve_detail_post'' | 810 | 1 | | retrieve_detail_post() - Get single post by ID |
| ''posts_by_archive'' | 836 | 1 | | posts_by_archive() - Get posts by archive |
| ''archive_index'' | 847 | 0 | | archive_index() - Get all archives for index |
| ''posts_by_tag'' | 858 | 1 | | posts_by_tag() - Get posts by tag |
| ''searching_by_tag'' | 869 | 1 | | searching_by_tag() - Full-text tag search |
| ''posts_by_category'' | 881 | 1 | | posts_by_category() - Get posts by category |
| ''retrieve_archives'' | 894 | 0 | | retrieve_archives() - Get archives for sidebar |
| ''retrieve_page'' | 905 | 2 | | retrieve_page() - Get page by ID or slug |
| ''nothing_found'' | 921 | 0 | | nothing_found() - Display "no posts" message |
======== previous_post() ========
//Declared inside a guard (the project uses `if (!function_exists(...))` around global functions), so the declaration is conditional at load time.//
public function previous_post($id)
previous_post() - Get previous post link
^ Parameter ^ Type ^ Default ^ Description ^
| ''$id'' | ''(untyped)'' | //required// | |
======== next_post() ========
//Declared inside a guard (the project uses `if (!function_exists(...))` around global functions), so the declaration is conditional at load time.//
public function next_post($id)
next_post() - Get next post link
^ Parameter ^ Type ^ Default ^ Description ^
| ''$id'' | ''(untyped)'' | //required// | |
======== initialize_page() ========
//Declared inside a guard (the project uses `if (!function_exists(...))` around global functions), so the declaration is conditional at load time.//
public function initialize_page()
initialize_page()
======== initialize_post() ========
//Declared inside a guard (the project uses `if (!function_exists(...))` around global functions), so the declaration is conditional at load time.//
public function initialize_post()
initialize_post()
======== initialize_comment() ========
//Declared inside a guard (the project uses `if (!function_exists(...))` around global functions), so the declaration is conditional at load time.//
public function initialize_comment()
initialize_comment()
======== initialize_archive() ========
//Declared inside a guard (the project uses `if (!function_exists(...))` around global functions), so the declaration is conditional at load time.//
public function initialize_archive()
initialize_archive()
======== initialize_topic() ========
//Declared inside a guard (the project uses `if (!function_exists(...))` around global functions), so the declaration is conditional at load time.//
public function initialize_topic()
initialize_topic()
======== initialize_tag() ========
//Declared inside a guard (the project uses `if (!function_exists(...))` around global functions), so the declaration is conditional at load time.//
public function initialize_tag()
initialize_tag()
======== initialize_gallery() ========
//Declared inside a guard (the project uses `if (!function_exists(...))` around global functions), so the declaration is conditional at load time.//
public function initialize_gallery()
initialize_gallery()
======== featured_post() ========
//Declared inside a guard (the project uses `if (!function_exists(...))` around global functions), so the declaration is conditional at load time.//
public function featured_post()
featured_post() - Get random headline posts
======== sticky_page() ========
//Declared inside a guard (the project uses `if (!function_exists(...))` around global functions), so the declaration is conditional at load time.//
public function sticky_page()
sticky_page() - Get random sticky page
======== random_posts() ========
//Declared inside a guard (the project uses `if (!function_exists(...))` around global functions), so the declaration is conditional at load time.//
public function random_posts($start, $end)
random_posts() - Get random posts
^ Parameter ^ Type ^ Default ^ Description ^
| ''$start'' | ''(untyped)'' | //required// | |
| ''$end'' | ''(untyped)'' | //required// | |
======== latest_posts() ========
//Declared inside a guard (the project uses `if (!function_exists(...))` around global functions), so the declaration is conditional at load time.//
public function latest_posts($limit, $position = null)
latest_posts() - Get latest posts
^ Parameter ^ Type ^ Default ^ Description ^
| ''$limit'' | ''(untyped)'' | //required// | |
| ''$position'' | ''(untyped)'' | ''null'' | |
======== prepare_post_card() ========
//Declared inside a guard (the project uses `if (!function_exists(...))` around global functions), so the declaration is conditional at load time.//
public function prepare_post_card(array $entry): \Scriptlog\Core\Theme\PostViewModel
prepare_post_card() - Normalize a raw post row into a display-ready card.
^ Parameter ^ Type ^ Default ^ Description ^
| ''$entry'' | ''array'' | //required// | |
======== theme_post_url() ========
//Declared inside a guard (the project uses `if (!function_exists(...))` around global functions), so the declaration is conditional at load time.//
public function theme_post_url(array $row): string
theme_post_url() - Build a post URL without a per-row database round-trip.
^ Parameter ^ Type ^ Default ^ Description ^
| ''$row'' | ''array'' | //required// | |
======== theme_topic_url() ========
//Declared inside a guard (the project uses `if (!function_exists(...))` around global functions), so the declaration is conditional at load time.//
public function theme_topic_url(array $row): string
theme_topic_url() - Build a category URL without a per-row DB round-trip.
^ Parameter ^ Type ^ Default ^ Description ^
| ''$row'' | ''array'' | //required// | |
======== theme_page_url() ========
//Declared inside a guard (the project uses `if (!function_exists(...))` around global functions), so the declaration is conditional at load time.//
public function theme_page_url(array $row): string
theme_page_url() - Build a static page URL without a per-row DB round-trip.
^ Parameter ^ Type ^ Default ^ Description ^
| ''$row'' | ''array'' | //required// | |
======== theme_search_url() ========
//Declared inside a guard (the project uses `if (!function_exists(...))` around global functions), so the declaration is conditional at load time.//
public function theme_search_url(): string
theme_search_url() - Build the front-end search URL honoring the permalink setting.
======== theme_tag_url() ========
//Declared inside a guard (the project uses `if (!function_exists(...))` around global functions), so the declaration is conditional at load time.//
public function theme_tag_url(string $tag): string
theme_tag_url() - Build a tag archive URL without a per-row DB round-trip.
^ Parameter ^ Type ^ Default ^ Description ^
| ''$tag'' | ''string'' | //required// | Raw tag value (display form) |
======== theme_month_name() ========
//Declared inside a guard (the project uses `if (!function_exists(...))` around global functions), so the declaration is conditional at load time.//
public function theme_month_name(string $month): string
theme_month_name() - Localized month number to English month name.
^ Parameter ^ Type ^ Default ^ Description ^
| ''$month'' | ''string'' | //required// | Month as number (1 or 2 digits, e.g. "3" or "03") |
======== theme_archive_url() ========
//Declared inside a guard (the project uses `if (!function_exists(...))` around global functions), so the declaration is conditional at load time.//
public function theme_archive_url(string $month, string $year): string
theme_archive_url() - Build a monthly archive URL without a per-row DB
^ Parameter ^ Type ^ Default ^ Description ^
| ''$month'' | ''string'' | //required// | Archive month (1 or 2 digits) |
| ''$year'' | ''string'' | //required// | Archive year (4 digits) |
======== prepare_page() ========
//Declared inside a guard (the project uses `if (!function_exists(...))` around global functions), so the declaration is conditional at load time.//
public function prepare_page(array $entry)
prepare_page() - Normalize a raw page row into a display-ready PageViewModel.
^ Parameter ^ Type ^ Default ^ Description ^
| ''$entry'' | ''array'' | //required// | |
======== prepare_archive() ========
//Declared inside a guard (the project uses `if (!function_exists(...))` around global functions), so the declaration is conditional at load time.//
public function prepare_archive(array $entry)
prepare_archive() - Normalize a raw archive row into a display-ready
^ Parameter ^ Type ^ Default ^ Description ^
| ''$entry'' | ''array'' | //required// | |
======== prepare_sidebar() ========
//Declared inside a guard (the project uses `if (!function_exists(...))` around global functions), so the declaration is conditional at load time.//
public function prepare_sidebar()
prepare_sidebar() - Normalize raw sidebar aggregates into a display-ready
======== format_topics() ========
//Declared inside a guard (the project uses `if (!function_exists(...))` around global functions), so the declaration is conditional at load time.//
public function format_topics($topics_data)
Format topics data into HTML category links
^ Parameter ^ Type ^ Default ^ Description ^
| ''$topics_data'' | ''(untyped)'' | //required// | Pipe-delimited topic data from GROUP_CONCAT |
======== retrieves_topic_simple() ========
//Declared inside a guard (the project uses `if (!function_exists(...))` around global functions), so the declaration is conditional at load time.//
public function retrieves_topic_simple($id)
retrieves_topic_simple() - Get topic links for post
^ Parameter ^ Type ^ Default ^ Description ^
| ''$id'' | ''(untyped)'' | //required// | |
======== retrieves_topic_prepared() ========
//Declared inside a guard (the project uses `if (!function_exists(...))` around global functions), so the declaration is conditional at load time.//
public function retrieves_topic_prepared($id)
retrieves_topic_prepared() - Get topic links with status check
^ Parameter ^ Type ^ Default ^ Description ^
| ''$id'' | ''(untyped)'' | //required// | |
======== sidebar_topics() ========
//Declared inside a guard (the project uses `if (!function_exists(...))` around global functions), so the declaration is conditional at load time.//
public function sidebar_topics()
sidebar_topics() - Get topics for sidebar
======== retrieve_tags() ========
//Declared inside a guard (the project uses `if (!function_exists(...))` around global functions), so the declaration is conditional at load time.//
public function retrieve_tags()
retrieve_tags() - Get tags for sidebar
======== link_tag() ========
//Declared inside a guard (the project uses `if (!function_exists(...))` around global functions), so the declaration is conditional at load time.//
public function link_tag($id)
link_tag() - Generate tag links
^ Parameter ^ Type ^ Default ^ Description ^
| ''$id'' | ''(untyped)'' | //required// | |
======== link_topic() ========
//Declared inside a guard (the project uses `if (!function_exists(...))` around global functions), so the declaration is conditional at load time.//
public function link_topic($id): string
link_topic() - Generate topic link
^ Parameter ^ Type ^ Default ^ Description ^
| ''$id'' | ''(untyped)'' | //required// | |
======== retrieve_blog_posts() ========
//Declared inside a guard (the project uses `if (!function_exists(...))` around global functions), so the declaration is conditional at load time.//
public function retrieve_blog_posts()
retrieve_blog_posts() - Get all blog posts
======== retrieve_detail_post() ========
//Declared inside a guard (the project uses `if (!function_exists(...))` around global functions), so the declaration is conditional at load time.//
public function retrieve_detail_post($id)
retrieve_detail_post() - Get single post by ID
^ Parameter ^ Type ^ Default ^ Description ^
| ''$id'' | ''(untyped)'' | //required// | |
======== posts_by_archive() ========
//Declared inside a guard (the project uses `if (!function_exists(...))` around global functions), so the declaration is conditional at load time.//
public function posts_by_archive(array $values)
posts_by_archive() - Get posts by archive
^ Parameter ^ Type ^ Default ^ Description ^
| ''$values'' | ''array'' | //required// | |
======== archive_index() ========
//Declared inside a guard (the project uses `if (!function_exists(...))` around global functions), so the declaration is conditional at load time.//
public function archive_index()
archive_index() - Get all archives for index
======== posts_by_tag() ========
//Declared inside a guard (the project uses `if (!function_exists(...))` around global functions), so the declaration is conditional at load time.//
public function posts_by_tag($tag)
posts_by_tag() - Get posts by tag
^ Parameter ^ Type ^ Default ^ Description ^
| ''$tag'' | ''(untyped)'' | //required// | |
======== searching_by_tag() ========
//Declared inside a guard (the project uses `if (!function_exists(...))` around global functions), so the declaration is conditional at load time.//
public function searching_by_tag($tag)
searching_by_tag() - Full-text tag search
^ Parameter ^ Type ^ Default ^ Description ^
| ''$tag'' | ''(untyped)'' | //required// | |
======== posts_by_category() ========
//Declared inside a guard (the project uses `if (!function_exists(...))` around global functions), so the declaration is conditional at load time.//
public function posts_by_category($topicId)
posts_by_category() - Get posts by category
^ Parameter ^ Type ^ Default ^ Description ^
| ''$topicId'' | ''(untyped)'' | //required// | |
======== retrieve_archives() ========
//Declared inside a guard (the project uses `if (!function_exists(...))` around global functions), so the declaration is conditional at load time.//
public function retrieve_archives()
retrieve_archives() - Get archives for sidebar
======== retrieve_page() ========
//Declared inside a guard (the project uses `if (!function_exists(...))` around global functions), so the declaration is conditional at load time.//
public function retrieve_page($arg, $rewrite)
retrieve_page() - Get page by ID or slug
^ Parameter ^ Type ^ Default ^ Description ^
| ''$arg'' | ''(untyped)'' | //required// | |
| ''$rewrite'' | ''(untyped)'' | //required// | |
======== nothing_found() ========
//Declared inside a guard (the project uses `if (!function_exists(...))` around global functions), so the declaration is conditional at load time.//
public function nothing_found()
nothing_found() - Display "no posts" message
----
//Generated by 'tools/gendoc'.//