diff --git a/common_config.php b/common_config.php
index 649c728..0cadbb9 100644
--- a/common_config.php
+++ b/common_config.php
@@ -31,6 +31,7 @@ define('USERAGENT', 'Daniels Online-Test http://tt3j2x4k5ycaa5zt.onion/test.php'
define('LANG', 'en'); // Default language
define('PROMOTEPRICE', 0.025); // Price to promote a site for PROMOTETIME long
define('PROMOTETIME', 864000); // Time (in seconds) to promote a site payed with PROMOTEPRICE - 864000 equals 10 days
+define('PER_PAGE', 50); // Sites listed per page
define('VERSION', '1'); // Script version
define('DBVERSION', 1); // Database layout version
//Categories - new links will always be put into the first one, leave it to Unsorted
diff --git a/onions.php b/onions.php
index 330332f..468e84f 100644
--- a/onions.php
+++ b/onions.php
@@ -137,7 +137,7 @@ function send_html(){
}
if($category==$cat){
echo "
$name ($num[0])";
- $pages=ceil($num[0]/100);
+ $pages=ceil($num[0]/PER_PAGE);
}else{
echo " $name ($num[0])";
}
@@ -159,7 +159,7 @@ function send_html(){
$num=$stmt->fetch(PDO::FETCH_NUM);
if($category==$cat){
echo " $name ($num[0])";
- $pages=ceil($num[0]/100);
+ $pages=ceil($num[0]/PER_PAGE);
}else{
echo " $name ($num[0])";
}
@@ -227,20 +227,20 @@ function send_html(){
--$tmp;
}
if($category-count($categories)===1){
- $query.=' ORDER BY id DESC LIMIT 100';
+ $query.=' ORDER BY id DESC LIMIT ' . PER_PAGE;
}else{
$query.=' ORDER BY address';
if($_REQUEST['pg']>0){
- $offset=100*($_REQUEST['pg']-1);
- $query.=" LIMIT 100 OFFSET $offset";
+ $offset=PER_PAGE*($_REQUEST['pg']-1);
+ $query.=' LIMIT ' . PER_PAGE . " OFFSET $offset";
}
}
$stmt=$db->query('SELECT address, lasttest, lastup, timeadded, description, locked, special FROM ' . PREFIX . "onions WHERE $query;");
echo get_table($stmt, $numrows, true);
}else{//show normal categories
if($_REQUEST['pg']>0){
- $offset=100*($_REQUEST['pg']-1);
- $offsetquery=" LIMIT 100 OFFSET $offset";
+ $offset=PER_PAGE*($_REQUEST['pg']-1);
+ $offsetquery=' LIMIT ' . PER_PAGE . " OFFSET $offset";
}else{
$offsetquery='';
}
@@ -319,7 +319,7 @@ function get_table(PDOStatement $stmt, &$numrows=0, $promoted=false){
function print_phishing_table(){
global $I, $db;
echo "| $I[link] | $I[cloneof] | $I[lastup] |
";
- $stmt=$db->query('SELECT address, original, lasttest, lastup FROM ' . PREFIX . 'onions, ' . PREFIX . 'phishing WHERE ' . PREFIX . "onions.id=onion_id AND address!='' ORDER BY onions.address AND timediff<604800;");
+ $stmt=$db->query('SELECT address, original, lasttest, lastup FROM ' . PREFIX . 'onions, ' . PREFIX . 'phishing WHERE ' . PREFIX . "onions.id=onion_id AND address!='' AND timediff<604800 ORDER BY address;");
while($link=$stmt->fetch(PDO::FETCH_ASSOC)){
if($link['lastup']===$link['lasttest']){
$class='up';