| @@ -1,7 +1,7 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | -* | |
| 3 | +* | |
| 4 | 4 | */ |
| 5 | 5 | |
| 6 | 6 | // Disllow direct access. |
| 7 | 7 | defined('ABSPATH') or die('Access denied'); |
| @@ -6,15 +6,15 @@ | ||
| 6 | 6 | // Disllow direct access. |
| 7 | 7 | defined('ABSPATH') or die('Access denied'); |
| 8 | 8 | |
| 9 | 9 | /** |
| 10 | -* | |
| 10 | +* | |
| 11 | 11 | */ |
| 12 | 12 | class CJTPackagesModel { |
| 13 | 13 | |
| 14 | 14 | /** |
| 15 | 15 | * put your comment there... |
| 16 | - * | |
| 16 | + * | |
| 17 | 17 | */ |
| 18 | 18 | public function getItems() { |
| 19 | 19 | // Build query. |
| 20 | 20 | $select = 'SELECT p.id, p.name, p.description, p.author, p.webSite, p.license, p.readme'; |
| @@ -21,12 +21,12 @@ | ||
| 21 | 21 | $queryBase = $this->getItemsQuery(); |
| 22 | 22 | // Paging. |
| 23 | 23 | $itemsPerPage = $this->getItemsPerPage(); |
| 24 | 24 | // Get page no#. |
| 25 | - $page = !isset($_REQUEST['paged']) ? esc_html(1) : esc_html($_REQUEST['paged']); | |
| 25 | + $page = !isset($_REQUEST['paged']) ? 1 : $_REQUEST['paged']; | |
| 26 | 26 | // Calculate start offset. |
| 27 | 27 | $start = ($page - 1) * $itemsPerPage; |
| 28 | - $limit = " LIMIT {$start},{$itemsPerPage}"; | |
| 28 | + $limit = " LIMIT {$start},{$itemsPerPage}"; | |
| 29 | 29 | // final query. |
| 30 | 30 | $query = "{$select}{$queryBase['from']}{$limit}"; |
| 31 | 31 | // Execute our query using MYSQL queue driver. |
| 32 | 32 | $result = cssJSToolbox::getInstance()->getDBDriver()->select($query); |
| @@ -31,20 +31,20 @@ | ||
| 31 | 31 | // Execute our query using MYSQL queue driver. |
| 32 | 32 | $result = cssJSToolbox::getInstance()->getDBDriver()->select($query); |
| 33 | 33 | return $result; |
| 34 | 34 | } |
| 35 | - | |
| 35 | + | |
| 36 | 36 | /** |
| 37 | 37 | * put your comment there... |
| 38 | - * | |
| 38 | + * | |
| 39 | 39 | */ |
| 40 | 40 | public function getItemsPerPage() { |
| 41 | - return 20; | |
| 41 | + return 20; | |
| 42 | 42 | } |
| 43 | - | |
| 43 | + | |
| 44 | 44 | /** |
| 45 | 45 | * put your comment there... |
| 46 | - * | |
| 46 | + * | |
| 47 | 47 | */ |
| 48 | 48 | public function getItemsQuery() { |
| 49 | 49 | // From clause. |
| 50 | 50 | $query['from'] = ' FROM #__cjtoolbox_packages p'; |
| @@ -49,12 +49,12 @@ | ||
| 49 | 49 | // From clause. |
| 50 | 50 | $query['from'] = ' FROM #__cjtoolbox_packages p'; |
| 51 | 51 | return $query; |
| 52 | 52 | } |
| 53 | - | |
| 53 | + | |
| 54 | 54 | /** |
| 55 | 55 | * put your comment there... |
| 56 | - * | |
| 56 | + * | |
| 57 | 57 | */ |
| 58 | 58 | public function getItemsTotal() { |
| 59 | 59 | $queryBase = $this->getItemsQuery(); |
| 60 | 60 | $select = 'SELECT count(*) Total'; |
| @@ -63,6 +63,6 @@ | ||
| 63 | 63 | $dbDriver = new CJTMYSQLQueueDriver($GLOBALS['wpdb']); |
| 64 | 64 | $result = $dbDriver->select($query); |
| 65 | 65 | return reset($result)->Total; |
| 66 | 66 | } |
| 67 | - | |
| 68 | -} // End class. | |
| 67 | + | |
| 68 | +} // End class. | |