차이
문서의 선택한 두 판 사이의 차이를 보여줍니다.
양쪽 이전 판이전 판다음 판 | 이전 판마지막 판양쪽 다음 판 | ||
tech:randompage [2014/08/21 01:35] – fe80:7afc:18cc:0c5b:20da:f433:e2ff:3e5f | tech:randompage [2014/08/23 09:40] – fe80:4852:64df:b1dd:fe73:ca34:7c28:eae5 | ||
---|---|---|---|
줄 2: | 줄 2: | ||
랜덤페이지 플러긴이다. 네임스페이스 지원하도록 약간 수정했다. | 랜덤페이지 플러긴이다. 네임스페이스 지원하도록 약간 수정했다. | ||
+ | 다른 위키엔진들은 대부분 기본 기능인데;; | ||
(원작: https:// | (원작: https:// | ||
- | |||
- | 다른 위키엔진들은 대부분 기본 기능인데;; | ||
아래의 파일을 받아서 '' | 아래의 파일을 받아서 '' | ||
줄 11: | 줄 9: | ||
? | ? | ||
혹은 | 혹은 | ||
- | ? | + | |
하면 된다. | 하면 된다. | ||
- | * http:// | + | * [[? |
- | * http:// | + | * [[? |
줄 31: | 줄 29: | ||
class action_plugin_randompage extends Dokuwiki_Action_Plugin { | class action_plugin_randompage extends Dokuwiki_Action_Plugin { | ||
- | |||
/** | /** | ||
* Register its handlers with the dokuwiki' | * Register its handlers with the dokuwiki' | ||
줄 38: | 줄 35: | ||
$controller-> | $controller-> | ||
} | } | ||
- | |||
function init(& | function init(& | ||
줄 50: | 줄 46: | ||
} | } | ||
} | } | ||
+ | |||
function action_randompage(& | function action_randompage(& | ||
줄 55: | 줄 52: | ||
global $conf; | global $conf; | ||
global $ID; | global $ID; | ||
- | | + | |
- | $data = array(); | + | |
+ | $data = array(); | ||
$dir = $conf[' | $dir = $conf[' | ||
+ | |||
$data = file ($dir.'/ | $data = file ($dir.'/ | ||
줄 75: | 줄 74: | ||
//echo $i; | //echo $i; | ||
$i++; | $i++; | ||
+ | |||
$id = rtrim($data[array_rand($data)]); | $id = rtrim($data[array_rand($data)]); | ||
$testACL = auth_aclcheck($id, | $testACL = auth_aclcheck($id, | ||
+ | |||
if (($testACL > 1) and (file_exists(wikiFN($id)))){ | if (($testACL > 1) and (file_exists(wikiFN($id)))){ | ||
$i=" | $i=" | ||
줄 100: | 줄 101: | ||
} | } | ||
return @$num; | return @$num; | ||
- | } | + | } |
- | + | ||
}</ | }</ | ||