Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

add option to disable Most Recent URLs or exclude bots

  • Loading branch information...
commit a6a55bbbae01da0a5c9f2e50a6d1357c5b2e530d 1 parent c4f533e
@tommyrot authored
Showing with 26 additions and 10 deletions.
  1. +20 −10 html.php
  2. +6 −0 sss.conf
View
30 html.php
@@ -37,6 +37,7 @@
private $maxrows_people_year = 10;
private $maxrows_recenturls = 25;
private $minrows = 3;
+ private $recenturls_type = 1;
private $rows_domains_tlds = 10;
private $sectionbits = 255;
private $stylesheet = 'sss.css';
@@ -81,6 +82,7 @@
'maxrows_recenturls' => 'int',
'minrows' => 'int',
'outputbits' => 'int',
+ 'recenturls_type' => 'int',
'rows_domains_tlds' => 'int',
'sectionbits' => 'int',
'stylesheet' => 'string',
@@ -740,16 +742,24 @@ public function make_html($mysqli)
$t->set_value('queries', array('main' => 'select count(*) as `v1`, `tld` as `v2` from `user_urls` join `urls` on `user_urls`.`lid` = `urls`.`lid` where `tld` != \'\' group by `tld` order by `v1` desc, `v2` asc limit '.$this->rows_domains_tlds));
$output .= $t->make_table($this->mysqli);
- $t = new table('Most Recent URLs', $this->minrows, $this->maxrows_recenturls);
- $t->set_value('keys', array(
- 'k1' => 'Date',
- 'k2' => 'User',
- 'k3' => 'URL',
- 'v1' => 'date',
- 'v2' => 'string',
- 'v3' => 'url'));
- $t->set_value('queries', array('main' => 'select `datetime` as `v1`, `csnick` as `v2`, `url` as `v3` from `user_urls` join `urls` on `user_urls`.`lid` = `urls`.`lid` join `user_status` on `user_urls`.`uid` = `user_status`.`uid` join `user_details` on `user_status`.`ruid` = `user_details`.`uid` order by `v1` desc limit '.$this->maxrows_recenturls));
- $output .= $t->make_table($this->mysqli);
+ if ($this->recenturls_type != 0) {
+ $t = new table('Most Recent URLs', $this->minrows, $this->maxrows_recenturls);
+ $t->set_value('keys', array(
+ 'k1' => 'Date',
+ 'k2' => 'User',
+ 'k3' => 'URL',
+ 'v1' => 'date',
+ 'v2' => 'string',
+ 'v3' => 'url'));
+
+ if ($this->recenturls_type == 1) {
+ $t->set_value('queries', array('main' => 'select `datetime` as `v1`, `csnick` as `v2`, `url` as `v3` from `user_urls` join `urls` on `user_urls`.`lid` = `urls`.`lid` join `user_status` on `user_urls`.`uid` = `user_status`.`uid` join `user_details` on `user_status`.`ruid` = `user_details`.`uid` order by `v1` desc limit '.$this->maxrows_recenturls));
+ } elseif ($this->recenturls_type == 2) {
+ $t->set_value('queries', array('main' => 'select `datetime` as `v1`, `csnick` as `v2`, `url` as `v3` from `user_urls` join `urls` on `user_urls`.`lid` = `urls`.`lid` join `user_status` on `user_urls`.`uid` = `user_status`.`uid` join `user_details` on `user_status`.`ruid` = `user_details`.`uid` where `ruid` not in (select `ruid` from `user_status` where `status` = 3) order by `v1` desc limit '.$this->maxrows_recenturls));
+ }
+
+ $output .= $t->make_table($this->mysqli);
+ }
$t = new table('URLs by Users', $this->minrows, $this->maxrows);
$t->set_value('keys', array(
View
6 sss.conf
@@ -89,6 +89,12 @@ logfile_dateformat = ""
# 128 Milestones
#sectionbits = "255"
+# There are three options on how to display the Most Recent URLs table:
+# 0 Disabled
+# 1 Enabled, show URLS by users and bots
+# 2 Enabled, show only URLs by users (exclude bots)
+#recenturls_type = "1"
+
# Settings to control how many rows will be displayed for various tables.
#minrows = "3" # Applies to generic tables.
#maxrows = "5" # Applies to generic tables.
Please sign in to comment.
Something went wrong with that request. Please try again.