Skip to main content

외부페이지 - 상단 기본소스 : 직접호출방지 / db호출 / POST, GET변수 가져오기

			<?php
			if(!defined('__XE__') && !defined('__ZBXE__')) exit();
			include _USER_PATH_."/inc/dbconn/defaultcondb.inc";
			while(list($key, $val) = each($_POST)) {
				$ = $val;
			}
			while(list($key, $val) = each($_GET)) {
				$ = $val;
			}
			?>
		
※ 참고 : _USER_PATH_ 변수는 /config/config.user.inc.php(원래 디버그할때 생성하는 파일임) 파일을 만들어 아래와 같이 지정해 놓았음.
			define('_USER_PATH_', _XE_PATH_.'XE폴더 이외에 개인적으로 생성한 폴더명/');
		
현재페이지 POST, GET변수 :
GET변수 : mid → 값 : sample_xe_outpage_getpost

외부페이지 - 상단 추가소스 : 로그인 정보 활용

			<?php
			if(!defined('__XE__') && !defined('__ZBXE__')) exit();
			$logged_info = Context::get('logged_info');
			if(!($logged_info->is_admin == "Y")){echo("관리자 전용 페이지입니다.");exit();}
			include _USER_PATH_."/inc/dbconn/defaultcondb.inc";
			while(list($key, $val) = each($_POST)) {
				$ = $val;
			}
			while(list($key, $val) = each($_GET)) {
				$ = $val;
			}
			?>
		

외부페이지 - 특정 문서 제목 가져오기

			$oDocumentModel = &getModel('document');
			$oDocument = $oDocumentModel->getDocument(15925, false, false);
			$title = $oDocument->get('title');
			echo('/15925 문서 제목 : '.$title.'');
		
/15925 문서 제목 : XE 크롬(chrome) 플래시(flash) 배경 검은색으로 나올때

외부페이지 - SyntaxHighlighter 사용하기

			<load target="'._XE_PATH_.'modules/editor/components/code_highlighter/style/shCore.css" media="all" />
			<load target="'._XE_PATH_.'modules/editor/components/code_highlighter/style/shThemeDefault.css" media="all" />
			<load target="'._XE_PATH_.'modules/editor/components/code_highlighter/script/shCore.js" />
		
해당 언어에 맞는 script만 불러오면 됩니다.
			<load target="'._XE_PATH_.'modules/editor/components/code_highlighter/script/shBrushPhp.js" />
			<load target="'._XE_PATH_.'modules/editor/components/code_highlighter/script/shBrushJScript.js" />
			<load target="'._XE_PATH_.'modules/editor/components/code_highlighter/script/shBrushCss.js" />
			<load target="'._XE_PATH_.'modules/editor/components/code_highlighter/script/shBrushSql.js" />
			<load target="'._XE_PATH_.'modules/editor/components/code_highlighter/script/shBrushXml.js" />
		
실행 예) php
			<pre class="brush: php;">
				php 소스를 넣어 주세요
			</pre>
		
아래 변수를 참조하여 해당 언어에 맞게 변경하고 불러오면 됩니다.
		var $brushes = array(
			array('Plain Text', 'Plain', 'text plain'),
			array('AppleScript', 'AppleScript', 'applescript'),
			array('ActionScript3', 'AS3', 'actionscript3 as3'),
			array('Bash(Shell)', 'Bash', 'bash shell'),
			array('DOS/NT Batch File', 'Batch', 'bat cmd batch btm'),
			array('ColdFusion', 'ColdFusion', 'coldfusion cf'),
			array('C/C++', 'Cpp', 'cpp c'),
			array('C#', 'CSharp', 'c# c-sharp csharp'),
			array('CSS', 'Css', 'css'),
			array('Delphi', 'Delphi', 'delphi pascal'),
			array('Diff', 'Diff', 'diff patch pas'),
			array('Erlang', 'Erlang', 'erl erlang'),
			array('Groovy', 'Groovy', 'groovy'),
			array('Java', 'Java', 'java'),
			array('JavaFX', 'JavaFX', 'jfx javafx'),
			array('JavasSript', 'JScript', 'js jscript javascript'),
			array('Perl', 'Perl', 'perl pl'),
			array('PHP', 'Php', 'php'),
			array('PowerShell', 'PowerShell', 'powershell ps'),
			array('Python', 'Python', 'py python'),
			array('Ruby', 'Ruby', 'ruby rails ror rb'),
			array('Sass', 'Sass', 'sass scss'),
			array('Scala', 'Scala', 'scala'),
			array('SQL', 'Sql', 'sql'),
			array('VB/VB.net', 'Vb', 'vb vbnet'),
			array('XML/HTML', 'Xml', 'xml xhtml xslt html')
		);