| @@ 602-618 (lines=17) @@ | ||
| 599 | * |
|
| 600 | * @return int |
|
| 601 | */ |
|
| 602 | private function getNextPageSetOrder($page_set_home) |
|
| 603 | { |
|
| 604 | global $xoopsDB; |
|
| 605 | ||
| 606 | $page_set_order = 1; |
|
| 607 | ||
| 608 | $keyword = $this->escapeForDB($page_set_home); |
|
| 609 | ||
| 610 | $sql = 'SELECT MAX(page_set_order) FROM ' . $xoopsDB->prefix('gwiki_pages') . " WHERE active = 1 and page_set_home = '{$keyword}' "; |
|
| 611 | $result = $xoopsDB->query($sql); |
|
| 612 | if ($result) { |
|
| 613 | $myrow = $xoopsDB->fetchRow($result); |
|
| 614 | $page_set_order = $myrow[0] + 1; |
|
| 615 | } |
|
| 616 | ||
| 617 | return $page_set_order; |
|
| 618 | } |
|
| 619 | ||
| 620 | /** |
|
| 621 | * Check if the current user may edit the current page |
|
| @@ 810-826 (lines=17) @@ | ||
| 807 | * |
|
| 808 | * @return int |
|
| 809 | */ |
|
| 810 | public function getPageId($keyword) |
|
| 811 | { |
|
| 812 | global $xoopsDB; |
|
| 813 | ||
| 814 | $page_id = 0; |
|
| 815 | ||
| 816 | $keyword = $this->escapeForDB($keyword); |
|
| 817 | ||
| 818 | $sql = 'SELECT page_id FROM ' . $xoopsDB->prefix('gwiki_pageids') . " WHERE keyword = '{$keyword}' "; |
|
| 819 | $result = $xoopsDB->query($sql); |
|
| 820 | if ($result) { |
|
| 821 | $myrow = $xoopsDB->fetchRow($result); |
|
| 822 | $page_id = $myrow[0]; |
|
| 823 | } |
|
| 824 | ||
| 825 | return $page_id; |
|
| 826 | } |
|
| 827 | ||
| 828 | /** |
|
| 829 | * record a page hit for a keyword |
|