From bc2694bf7f9d4e36e92376c6263c3471569bd4d8 Mon Sep 17 00:00:00 2001 From: Michael Date: Tue, 5 Nov 2019 20:28:35 +0000 Subject: [PATCH] Redo some changes --- src/Module/Pinned.php | 60 ----------------------------------- static/dbstructure.config.php | 5 ++- static/routes.config.php | 5 ++- 3 files changed, 4 insertions(+), 66 deletions(-) delete mode 100644 src/Module/Pinned.php diff --git a/src/Module/Pinned.php b/src/Module/Pinned.php deleted file mode 100644 index 590bda159e..0000000000 --- a/src/Module/Pinned.php +++ /dev/null @@ -1,60 +0,0 @@ -argc > 1) { - $itemId = intval($a->argv[1]); - } - - if (!$itemId) { - exit(); - } - - $item = Item::selectFirstForUser(local_user(), ['pinned'], ['uid' => local_user(), 'id' => $itemId]); - if (empty($item)) { - exit(); - } - - if (!intval($item['pinned'])) { - $pinned = 1; - } - - Item::update(['pinned' => $pinned], ['id' => $itemId]); - - // See if we've been passed a return path to redirect to - $returnPath = $_REQUEST['return'] ?? ''; - if ($returnPath) { - $rand = '_=' . time(); - if (strpos($returnPath, '?')) { - $rand = "&$rand"; - } else { - $rand = "?$rand"; - } - - $a->internalRedirect($returnPath . $rand); - } - - // the json doesn't really matter, it will either be 0 or 1 - echo json_encode($pinned); - exit(); - } -} diff --git a/static/dbstructure.config.php b/static/dbstructure.config.php index 65e0b26a6a..53f8a8ed44 100755 --- a/static/dbstructure.config.php +++ b/static/dbstructure.config.php @@ -34,7 +34,7 @@ use Friendica\Database\DBA; if (!defined('DB_UPDATE_VERSION')) { - define('DB_UPDATE_VERSION', 1324); + define('DB_UPDATE_VERSION', 1323); } return [ @@ -1384,8 +1384,7 @@ return [ "iid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "primary" => "1", "relation" => ["item" => "id"], "comment" => "Item id"], "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "primary" => "1", "relation" => ["user" => "uid"], "comment" => "User id"], "hidden" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Marker to hide an item from the user"], - "ignored" => ["type" => "boolean", "comment" => "Ignore this thread if set"], - "pinned" => ["type" => "boolean", "comment" => "The item is pinned on the profile page"] + "ignored" => ["type" => "boolean", "comment" => "Ignore this thread if set"] ], "indexes" => [ "PRIMARY" => ["uid", "iid"] diff --git a/static/routes.config.php b/static/routes.config.php index 339860afe6..1f2fe0ad1b 100644 --- a/static/routes.config.php +++ b/static/routes.config.php @@ -179,9 +179,8 @@ return [ '/{type}/{customize}/{name}' => [Module\Photo::class, [R::GET]], ], - '/pinned/{item:\d+}' => [Module\Pinned::class, [R::GET]], - '/pretheme' => [Module\ThemeDetails::class, [R::GET]], - '/probe' => [Module\Debug\Probe::class, [R::GET]], + '/pretheme' => [Module\ThemeDetails::class, [R::GET]], + '/probe' => [Module\Debug\Probe::class, [R::GET]], '/profile' => [ '/{nickname}' => [Module\Profile::class, [R::GET]],