Example #1
0
 * @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();
Example #2
0
 * @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);
}
<?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();
    return;
}
if (!$board) {
    return;
}
// 비밀 게시판이면 pass
if ($board['bo_use_secret'] && $secret) {
    return;
}
// 비회원 사용자가 볼 수 없다면 pass
if ($board['bo_list_level'] > 1 || $board['bo_view_level'] > 1) {
    return;
}
if ($w == 'u' && $wr && !$wr['wr_id']) {
    return;
}
// 수정 대상 또는 신규 입력한 id가 있다면 ping을 보냄
if ($wr['wr_id'] || $wr_id) {
    $syndi_dir = realpath(dirname(__FILE__) . '/../');
    // include config & Syndication Ping class
    include $syndi_dir . '/config/site.config.php';
    include $syndi_dir . '/libs/SyndicationHandler.class.php';
    include $syndi_dir . '/libs/SyndicationPing.class.php';
    $oPing = new SyndicationPing();
    $oPing->setId(SyndicationHandler::getTag('channel', $board['bo_table']));
    $oPing->setType('article');
    // if deleted
    $_sql = "delete from {$g5['syndi_log_table']} where content_id='%s' and bbs_id='%s'";
    sql_query(sprintf($_sql, $wr_id ? $wr_id : $wr[wr_id], $board['bo_table']));
    $oPing->request();
}