summaryrefslogtreecommitdiff
path: root/modules/top10_pageviews/module.php
diff options
context:
space:
mode:
authorfisharebest <fisharebest@gmail.com>2010-10-03 13:58:58 +0000
committerfisharebest <fisharebest@gmail.com>2010-10-03 13:58:58 +0000
commita7e80b7a48370cdbf611d9b4fc4a3e5450473595 (patch)
tree8ed7d495d394bb644d6e3c5da1bfb506badfe148 /modules/top10_pageviews/module.php
parent1002e57e8c0d9b4521a3fbd9e37ba8c35480b4cf (diff)
downloadwebtrees-a7e80b7a48370cdbf611d9b4fc4a3e5450473595.tar.gz
webtrees-a7e80b7a48370cdbf611d9b4fc4a3e5450473595.tar.bz2
webtrees-a7e80b7a48370cdbf611d9b4fc4a3e5450473595.zip
Use native MySQL LIMIT queries, instead of through an abstration layer
Diffstat (limited to 'modules/top10_pageviews/module.php')
-rw-r--r--modules/top10_pageviews/module.php7
1 files changed, 3 insertions, 4 deletions
diff --git a/modules/top10_pageviews/module.php b/modules/top10_pageviews/module.php
index e7a45d430d..4c0ef94860 100644
--- a/modules/top10_pageviews/module.php
+++ b/modules/top10_pageviews/module.php
@@ -48,7 +48,7 @@ class top10_pageviews_WT_Module extends WT_Module implements WT_Module_Block {
global $ctype, $WT_IMAGES, $SHOW_COUNTER, $TEXT_DIRECTION, $THEME_DIR;
$count_placement=get_block_setting($block_id, 'count_placement', 'before');
- $num=get_block_setting($block_id, 'num', 10);
+ $num=(int)get_block_setting($block_id, 'num', 10);
$block=get_block_setting($block_id, 'block', false);
if ($cfg) {
foreach (array('count_placement', 'num', 'block') as $name) {
@@ -75,12 +75,11 @@ class top10_pageviews_WT_Module extends WT_Module implements WT_Module_Block {
}
} else {
// load the lines from the file
- $top10=WT_DB::prepareLimit(
+ $top10=WT_DB::prepare(
"SELECT page_parameter, page_count".
" FROM `##hit_counter`".
" WHERE gedcom_id=? AND page_name IN ('individual.php','family.php','source.php','repo.php','note.php','mediaviewer.php')".
- " ORDER BY page_count DESC",
- $num
+ " ORDER BY page_count DESC LIMIT ".$num
)->execute(array(WT_GED_ID))->FetchAssoc();