Skip to content

Commit

Permalink
add rows var for domains and tlds tables to config
Browse files Browse the repository at this point in the history
  • Loading branch information
tommyrot committed Nov 3, 2012
1 parent 06bedc5 commit d0b9c4a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
10 changes: 6 additions & 4 deletions html.php
Expand Up @@ -37,6 +37,7 @@ final class html extends base
private $maxrows_people_year = 10; private $maxrows_people_year = 10;
private $maxrows_recenturls = 25; private $maxrows_recenturls = 25;
private $minrows = 3; private $minrows = 3;
private $rows_domains_tlds = 10;
private $sectionbits = 127; private $sectionbits = 127;
private $stylesheet = 'sss.css'; private $stylesheet = 'sss.css';
private $userstats = false; private $userstats = false;
Expand Down Expand Up @@ -80,6 +81,7 @@ final class html extends base
'maxrows_recenturls' => 'int', 'maxrows_recenturls' => 'int',
'minrows' => 'int', 'minrows' => 'int',
'outputbits' => 'int', 'outputbits' => 'int',
'rows_domains_tlds' => 'int',
'sectionbits' => 'int', 'sectionbits' => 'int',
'stylesheet' => 'string', 'stylesheet' => 'string',
'userstats' => 'bool'); 'userstats' => 'bool');
Expand Down Expand Up @@ -714,25 +716,25 @@ public function make_html($mysqli)
if ($this->sectionbits & 32) { if ($this->sectionbits & 32) {
$output = ''; $output = '';


$t = new table('Most Referenced Domain Names', 10, 10); $t = new table('Most Referenced Domain Names', $this->rows_domains_tlds, $this->rows_domains_tlds);
$t->set_value('keys', array( $t->set_value('keys', array(
'k1' => 'Total', 'k1' => 'Total',
'k2' => 'Domain', 'k2' => 'Domain',
'k3' => 'First Used', 'k3' => 'First Used',
'v1' => 'int', 'v1' => 'int',
'v2' => 'url', 'v2' => 'url',
'v3' => 'date')); 'v3' => 'date'));
$t->set_value('queries', array('main' => 'select count(*) as `v1`, (select concat(\'http://\', `fqdn`) from `fqdns` where `fid` = `urls`.`fid`) as `v2`, min(`datetime`) as `v3` from `user_urls` join `urls` on `user_urls`.`lid` = `urls`.`lid` where `fid` is not null group by `fid` order by `v1` desc, `v3` asc limit 10')); $t->set_value('queries', array('main' => 'select count(*) as `v1`, (select concat(\'http://\', `fqdn`) from `fqdns` where `fid` = `urls`.`fid`) as `v2`, min(`datetime`) as `v3` from `user_urls` join `urls` on `user_urls`.`lid` = `urls`.`lid` where `fid` is not null group by `fid` order by `v1` desc, `v3` asc limit '.$this->rows_domains_tlds));
$t->set_value('medium', true); $t->set_value('medium', true);
$output .= $t->make_table($this->mysqli); $output .= $t->make_table($this->mysqli);


$t = new table('Most Referenced TLDs', 10, 10); $t = new table('Most Referenced TLDs', $this->rows_domains_tlds, $this->rows_domains_tlds);
$t->set_value('keys', array( $t->set_value('keys', array(
'k1' => 'Total', 'k1' => 'Total',
'k2' => 'TLD', 'k2' => 'TLD',
'v1' => 'int', 'v1' => 'int',
'v2' => 'string')); 'v2' => 'string'));
$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 10')); $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); $output .= $t->make_table($this->mysqli);


$t = new table('Most Recent URLs', $this->minrows, $this->maxrows_recenturls); $t = new table('Most Recent URLs', $this->minrows, $this->maxrows_recenturls);
Expand Down
1 change: 1 addition & 0 deletions sss.conf
Expand Up @@ -66,4 +66,5 @@ maxrows_people2 = "10" # Less Talkative People - Alltime
maxrows_people_year = "10" # Most Talkative People - Year maxrows_people_year = "10" # Most Talkative People - Year
maxrows_people_month = "10" # Most Talkative People - Month maxrows_people_month = "10" # Most Talkative People - Month
maxrows_people_timeofday = "10" # Most Talkative People by Time of Day maxrows_people_timeofday = "10" # Most Talkative People by Time of Day
rows_domains_tlds = "10" # Fixed amount of rows for Domains and TLDs
maxrows_recenturls = "25" # Most Recent URLs maxrows_recenturls = "25" # Most Recent URLs

0 comments on commit d0b9c4a

Please sign in to comment.