51 lines
1.6 KiB
PHP
51 lines
1.6 KiB
PHP
<?php
|
|
if (!defined('_GNUBOARD_')) exit;
|
|
|
|
/**
|
|
* rb.custom :: notice_section/module.php
|
|
* 공지사항 모듈
|
|
*/
|
|
|
|
// Assume $md_id is provided by the Rebuilder system. If not, generate a fallback.
|
|
if (!isset($md_id)) {
|
|
$md_id = uniqid('ns_'); // Fallback unique ID
|
|
}
|
|
?>
|
|
|
|
<div class="notice-module" id="ns-<?php echo $md_id; ?>">
|
|
<!-- <h2>공지사항</h2>-->
|
|
<?php
|
|
// 'basic' 최신글 스킨을 사용하여 'notice' 게시판의 최신글 5개를 가져옵니다.
|
|
echo latest('theme/basic', 'notice', 5, 40);
|
|
?>
|
|
</div>
|
|
|
|
<link rel="stylesheet" href="<?php echo G5_THEME_URL; ?>/rb.custom/notice_section/module.css?ver=<?php echo G5_CSS_VER; ?>">
|
|
<script>
|
|
(function() {
|
|
const currentModuleId = 'ns-<?php echo $md_id; ?>';
|
|
const initFunctionName = 'initNoticeModule';
|
|
const scriptId = 'notice-module-script-' + currentModuleId;
|
|
|
|
if (document.getElementById(scriptId)) {
|
|
if (typeof window[initFunctionName] === 'function') {
|
|
window[initFunctionName](currentModuleId);
|
|
}
|
|
return;
|
|
}
|
|
|
|
const script = document.createElement('script');
|
|
script.id = scriptId;
|
|
script.src = '<?php echo G5_THEME_URL; ?>/rb.custom/notice_section/module.js?ver=<?php echo G5_JS_VER; ?>';
|
|
script.async = true;
|
|
|
|
script.onload = () => {
|
|
if (typeof window[initFunctionName] === 'function') {
|
|
window[initFunctionName](currentModuleId);
|
|
}
|
|
return;
|
|
};
|
|
document.head.appendChild(script);
|
|
})();
|
|
</script>
|