| @@ 599-615 (lines=17) @@ | ||
| 596 | * |
|
| 597 | * @return int |
|
| 598 | */ |
|
| 599 | private function getNextPageSetOrder($page_set_home) |
|
| 600 | { |
|
| 601 | global $xoopsDB; |
|
| 602 | ||
| 603 | $page_set_order = 1; |
|
| 604 | ||
| 605 | $keyword = $this->escapeForDB($page_set_home); |
|
| 606 | ||
| 607 | $sql = 'SELECT MAX(page_set_order) FROM ' . $xoopsDB->prefix('gwiki_pages') . " WHERE active = 1 and page_set_home = '{$keyword}' "; |
|
| 608 | $result = $xoopsDB->query($sql); |
|
| 609 | if ($result) { |
|
| 610 | $myrow = $xoopsDB->fetchRow($result); |
|
| 611 | $page_set_order = $myrow[0] + 1; |
|
| 612 | } |
|
| 613 | ||
| 614 | return $page_set_order; |
|
| 615 | } |
|
| 616 | ||
| 617 | /** |
|
| 618 | * Check if the current user may edit the current page |
|
| @@ 799-815 (lines=17) @@ | ||
| 796 | * |
|
| 797 | * @return int |
|
| 798 | */ |
|
| 799 | public function getPageId($keyword) |
|
| 800 | { |
|
| 801 | global $xoopsDB; |
|
| 802 | ||
| 803 | $page_id = 0; |
|
| 804 | ||
| 805 | $keyword = $this->escapeForDB($keyword); |
|
| 806 | ||
| 807 | $sql = 'SELECT page_id FROM ' . $xoopsDB->prefix('gwiki_pageids') . " WHERE keyword = '{$keyword}' "; |
|
| 808 | $result = $xoopsDB->query($sql); |
|
| 809 | if ($result) { |
|
| 810 | $myrow = $xoopsDB->fetchRow($result); |
|
| 811 | $page_id = $myrow[0]; |
|
| 812 | } |
|
| 813 | ||
| 814 | return $page_id; |
|
| 815 | } |
|
| 816 | ||
| 817 | /** |
|
| 818 | * record a page hit for a keyword |
|