3 # Lists all used words inside WikiPageNames and shows a list of them
4 # (similar to PageIndex) - but it redirects the words to PowerSearch,
5 # which also needs to be installed therefor!
8 define("EWIKI_PAGE_WORDINDEX", "WordIndex");
9 $ewiki_plugins["page"][EWIKI_PAGE_WORDINDEX] = "ewiki_page_wordindex";
12 function ewiki_page_wordindex($id, $data, $action) {
14 global $ewiki_plugins;
16 $o = ewiki_make_title($id, $id, 2);
20 $result = ewiki_db::GETALL(array("flags"));
21 while ($row = $result->get()) {
22 if (EWIKI_PROTECTED_MODE && EWIKI_PROTECTED_MODE_HIDING && !ewiki_auth($row["id"], $uu, "view")) {
25 if (($row["flags"] & EWIKI_DB_F_TYPE) == EWIKI_DB_F_TEXT) {
26 $src .= " " . $row["id"];
30 $src = ewiki_split_title($src, "SPLIT", 0);
31 $chars = strtr(EWIKI_CHARS_U.EWIKI_CHARS_L, "_", " ");
32 $src = preg_replace("/[^$chars]/", " ", $src);
33 $src = explode(" ", $src);
34 $src = array_unique($src); //@ADD: word counting
40 foreach ($src as $i => $word) {
42 if (strlen($word) >= 2) {
45 EWIKI_PAGE_POWERSEARCH,
46 array("where"=>"id", "q"=>$word),
47 $word, "" //@ADD: display word count
54 $pf_list_pages = $ewiki_plugins["list_dict"][0];
55 $o .= ewiki_list_pages($sorted, $limit=0, $vat=1, $pf_list_pages);