<? /** * * 임시 저장 * * @package narinwiki * @subpackage pages * @license GPL2 (http://narinwiki.org/license) * @author byfun (http://byfun.com) * @filesource */ if(!defined("__NARIN_API__")) wiki_not_found_page(); if(!$member['mb_id']) wiki_ajax_error('로그인한 사용자만 사용할 수 있습니다.'); if(!$wr_doc) wiki_ajax_error('문서 제목이 누락되었습니다.'); if(!$wr_content) wiki_ajax_error('문서 내용이 없습니다.'); $id = md5($member['mb_id']."_".$wr_doc); $reg = "tmpsave/$id"; wiki_set_option($reg, array("wr_content", "wr_date"), array($wr_content, date("Y-m-d h:i:s"))); echo json_encode(array('code'=>1)); ?>
<? /** * * 플러그인 명령 실행 * * @package narinwiki * @license GPL2 (http://narinwiki.org/license) * @author byfun (http://byfun.com) * @filesource */ include_once "_common.php"; if(!$p || !$m) wiki_not_found_page(); $wikiConfig =& wiki_class_load("Config"); $is_active = false; foreach($wikiConfig->using_plugins as $plugin) { if($plugin == $p) { $is_active = true; break; } } // $p 는 플러그인 폴더명 $wikiEvent->trigger_one($p, strtoupper("PX_" . $p . "_" . $m), array("get"=>$_GET, "post"=>$_POST)); ?>
* @subpackage pages * @license GPL2 (http://narinwiki.org/license) * @author byfun (http://byfun.com) * @filesource */ define("__NARIN_API__", true); include_once "./_common.php"; //wiki_only_ajax(); @extract(wiki_unescape($_POST)); @extract(wiki_unescape($_GET)); $inc_file = "./response/".$w.".php"; if(!$w || !file_exists($inc_file)) { wiki_not_found_page(); } include_once $inc_file; function wiki_ajax_error($msg = "파라미터 오류") { echo wiki_json_encode(array('code'=>-1, 'msg'=>$msg)); exit; } ?>
/** * * ajax 가 아니면 페이지 없음 표시 * * @todo 제대로 되는지 검증 필요 */ function wiki_only_ajax() { if(!isset($_SERVER['HTTP_X_REQUESTED_WITH']) && !$_SERVER['HTTP_X_REQUESTED_WITH']=="XMLHttpRequest") { wiki_not_found_page(); } }