';
+ }
+
+ // Update mutes table to hashed ip
+ $query = prepare("SELECT DISTINCT `ip` FROM ``mutes`` WHERE `ip` REGEXP '^[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}$'");
+ $query->execute() or $sql_errors .= '
SQL errors were encountered when trying to update the database and hashing ip addresses.
The errors encountered were:
' . $sql_errors . '
';
+
+ break;
+}
+
+
+echo Element('page.html', $page);
+
+?>
+
+
diff --git a/inc/archive.php b/inc/archive.php
index b4eca253..5824a36e 100644
--- a/inc/archive.php
+++ b/inc/archive.php
@@ -114,7 +114,7 @@ class Archive {
// Delete all static pages and files for archived threads that has timed out
$query = prepare(sprintf("SELECT `id`, `files` FROM ``archive_%s`` WHERE `lifetime` < :lifetime AND `featured` = 0", $board['uri']));
- $query->bindValue(':lifetime', strtotime("+".$config['archive']['lifetime']." days"), PDO::PARAM_INT);
+ $query->bindValue(':lifetime', strtotime("-" . $config['archive']['lifetime']), PDO::PARAM_INT);
$query->execute() or error(db_error($query));
while($thread = $query->fetch(PDO::FETCH_ASSOC)) {
// Delete Files
@@ -128,8 +128,11 @@ class Archive {
}
// Delete Archive Entries
- if($query->rowCount() != 0)
- $query = query(sprintf("DELETE FROM ``archive_%s`` WHERE `lifetime` < %d AND `featured` = 0", $board['uri'], time())) or error(db_error());
+ if($query->rowCount() != 0) {
+ $query = prepare(sprintf("DELETE FROM ``archive_%s`` WHERE `lifetime` < %d AND `featured` = 0", $board['uri'], time())) or error(db_error());
+ $query->bindValue(':lifetime', strtotime("-" . $config['archive']['lifetime']), PDO::PARAM_INT);
+ $query->execute() or error(db_error($query));
+ }
return $query->rowCount();
}
diff --git a/inc/config.php b/inc/config.php
index 0f0fd61f..ffcdf84d 100644
--- a/inc/config.php
+++ b/inc/config.php
@@ -1309,25 +1309,6 @@
// Directory for "Featured Threads" (threads makred for permanent storage)
$config['dir']['featured'] = 'featured/';
- // Indicate if threads should be archived
- $config['archive']['threads'] = true;
- // Indicate if it is possible to mark threads as featured (stored forever)
- $config['feature']['threads'] = true;
- // Indicate if link to featured archive should be shown on post and thread page
- $config['feature']['link_post_page'] = false;
-
- // Days to keep archived threads before deletion (if set to false all archived threads are kept forever)
- $config['archive']['lifetime'] = 3;
-
- // Number of chars in snippet
- $config['archive']['snippet_len'] = 400;
-
- // If any is set to run in crom both will be run in cron regardless
- // Archiving is run in cron job
- $config['archive']['cron_job']['archiving'] = false;
- // Purging of archive is run in cron job
- $config['archive']['cron_job']['purge'] = false;
-
// For load balancing, having a seperate server (and domain/subdomain) for serving static content is
// possible. This can either be a directory or a URL. Defaults to $config['root'] . 'static/'.
@@ -1368,6 +1349,35 @@
// Try not to build pages when we shouldn't have to.
$config['try_smarter'] = true;
+
+
+
+/*
+ * ====================
+ * Archive settings
+ * ====================
+ */
+
+ // Indicate if threads should be archived
+ $config['archive']['threads'] = true;
+ // Indicate if it is possible to mark threads as featured (stored forever)
+ $config['feature']['threads'] = true;
+ // Indicate if link to featured archive should be shown on post and thread page
+ $config['feature']['link_post_page'] = false;
+
+ // Days to keep archived threads before deletion (ex. "60 minutes", "6 hours", "1 day", "1 week"), if set to false all archived threads are kept forever
+ $config['archive']['lifetime'] = "3 days";
+
+ // Number of chars in snippet
+ $config['archive']['snippet_len'] = 400;
+
+ // If any is set to run in crom both will be run in cron regardless
+ // Archiving is run in cron job
+ $config['archive']['cron_job']['archiving'] = false;
+ // Purging of archive is run in cron job
+ $config['archive']['cron_job']['purge'] = false;
+
+
/*
* ====================
* Advanced build