Fixes bug and updates PPH on each post
This commit is contained in:
parent
bd87661a69
commit
bdf1fcf27b
|
@ -30,8 +30,8 @@
|
||||||
{% trans "Post Statistics" %}
|
{% trans "Post Statistics" %}
|
||||||
</h2>
|
</h2>
|
||||||
<p>
|
<p>
|
||||||
{% stats.pph %} {% trans "posts in the last hour." %}
|
{{ stats.pph }} {% trans "posts in the last hour." %}
|
||||||
{% stats.unique_ip_count %} {% trans "unique posters in the last hour." %}
|
{{ stats.unique_ip_count }} {% trans "unique posters in the last hour." %}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -15,16 +15,22 @@
|
||||||
public static function build($action, $settings) {
|
public static function build($action, $settings) {
|
||||||
global $config;
|
global $config;
|
||||||
|
|
||||||
if ($action == 'all')
|
if ($action == 'all' ||
|
||||||
|
$action == 'boards' ||
|
||||||
|
$action == 'news' ||
|
||||||
|
$action == 'post' ||
|
||||||
|
$action == 'post-thread' ||
|
||||||
|
$action == 'post-delete'){
|
||||||
file_write($config['dir']['home'] . $settings['file_main'], Categories::homepage($settings));
|
file_write($config['dir']['home'] . $settings['file_main'], Categories::homepage($settings));
|
||||||
|
|
||||||
if ($action == 'all' || $action == 'boards')
|
|
||||||
file_write($config['dir']['home'] . $settings['file_sidebar'], Categories::sidebar($settings));
|
|
||||||
|
|
||||||
if ($action == 'all' || $action == 'news')
|
|
||||||
file_write($config['dir']['home'] . $settings['file_news'], Categories::news($settings));
|
file_write($config['dir']['home'] . $settings['file_news'], Categories::news($settings));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($action == 'all'){
|
||||||
|
file_write($config['dir']['home'] . $settings['file_sidebar'], Categories::sidebar($settings));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Build homepage
|
// Build homepage
|
||||||
public static function homepage($settings) {
|
public static function homepage($settings) {
|
||||||
global $config;
|
global $config;
|
||||||
|
@ -51,11 +57,12 @@
|
||||||
|
|
||||||
$query = query("SELECT * FROM ``news`` ORDER BY `time` DESC") or error(db_error());
|
$query = query("SELECT * FROM ``news`` ORDER BY `time` DESC") or error(db_error());
|
||||||
$news = $query->fetchAll(PDO::FETCH_ASSOC);
|
$news = $query->fetchAll(PDO::FETCH_ASSOC);
|
||||||
|
$stats = Categories::getPostStatistics($settings);
|
||||||
return Element('themes/categories/news.html', Array(
|
return Element('themes/categories/news.html', Array(
|
||||||
'settings' => $settings,
|
'settings' => $settings,
|
||||||
'config' => $config,
|
'config' => $config,
|
||||||
'news' => $news,
|
'news' => $news,
|
||||||
|
'stats' => $stats,
|
||||||
'boardlist' => createBoardlist(false)
|
'boardlist' => createBoardlist(false)
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue