function fs_getentries() { $amount = fs_get_num_hits_in_table(); $timezone = fs_get_option('firestats_user_timezone', 'system'); $db_support_tz = ver_comp("4.1.3", fs_mysql_version()) <= 0; $ts = $db_support_tz && $timezone != 'system' ? "CONVERT_TZ(`timestamp`,'system','{$timezone}')" : "timestamp"; if ($amount === false) { return false; } $hits = fs_hits_table(); $ua = fs_useragents_table(); $urls = fs_urls_table(); $not_excluded = not_excluded(true, 'hits'); $not_filtered = fs_not_filtered(); $sql = "SELECT hits.id,ip,useragent,referers.url as referer,referers.search_terms,urls.url as url,{$ts} as timestamp,country_code,urls.title as url_title, referers.title as referrer_title\n\t\t\t\t\tFROM `{$hits}` AS hits,`{$ua}` AS agents,`{$urls}` AS urls,`{$urls}` AS referers\n\t\t\t\t\tWHERE \n\t\t\t\t\t\thits.useragent_id = agents.id AND \n\t\t\t\t\t\thits.url_id = urls.id AND \n\t\t\t\t\t\thits.referer_id = referers.id \n\t\t\t\t\t\tAND {$not_excluded} \n\t\t\t\t\t\tAND {$not_filtered}\n\t\t\t\t\tORDER BY timestamp DESC"; $sql .= " LIMIT {$amount}"; $fsdb =& fs_get_db_conn(); return $fsdb->get_results($sql); }
fs_e('Hits table'); fs_create_anchor('HitsTable'); ?> <?php fs_cfg_button('records_table_config'); ?> <span id="records_table_config" class="normal_font hidden"> <span> <?php fs_e('Number of hits to show'); ?> <input type="text" onkeypress="return trapEnter(event, 'saveNumEntries();');" size="4" id="firestats_num_to_show" value="<?php echo fs_get_num_hits_in_table(); ?> " /> <button class="button" onclick="saveNumEntries()"><?php fs_e('Save'); ?> </button> </span> </span> </h2> <div style="border:1px solid #f0f0fa"> <table> <tr> <th></th>