// end if $sql = "SELECT COUNT(*) FROM `{$table_name}`"; if ($where_clause != "") { $sql .= " WHERE {$where_clause}"; } // end if $res_records_without_limit = $db->send_query($sql); while ($count_row = $db->db_fetch_row($res_records_without_limit)) { $results_number = $count_row[0]; // get the number of results } // end while $db->free_result($res_records_without_limit); if ($results_number > 0) { // at least one record found $pages_number = get_pages_number($results_number, $records_per_page); // get the total number of pages $sql = build_select_part($fields_labels_ar, $table_name); if ($where_clause != "") { $sql .= " WHERE {$where_clause}"; } // end if if (isset($export_to_csv) && $export_to_csv == 1 && $export_to_csv_feature == 1) { if (isset($csv_creation_time_limt)) { set_time_limit($csv_creation_time_limt); } // end if // execute the select without limit query for csv $res_records_csv = $db->send_query($sql); $csv = build_csv($res_records_csv, $fields_labels_ar); ob_end_clean();
<?php //////////////////////////////////////////////////////////////////////////////// // Copyright (C) ReloadCMS Development Team // // http://reloadcms.com // // This product released under GNU General Public License v2 // //////////////////////////////////////////////////////////////////////////////// global $system; $page = (!empty($_GET['page']) ? (int) $_GET['page'] : 1) - 1; $pages = get_pages_number(RCMS_GB_DEFAULT_FILE); $pagination = rcms_pagination($pages * $system->config['perpage'], $system->config['perpage'], $page + 1, '?module=' . $module); if (!empty($_POST['comtext'])) { if (isset($system->config['guestbook-guest']) and !LOGGED_IN) { show_window(__('Error'), __('You are not logined!')); } else { if (isset($_POST['antispam']) and isset($_POST['captcheckout'])) { $defcatp = substr(md5($_POST['antispam']), 0, 5); $intcapt = $_POST['captcheckout']; if ($defcatp == $intcapt) { post_message($system->user['username'], $system->user['nickname'], $_POST['comtext'], RCMS_GB_DEFAULT_FILE, 'guestbook.ini'); rcms_redirect(''); } else { show_window(__('Error'), __('Invalid form data')); } } else { post_message($system->user['username'], $system->user['nickname'], $_POST['comtext'], RCMS_GB_DEFAULT_FILE, 'guestbook.ini'); rcms_redirect(''); } } } if (isset($_POST['gbd']) && $system->checkForRight('GUESTBOOK')) {