From 58b60f0aa4ef14589315a66fcf58d749928483c7 Mon Sep 17 00:00:00 2001 From: czaks Date: Tue, 10 Mar 2015 13:46:34 +0100 Subject: ... --- inc/mod/pages.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'inc/mod/pages.php') diff --git a/inc/mod/pages.php b/inc/mod/pages.php index 79d1bf51..2b7de134 100644 --- a/inc/mod/pages.php +++ b/inc/mod/pages.php @@ -1224,7 +1224,10 @@ function mod_move($originBoard, $postID) { // create the new thread $newID = post($post); - + + $op = $post; + $op['id'] = $newID; + if ($post['has_file']) { // copy image foreach ($post['files'] as $i => &$file) { @@ -1357,14 +1360,14 @@ function mod_move($originBoard, $postID) { buildIndex(); - header('Location: ?/' . sprintf($config['board_path'], $originBoard) . $config['dir']['res'] . link_for($post, false, $newboard) . + header('Location: ?/' . sprintf($config['board_path'], $originBoard) . $config['dir']['res'] . link_for($op, false, $newboard) . '#' . $botID, true, $config['redirect_http']); } else { deletePost($postID); buildIndex(); openBoard($targetBoard); - header('Location: ?/' . sprintf($config['board_path'], $board['uri']) . $config['dir']['res'] . link_for($post, false, $newboard), true, $config['redirect_http']); + header('Location: ?/' . sprintf($config['board_path'], $board['uri']) . $config['dir']['res'] . link_for($op, false, $newboard), true, $config['redirect_http']); } } -- cgit v1.3 From 2f7aeec53128b08e000e89bc031f25c0501565f3 Mon Sep 17 00:00:00 2001 From: czaks Date: Tue, 10 Mar 2015 13:48:33 +0100 Subject: ... --- inc/mod/pages.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'inc/mod/pages.php') diff --git a/inc/mod/pages.php b/inc/mod/pages.php index 2b7de134..be713f57 100644 --- a/inc/mod/pages.php +++ b/inc/mod/pages.php @@ -1360,14 +1360,14 @@ function mod_move($originBoard, $postID) { buildIndex(); - header('Location: ?/' . sprintf($config['board_path'], $originBoard) . $config['dir']['res'] . link_for($op, false, $newboard) . + header('Location: ?/' . sprintf($config['board_path'], $newboard['uri']) . $config['dir']['res'] . link_for($op, false, $newboard) . '#' . $botID, true, $config['redirect_http']); } else { deletePost($postID); buildIndex(); openBoard($targetBoard); - header('Location: ?/' . sprintf($config['board_path'], $board['uri']) . $config['dir']['res'] . link_for($op, false, $newboard), true, $config['redirect_http']); + header('Location: ?/' . sprintf($config['board_path'], $newboard['uri']) . $config['dir']['res'] . link_for($op, false, $newboard), true, $config['redirect_http']); } } -- cgit v1.3 From b78b3db0105c832f3e5b1f5cca019bb41a137662 Mon Sep 17 00:00:00 2001 From: czaks Date: Sun, 5 Apr 2015 16:59:04 +0200 Subject: uncache themes on settings change --- inc/mod/pages.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'inc/mod/pages.php') diff --git a/inc/mod/pages.php b/inc/mod/pages.php index be713f57..969c570e 100644 --- a/inc/mod/pages.php +++ b/inc/mod/pages.php @@ -2501,10 +2501,14 @@ function mod_theme_configure($theme_name) { $query->bindValue(':value', $_POST[$conf['name']]); $query->execute() or error(db_error($query)); } - + $query = prepare("INSERT INTO ``theme_settings`` VALUES(:theme, NULL, NULL)"); $query->bindValue(':theme', $theme_name); $query->execute() or error(db_error($query)); + + // Clean cache + Cache::delete("themes"); + Cache::delete("theme_settings_".$theme); $result = true; $message = false; @@ -2552,11 +2556,15 @@ function mod_theme_uninstall($theme_name) { if (!hasPermission($config['mod']['themes'])) error($config['error']['noaccess']); - + $query = prepare("DELETE FROM ``theme_settings`` WHERE `theme` = :theme"); $query->bindValue(':theme', $theme_name); $query->execute() or error(db_error($query)); + // Clean cache + Cache::delete("themes"); + Cache::delete("theme_settings_".$theme); + header('Location: ?/themes', true, $config['redirect_http']); } -- cgit v1.3 From 4c1d2f924c60b1b33d6ab96b2ad26e48d6bd68b4 Mon Sep 17 00:00:00 2001 From: czaks Date: Thu, 23 Apr 2015 07:57:52 +0200 Subject: fix error while installing themes; thanks xixi --- inc/mod/pages.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'inc/mod/pages.php') diff --git a/inc/mod/pages.php b/inc/mod/pages.php index 969c570e..804c1e43 100644 --- a/inc/mod/pages.php +++ b/inc/mod/pages.php @@ -2508,7 +2508,7 @@ function mod_theme_configure($theme_name) { // Clean cache Cache::delete("themes"); - Cache::delete("theme_settings_".$theme); + Cache::delete("theme_settings_".$theme_name); $result = true; $message = false; -- cgit v1.3 From 2d9214ac63b34ea1066efa2dbc759258f2ca661a Mon Sep 17 00:00:00 2001 From: czaks Date: Thu, 23 Apr 2015 08:18:36 +0200 Subject: version check should point at engine.vichan.net and not tinyboard.org actually --- inc/mod/pages.php | 4 ++-- templates/mod/dashboard.html | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'inc/mod/pages.php') diff --git a/inc/mod/pages.php b/inc/mod/pages.php index 804c1e43..2c679b20 100644 --- a/inc/mod/pages.php +++ b/inc/mod/pages.php @@ -111,7 +111,7 @@ function mod_dashboard() { $latest = unserialize($_COOKIE['update']); } else { $ctx = stream_context_create(array('http' => array('timeout' => 5))); - if ($code = @file_get_contents('http://tinyboard.org/version.txt', 0, $ctx)) { + if ($code = @file_get_contents('http://engine.vichan.net/version.txt', 0, $ctx)) { $ver = strtok($code, "\n"); if (preg_match('@^// v(\d+)\.(\d+)\.(\d+)\s*?$@', $ver, $matches)) { @@ -120,7 +120,7 @@ function mod_dashboard() { 'major' => $matches[2], 'minor' => $matches[3] ); - if (preg_match('/v(\d+)\.(\d)\.(\d+)(-dev.+)?$/', $config['version'], $matches)) { + if (preg_match('/(\d+)\.(\d)\.(\d+)(-dev.+)?$/', $config['version'], $matches)) { $current = array( 'massive' => (int) $matches[1], 'major' => (int) $matches[2], diff --git a/templates/mod/dashboard.html b/templates/mod/dashboard.html index 2c370a11..7e25555b 100644 --- a/templates/mod/dashboard.html +++ b/templates/mod/dashboard.html @@ -155,9 +155,9 @@ Update
  • - A newer version of Tinyboard + A newer version of vichan (v{{ newer_release.massive }}.{{ newer_release.major }}.{{ newer_release.minor }}) is available! - See http://tinyboard.org/ for upgrade instructions. + See https://engine.vichan.net/ for upgrade instructions.
-- cgit v1.3