From c4adf366eec747494c27b50766c511ac0555010e Mon Sep 17 00:00:00 2001
From: s22 Tech <59073912+s22-tech@users.noreply.github.com>
Date: Sun, 19 May 2024 10:56:25 -0700
Subject: [PATCH] Initial upload
---
--TO DO | 33 +
Read_Me.txt | 66 +
VERSION | 1 +
admin.php | 236 +
async_header.php | 33 +
bookmarks/add_bookmark.php | 2 +
bookmarks/async_bookmarks.php | 44 +
bookmarks/bookmarks.php | 229 +
bookmarks/delete_bookmark.inc.php | 50 +
bookmarks/delete_bookmark.php | 100 +
bookmarks/edit_bookmark.php | 237 +
bookmarks/move_bookmark.php | 60 +
bookmarks/new_bookmark.php | 152 +
change_password.php | 73 +
composer.json | 12 +
config/config.php | 77 +
docs/-read_me.txt | 66 +
docs/CHANGES | 39 +
docs/INSTALL.txt | 4 +
docs/installation.html | 366 ++
export.php | 300 +
favicon.ico | Bin 0 -> 1150 bytes
favicon.php | 305 +
folders/async_folders.php | 9 +
folders/delete_folder.php | 124 +
folders/edit_folder.php | 123 +
folders/folder.php | 356 ++
folders/move_folder.php | 65 +
folders/new_folder.php | 42 +
folders/select_folder.php | 26 +
footer.php | 7 +
header.min.php | 28 +
header.php | 63 +
images/ascending.gif | Bin 0 -> 82 bytes
images/background.jpg | Bin 0 -> 23122 bytes
images/bookmark.gif | Bin 0 -> 1120 bytes
images/bookmark_image.gif | Bin 0 -> 1120 bytes
images/delete.gif | Bin 0 -> 1029 bytes
images/descending.gif | Bin 0 -> 82 bytes
images/edit.gif | Bin 0 -> 1011 bytes
images/folder.gif | Bin 0 -> 1004 bytes
images/folder_open.gif | Bin 0 -> 997 bytes
images/folder_open_red.gif | Bin 0 -> 970 bytes
images/folder_red.gif | Bin 0 -> 977 bytes
images/grad.png | Bin 0 -> 345 bytes
images/loading.gif | Bin 0 -> 18300 bytes
images/logo.png | Bin 0 -> 1982 bytes
images/minus.gif | Bin 0 -> 880 bytes
images/move.gif | Bin 0 -> 1001 bytes
images/plus.gif | Bin 0 -> 881 bytes
images/spacer.gif | Bin 0 -> 43 bytes
import.php | 341 ++
includes/css/mobile.css | 73 +
includes/css/mobiledark.css | 8 +
includes/css/style.css | 287 +
includes/css/styledark.css | 126 +
includes/jquery/images/file.gif | Bin 0 -> 110 bytes
includes/jquery/images/folder.gif | Bin 0 -> 106 bytes
.../jquery/images/tv-collapsable-last.gif | Bin 0 -> 85 bytes
includes/jquery/images/tv-collapsable.gif | Bin 0 -> 781 bytes
includes/jquery/images/tv-expandable-last.gif | Bin 0 -> 89 bytes
includes/jquery/images/tv-expandable.gif | Bin 0 -> 787 bytes
includes/jquery/images/tv-item-last.gif | Bin 0 -> 65 bytes
includes/jquery/images/tv-item.gif | Bin 0 -> 750 bytes
includes/jquery/jquery-ui.min.js | 6 +
includes/jquery/jquery.js | 4994 +++++++++++++++++
includes/jquery/jquery.treeview.js | 239 +
index.php | 331 ++
install/install.php | 527 ++
lib/--mysql--orig.php | 35 +
lib/--pdo.php | 62 +
lib/--pngfix.js | 37 +
lib/auth.php | 178 +
lib/boolean_search.php | 275 +
lib/lib.js | 125 +
lib/lib.php | 594 ++
lib/login.php | 105 +
lib/mysql.php | 50 +
lib/webstart.php | 51 +
register.php | 164 +
settings.php | 398 ++
shared.php | 156 +
sidebar.php | 169 +
vendor/simplehtmldom/CHANGELOG.md | 369 ++
vendor/simplehtmldom/Debug.php | 149 +
vendor/simplehtmldom/HtmlDocument.php | 1125 ++++
vendor/simplehtmldom/HtmlNode.php | 1441 +++++
vendor/simplehtmldom/HtmlWeb.php | 133 +
vendor/simplehtmldom/README.md | 116 +
vendor/simplehtmldom/composer.json | 58 +
vendor/simplehtmldom/constants.php | 28 +
vendor/simplehtmldom/simple_html_dom.php | 152 +
92 files changed, 16230 insertions(+)
create mode 100644 --TO DO
create mode 100644 Read_Me.txt
create mode 100644 VERSION
create mode 100644 admin.php
create mode 100644 async_header.php
create mode 100644 bookmarks/add_bookmark.php
create mode 100644 bookmarks/async_bookmarks.php
create mode 100644 bookmarks/bookmarks.php
create mode 100644 bookmarks/delete_bookmark.inc.php
create mode 100644 bookmarks/delete_bookmark.php
create mode 100644 bookmarks/edit_bookmark.php
create mode 100644 bookmarks/move_bookmark.php
create mode 100644 bookmarks/new_bookmark.php
create mode 100644 change_password.php
create mode 100644 composer.json
create mode 100644 config/config.php
create mode 100644 docs/-read_me.txt
create mode 100644 docs/CHANGES
create mode 100644 docs/INSTALL.txt
create mode 100644 docs/installation.html
create mode 100644 export.php
create mode 100644 favicon.ico
create mode 100644 favicon.php
create mode 100644 folders/async_folders.php
create mode 100644 folders/delete_folder.php
create mode 100644 folders/edit_folder.php
create mode 100644 folders/folder.php
create mode 100644 folders/move_folder.php
create mode 100644 folders/new_folder.php
create mode 100644 folders/select_folder.php
create mode 100644 footer.php
create mode 100644 header.min.php
create mode 100644 header.php
create mode 100644 images/ascending.gif
create mode 100644 images/background.jpg
create mode 100644 images/bookmark.gif
create mode 100644 images/bookmark_image.gif
create mode 100644 images/delete.gif
create mode 100644 images/descending.gif
create mode 100644 images/edit.gif
create mode 100644 images/folder.gif
create mode 100644 images/folder_open.gif
create mode 100644 images/folder_open_red.gif
create mode 100644 images/folder_red.gif
create mode 100644 images/grad.png
create mode 100644 images/loading.gif
create mode 100644 images/logo.png
create mode 100644 images/minus.gif
create mode 100644 images/move.gif
create mode 100644 images/plus.gif
create mode 100644 images/spacer.gif
create mode 100644 import.php
create mode 100644 includes/css/mobile.css
create mode 100644 includes/css/mobiledark.css
create mode 100644 includes/css/style.css
create mode 100644 includes/css/styledark.css
create mode 100644 includes/jquery/images/file.gif
create mode 100644 includes/jquery/images/folder.gif
create mode 100644 includes/jquery/images/tv-collapsable-last.gif
create mode 100644 includes/jquery/images/tv-collapsable.gif
create mode 100644 includes/jquery/images/tv-expandable-last.gif
create mode 100644 includes/jquery/images/tv-expandable.gif
create mode 100644 includes/jquery/images/tv-item-last.gif
create mode 100644 includes/jquery/images/tv-item.gif
create mode 100644 includes/jquery/jquery-ui.min.js
create mode 100644 includes/jquery/jquery.js
create mode 100644 includes/jquery/jquery.treeview.js
create mode 100644 index.php
create mode 100644 install/install.php
create mode 100644 lib/--mysql--orig.php
create mode 100644 lib/--pdo.php
create mode 100644 lib/--pngfix.js
create mode 100644 lib/auth.php
create mode 100644 lib/boolean_search.php
create mode 100644 lib/lib.js
create mode 100644 lib/lib.php
create mode 100644 lib/login.php
create mode 100644 lib/mysql.php
create mode 100644 lib/webstart.php
create mode 100644 register.php
create mode 100644 settings.php
create mode 100644 shared.php
create mode 100644 sidebar.php
create mode 100644 vendor/simplehtmldom/CHANGELOG.md
create mode 100644 vendor/simplehtmldom/Debug.php
create mode 100644 vendor/simplehtmldom/HtmlDocument.php
create mode 100644 vendor/simplehtmldom/HtmlNode.php
create mode 100644 vendor/simplehtmldom/HtmlWeb.php
create mode 100644 vendor/simplehtmldom/README.md
create mode 100644 vendor/simplehtmldom/composer.json
create mode 100644 vendor/simplehtmldom/constants.php
create mode 100644 vendor/simplehtmldom/simple_html_dom.php
diff --git a/--TO DO b/--TO DO
new file mode 100644
index 0000000..6662ee0
--- /dev/null
+++ b/--TO DO
@@ -0,0 +1,33 @@
+OBM II
+
+
+TO DO
+
+• mobile layout is still pretty messed up
+
+• loading.gif shows twice on screen - once in the main section and once in the folders section - why?
+
+• $this->foreign_username appears to be empty in print_tree() in folders.php
+ The folders menu shows the "user's Bookmarks" but once you navigate, it changes to "My Bookmarks" and the icons change color.
+
+? the object orientation seems half-baked. Some files are classes but others aren't.
+
+• add password update in admin
+
+• make each column scroll independently from each other.
+
+
+
+DONE
+
+√ updated to work with PHP 8.0+
+
+√ added simplehtmldom to cover all cases of favicon paths.
+
+√ fixed favicon.php
+√ Refresh Icon button now works
+√ Delete Favicons button now works
+
+√ updated mysql to mysqli
+
+√ general code cleanup, consistency
diff --git a/Read_Me.txt b/Read_Me.txt
new file mode 100644
index 0000000..2762ef7
--- /dev/null
+++ b/Read_Me.txt
@@ -0,0 +1,66 @@
+https://github.com/s22-tech/openbookmark
+
+
+See http://www.frech.ch/openbookmark/installation.php for installation instructions.
+
+If you are upgrading from an old version, please manually create the following column on the `user` table:
+ theme varchar(50) NOT NULL default ''
+
+
+
+------
+
+
+
+New Installation:
+
+Basically the installation of OpenBookmark is not a big deal. There is an install script that guides you through the install steps. Just make sure you know your servers database credentials.
+
+ Download: First of all, download the latest Version of OpenBookmark and unpack the tarball in your Webserver's DocumentRoot direcotry.
+ Installation: Now point your browser to the freshly created directory on your webserver. If you did it well, the URL might look like this:
+
+ http://www.yourserver.com/openbookmark/
+
+ If the configuration file "./config/config.php" is missing - and it most probably will be if you are installing a new version - then a page will be shown linking to the install script. After answering all the questions in the install script, a config section is being displayed. Copy the section and paste it to "./config/config.php". The section looks like this. After creating the config file you must delete the install.php file prior visiting OpenBookmark, just for security reasons.
+
+ Login: Try visiting http://www.yourserver.com/openbookmark/ and login using the user that the install script created for you. The username and password is "admin". The first thing you should do is changing the password. Then open the admin script and start creating other users. You can find the admin script under the menu option "Tools".
+
+
+Upgrade an existing Installation:
+
+If you have an already existing installation of OpenBookmark and you would like to upgrade, the install script will care about the needed steps. If you are wise, you will backup the working installation before using the new one:
+
+ Backup files: I simply rename or move the old installation of OpenBookmark so that the new version can take place:
+
+ # mv /path/to/openbookmark \
+ /path/to/openbookmark-backup
+
+ Backup the database: Then I backup the database content by feeding this command to the MySQL server:
+
+ # mysqldump --user=bookmarkmgr \
+ --password=password_of_bookmarkmgr \
+ bookmarks \
+ > /some/path/openbookmark-backup.sql
+
+ Upgrade: Now proceed with the steps from the description above. Don't forget to copy the favicons to the new directory:
+
+ # cp -a /path/to/openbookmark-backup/icons/* \
+ /path/to/openbookmark/icons/
+
+ Admin user: If you upgraded and using at least version 0.8.7_beta now, the new admin script will be available. However, it will only be accessible by admin users. Thus you have to define one ore more users as admins now. To do so login to your MySQL server and do the following change in your database:
+
+ # mysql -p bookmarks
+ Enter password:
+ ...
+ mysql> UPDATE user SET admin='1' WHERE username='some_user';
+
+
+Install favicon support:
+
+ Since version 0.6.4 there is a nice feature with OpenBookmark that allows you to display the favicon of a webpage if one exists. To make this work, do the following steps:
+
+ Make sure ImageMagick is installed on your server. This is used to convert the favicon to PNG, since some browsers cannot display ICO files.
+
+ Edit the "./config/config.php" file and set the variables $convert and $identify to where the "convert" and "identify" executables are on your system. It might be something like "/usr/local/bin/convert" or "/usr/bin/convert".
+
+ Make sure that the "./favicons" directory is writable, readable and executable by the user your webserver runs as. Just chmod it to 755 and it will be.
diff --git a/VERSION b/VERSION
new file mode 100644
index 0000000..9f8e9b6
--- /dev/null
+++ b/VERSION
@@ -0,0 +1 @@
+1.0
\ No newline at end of file
diff --git a/admin.php b/admin.php
new file mode 100644
index 0000000..6341a20
--- /dev/null
+++ b/admin.php
@@ -0,0 +1,236 @@
+
+
+
+
+
+error);
+ }
+ }
+
+ require_once($_SERVER['DOCUMENT_ROOT'] . '/footer.php');
+?>
\ No newline at end of file
diff --git a/bookmarks/edit_bookmark.php b/bookmarks/edit_bookmark.php
new file mode 100644
index 0000000..c84af67
--- /dev/null
+++ b/bookmarks/edit_bookmark.php
@@ -0,0 +1,237 @@
+ 1) {
+ // If there is more than one bookmark to edit, we just care about the public/projects field.
+ if (!isset($_POST['public'])) {
+ $qbmlist = implode(',', $bmlist);
+ $query = sprintf("
+ SELECT `title`, `id`, `public`, `favicon`
+ FROM `bookmark`
+ WHERE `id` IN (%s) AND `user`='%s'
+ ORDER BY `title`",
+ $mysql->escape($qbmlist),
+ $mysql->escape($username)
+ );
+ if ($mysql->query($query)) {
+ require_once($_SERVER['DOCUMENT_ROOT'] . '/bookmarks/bookmarks.php');
+ $query_string = '?bmlist=' . implode('_"', $bmlist);
+?>
+
+
+
+
+
+escape($username),
+ $mysql->escape($post_title),
+ $mysql->escape($post_url),
+ $mysql->escape($post_description),
+ $mysql->escape($post_childof),
+ $mysql->escape($post_public)
+ );
+ if ($mysql->query($query)) {
+ echo 'Bookmark successfully created. ' . PHP_EOL;
+ $bm_id = mysqli_insert_id($mysql->conn); // Returns the value generated for an AUTO_INCREMENT column by the last query.
+ // https://www.php.net/manual/en/mysqli.insert-id.php
+ // Using $mysql->insert_id produces "Undefined property: mysql::$insert_id".
+// $bm_id = $pdo->lastInsertId(); // PDO equivalent -- https://www.php.net/pdo.lastinsertid
+ }
+ else {
+ message($mysql->error);
+ }
+ unset($_SESSION['title'], $_SESSION['url']);
+
+debug_logger(variable:$post_url, name:'post_url', file:__FILE__, function:__FUNCTION__);
+
+///////////////////////////
+// SAVE Favicon
+// Saving the favicon in a separate second step is done because
+// we want to make sure the bookmark is saved in any case,
+// since the favicon is not as important.
+///////////////////////////
+ if ($settings['show_bookmark_icon']) {
+ require_once($_SERVER['DOCUMENT_ROOT'] . '/favicon.php');
+ $favicon = new Favicon($post_url);
+debug_logger(variable:print_r($favicon, true), name:'favicon-object', file:__FILE__, function:__FUNCTION__);
+
+ if (!empty($favicon->favicon)) {
+ $update_query = sprintf("
+ UPDATE `obm_bookmarks`
+ SET `favicon` = '%s'
+ WHERE `user` = '%s'
+ AND `id` = '%d'",
+ $mysql->escape($favicon->favicon),
+ $mysql->escape($username),
+ $mysql->escape($bm_id)
+ );
+debug_logger(variable:$update_query, name:'update-query', file:__FILE__, function:__FUNCTION__);
+ if (!$mysql->query($update_query)) {
+ message($mysql->error);
+ }
+ $icon = '';
+ }
+ else {
+ $icon = $bookmark_image;
+debug_logger(variable:$icon, name:'favicon->favicon was NOT set', file:__FILE__, function:__FUNCTION__);
+debug_logger(variable:debug_backtrace(), name:'debug_backtrace()', file:__FILE__, function:__FUNCTION__);
+ }
+ }
+
+ if (strtolower(basename($_SERVER['SCRIPT_NAME'])) === 'add_bookmark.php') {
+ echo 'Back to '.$icon.' '.$post_title.' ' . PHP_EOL;
+ echo 'Open '.$folder_opened.' folder containing new Bookmark ' . PHP_EOL;
+ }
+ else {
+ echo '';
+ # I know, the following is ugly, but I found no other way to do it.
+ # When creating a bookmark out of the personal toolbar, there is no
+ # window.opener that can be closed. Thus javascript exits with an error
+ # without finishing itself (self.close()).
+ echo '';
+ }
+ }
+ require_once($_SERVER['DOCUMENT_ROOT'] . '/footer.php');
+?>
\ No newline at end of file
diff --git a/change_password.php b/change_password.php
new file mode 100644
index 0000000..d4759fc
--- /dev/null
+++ b/change_password.php
@@ -0,0 +1,73 @@
+escape($password),
+ $mysql->escape($username)
+ );
+
+ if ($mysql->query($query)) {
+ $pw_message = 'Password changed. '. PHP_EOL;
+ }
+ else {
+ message($mysql->error);
+ }
+ }
+ unset($_POST['set_password1'], $_POST['set_password2'], $password);
+ }
+
+?>
+
+
Change Password
+
+
+
+
diff --git a/composer.json b/composer.json
new file mode 100644
index 0000000..bb5068c
--- /dev/null
+++ b/composer.json
@@ -0,0 +1,12 @@
+{
+ "name": "s22-tech/openbookmark",
+ "type": "project",
+ "description": "An open source bookmark manager.",
+ "version": "v2.0",
+ "homepage": "https://github.com/s22-tech/openbookmark",
+ "license": "GPL-3.0+",
+ "require": {
+ "php": ">=8.0",
+ "simplehtmldom/simplehtmldom": "^1.9.1"
+ }
+}
diff --git a/config/config.php b/config/config.php
new file mode 100644
index 0000000..49398da
--- /dev/null
+++ b/config/config.php
@@ -0,0 +1,77 @@
+ 'ob_cookie',
+ 'domain' => '',
+ 'path' => '/',
+ 'seed' => '4Xp2yHprO6oTy5',
+ 'expire' => time() + 31_536_000,
+ ];
+
+ // Feel free to add values to this list as you like, according to the PHP documentation.
+ ## http://www.php.net/manual/en/function.date.php
+ $cfg['date_formats'] = [
+ 'd/m/Y',
+ 'Y-m-d',
+ 'm/d/Y',
+ 'd.m.Y',
+ 'F j, Y',
+ 'dS \o\f F Y',
+ 'dS F Y',
+ 'd F Y',
+ 'd. M Y',
+ 'Y F d',
+ 'F d, Y',
+ 'M. d, Y',
+ 'm/d/Y',
+ 'm-d-Y',
+ 'm.d.Y',
+ 'm.d.y',
+ ];
+
+ $cfg['convert_favicons'] = true;
+ $cfg['icon_size'] = '24x24';
+ $cfg['convert'] = '/usr/bin/convert';
+ $cfg['identify'] = '/usr/bin/identify';
+ $cfg['timeout'] = 5;
+ [$cfg['icon_w'], $cfg['icon_h']] = explode('x', $cfg['icon_size']);
+
+ $cfg['locale'] = 'en-US';
+ $cfg['user_agent'] = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36 Edg/124.0.2478.109';
+
+ $folder_closed = '';
+ $folder_opened = '';
+ $folder_closed_public = '';
+ $folder_opened_public = '';
+
+ $plus = ' ';
+ $minus = ' ';
+ $neutral = ' ';
+ $edit_image = '';
+ $move_image = '';
+ $delete_image = '';
+ $bookmark_image = '';
+
+
+
+/*
+javascript:(function(){bmadd=window.open('https://obm.domain.com/bookmarks/new_bookmark.php?title='+encodeURIComponent(document.title)+'&url='+encodeURIComponent(location.href),'bmadd','toolbar=no,location=no,status=no,scrollbars=yes,resizable=yes,width=500,height=500,left=50,top=50');setTimeout(function(){bmadd.focus();});})();
+*/
diff --git a/docs/-read_me.txt b/docs/-read_me.txt
new file mode 100644
index 0000000..2762ef7
--- /dev/null
+++ b/docs/-read_me.txt
@@ -0,0 +1,66 @@
+https://github.com/s22-tech/openbookmark
+
+
+See http://www.frech.ch/openbookmark/installation.php for installation instructions.
+
+If you are upgrading from an old version, please manually create the following column on the `user` table:
+ theme varchar(50) NOT NULL default ''
+
+
+
+------
+
+
+
+New Installation:
+
+Basically the installation of OpenBookmark is not a big deal. There is an install script that guides you through the install steps. Just make sure you know your servers database credentials.
+
+ Download: First of all, download the latest Version of OpenBookmark and unpack the tarball in your Webserver's DocumentRoot direcotry.
+ Installation: Now point your browser to the freshly created directory on your webserver. If you did it well, the URL might look like this:
+
+ http://www.yourserver.com/openbookmark/
+
+ If the configuration file "./config/config.php" is missing - and it most probably will be if you are installing a new version - then a page will be shown linking to the install script. After answering all the questions in the install script, a config section is being displayed. Copy the section and paste it to "./config/config.php". The section looks like this. After creating the config file you must delete the install.php file prior visiting OpenBookmark, just for security reasons.
+
+ Login: Try visiting http://www.yourserver.com/openbookmark/ and login using the user that the install script created for you. The username and password is "admin". The first thing you should do is changing the password. Then open the admin script and start creating other users. You can find the admin script under the menu option "Tools".
+
+
+Upgrade an existing Installation:
+
+If you have an already existing installation of OpenBookmark and you would like to upgrade, the install script will care about the needed steps. If you are wise, you will backup the working installation before using the new one:
+
+ Backup files: I simply rename or move the old installation of OpenBookmark so that the new version can take place:
+
+ # mv /path/to/openbookmark \
+ /path/to/openbookmark-backup
+
+ Backup the database: Then I backup the database content by feeding this command to the MySQL server:
+
+ # mysqldump --user=bookmarkmgr \
+ --password=password_of_bookmarkmgr \
+ bookmarks \
+ > /some/path/openbookmark-backup.sql
+
+ Upgrade: Now proceed with the steps from the description above. Don't forget to copy the favicons to the new directory:
+
+ # cp -a /path/to/openbookmark-backup/icons/* \
+ /path/to/openbookmark/icons/
+
+ Admin user: If you upgraded and using at least version 0.8.7_beta now, the new admin script will be available. However, it will only be accessible by admin users. Thus you have to define one ore more users as admins now. To do so login to your MySQL server and do the following change in your database:
+
+ # mysql -p bookmarks
+ Enter password:
+ ...
+ mysql> UPDATE user SET admin='1' WHERE username='some_user';
+
+
+Install favicon support:
+
+ Since version 0.6.4 there is a nice feature with OpenBookmark that allows you to display the favicon of a webpage if one exists. To make this work, do the following steps:
+
+ Make sure ImageMagick is installed on your server. This is used to convert the favicon to PNG, since some browsers cannot display ICO files.
+
+ Edit the "./config/config.php" file and set the variables $convert and $identify to where the "convert" and "identify" executables are on your system. It might be something like "/usr/local/bin/convert" or "/usr/bin/convert".
+
+ Make sure that the "./favicons" directory is writable, readable and executable by the user your webserver runs as. Just chmod it to 755 and it will be.
diff --git a/docs/CHANGES b/docs/CHANGES
new file mode 100644
index 0000000..7d074d8
--- /dev/null
+++ b/docs/CHANGES
@@ -0,0 +1,39 @@
+2024-05-18
+- More code cleanup for PHP 8.3
+- Changed favicon format to SVG as they are much smaller files.
+- Favicons are named per domain now, so there won't be multiple icons saved for the same domain. E.g.if you save a lot of YouTube videos, you don't need a separate icon for all of them. Just one will do the trick. Helps keep your inode count down.
+
+2021-04-11, Version 0.9.1 beta
+- Refactored the code for PHP 8 by s22_tech.
+- Cleaned up the code as I went -- still a lot more to do.
+- Swapped out Google search for DuckDuckGo.
+
+2008-04-20, Version 0.8.9 beta
+- Added the possibility to either convert favicon using ImageMagick or
+ leave them in the ICO format. Updating favicon.php and install.php accordingly.
+
+2008-05-04, Version 0.8.10 beta
+- Changed the "Select folder" link to a button in /bookmarks/edit_bookmark.php and /bookmarks/new_bookmark.php files.
+- Fixed HTML encoded strings when importing bookmarks in Netscape format.
+- Fixed some typos in index.php and added the "My Bookmarks" link in search mode.
+
+2008-05-17, Version 0.8.11_beta
+- Added a link to use OpenBookmark as a real Firefox Sidebar. Many thanks to Adam Patterson.
+- You can find the link "Change Password" under "Settings" from now on.
+- Added completely new search lib. Many thanks to John-Paul Durrieu as well for other hints and suggestions.
+
+2008-07-22, Version 0.8.12_beta
+- Changed the look of the menu headers
+- Changed the look of the footer
+- Added sort by Title and Date to bookmarks header
+
+2008-08-01, Version 0.8.13_beta
+- Adjusted order function so that arrow changes direction when changing order.
+
+2008-08-12, Version 0.8.14_beta
+- Getting rid of dangerous $GLOBALS in export.php, import.php and folders.php.
+
+2008-04-16, Version 0.8.8 beta
+- New design.
+- Added the possibility to change the public/projects status on multiple bookmarks.
+- Added the possibility to mark bookmarks and folders public/projects when importing them.
diff --git a/docs/INSTALL.txt b/docs/INSTALL.txt
new file mode 100644
index 0000000..8e52f78
--- /dev/null
+++ b/docs/INSTALL.txt
@@ -0,0 +1,4 @@
+See http://www.frech.ch/online-bookmarks/installation.php for installation instructions.
+
+If you are upgrading from an old version, please manually create the following column on the `user` table:
+ theme varchar(50) NOT NULL default ''
\ No newline at end of file
diff --git a/docs/installation.html b/docs/installation.html
new file mode 100644
index 0000000..223be4d
--- /dev/null
+++ b/docs/installation.html
@@ -0,0 +1,366 @@
+
+
+
+
+
+
+
+ Online-Bookmarks / Installation
+
+
+
+
+
+
+ If you like Online-Bookmarks, please rate it at
+ HotScripts.com.
+
+
+
+
+
+
+
+
+
+
+
+I am having a break!
+
+
+
+Online-Bookmarks has been developed for over seven years now. There
+where incredible many comments, feedbacks, ideas and help from people all over
+the world. In fact there have been so many, that I was not able to
+answer all of them. I really do appreciate every single message that reached me. But
+I need to get some distance of this application for the next couple of month,
+mainly because of this.
+Thanks to all of you supporting this tool,
+especially the one that made a donation.
+In the meantime the latest version will remain available for download.
+The same is also available on SourceForge.net
+CVS.
+
+
+
+
+
+
+
+
+
+
+
+So long, Stefan
+August 22nd 2008
+
+
+
+
+
+New Installation:
+
+Basically the Installation of Online-Bookmarks is not a big deal.
+There is an install script that guides you through the install steps.
+Just make sure you know your servers database credentials.
+If you will have troubles anyway, you can look for help in the
+forum, if you can't find help there
+and you really do not feel like testing around for hours, drop me a message
+with the subject "Online-Bookmarks" and I will try to help you.
+
+
+
Download:
+ First of all, download
+ the latest Version of Online-Bookmarks and unpack the tarball
+ in your Webserver's DocumentRoot direcotry.
+
+
+
Installation:
+ Now point your browser to the freshly created directory on your
+ webserver. If you did it well, the URL might look like this:
+
http://www.yourserver.com/online-bookmarks/
+ If the configuration file "./config/config.php" is missing - and
+ it most probably will if you are installing a new version
+ - then a page will be shown linking to the install
+ script. After answering all the questions in the install script,
+ a config section is being displayed. Copy the section and paste it
+ to "./config/config.php". The section looks like
+ this. After
+ creating the config file you must delete the install.php file prior
+ visiting Online-Bookmarks, just for security reasons.
+
+
+
Login:
+ Try visiting http://www.yourserver.com/online-bookmarks/
+ and login using the user that the install script created for you.
+ Its username and password is "admin". The first thing you should
+ do is changing the password. Then open the admin script and start
+ creating other users. You can find the admin script under the menu
+ option "Tools". This admin user and the admin script are available
+ from Online-Bookmarks version 0.8.7_beta.
+
+
+
+
+
+Upgrade an existing Installation:
+If you have an already existing installation of Online-Bookmarks
+and you would like to upgrade, the install script will care about
+the needed steps. If you are wise, you will backup the working
+installation before using the new one:
+
+
+
Backup files:
+ I simply rename or move the old installation of Online-Bookmarks so that
+ the new version can take place:
+
Upgrade:
+ Now proceed with the steps from the description above. Don't forget to
+ copy the favicons to the new directory:
+
+# cp -a /path/to/online-bookmarks-backup/icons/* \
+ /path/to/online-bookmarks/icons/
+
+
+
+
Admin user:
+ If you upgraded and using at least version 0.8.7_beta now, the new
+ admin script will be available. However, it will only be accessible
+ by admin users. Thus you have to define one ore more users as admins
+ now. To do so login to your MySQL server and do the following
+ change in your database:
+
+
+# mysql -p bookmarks
+Enter password:
+...
+mysql> UPDATE user SET admin='1' WHERE username='some_user';
+
+
+
+
+
+
+
+Install favicon support:
+Since version 0.6.4 there comes a nice feature with Online-Bookmarks that allows you to display the favicon
+of a webpage if one exists. To make this work do the following steps:
+
+
Make sure ImageMagick is installed on your server.
+ This is used to convert the favicon to PNG, since some browsers cannot display ICO files.
+
+
+
Edit the "./config/config.php" file and set the variables $convert and $identify to where
+ the "convert" and "identify" executables are on your system. It might be something like "/usr/local/bin/convert"
+ or "/usr/bin/convert".
+
+
+
Make sure that the "./favicons" directory is writable, readable and executable by the user your
+ webserver runs as. Just chmod it to 777 and it will be.
+
';
+ if ($mysql->query($query)) {
+ while ($row = mysqli_fetch_assoc($mysql->result)) {
+ $this->folders[$row['id']] = $row;
+ if (empty($this->children[$row['childof']])) {
+ $this->children[$row['childof']] = [];
+ }
+ array_push($this->children[$row['childof']], $row['id']);
+ }
+ }
+ else {
+ message($mysql->error);
+ }
+ }
+
+ function get_shared_data($user) {
+ global $mysql, $username;
+
+ // Does the user exist in the database?
+ if (check_username($user)) {
+ $this->foreign_username = $user;
+ }
+ else {
+ $this->foreign_username = $username;
+ }
+
+ // Get all shared folders for the given user.
+ $query = "
+ SELECT `id`, `childof`, `name`, `public`
+ FROM `obm_folders`
+ WHERE `public` = '1' AND `deleted` != '1' AND `user` = '$this->foreign_username'
+ ORDER BY `name`";
+
+ if ($mysql->query($query)) {
+ // Make two arrays:
+ // 1) $children containing arrays with children. The keys of these arrays are the id's of the parents.
+ // 2) $folders containing arrays with folder settings (id, childof, name, public).
+ $shared_children = [];
+ while ($row = mysqli_fetch_assoc($mysql->result)) {
+ $this->folders[$row['id']] = $row;
+ if (empty($this->children[$row['childof']])) {
+ $this->children[$row['childof']] = [];
+ }
+ array_push($this->children[$row['childof']], $row['id']);
+ array_push($shared_children, $row['id']);
+ }
+
+ $this->children[0] = [];
+ // The 'childof' fields of each folder with no parent are being set to 0, so each becomes a child of the root folder.
+ foreach ($this->folders as $value) {
+ if (in_array($value['childof'], $shared_children)) {
+ continue;
+ }
+ else {
+ array_push($this->children[0], $value['id']);
+ $this->folders[$value['id']]['childof'] = 0;
+ }
+ }
+ }
+ else {
+ message($mysql->error);
+ }
+ }
+
+
+ // Assembles the tree.
+ function make_tree($id) {
+ if (isset($this->children)) {
+ $this->level++;
+ if (isset($this->children[$id])) {
+ foreach ($this->children[$id] as $value) {
+ array_push($this->tree, [
+ 'level' => $this->level,
+ 'id' => $value,
+ 'name' => $this->folders[$value]['name'],
+ 'public' => $this->folders[$value]['public'],
+ ]);
+ // Check for children.
+ $symbol = &$this->tree[count($this->tree) - 1]['symbol'];
+ if (isset($this->children[$value])) {
+ if (in_array($value, $this->expand)) {
+ $symbol = 'minus';
+ $this->make_tree($value);
+ }
+ else {
+ $symbol = 'plus';
+ }
+ }
+ else {
+ $symbol = '';
+ }
+ }
+ }
+ $this->level--;
+ }
+ }
+
+ // Draws the tree.
+ function print_tree($scriptname='') {
+ global $settings, $folder_opened, $folder_closed, $folder_opened_public, $folder_closed_public, $plus, $minus, $neutral;
+
+ if ($scriptname == '') $scriptname = $_SERVER['SCRIPT_NAME']; // e.g. index.php
+
+ // Depending on who's bookmarks are being displayed, we set some variables differently.
+ if (!empty($this->foreign_username)) {
+ $root_folder_name = $this->foreign_username . "'s Bookmarks";
+ $user_var = "&user=$this->foreign_username";
+ }
+ else {
+ $root_folder_name = $settings['root_folder_name'];
+ $user_var = '';
+ }
+
+ $root_folder = [
+ 'level' => 0,
+ 'id' => 0,
+ 'name' => $root_folder_name,
+ 'symbol' => null,
+ 'public' => 0,
+ ];
+ if (isset($this->tree)) {
+ array_unshift($this->tree, $root_folder);
+ }
+
+ // The top folder shows up too high at the top. Draw a little space there.
+ echo '' . PHP_EOL;
+
+// usort($this->tree, function ($folder1, $folder2) {
+// return $folder1['name'] <=> $folder2['name'];
+// });
+// array_multisort(array_column($this->tree, 'name'), SORT_ASC, SORT_NATURAL|SORT_FLAG_CASE, $this->tree);
+// echo '
'; print_r($this->tree); echo '
';
+
+ foreach ($this->tree as $key => $value) {
+ // This is the begining of the line that shows a folder
+ // with the symbol (plus, minus or neutral).
+ $spacer = '