AvocadoAmber/AvocadoEdition_Light/lib/poll.lib.php

31 lines
756 B
PHP
Raw Normal View History

2022-09-17 20:50:50 +09:00
<?php
2024-09-19 20:57:39 +09:00
if (!defined('_GNUBOARD_'))
exit;
2022-09-17 20:50:50 +09:00
// 설문조사
2024-09-19 20:57:39 +09:00
function poll($skin_dir = 'basic', $po_id = false)
2022-09-17 20:50:50 +09:00
{
2024-09-19 20:57:39 +09:00
global $config, $member, $g5, $is_admin;
2022-09-17 20:50:50 +09:00
2024-09-19 20:57:39 +09:00
// 투표번호가 넘어오지 않았다면 가장 큰(최근에 등록한) 투표번호를 얻는다
if (!$po_id) {
2024-09-30 01:58:32 +09:00
$row = sql_fetch("SELECT MAX(po_id) as max_po_id FROM {$g5['poll_table']} ");
2024-09-19 20:57:39 +09:00
$po_id = $row['max_po_id'];
}
2022-09-17 20:50:50 +09:00
2024-09-19 20:57:39 +09:00
if (!$po_id)
return;
2022-09-17 20:50:50 +09:00
2024-09-19 20:57:39 +09:00
$poll_skin_path = G5_SKIN_PATH . '/poll/' . $skin_dir;
$poll_skin_url = G5_SKIN_URL . '/poll/' . $skin_dir;
2022-09-17 20:50:50 +09:00
2024-09-30 01:58:32 +09:00
$po = sql_fetch("SELECT * FROM {$g5['poll_table']} where po_id = '$po_id' ");
2022-09-17 20:50:50 +09:00
2024-09-19 20:57:39 +09:00
ob_start();
include_once $poll_skin_path . "/poll.skin.php";
2024-09-19 20:57:39 +09:00
$content = ob_get_contents();
ob_end_clean();
2022-09-17 20:50:50 +09:00
2024-09-19 20:57:39 +09:00
return $content;
2022-09-17 20:50:50 +09:00
}