From 0fd96fcdae3c3d78c74e9446f692c1f3d30d6b00 Mon Sep 17 00:00:00 2001 From: Shish Date: Sat, 18 Jun 2016 18:26:11 +0100 Subject: [PATCH] remove incomplete and unmaintained bookmarks ext, see #532 --- ext/bookmarks/main.php | 68 ----------------------------------------- ext/bookmarks/test.php | 8 ----- ext/bookmarks/theme.php | 5 --- 3 files changed, 81 deletions(-) delete mode 100644 ext/bookmarks/main.php delete mode 100644 ext/bookmarks/test.php delete mode 100644 ext/bookmarks/theme.php diff --git a/ext/bookmarks/main.php b/ext/bookmarks/main.php deleted file mode 100644 index d864d92a..00000000 --- a/ext/bookmarks/main.php +++ /dev/null @@ -1,68 +0,0 @@ - - * Link: http://code.shishnet.org/shimmie2/ - * License: GPLv2 - * Description: Allow users to bookmark searches - */ - -class Bookmarks extends Extension { - public function onInitExt(InitExtEvent $event) { - $this->install(); - } - - public function onPageRequest(PageRequestEvent $event) { - global $page; - - if($event->page_matches("bookmark")) { - if($event->get_arg(0) == "add") { - if(isset($_POST['url'])) { - $page->set_mode("redirect"); - $page->set_redirect(make_link("user")); - } - } - else if($event->get_arg(0) == "remove") { - if(isset($_POST['id'])) { - $page->set_mode("redirect"); - $page->set_redirect(make_link("user")); - } - } - } - } - - protected function install() { - global $database, $config; - - // shortcut to latest - if($config->get_int("ext_bookmarks_version") < 1) { - $database->create_table("bookmark", " - id SCORE_AIPK, - owner_id INTEGER NOT NULL, - url TEXT NOT NULL, - title TEXT NOT NULL, - FOREIGN KEY (owner_id) REFERENCES users(id) ON DELETE CASCADE - "); - $database->execute("CREATE INDEX bookmark_owner_id_idx ON bookmark(owner_id)", array()); - $config->set_int("ext_bookmarks_version", 1); - } - } - - private function get_bookmarks() { - global $database; - $bms = $database->get_all(" - SELECT * - FROM bookmark - WHERE bookmark.owner_id = ? - "); - if($bms) {return $bms;} - else {return array();} - } - - private function add_bookmark(/*string*/ $url, /*string*/ $title) { - global $database, $user; - $sql = "INSERT INTO bookmark(owner_id, url, title) VALUES (?, ?, ?)"; - $database->Execute($sql, array($user->id, $url, $title)); - } -} - diff --git a/ext/bookmarks/test.php b/ext/bookmarks/test.php deleted file mode 100644 index 02f99fec..00000000 --- a/ext/bookmarks/test.php +++ /dev/null @@ -1,8 +0,0 @@ -get_page("bookmark/add"); - $this->get_page("bookmark/remove"); - } -} - diff --git a/ext/bookmarks/theme.php b/ext/bookmarks/theme.php deleted file mode 100644 index a1cb7b42..00000000 --- a/ext/bookmarks/theme.php +++ /dev/null @@ -1,5 +0,0 @@ -