| Current Path : /var/www/cesa.co.za/php/templates/bce/ |
| Current File : /var/www/cesa.co.za/php/templates/bce/guideline-view.php |
<?php
/**
* BCE Guideline single post content template.
* Expects: $post (array or false), $baseUrl (e.g. '/cesanet', '/cceconvenors', '/cceadmin')
*/
if (!isset($baseUrl)) {
$baseUrl = '/cesanet';
}
if (!function_exists('bce_guideline_wpautop')) {
function bce_guideline_wpautop($content) {
$content = str_replace("\r\n", "\n", $content);
$content = str_replace("\r", "\n", $content);
$paragraphs = explode("\n\n", $content);
$formatted = '';
foreach ($paragraphs as $paragraph) {
$paragraph = trim($paragraph);
if (!empty($paragraph)) {
$formatted .= '<p>' . $paragraph . '</p>';
}
}
return $formatted;
}
}
?>
<div class="text-end">
<a href="<?php echo htmlspecialchars($baseUrl); ?>/guideline.php" class="btn">Back to Introduction</a>
</div>
<?php
if (is_array($post) && count($post) > 0) {
?>
<div class="content-block">
<h1><?php echo htmlspecialchars($post['post_title']); ?></h1>
<div class="post-content">
<?php echo bce_guideline_wpautop($post['post_content']); ?>
</div>
</div>
<?php
} else {
echo '<div class="content-block"><p>Post not found or not published.</p></div>';
}