Example #1
0
 /**
  * @return string[] List of pagename
  */
 public function &getAllUserPages()
 {
     $WikiPageAdminPages = PHPWikiPage::getAdminPages();
     $WikiPageDefaultPages = PHPWikiPage::getDefaultPages();
     $allPages = array();
     $res = db_query(' SELECT pagename' . ' FROM plugin_phpwiki_page, plugin_phpwiki_nonempty' . ' WHERE plugin_phpwiki_page.group_id="' . db_ei($this->gid) . '"' . ' AND plugin_phpwiki_nonempty.id=plugin_phpwiki_page.id' . ' AND plugin_phpwiki_page.pagename NOT IN ("' . implode('","', $WikiPageDefaultPages) . '",
                                                       "' . implode('","', $WikiPageAdminPages) . '")');
     while ($row = db_fetch_array($res)) {
         $allPages[] = $row[0];
     }
     return $allPages;
 }
Example #2
0
 public function doesWikiPageExistInRESTContext($page_id)
 {
     $admin_pages = $this->da->quoteSmartImplode(',', PHPWikiPage::getAdminPages());
     $default_pages = $this->da->quoteSmartImplode(',', PHPWikiPage::getDefaultPages());
     $page_id = $this->da->escapeInt($page_id);
     $sql = "SELECT SQL_CALC_FOUND_ROWS plugin_phpwiki_page.id\n                FROM plugin_phpwiki_page, plugin_phpwiki_nonempty\n                WHERE plugin_phpwiki_page.id = {$page_id}\n                    AND plugin_phpwiki_nonempty.id <> plugin_phpwiki_page.id\n                    AND plugin_phpwiki_page.pagename NOT IN ({$default_pages},{$admin_pages})";
     $this->retrieve($sql);
     return (int) $this->foundRows();
 }
Example #3
0
 /**
  * Get number of project wiki pages.
  * @return number of project pages (0 if wiki is empty)
  */
 function getProjectPageCount()
 {
     $res = db_query(' SELECT count(*) as count' . ' FROM plugin_phpwiki_page, plugin_phpwiki_nonempty' . ' WHERE plugin_phpwiki_page.group_id="' . db_ei($this->gid) . '"' . ' AND plugin_phpwiki_nonempty.id=plugin_phpwiki_page.id' . ' AND plugin_phpwiki_page.pagename NOT IN ("' . implode('","', PHPWikiPage::getDefaultPages()) . '",
                                           "' . implode('","', PHPWikiPage::getAdminPages()) . '")');
     if (db_numrows($res) > 0) {
         return db_result($res, 0, 'count');
     } else {
         return 0;
     }
 }