Changeset 164
- Timestamp:
- 04/18/2006 06:10:06 AM (6 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
-
globals/classes/table.php (modified) (2 diffs)
-
install/schema.sql (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/globals/classes/table.php
r102 r164 32 32 global $db, $vars; 33 33 if ($limit == '' && $limit !== FALSE) { 34 $cnt = $db->cnt($select, $from, $where, $group_by); 34 if ($this->info['CURRENT_PAGE'] == '' && $_SERVER['REQUEST_METHOD'] == 'GET') $this->info['CURRENT_PAGE'] = get($this->info['TABLE_NAME']."_showpage"); 35 if ($this->info['CURRENT_PAGE'] == '') $this->info['CURRENT_PAGE'] = 1; 36 $page = $this->info['CURRENT_PAGE']; 37 $limit = (($page-1)*$vars['constructor']['max_rows']).', '.$vars['constructor']['max_rows']; 38 $want_pages = true; 39 } 40 $data = $db->get("SQL_CALC_FOUND_ROWS ".$select, $from, $where, $group_by, $order_by, $limit); 41 if (isset($want_pages)) { 42 $cnt = $db->query_data("SELECT FOUND_ROWS()"); 43 $cnt = $cnt[0]['FOUND_ROWS()']; 35 44 if ($vars['constructor']['max_rows'] != '' && $cnt > $vars['constructor']['max_rows']) { 36 45 $this->info['TOTAL_PAGES'] = ceil($cnt / $vars['constructor']['max_rows']); 37 38 if ($this->info['CURRENT_PAGE'] == '' && $_SERVER['REQUEST_METHOD'] == 'GET') $this->info['CURRENT_PAGE'] = get($this->info['TABLE_NAME']."_showpage");39 if ($this->info['CURRENT_PAGE'] == '') $this->info['CURRENT_PAGE'] = 1;40 41 $page = $this->info['CURRENT_PAGE'];42 $limit = (($page-1)*$vars['constructor']['max_rows']).', '.$vars['constructor']['max_rows'];43 44 46 for ($i=1;$i<=$this->info['TOTAL_PAGES'];$i++) { 45 47 $this->info['PAGES'][$i] = makelink(array($this->info['TABLE_NAME']."_showpage" => $i), TRUE); … … 47 49 } 48 50 } 49 $data = $db->get($select, $from, $where, $group_by, $order_by, $limit);50 51 if (isset($data[0])) { 51 52 $isset = TRUE; -
trunk/install/schema.sql
r156 r164 107 107 `info` text, 108 108 PRIMARY KEY (`id`), 109 KEY `node_id` (`node_id` ),110 KEY `peer_node_id` (`peer_node_id` ),109 KEY `node_id` (`node_id`,`type`,`status`), 110 KEY `peer_node_id` (`peer_node_id`,`type`,`status`), 111 111 KEY `type` (`type`), 112 112 KEY `status` (`status`), 113 KEY `peer_ap_id` (`peer_ap_id` )113 KEY `peer_ap_id` (`peer_ap_id`,`type`,`status`) 114 114 ) ENGINE=MyISAM DEFAULT CHARSET=utf8; 115 115
Note: See TracChangeset
for help on using the changeset viewer.
