* @author sol (ngleader@gmail.com) * @brief 글 삭제시 Syndication Ping * gnuboard5/bbs/bbs.delete_all.php 파일에 추가 * include '../syndi/include/include.bbs.delete_all.php'; */ if (!defined('_GNUBOARD_')) { return; } if (!$write || !$row) { return; } // 비회원 access가 불가능 한 게시판이면 pass $sql = 'select count(*) as cnt from ' . $g5['board_table'] . ' b, ' . $g5['group_table'] . ' g where b.bo_table=\'' . $bo_table . '\' and b.bo_read_level=1 and b.bo_list_level=1 and g.gr_use_access=0 and g.gr_id = b.gr_id'; $cnt_row = sql_fetch($sql); if ($cnt_row['cnt'] < 1) { return; } $syndi_dir = realpath(dirname(__FILE__) . '/../'); // include config & Syndication Ping class include_once $syndi_dir . '/config/site.config.php'; include_once $syndi_dir . '/libs/SyndicationHandler.class.php'; include_once $syndi_dir . '/libs/SyndicationPing.class.php'; $sql = "select wr_subject from {$write_table} where wr_id='" . $row['wr_id'] . "'"; $subject_row = sql_fetch($sql); $_link = './bbs/board.php?bo_table=%s&wr_id=%s'; $_sql = "insert into {$g5['syndi_log_table']} (content_id, bbs_id, title, link_alternative, delete_date) values('%s','%s','%s','%s','%s')"; sql_query(sprintf($_sql, $row['wr_id'], $bo_table, addslashes($subject_row['wr_subject']), sprintf($_link, $bo_table, $row['wr_id']), date('YmdHis')), false); $oPing = new SyndicationPing(); $oPing->setId(SyndicationHandler::getTag('channel', $bo_table)); $oPing->setType('deleted'); $oPing->request();
function ztime($str) { if (!$str) { return; } $hour = (int) substr($str, 8, 2); $min = (int) substr($str, 10, 2); $sec = (int) substr($str, 12, 2); $year = (int) substr($str, 0, 4); $month = (int) substr($str, 4, 2); $day = (int) substr($str, 6, 2); if (strlen($str) <= 8) { $gap = 0; } else { $gap = SyndicationHandler::zgap(); } return mktime($hour, $min, $sec, $month ? $month : 1, $day ? $day : 1, $year) + $gap; }
<?php include_once './_common.php'; /** * @file syndi_echo.php * @author sol (ngleader@gmail.com) * @brief Print Syndication Data XML */ header('Content-Type: text/html; charset=UTF-8'); header('Pragma: no-cache'); if (version_compare(PHP_VERSION, '5.3.0') >= 0) { date_default_timezone_set(@date_default_timezone_get()); } error_reporting(E_ALL & ~E_NOTICE & ~E_STRICT); $syndi_path = dirname(__FILE__); // include class include $syndi_path . '/libs/SyndicationHandler.class.php'; include $syndi_path . '/libs/SyndicationObject.class.php'; include $syndi_path . '/libs/SyndicationSite.class.php'; include $syndi_path . '/libs/SyndicationChannel.class.php'; include $syndi_path . '/libs/SyndicationArticle.class.php'; include $syndi_path . '/libs/SyndicationDeleted.class.php'; // config & custom func for site include $syndi_path . '/config/site.config.php'; include $syndi_path . '/func/site.func.php'; $oSyndicationHandler =& SyndicationHandler::getInstance(); $oSyndicationHandler->setArgument(); echo $oSyndicationHandler->getXML();
/** * @brief 삭제 게시물 목록 * 삭제된 게시물에 대해 logging이 필요 **/ function Syndi_getDeletedList($args) { global $g5; $table = $g5['syndi_log_table']; // get delete article list $where = ''; if ($args->target_content_id) { $where .= " and content_id='" . mysql_real_escape_string($args->target_content_id) . "'"; } if ($args->target_channel_id) { $where .= " and bbs_id='" . mysql_real_escape_string($args->target_channel_id) . "'"; } if ($args->start_time) { $where .= ' and delete_date >= ' . $args->start_time; } if ($args->end_time) { $where .= ' and delete_date <= ' . $args->end_time; } $sql = "select content_id, bbs_id, title, link_alternative, delete_date from {$table} where 1=1" . $where; $sql .= " order by delete_date desc "; $sql .= sprintf(" limit %s,%s", ($args->page - 1) * $args->max_entry, $args->max_entry); $result = sql_query($sql); $deleted_list = array(); while ($row = sql_fetch_array($result)) { $oDeleted = new SyndicationDeleted(); $tag = SyndicationHandler::getTag('article', $row['bbs_id'], $row['content_id']); $oDeleted->setId($tag); $oDeleted->setTitle($row['title']); $oDeleted->setUpdated($row['delete_date']); $oDeleted->setDeleted($row['delete_date']); if (substr($row['link_alternative'], 0, 2) == './') { $row['link_alternative'] = G5_URL . substr($row['link_alternative'], 1); } $oDeleted->setLinkAlternative($row['link_alternative']); $deleted_list[] = $oDeleted; } sql_free_result($result); return $deleted_list; }
<?php /** * @file include.adm.board_delete.inc.php * @author sol (ngleader@gmail.com) * @brief 게시판 삭제시 Syndication Ping * gnuboard5/adm/board_delete.inc.php 파일에 추가 * include '../syndi/include/include.adm.board_delete.inc.php'; */ if (!defined('_GNUBOARD_')) { return; } if (!$tmp_bo_table) { return; } $syndi_dir = realpath(dirname(__FILE__) . '/../'); // include config & Syndication Ping class include_once $syndi_dir . '/config/site.config.php'; include_once $syndi_dir . '/libs/SyndicationHandler.class.php'; include_once $syndi_dir . '/libs/SyndicationPing.class.php'; $oPing = new SyndicationPing(); $oPing->setId(SyndicationHandler::getTag('site')); $oPing->setType('channel'); // delete log $_sql = "delete from {$g5['syndi_log_table']} where bbs_id='%s'"; sql_query(sprintf($_sql, $tmp_bo_table)); $oPing->request();
function _getTime($time) { return SyndicationHandler::getTimestamp($time); }
* @file include.bbs.move_update.php * @author sol (ngleader@gmail.com) * @brief 글 등록/수정시 Syndication Ping * gnuboard5/bbs/move_update.php 파일에 추가 * include '../syndi/include/include.bbs.move_update.php'; */ if (!defined('_GNUBOARD_')) { return; } if ($sw != 'move' && $sw != 'copy') { return; } $syndi_dir = realpath(dirname(__FILE__) . '/../'); // include config & Syndication Ping class include_once $syndi_dir . '/config/site.config.php'; include_once $syndi_dir . '/libs/SyndicationHandler.class.php'; include_once $syndi_dir . '/libs/SyndicationPing.class.php'; if ($sw == "copy") { $oPing = new SyndicationPing(); $oPing->setId(SyndicationHandler::getTag('channel', $bo_table)); $oPing->setType('article'); $oPing->request(); unset($oPing); } for ($i = 0, $c = count($_POST['chk_bo_table']); $i < $c; $i++) { $oPing = new SyndicationPing(); $oPing->setId(SyndicationHandler::getTag('channel', $_POST['chk_bo_table'][$i])); $oPing->setType('article'); $oPing->request(); unset($oPing); }