Scriptlog Docs

Scriptlog Documentation

Code reference for the Scriptlog codebase

User Tools

Site Tools


scriptlog:public:functions-comments

This is an old revision of the document!


public/themes/blog/functions-comments.php

Source: public/themes/blog/functions-comments.php · 73 lines, ~286 statements · namespace: (global) · `declare(strict_types=1)`: no


Blog Theme Comment Helpers

Comment counting, CSRF token and comment-section rendering helpers for the Bootstrap Blog theme. Extracted from the monolithic functions.php (Phase 5 remediation). The raw comment-count SQL is routed through CommentDao. All functions use function_exists() guards to avoid redeclaration errors.

Functions (3)

^ Function ^ Line ^ Params ^ Returns ^ Summary ^
| ''total_comment'' | 22 | 1 |  | total_comment() - Get total approved comments for post |
| ''block_csrf'' | 42 | 0 |  | block_csrf() - Generate CSRF token for comment form |
| ''render_comments_section'' | 55 | 2 | ''string'' | render_comments_section() - Render comments section HTML |

total_comment()

Declared inside a guard (the project uses `if (!function_exists(…))` around global functions), so the declaration is conditional at load time.

public function total_comment($id)

total_comment() - Get total approved comments for post

^ Parameter ^ Type ^ Default ^ Description ^
| ''$id'' | ''(untyped)'' | //required// |  |

block_csrf()

Declared inside a guard (the project uses `if (!function_exists(…))` around global functions), so the declaration is conditional at load time.

public function block_csrf()

block_csrf() - Generate CSRF token for comment form

render_comments_section()

Declared inside a guard (the project uses `if (!function_exists(…))` around global functions), so the declaration is conditional at load time.

public function render_comments_section(int $postId, int $offset = 0): string

render_comments_section() - Render comments section HTML

^ Parameter ^ Type ^ Default ^ Description ^
| ''$postId'' | ''int'' | //required// |  |
| ''$offset'' | ''int'' | ''0'' |  |

Generated by 'tools/gendoc'.

scriptlog/public/functions-comments.1790413764.txt.gz · Last modified: by admin