차이
문서의 선택한 두 판 사이의 차이를 보여줍니다.
| 양쪽 이전 판이전 판다음 판 | 이전 판 | ||
| tech:randompage [2014/08/20 16:35] – fe80:7afc:18cc:0c5b:20da:f433:e2ff:3e5f | tech:randompage [2016/07/12 00:56] (현재) – 바깥 편집 127.0.0.1 | ||
|---|---|---|---|
| 줄 1: | 줄 1: | ||
| + | {{tag> | ||
| ======랜덤페이지 (Randompage) 플러긴====== | ======랜덤페이지 (Randompage) 플러긴====== | ||
| 랜덤페이지 플러긴이다. 네임스페이스 지원하도록 약간 수정했다. | 랜덤페이지 플러긴이다. 네임스페이스 지원하도록 약간 수정했다. | ||
| + | 다른 위키엔진들은 대부분 기본 기능인데;; | ||
| (원작: https:// | (원작: https:// | ||
| - | |||
| - | 다른 위키엔진들은 대부분 기본 기능인데;; | ||
| 아래의 파일을 받아서 '' | 아래의 파일을 받아서 '' | ||
| 줄 11: | 줄 10: | ||
| ? | ? | ||
| 혹은 | 혹은 | ||
| - | ? | + | |
| 하면 된다. | 하면 된다. | ||
| - | * http:// | + | * [[? |
| - | * http:// | + | * [[? |
| 줄 31: | 줄 30: | ||
| 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: | 줄 36: | ||
| $controller-> | $controller-> | ||
| } | } | ||
| - | |||
| function init(& | function init(& | ||
| 줄 50: | 줄 47: | ||
| } | } | ||
| } | } | ||
| + | |||
| function action_randompage(& | function action_randompage(& | ||
| 줄 55: | 줄 53: | ||
| global $conf; | global $conf; | ||
| global $ID; | global $ID; | ||
| - | | + | |
| - | $data = array(); | + | |
| + | $data = array(); | ||
| $dir = $conf[' | $dir = $conf[' | ||
| + | |||
| $data = file ($dir.'/ | $data = file ($dir.'/ | ||
| 줄 75: | 줄 75: | ||
| //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: | 줄 102: | ||
| } | } | ||
| return @$num; | return @$num; | ||
| - | } | + | } |
| - | + | ||
| }</ | }</ | ||
| ^ 누구나 수정하실 수 있다. [[http:// | ^ 누구나 수정하실 수 있다. [[http:// | ||
| - | {{tag> | + | |