게시글 연동 구글 애드센스 애드온 추가

git-svn-id: http://xe-core.googlecode.com/svn/trunk@1934 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
zero 2007-07-13 07:36:36 +00:00
parent 8c09488be4
commit c2699bb91b
3 changed files with 149 additions and 0 deletions

View file

@ -0,0 +1,23 @@
<?php
if(!defined("__ZBXE__")) exit();
/**
* @file google_adsense.addon.php
* @author zero (zero@nzeo.com)
* @brief google_adsense를 게시글의 /하단에 출력할 있도록 한다.
*
* 모든 출력이 끝난후에 사용이 .
**/
// called_position이 before_module_init일때만 실행
if($called_position != 'before_display_content' || Context::getResponseMethod()=="XMLRPC") return;
require_once("./addons/google_adsense/google_adsense.lib.php");
if($addon_info->position == "top") $pos_regx = "!<\!--BeforeDocument\(([0-9]+),([0-9]+)\)-->!is";
else $pos_regx = "!<\!--AfterDocument\(([0-9]+),([0-9]+)\)-->!is";
$GLOBALS['__g_addon_info__'] = $addon_info;
$output = preg_replace_callback($pos_regx, matchDocument, $output);
?>