Files
dnssash/theme/rd.dnssash/rb.custom/latest_posts_section/module.php
T
2026-06-11 18:47:38 +09:00

57 lines
1.9 KiB
PHP

<?php
if (!defined('_GNUBOARD_')) exit;
/**
* rb.custom :: latest_posts_section/module.php
* 최신글 5개 모듈
*/
// Assume $md_id is provided by the Rebuilder system. If not, generate a fallback.
if (!isset($md_id)) {
$md_id = uniqid('lps_'); // Fallback unique ID
}
// 최신글을 가져올 게시판 목록
$latest_boards = array('journal', 'coverage', 'interview', 'newsfocus1', 'newsfocus2', 'photonews', 'newtech', 'newproduct');
?>
<div class="latest-posts-module" id="lps-<?php echo $md_id; ?>">
<?php foreach ($latest_boards as $bo_table): ?>
<div class="latest-board-section">
<?php
// 'basic' 최신글 스킨을 사용하여 각 게시판의 최신글 5개를 가져옵니다.
echo latest('theme/basic', $bo_table, 5, 40);
?>
</div>
<?php endforeach; ?>
</div>
<link rel="stylesheet" href="<?php echo G5_THEME_URL; ?>/rb.custom/latest_posts_section/module.css?ver=<?php echo G5_CSS_VER; ?>">
<script>
(function() {
const currentModuleId = 'lps-<?php echo $md_id; ?>';
const initFunctionName = 'initLatestPostsModule';
const scriptId = 'latest-posts-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/latest_posts_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>