initial version
This commit is contained in:
7
CHANGES
Normal file
7
CHANGES
Normal file
@@ -0,0 +1,7 @@
|
||||
16.04.2008, Version 0.8.8 beta
|
||||
- New design.
|
||||
- Added the possibility to change the public/private status on multiple
|
||||
bookmarks.
|
||||
- Added the possibility to mark bookmarks and folders public/private
|
||||
when importing them.
|
||||
|
||||
1
INSTALL
Normal file
1
INSTALL
Normal file
@@ -0,0 +1 @@
|
||||
See http://www.frech.ch/online-bookmarks/installation.php for installation instructions.
|
||||
1
README
Normal file
1
README
Normal file
@@ -0,0 +1 @@
|
||||
See http://www.frech.ch/online-bookmarks/ for documentation.
|
||||
282
admin.php
Normal file
282
admin.php
Normal file
@@ -0,0 +1,282 @@
|
||||
<?php
|
||||
require_once ('./header.php');
|
||||
logged_in_only ();
|
||||
|
||||
$delete = set_post_string_var ('delete');
|
||||
$create = set_post_string_var ('create');
|
||||
$new_username = set_post_string_var ('new_username');
|
||||
$new_password = set_post_string_var('new_password');
|
||||
$new_admin = set_post_bool_var ('new_admin', false);
|
||||
$existing_user = set_post_string_var ('existing_user');
|
||||
$noconfirm = set_get_noconfirm ();
|
||||
|
||||
$message1 = '';
|
||||
$message2 = '';
|
||||
?>
|
||||
|
||||
<table class="caption">
|
||||
<tr>
|
||||
<td><span class="caption"><img src="./images/logo.png" alt=""> Admin Page</span>
|
||||
</td>
|
||||
|
||||
<td class="captionright">
|
||||
<div><?php object_count (); ?></div>
|
||||
<div><?php print_footer (); ?></div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
<table class="main">
|
||||
<tr>
|
||||
<td class="main1">
|
||||
<table class="menu">
|
||||
<tr>
|
||||
<th class="menuhead">Bookmarks</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="menu">
|
||||
<a href="./index.php">My Bookmarks</a><br>
|
||||
<a href="./shared.php">Shared Bookmarks</a><br>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<br>
|
||||
|
||||
<table class="menu">
|
||||
<tr>
|
||||
<th class="menuhead">Tools</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="menu">
|
||||
<?php if (admin_only ()) { ?>
|
||||
<a href="./admin.php">Admin</a><br>
|
||||
<?php } ?>
|
||||
<a href="./import.php">Import</a><br>
|
||||
<a href="./export.php">Export</a><br>
|
||||
<a href="./sidebar.php">View as Sidebar</a><br>
|
||||
<a href="./settings.php">Settings</a><br>
|
||||
<a href="javascript:chpw()">Change Password</a><br>
|
||||
<a href="./index.php?logout=1">Logout</a><br>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<td class="">
|
||||
<img src="./images/spacer.gif" alt="" class="main2">
|
||||
</td>
|
||||
<td class="main4">
|
||||
|
||||
<?php
|
||||
if (!admin_only ()) {
|
||||
message ("You are not an Admin.");
|
||||
}
|
||||
|
||||
if ($create == 'Create') {
|
||||
if ($new_username == '' || $new_password == '') {
|
||||
$message1 = 'Username and Password fields must not be empty.';
|
||||
}
|
||||
else if (check_username ($new_username)) {
|
||||
$message1 = 'User already exists.';
|
||||
}
|
||||
else {
|
||||
$query = sprintf ("INSERT INTO user (username, password, admin) VALUES ('%s', md5('%s'), '%d')",
|
||||
$mysql->escape ($new_username),
|
||||
$mysql->escape ($new_password),
|
||||
$mysql->escape ($new_admin));
|
||||
|
||||
if ($mysql->query ($query)) {
|
||||
$message1 = "User $new_username created.";
|
||||
}
|
||||
else {
|
||||
message ($mysql->error);
|
||||
}
|
||||
unset ($new_password, $_POST['new_password']);
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
<fieldset>
|
||||
<legend>Create User</legend>
|
||||
|
||||
<form action="<?php echo $_SERVER['SCRIPT_NAME']; ?>" method="POST">
|
||||
<table>
|
||||
<tr>
|
||||
<td>Username:
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="new_username">
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>Password:
|
||||
</td>
|
||||
<td>
|
||||
<input type="password" name="new_password">
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>Admin:
|
||||
</td>
|
||||
<td>
|
||||
<input type="checkbox" name="new_admin" value="1">
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
</td>
|
||||
<td>
|
||||
<input type="submit" name="create" value="Create"> <?php echo $message1; ?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
|
||||
</fieldset>
|
||||
|
||||
|
||||
<fieldset>
|
||||
<legend>Delete User</legend>
|
||||
|
||||
<?php
|
||||
if ($delete == 'Delete') {
|
||||
if (check_username ($existing_user)) {
|
||||
if ($noconfirm) {
|
||||
$query = sprintf ("DELETE FROM user WHERE md5(username)=md5('%s')",
|
||||
$mysql->escape ($existing_user));
|
||||
if ($mysql->query ($query)) {
|
||||
$message2 = "User $existing_user deleted.<br>";
|
||||
}
|
||||
else {
|
||||
message ($mysql->error);
|
||||
}
|
||||
|
||||
$query = sprintf ("DELETE FROM bookmark WHERE md5(user)=md5('%s')",
|
||||
$mysql->escape ($existing_user));
|
||||
if (!$mysql->query ($query)) {
|
||||
message ($mysql->error);
|
||||
}
|
||||
|
||||
$query = sprintf ("DELETE FROM folder WHERE md5(user)=md5('%s')",
|
||||
$mysql->escape ($existing_user));
|
||||
if (!$mysql->query ($query)) {
|
||||
message ($mysql->error);
|
||||
}
|
||||
list_users ();
|
||||
}
|
||||
else {
|
||||
?>
|
||||
|
||||
<p>Are you sure you want to delete the user <?php echo $existing_user; ?> and all it's Bookmarks and Folders?</p>
|
||||
<form action="<?php echo $_SERVER['SCRIPT_NAME'] . "?noconfirm=1"; ?>" method="POST" name="userdelete">
|
||||
<input type="hidden" name="existing_user" value="<?php echo $existing_user; ?>">
|
||||
<input type="submit" name="delete" value="Delete">
|
||||
<input type="button" value=" Cancel " onClick="self.location.href='./admin.php'">
|
||||
</form>
|
||||
|
||||
<?php
|
||||
}
|
||||
}
|
||||
else {
|
||||
$message2 = 'User does not exist.';
|
||||
list_users ();
|
||||
}
|
||||
}
|
||||
else {
|
||||
list_users ();
|
||||
}
|
||||
|
||||
function list_users () {
|
||||
global $mysql, $message2;;
|
||||
?>
|
||||
|
||||
<form action="<?php echo $_SERVER['SCRIPT_NAME']; ?>" method="POST">
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<div style="height: 200px; width: 300px; overflow:auto;">
|
||||
<?php
|
||||
$query = "SELECT username, admin FROM user ORDER BY username";
|
||||
|
||||
if ($mysql->query ($query)) {
|
||||
while ($row = mysql_fetch_object ($mysql->result)) {
|
||||
echo '<input type="radio" name="existing_user" value="'.$row->username.'">';
|
||||
if ($row->admin) {
|
||||
echo " <b>" . $row->username . "</b><br>\n";
|
||||
}
|
||||
else {
|
||||
echo " " . $row->username . "<br>\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
message ($mysql->error);
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<input type="submit" name="delete" value="Delete">
|
||||
<?php echo $message2; ?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</form>
|
||||
|
||||
<?php
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
</fieldset>
|
||||
|
||||
<fieldset>
|
||||
<legend>Version</legend>
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<td>This Version:</td>
|
||||
<td><?php @readfile (ABSOLUTE_PATH . "VERSION"); ?></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><a href="http://www.frech.ch/online-bookmarks/" target="_new">Newest Version available:</a></td>
|
||||
<td><a href="http://www.frech.ch/online-bookmarks/" target="_new"><?php echo check_version (); ?></a></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<?php
|
||||
function check_version () {
|
||||
$version = null;
|
||||
if ($fp = @fsockopen ("www.frech.ch", 80)) {
|
||||
$get = "GET /online-bookmarks/bookmarks/VERSION HTTP/1.0\r\n\r\n";
|
||||
$data = null;
|
||||
fwrite ($fp, $get);
|
||||
while (!feof ($fp)) {
|
||||
$data .= fgets ($fp, 128);
|
||||
}
|
||||
fclose ($fp);
|
||||
$pos = strpos($data, "\r\n\r\n") + 4;
|
||||
$version = substr ($data, $pos, strlen ($data));
|
||||
}
|
||||
return $version;
|
||||
}
|
||||
?>
|
||||
|
||||
</fieldset>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<?php
|
||||
require_once (ABSOLUTE_PATH . 'footer.php');
|
||||
?>
|
||||
3
bookmark_add.php
Normal file
3
bookmark_add.php
Normal file
@@ -0,0 +1,3 @@
|
||||
<?php
|
||||
include ('./bookmark_new.php');
|
||||
?>
|
||||
70
bookmark_delete.php
Normal file
70
bookmark_delete.php
Normal file
@@ -0,0 +1,70 @@
|
||||
<?php
|
||||
require_once ("./header.php");
|
||||
logged_in_only ();
|
||||
|
||||
$bmlist = set_get_num_list ('bmlist');
|
||||
|
||||
if (count ($bmlist) == 0){
|
||||
echo "No Bookmarks selected";
|
||||
}
|
||||
else if (!$settings['confirm_delete'] || set_get_noconfirm ()){
|
||||
$bmlist = implode (",", $bmlist);
|
||||
$query = sprintf ("DELETE FROM bookmark WHERE id IN (%s) AND user='%s'",
|
||||
$mysql->escape ($bmlist),
|
||||
$mysql->escape ($username));
|
||||
if ($mysql->query ($query)) {
|
||||
echo "Bookmarks successfully deleted<br>\n";
|
||||
echo '<script language="JavaScript">reloadclose();</script>';
|
||||
}
|
||||
else {
|
||||
message ($mysql->error);
|
||||
}
|
||||
}
|
||||
else {
|
||||
$bmlistq = implode (",", $bmlist);
|
||||
$query = sprintf ("SELECT title, id, favicon FROM bookmark WHERE id IN (%s) AND user='%s' ORDER BY title",
|
||||
$mysql->escape ($bmlistq),
|
||||
$mysql->escape ($username));
|
||||
if ($mysql->query ($query)) {
|
||||
require_once (ABSOLUTE_PATH . "bookmarks.php");
|
||||
$query_string = "?bmlist=" . implode ("_", $bmlist) . "&noconfirm=1";
|
||||
?>
|
||||
|
||||
<p class="title">Delete these Bookmarks?</p>
|
||||
<div style="width:100%; height:330px; overflow:auto;">
|
||||
|
||||
<?php
|
||||
$bookmarks = array ();
|
||||
while ($row = mysql_fetch_assoc ($mysql->result)) {
|
||||
array_push ($bookmarks, $row);
|
||||
}
|
||||
list_bookmarks ($bookmarks,
|
||||
false,
|
||||
false,
|
||||
$settings['show_bookmark_icon'],
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
false);
|
||||
?>
|
||||
|
||||
</div>
|
||||
|
||||
<br>
|
||||
<form action="<?php echo $_SERVER['SCRIPT_NAME'] . $query_string; ?>" method="POST" name="bmdelete">
|
||||
<input type="submit" value=" OK ">
|
||||
<input type="button" value=" Cancel " onClick="self.close()">
|
||||
</form>
|
||||
|
||||
<?php
|
||||
}
|
||||
else {
|
||||
message ($mysql->error);
|
||||
}
|
||||
}
|
||||
|
||||
require_once (ABSOLUTE_PATH . "footer.php");
|
||||
?>
|
||||
188
bookmark_edit.php
Normal file
188
bookmark_edit.php
Normal file
@@ -0,0 +1,188 @@
|
||||
<?php
|
||||
require_once ("./header.php");
|
||||
logged_in_only ();
|
||||
|
||||
$bmlist = set_get_num_list ('bmlist');
|
||||
|
||||
$post_title = set_post_title ();
|
||||
$post_url = set_post_url ();
|
||||
$post_description = set_post_description ();
|
||||
$post_icon = set_post_bool_var ('favicon', false);
|
||||
$post_childof = set_post_childof ();
|
||||
$post_public = set_post_bool_var ("public", false);
|
||||
|
||||
if (count ($bmlist) > 1) {
|
||||
# if there is more than one bookmark to edit, we just care about the
|
||||
# public/private 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 (ABSOLUTE_PATH . "bookmarks.php");
|
||||
$query_string = "?bmlist=" . implode ("_", $bmlist);
|
||||
?>
|
||||
|
||||
<p class="title">Change public state:</p>
|
||||
<div style="width:100%; height:330px; overflow:auto;">
|
||||
|
||||
<?php
|
||||
$bookmarks = array ();
|
||||
while ($row = mysql_fetch_assoc ($mysql->result)) {
|
||||
array_push ($bookmarks, $row);
|
||||
}
|
||||
list_bookmarks ($bookmarks,
|
||||
false,
|
||||
false,
|
||||
$settings['show_bookmark_icon'],
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
true);
|
||||
?>
|
||||
|
||||
</div>
|
||||
|
||||
<br>
|
||||
<form action="<?php echo $_SERVER['SCRIPT_NAME'] . $query_string; ?>" method="POST" name="bmedit">
|
||||
<p>
|
||||
<select name="public">
|
||||
<option value="1">public</option>
|
||||
<option value="0">private</option>
|
||||
</select>
|
||||
</p>
|
||||
<input type="submit" value=" OK ">
|
||||
<input type="button" value=" Cancel " onClick="self.close()">
|
||||
</form>
|
||||
|
||||
<?php
|
||||
}
|
||||
else {
|
||||
message ($mysql->error);
|
||||
}
|
||||
}
|
||||
else {
|
||||
$bmlist = implode (",", $bmlist);
|
||||
$query = sprintf ("UPDATE bookmark SET public='%d'
|
||||
WHERE id IN (%s)
|
||||
AND user='%s'",
|
||||
$mysql->escape ($post_public),
|
||||
$mysql->escape ($bmlist),
|
||||
$mysql->escape ($username));
|
||||
if ($mysql->query ($query)) {
|
||||
echo "Bookmark successfully updated<br>\n";
|
||||
echo '<script language="JavaScript">reloadclose();</script>';
|
||||
}
|
||||
else {
|
||||
message ($mysql->error);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
else if (count ($bmlist) < 1) {
|
||||
message ("No Bookmark to edit.");
|
||||
}
|
||||
else if ($post_title == "" || $post_url == "" || $post_icon) {
|
||||
$query = sprintf ("SELECT title, url, description, childof, id, favicon, public
|
||||
FROM bookmark
|
||||
WHERE id='%d'
|
||||
AND user='%s'
|
||||
AND deleted != '1'",
|
||||
$mysql->escape ($bmlist[0]),
|
||||
$mysql->escape ($username));
|
||||
if ($mysql->query ($query)) {
|
||||
if (mysql_num_rows ($mysql->result) != 1) {
|
||||
message ("No Bookmark to edit");
|
||||
}
|
||||
else {
|
||||
$row = mysql_fetch_object ($mysql->result);
|
||||
require_once (ABSOLUTE_PATH . "folders.php");
|
||||
$tree = & new folder;
|
||||
$query_string = "?expand=" . implode(",", $tree->get_path_to_root ($row->childof)) . "&folderid=" . $row->childof;
|
||||
$path = $tree->print_path ($row->childof);
|
||||
if ($post_icon && $settings['show_bookmark_icon']) {
|
||||
if (isset ($row->favicon)) {
|
||||
@unlink ($row->favicon);
|
||||
}
|
||||
require_once (ABSOLUTE_PATH . "favicon.php");
|
||||
$favicon = & new favicon ($post_url);
|
||||
if (isset ($favicon->favicon)) {
|
||||
$icon = '<img src="' . $favicon->favicon . '" width="16" height="16" alt="">';
|
||||
$query = sprintf ("UPDATE bookmark SET favicon='%s' WHERE user='%s' AND id='%d'",
|
||||
$mysql->escape ($favicon->favicon),
|
||||
$mysql->escape ($username),
|
||||
$mysql->escape ($bmlist[0]));
|
||||
if (!$mysql->query ($query)) {
|
||||
message ($mysql->error);
|
||||
}
|
||||
}
|
||||
else {
|
||||
$icon = $bookmark_image;
|
||||
}
|
||||
}
|
||||
else if ($row->favicon && is_file ($row->favicon)) {
|
||||
$icon = '<img src="' . $row->favicon . '" width="16" height="16" alt="">';
|
||||
}
|
||||
else {
|
||||
$icon = $bookmark_image;
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
message ($mysql->error);
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<p class="title">Edit Bookmark</p>
|
||||
<form action="<?php echo $_SERVER['SCRIPT_NAME'] . "?bmlist=" . $row->id; ?>" id="bmedit" method="POST">
|
||||
<p>Title<br>
|
||||
<input type=text name="title" size="50" value="<?php echo $row->title; ?>"> <?php echo $settings['show_bookmark_icon'] ? $icon : ""; ?></p>
|
||||
<p>URL<br>
|
||||
<input type=text name="url" size="50" value="<?php echo $row->url; ?>">
|
||||
<p>Description<br>
|
||||
<textarea name="description" cols="50" rows="8"><?php echo $row->description; ?></textarea></p>
|
||||
<p><a href="javascript:window.childof=document.forms['bmedit'].childof; window.path=document.forms['bmedit'].path; selectfolder('<?php echo $query_string; ?>')">Select/Change folder</a><br>
|
||||
<input type="text" name="path" value="<?php echo $path; ?>" size="50" readonly>
|
||||
<input type="text" name="childof" value="<?php echo $row->childof; ?>" size="1" class="invisible" readonly></p>
|
||||
<p>Tags<br>
|
||||
<input type=text name="tags" size="50" value="Not yet working"></p>
|
||||
<input type="submit" value=" OK ">
|
||||
<input type="button" value=" Cancel " onClick="self.close()">
|
||||
<input type="submit" value="Refresh Icon" name="favicon">
|
||||
Public <input type="checkbox" name="public" <?php echo $row->public ? "checked" : "";?>>
|
||||
</form>
|
||||
<script>
|
||||
this.focus();
|
||||
document.getElementById('bmedit').title.focus();
|
||||
</script>
|
||||
|
||||
<?php
|
||||
|
||||
}
|
||||
else {
|
||||
$query = sprintf ("UPDATE bookmark SET title='%s', url='%s', description='%s', childof='%d', public='%d'
|
||||
WHERE id='%d'
|
||||
AND user='%s'",
|
||||
$mysql->escape ($post_title),
|
||||
$mysql->escape ($post_url),
|
||||
$mysql->escape ($post_description),
|
||||
$mysql->escape ($post_childof),
|
||||
$mysql->escape ($post_public),
|
||||
$mysql->escape ($bmlist[0]),
|
||||
$mysql->escape ($username));
|
||||
if ($mysql->query ($query)) {
|
||||
echo "Bookmark successfully updated<br>\n";
|
||||
echo '<script language="JavaScript">reloadclose();</script>';
|
||||
}
|
||||
else {
|
||||
message ($mysql->error);
|
||||
}
|
||||
}
|
||||
|
||||
require_once (ABSOLUTE_PATH . "footer.php");
|
||||
?>
|
||||
56
bookmark_move.php
Normal file
56
bookmark_move.php
Normal file
@@ -0,0 +1,56 @@
|
||||
<?php
|
||||
require_once ("./header.php");
|
||||
logged_in_only ();
|
||||
|
||||
$bmlist = set_post_num_list ('bmlist');
|
||||
|
||||
if (count ($bmlist) == 0) {
|
||||
?>
|
||||
|
||||
<p class="title">Move bookmarks to:</p>
|
||||
<form action="<?php echo $_SERVER['SCRIPT_NAME'] . "?folderid=" . $folderid; ?>" method="POST" name="bookmarksmove">
|
||||
|
||||
<div style="width:100%; height:330px; overflow:auto;">
|
||||
|
||||
<?php
|
||||
require_once (ABSOLUTE_PATH . "folders.php");
|
||||
$tree = & new folder;
|
||||
$tree->make_tree (0);
|
||||
$tree->print_tree ();
|
||||
?>
|
||||
|
||||
</div>
|
||||
<br>
|
||||
<input type="hidden" name="bmlist">
|
||||
<input type="submit" value=" OK ">
|
||||
<input type="button" value=" Cancel " onClick="self.close()">
|
||||
<input type="button" value=" New Folder " onClick="self.location.href='javascript:foldernew(<?php echo $folderid; ?>)'">
|
||||
|
||||
</form>
|
||||
|
||||
<script type="text/javascript">
|
||||
document.bookmarksmove.bmlist.value = self.name;
|
||||
</script>
|
||||
|
||||
<?php
|
||||
}
|
||||
else if ($folderid == '') {
|
||||
message ('No destination Folder selected.');
|
||||
}
|
||||
else {
|
||||
$query = sprintf ("UPDATE bookmark SET childof='%d' WHERE id IN (%s) AND user='%s'",
|
||||
$mysql->escape ($folderid),
|
||||
$mysql->escape (implode (",", $bmlist)),
|
||||
$mysql->escape ($username));
|
||||
|
||||
if ($mysql->query ($query)) {
|
||||
echo "Bookmarks moved<br>\n";
|
||||
echo '<script language="JavaScript">reloadclose();</script>';
|
||||
}
|
||||
else {
|
||||
message ($mysql->error);
|
||||
}
|
||||
}
|
||||
|
||||
require_once (ABSOLUTE_PATH . "footer.php");
|
||||
?>
|
||||
122
bookmark_new.php
Normal file
122
bookmark_new.php
Normal file
@@ -0,0 +1,122 @@
|
||||
<?php
|
||||
require_once ('./header.php');
|
||||
|
||||
$get_title = set_title ();
|
||||
$get_url = set_url ();
|
||||
|
||||
logged_in_only ();
|
||||
|
||||
$post_title = set_post_title ($persistent = true);
|
||||
$post_url = set_post_url ();
|
||||
$post_description = set_post_description ();
|
||||
$post_childof = set_post_childof ();
|
||||
$post_public = set_post_bool_var ("public", false);
|
||||
|
||||
require_once (ABSOLUTE_PATH . "folders.php");
|
||||
$tree = & new folder;
|
||||
$query_string = "?expand=" . implode(",", $tree->get_path_to_root ($post_childof)) . "&folderid=" . $post_childof;
|
||||
|
||||
if ($post_title == '' || $post_url == '') {
|
||||
$path = $tree->print_path ($folderid);
|
||||
if ($post_title != '') {
|
||||
$title = $post_title;
|
||||
}
|
||||
else {
|
||||
$title = $get_title;
|
||||
}
|
||||
if ($post_url != '') {
|
||||
$url = $post_url;
|
||||
}
|
||||
else if ($get_url != '') {
|
||||
$url = $get_url;
|
||||
}
|
||||
else {
|
||||
$url = 'http://';
|
||||
}
|
||||
if (strtolower (basename ($_SERVER['SCRIPT_NAME'])) == 'bookmark_add.php') {
|
||||
$js_onclick = 'history.back()';
|
||||
}
|
||||
else {
|
||||
$js_onclick = 'self.close()';
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<p class="title">New Bookmark</p>
|
||||
<form action="<?php echo $_SERVER['SCRIPT_NAME'] . "?folderid=" . $folderid; ?>" id="bmnew" method="POST">
|
||||
<p>Title<br>
|
||||
<input type=text name="title" size="50" value="<?php echo $title; ?>"></p>
|
||||
<p>Homepage<br>
|
||||
<input type=text name="url" size="50" value="<?php echo $url; ?>"></p>
|
||||
<p>Description<br>
|
||||
<textarea name="description" cols="50" rows="8"><?php echo $post_description; ?></textarea></p>
|
||||
<p><a href="javascript:window.childof=document.forms['bmnew'].childof; window.path=document.forms['bmnew'].path; selectfolder('<?php echo $query_string; ?>')">Select/Change folder</a><br>
|
||||
<input type="text" name="path" value="<?php echo $path; ?>" size="50" readonly>
|
||||
<input type="text" name="childof" value="<?php echo $folderid; ?>" size="1" class="invisible" readonly></p>
|
||||
<p>Tags<br>
|
||||
<input type=text name="tags" size="50" value="Not yet working"></p>
|
||||
<input type="submit" value=" OK ">
|
||||
<input type="button" value=" Cancel " onClick="<?php echo $js_onclick; ?>">
|
||||
Public <input type="checkbox" name="public" <?php echo $post_public ? "checked" : "";?>>
|
||||
</form>
|
||||
<script>
|
||||
this.focus();
|
||||
document.getElementById('bmnew').title.focus();
|
||||
</script>
|
||||
|
||||
<?php
|
||||
}
|
||||
else {
|
||||
$query = sprintf ("INSERT INTO bookmark
|
||||
(user, title, url, description, childof, public)
|
||||
VALUES ('%s', '%s', '%s', '%s', '%d', '%d')",
|
||||
$mysql->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<br>\n";
|
||||
$bm_id = mysql_insert_id ();
|
||||
}
|
||||
else {
|
||||
message ($mysql->error);
|
||||
}
|
||||
unset ($_SESSION['title'], $_SESSION['url']);
|
||||
|
||||
# safing the favicon in a separate second step is done because
|
||||
# we want to make sure the bookmark is safed in any case. the
|
||||
# favicon is not that important.
|
||||
if ($settings['show_bookmark_icon']) {
|
||||
require_once (ABSOLUTE_PATH . "favicon.php");
|
||||
$favicon = & new favicon ($post_url);
|
||||
if (isset ($favicon->favicon)) {
|
||||
$query = sprintf ("UPDATE bookmark set favicon='%s' WHERE user='%s' AND id='%d'",
|
||||
$mysql->escape ($favicon->favicon),
|
||||
$mysql->escape ($username),
|
||||
$mysql->escape ($bm_id));
|
||||
$mysql->query ($query);
|
||||
$icon = '<img src="'.$favicon->favicon.'">';
|
||||
}
|
||||
else {
|
||||
$icon = $bookmark_image;
|
||||
}
|
||||
}
|
||||
|
||||
if (strtolower (basename ($_SERVER['SCRIPT_NAME'])) == "bookmark_add.php") {
|
||||
echo 'Back to '.$icon.' <a href="'.$post_url.'">'.$post_title.'</a><br>' . "\n";
|
||||
echo 'Open '.$folder_opened.' <a href="./index.php'.$query_string.'">folder</a> containing new Bookmark<br>' . "\n";
|
||||
}
|
||||
else {
|
||||
echo '<script language="JavaScript">reloadclose();</script>';
|
||||
# I know, the following is ugly, but I found no other way to do.
|
||||
# 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 '<script language="JavaScript">self.close();</script>';
|
||||
}
|
||||
}
|
||||
require_once (ABSOLUTE_PATH . "footer.php");
|
||||
?>
|
||||
138
bookmarks.php
Normal file
138
bookmarks.php
Normal file
@@ -0,0 +1,138 @@
|
||||
<?php
|
||||
if (basename ($_SERVER['SCRIPT_NAME']) == basename (__FILE__)) {
|
||||
die ("no direct access allowed");
|
||||
}
|
||||
|
||||
function list_bookmarks ($bookmarks, $show_checkbox, $show_folder, $show_icon, $show_link, $show_desc, $show_date, $show_edit, $show_move, $show_delete, $show_share) {
|
||||
global $folderid,
|
||||
$expand,
|
||||
$settings,
|
||||
$column_width_folder,
|
||||
$bookmark_image,
|
||||
$edit_image,
|
||||
$move_image,
|
||||
$delete_image,
|
||||
$folder_opened,
|
||||
$folder_opened_public,
|
||||
$date_formats;
|
||||
|
||||
if ($show_folder) {
|
||||
require_once (ABSOLUTE_PATH . "folders.php");
|
||||
$tree = & new folder;
|
||||
}
|
||||
|
||||
echo '<form name="bookmarks">' . "\n";
|
||||
echo '<table cellspacing="0" style="width: 97%;">' . "\n";
|
||||
|
||||
foreach ($bookmarks as $value) {
|
||||
echo '<tr class="sh">' . "\n";
|
||||
|
||||
# the folders, only needed when searching for bookmarks
|
||||
if ($show_folder) {
|
||||
if ($value['fid'] == null) {
|
||||
$value['name'] = $settings['root_folder_name'];
|
||||
$value['fid'] = 0;
|
||||
}
|
||||
if ($value['fpublic']) {
|
||||
$folder_image = $folder_opened_public;
|
||||
}
|
||||
else {
|
||||
$folder_image = $folder_opened;
|
||||
}
|
||||
$expand = $tree->get_path_to_root ($value['fid']);
|
||||
echo '<td style="width:' . $column_width_folder . ';">';
|
||||
echo '<a class="f" href="./index.php?expand=' . implode (",", $expand) . '&folderid='. $value['fid'] .'#' . $value['fid'] . '">';
|
||||
echo $folder_image . " " . $value['name'] . "</a>";
|
||||
echo "</td>\n";
|
||||
}
|
||||
|
||||
if ($show_checkbox){
|
||||
# the checkbox, needed in any case
|
||||
echo '<td class="ten">';
|
||||
echo '<input type="checkbox" name="' . $value['id'] . '">';
|
||||
echo "</td>\n";
|
||||
}
|
||||
|
||||
# the bookmark image if configured to be displayed
|
||||
if ($show_icon){
|
||||
echo '<td class="ten">';
|
||||
if ($value['favicon'] && is_file ($value['favicon'])) {
|
||||
echo '<img src="' . $value['favicon'] . '" width="16" height="16">';
|
||||
}
|
||||
else {
|
||||
echo $bookmark_image;
|
||||
}
|
||||
echo "</td>\n";
|
||||
}
|
||||
|
||||
# the link if configured to be displayed
|
||||
echo '<td>';
|
||||
|
||||
if ($settings['open_new_window']) {
|
||||
$target = ' target="_blank"';
|
||||
}
|
||||
else {
|
||||
$target = null;
|
||||
}
|
||||
|
||||
if ($show_link){
|
||||
$link = '<a href="' . $value['url'] . '" title="' . $value['url'] . '"' . $target . '>' . $value['title'] . "</a>";
|
||||
}
|
||||
else {
|
||||
$link = $value['title'];
|
||||
}
|
||||
echo '<div>' . $link . "</div>\n";
|
||||
|
||||
# the description if configured to be displayed and if not empty
|
||||
# thanks to Tim Hogan <tlhogan22@yahoo.com>
|
||||
# also display the public status here
|
||||
if ($show_desc && $value['description'] != "") {
|
||||
echo '<div class="description">' . $value['description'] . "</div>\n";
|
||||
}
|
||||
echo "</td>\n";
|
||||
|
||||
if ($show_date) {
|
||||
echo '<td class="ten">';
|
||||
echo '<div class="date">'. date ($date_formats[$settings['date_format']], $value['timestamp']) .'</div>';
|
||||
echo "</td>\n";
|
||||
}
|
||||
|
||||
|
||||
if ($show_share) {
|
||||
echo '<td class="ten">';
|
||||
$share = $value['public'] ? 'public' : 'private';
|
||||
echo '<div class="'.$share.'">'.$share.'</div> ';
|
||||
echo "</td>\n";
|
||||
}
|
||||
|
||||
|
||||
# the edit column if configured to be displayed
|
||||
if ($show_edit) {
|
||||
echo '<td class="ten">';
|
||||
echo '<a href="javascript:bookmarkedit(\'' . $value['id'] . '\')">';
|
||||
echo sprintf ($edit_image, "Edit");
|
||||
echo "</a></td>\n";
|
||||
}
|
||||
|
||||
# the move column if configured to be displayed
|
||||
if ($show_move) {
|
||||
echo '<td class="ten">';
|
||||
echo '<a href="javascript:bookmarkmove(\'' . $value['id'] . '\', \'' . 'expand=' . implode (",", $expand) . '&folderid=' . $folderid . '\')">';
|
||||
echo sprintf ($move_image, "Move");
|
||||
echo "</a></td>\n";
|
||||
}
|
||||
|
||||
# the delete column if configured to be displayed
|
||||
if ($show_delete) {
|
||||
echo '<td class="ten">';
|
||||
echo '<a href="javascript:bookmarkdelete(\'' . $value['id'] . '\')">';
|
||||
echo sprintf ($delete_image, "Delete");
|
||||
echo "</a></td>\n";
|
||||
}
|
||||
|
||||
echo "</tr>\n";
|
||||
}
|
||||
echo "</table></form>\n";
|
||||
}
|
||||
|
||||
?>
|
||||
326
export.php
Normal file
326
export.php
Normal file
@@ -0,0 +1,326 @@
|
||||
<?php
|
||||
|
||||
if (!isset ($_POST['browser']) || $_POST['browser'] == "" ||
|
||||
($_POST['browser'] != "netscape" &&
|
||||
$_POST['browser'] != "opera" &&
|
||||
$_POST['browser'] != "IE")) {
|
||||
|
||||
# header.php is included here, because we want to print
|
||||
# plain text when exporting bookmarks, so that browsers
|
||||
# can handle results better. header.php is needed only to
|
||||
# display html.
|
||||
require_once ("./header.php");
|
||||
logged_in_only ();
|
||||
|
||||
$folderid = set_get_folderid ();
|
||||
|
||||
# get the browser type for default setting below if possible
|
||||
if( eregi ("opera", $_SERVER['HTTP_USER_AGENT'])) {
|
||||
$default_browser = "opera";
|
||||
}
|
||||
else if (eregi ("msie", $_SERVER['HTTP_USER_AGENT'])) {
|
||||
$default_browser = "IE";
|
||||
}
|
||||
else{
|
||||
$default_browser = "netscape";
|
||||
}
|
||||
?>
|
||||
|
||||
<table class="caption">
|
||||
<tr>
|
||||
<td><span class="caption"><img src="./images/logo.png" alt=""> Export Bookmarks</span>
|
||||
</td>
|
||||
|
||||
<td class="captionright">
|
||||
<div><?php object_count (); ?></div>
|
||||
<div><?php print_footer (); ?></div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
<table class="main">
|
||||
<tr>
|
||||
<td class="main1">
|
||||
<table class="menu">
|
||||
<tr>
|
||||
<th class="menuhead">Bookmarks</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="menu">
|
||||
<a href="./index.php">My Bookmarks</a><br>
|
||||
<a href="./shared.php">Shared Bookmarks</a><br>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<br>
|
||||
|
||||
<table class="menu">
|
||||
<tr>
|
||||
<th class="menuhead">Tools</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="menu">
|
||||
<?php if (admin_only ()) { ?>
|
||||
<a href="./admin.php">Admin</a><br>
|
||||
<?php } ?>
|
||||
<a href="./import.php">Import</a><br>
|
||||
<a href="./export.php">Export</a><br>
|
||||
<a href="./sidebar.php">View as Sidebar</a><br>
|
||||
<a href="./settings.php">Settings</a><br>
|
||||
<a href="javascript:chpw()">Change Password</a><br>
|
||||
<a href="./index.php?logout=1">Logout</a><br>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<td class="">
|
||||
<img src="./images/spacer.gif" alt="" class="main2">
|
||||
</td>
|
||||
<td class="main4">
|
||||
|
||||
<form enctype="multipart/form-data" action="<?php echo $_SERVER['SCRIPT_NAME'];?>" method="POST">
|
||||
<table valign="top">
|
||||
<tr>
|
||||
<td>
|
||||
Export Bookmarks to Browser:
|
||||
</td>
|
||||
<td width="<?php echo $column_width_folder?>">
|
||||
<select name="browser">
|
||||
<option value="IE"<?php if ($default_browser == "IE") {echo " selected"; } ?>>Internet Explorer</option>
|
||||
<option value="netscape"<?php if ($default_browser == "netscape") {echo " selected"; } ?>>Netscape / Mozilla</option>
|
||||
<option value="opera"<?php if ($default_browser == "opera") {echo " selected"; } ?>>Opera .adr</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>Character encoding</td>
|
||||
<td>
|
||||
<select name="charset">
|
||||
<?php
|
||||
$charsets = return_charsets ();
|
||||
foreach ($charsets as $value) {
|
||||
$selected = '';
|
||||
if ($value == 'UTF-8') {$selected = ' selected';}
|
||||
echo '<option value="'.$value.'"'.$selected.'>'.$value.'</option>' . "\n";
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
Folder to export:
|
||||
</td>
|
||||
<td>
|
||||
<div style="width:<?php echo $column_width_folder; ?>; height:350px; overflow:auto;">
|
||||
|
||||
<?php
|
||||
require_once (ABSOLUTE_PATH . "folders.php");
|
||||
$tree = & new folder;
|
||||
$tree->make_tree (0);
|
||||
$tree->print_tree ();
|
||||
?>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<input type="hidden" name="folder" value="<?php echo $folderid; ?>">
|
||||
<input type="submit" value="Export">
|
||||
<input type="button" value=" Cancel " onClick="self.location.href='./index.php'">
|
||||
</td>
|
||||
<td>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<?php
|
||||
require_once (ABSOLUTE_PATH . "footer.php");
|
||||
}
|
||||
|
||||
else{
|
||||
# these files are being included, because we do not want to include
|
||||
# header.php since there is no reason for the http header to display.
|
||||
define ("ABSOLUTE_PATH", dirname (__FILE__) . "/");
|
||||
require_once (ABSOLUTE_PATH . "lib/webstart.php");
|
||||
require_once (ABSOLUTE_PATH . "config/config.php");
|
||||
require_once (ABSOLUTE_PATH . "lib/mysql.php");
|
||||
$mysql = & new mysql;
|
||||
require_once (ABSOLUTE_PATH . "lib/auth.php");
|
||||
$auth = & new Auth;
|
||||
require_once (ABSOLUTE_PATH . "lib/lib.php");
|
||||
logged_in_only ();
|
||||
require_once (ABSOLUTE_PATH . "lib/login.php");
|
||||
|
||||
$browser = set_post_browser ();
|
||||
if ($browser == "opera") {
|
||||
$filename = "opera6.adr";
|
||||
}
|
||||
else if ($browser == "IE") {
|
||||
$filename = "bookmark.htm";
|
||||
}
|
||||
else if ($browser == "netscape") {
|
||||
$filename = "bookmarks.html";
|
||||
}
|
||||
else {
|
||||
$filename = "bookmarks.html";
|
||||
}
|
||||
|
||||
header("Content-Disposition: attachment; filename=$filename");
|
||||
header("Content-type: application/octet-stream");
|
||||
header("Cache-Control: no-store, no-cache, must-revalidate"); // HTTP/1.1
|
||||
header("Cache-Control: post-check=0, pre-check=0", false); // HTTP/1.0
|
||||
header("Content-Type: text/html; charset=UTF-8");
|
||||
|
||||
$folderid = set_get_folderid ();
|
||||
if ($browser == "netscape" || $browser == "IE") {
|
||||
echo "<!DOCTYPE NETSCAPE-Bookmark-file-1>\n";
|
||||
echo "<TITLE>Bookmarks</TITLE>\n";
|
||||
echo "<H1>Bookmarks</H1>\n";
|
||||
echo "<DL><p>\n";
|
||||
$export = & new export;
|
||||
$export->make_tree ($folderid);
|
||||
echo "</DL><p>\n";
|
||||
}
|
||||
else if ($browser == "opera") {
|
||||
echo "Opera Hotlist version 2.0\n";
|
||||
echo "Options: encoding = utf8, version=3\n\n";
|
||||
$export = & new export;
|
||||
$export->make_tree ($folderid);
|
||||
}
|
||||
}
|
||||
|
||||
class export {
|
||||
function export () {
|
||||
# collect the folder data
|
||||
require_once (ABSOLUTE_PATH . "folders.php");
|
||||
$this->tree = & new folder;
|
||||
$this->tree->folders[0] = array ('id' => 0, 'childof' => null, 'name' => $GLOBALS['settings']['root_folder_name']);
|
||||
|
||||
global $username, $mysql;
|
||||
$this->browser = $GLOBALS['browser'];
|
||||
|
||||
$this->counter = 0;
|
||||
|
||||
# work around PHP < 5 problem
|
||||
# http://bugs.php.net/bug.php?id=25670
|
||||
if (intval(str_replace('.', '', phpversion())) < 500) {
|
||||
$this->charset = 'iso-8859-1';
|
||||
}
|
||||
else {
|
||||
$this->charset = set_post_charset ();
|
||||
}
|
||||
|
||||
# collect the bookmark data
|
||||
$query = sprintf ("SELECT title, url, description, childof, id
|
||||
FROM bookmark
|
||||
WHERE user='%s'
|
||||
AND deleted!='1'",
|
||||
$mysql->escape ($username));
|
||||
|
||||
if ($mysql->query ($query)) {
|
||||
while ($row = mysql_fetch_assoc ($mysql->result)) {
|
||||
if (!isset ($this->bookmarks[$row['childof']])) {
|
||||
$this->bookmarks[$row['childof']] = array ();
|
||||
}
|
||||
array_push ($this->bookmarks[$row['childof']], $row);
|
||||
}
|
||||
}
|
||||
else {
|
||||
message ($mysql->error);
|
||||
}
|
||||
}
|
||||
|
||||
function make_tree ($id) {
|
||||
if (isset ($this->tree->children[$id])) {
|
||||
$this->counter++;
|
||||
foreach ($this->tree->children[$id] as $value) {
|
||||
$this->print_folder ($value);
|
||||
$this->make_tree ($value);
|
||||
$this->print_folder_close ();
|
||||
}
|
||||
$this->counter--;
|
||||
}
|
||||
$this->print_bookmarks ($id);
|
||||
}
|
||||
|
||||
|
||||
function print_folder ($folderid) {
|
||||
$spacer = str_repeat (" ", $this->counter);
|
||||
$foldername = html_entity_decode ($this->tree->folders[$folderid]['name'], ENT_QUOTES, $this->charset);
|
||||
if ($this->browser == "netscape") {
|
||||
echo $spacer . "<DT><H3>" . $foldername . "</H3>\n";
|
||||
echo $spacer . "<DL><p>\n";
|
||||
}
|
||||
else if ($this->browser == "IE") {
|
||||
echo $spacer . '<DT><H3 FOLDED ADD_DATE="">' . $foldername . "</H3>\n";
|
||||
echo $spacer . "<DL><p>\n";
|
||||
}
|
||||
else if ($this->browser == "opera") {
|
||||
echo "\n#FOLDER\n";
|
||||
echo "\tNAME=" . $foldername . "\n";
|
||||
}
|
||||
}
|
||||
|
||||
function print_folder_close () {
|
||||
$spacer = str_repeat (" ", $this->counter);
|
||||
if ($this->browser == "netscape" || $this->browser == "IE"){
|
||||
echo $spacer . "</DL><p>\n";
|
||||
}
|
||||
else if ($this->browser == "opera"){
|
||||
echo "\n-\n";
|
||||
}
|
||||
}
|
||||
|
||||
function print_bookmarks ($folderid) {
|
||||
$spacer = str_repeat (" ", $this->counter);
|
||||
if (isset ($this->bookmarks[$folderid])) {
|
||||
foreach ($this->bookmarks[$folderid] as $value) {
|
||||
$url = html_entity_decode ($value['url'], ENT_QUOTES, $this->charset);
|
||||
$title = html_entity_decode ($value['title'], ENT_QUOTES, $this->charset);
|
||||
if ($value['description'] != '') {
|
||||
$description = html_entity_decode ($value['description'], ENT_QUOTES, $this->charset);
|
||||
}
|
||||
else {
|
||||
$description = '';
|
||||
}
|
||||
|
||||
if ($this->browser == 'netscape') {
|
||||
echo $spacer . ' <DT><A HREF="' . $url . '">' . $title . "</A>\n";
|
||||
if ($description != '') {
|
||||
echo $spacer . ' <DD>' . $description . "\n";
|
||||
}
|
||||
}
|
||||
else if ($this->browser == 'IE') {
|
||||
echo $spacer . ' <DT><A HREF="' . $url . '" ADD_DATE="" LAST_VISIT="" LAST_MODIFIED="">' . $title . "</A>\n";
|
||||
# unfortunately description for bookmarks in MS Internet Explorer is not supported.
|
||||
# thats why we just ignore the output of the description here.
|
||||
}
|
||||
else if ($this->browser == 'opera') {
|
||||
echo "\n#URL\n";
|
||||
echo "\tNAME=" . $title . "\n";
|
||||
echo "\tURL=" . $url . "\n";
|
||||
if ($description != "") {
|
||||
# opera cannot handle the \r\n character, so we fix this.
|
||||
$description = str_replace ("\r\n", " ", $description);
|
||||
echo "\tDESCRIPTION=" . $description . "\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
BIN
favicon.ico
Normal file
BIN
favicon.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.1 KiB |
200
favicon.php
Normal file
200
favicon.php
Normal file
@@ -0,0 +1,200 @@
|
||||
<?php
|
||||
if (basename ($_SERVER['SCRIPT_NAME']) == basename (__FILE__)) {
|
||||
die ("no direct access allowed");
|
||||
}
|
||||
|
||||
class favicon {
|
||||
function favicon ($url) {
|
||||
global $settings;
|
||||
if ($settings['show_bookmark_icon']) {
|
||||
if ($this->parsed_url = $this->return_parse_url ($url)) {
|
||||
if ($this->favicon_url = $this->get_favicon_url ()) {
|
||||
$this->icon_name = rand () . basename ($this->favicon_url);
|
||||
if ($this->get_favicon_image ()) {
|
||||
$this->convert_favicon ();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
###
|
||||
### check the image type and convert & resize it if required
|
||||
### returns the absolute path of the (converted) .png file
|
||||
###
|
||||
function convert_favicon () {
|
||||
|
||||
global $convert, $identify;
|
||||
|
||||
$tmp_file = "./favicons/" . $this->icon_name;
|
||||
# find out file type
|
||||
if (@exec ("$identify $tmp_file", $output)) {
|
||||
$ident = explode (" ", $output[0]);
|
||||
if (count ($output) > 1) {
|
||||
$file_to_convert = $ident[0];
|
||||
}
|
||||
else {
|
||||
$file_to_convert = $tmp_file;
|
||||
}
|
||||
|
||||
# convert image in any case to 16x16 and .png
|
||||
system ("$convert $file_to_convert -resize 16x16 $tmp_file.png");
|
||||
$this->favicon = $tmp_file . ".png";
|
||||
@unlink ($tmp_file);
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
@unlink ($tmp_file);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
###
|
||||
### download and save favicon
|
||||
###
|
||||
function get_favicon_image () {
|
||||
//Selbstgebastelte, IIS-kompatible Version von Arne Haak (www.arnehaak.de)
|
||||
# HTTP-Url auswerten
|
||||
$httpparsed = $this->return_parse_url ($this->favicon_url);
|
||||
|
||||
//HTTP-Request-Header erzeugen
|
||||
$httprequest = "GET ".$httpparsed['path']." HTTP/1.0\r\n".
|
||||
"Accept: */*\r\n".
|
||||
"Accept-Language: en\r\n".
|
||||
"Accept-Encoding: identity\r\n".
|
||||
"User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)\r\n".
|
||||
"Host: ".$httpparsed['host']."\r\n".
|
||||
"Connection: close\r\n\r\n";
|
||||
|
||||
//Verbindung aufbauen und Request abschicken
|
||||
if ($httphandle = fsockopen($httpparsed['host'],$httpparsed['port'])) {
|
||||
fputs($httphandle, $httprequest);
|
||||
|
||||
//Daten runterladen solange vorhanden
|
||||
$answerdata = null;
|
||||
do {
|
||||
$answerdata .= fread($httphandle, 1024);
|
||||
} while (feof($httphandle) != true);
|
||||
|
||||
// Verbindung schliessen
|
||||
fclose ($httphandle);
|
||||
|
||||
//Header finden und abtrennen
|
||||
$finalposi = strpos($answerdata, "\r\n\r\n") + 4; //Position des ersten Bytes nach dem Header bestimmen
|
||||
$finalfile = substr($answerdata, $finalposi, strlen($answerdata) - $finalposi); //Header abschneiden
|
||||
|
||||
//Datei abspeichern
|
||||
if ($fp = @fopen("./favicons/" . $this->icon_name, "w")) {
|
||||
fwrite($fp, $finalfile);
|
||||
fclose($fp);
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
###
|
||||
### checks for the existence of a favicon on a remote server
|
||||
### and returns the url if one exist
|
||||
###
|
||||
function get_favicon_url () {
|
||||
global $timeout;
|
||||
# search for favicon in document root first
|
||||
if ($socket = @fsockopen ($this->parsed_url['host'], $this->parsed_url['port'], $errno, $errstr, $timeout)) {
|
||||
fwrite ($socket, "HEAD /favicon.ico HTTP/1.0\r\nHost: " . $this->parsed_url['host'] . "\r\n\r\n");
|
||||
$http_response = fgets ($socket, 22);
|
||||
fclose ($socket);
|
||||
if (ereg ("200 OK", $http_response)) {
|
||||
#echo "favicon found in document root\n";
|
||||
return $this->parsed_url['scheme'] . "://" . $this->parsed_url['host'] . ":" . $this->parsed_url['port'] . "/favicon.ico";
|
||||
}
|
||||
else {
|
||||
# if favicon was not found in document root, search in html header for it
|
||||
if ($socket = @fsockopen ($this->parsed_url['host'], $this->parsed_url['port'], $errno, $errstr, $timeout)) {
|
||||
fwrite ($socket, "GET " . $this->parsed_url['path'] . " HTTP/1.0\r\nHost: " . $this->parsed_url['host'] . "\r\n\r\n");
|
||||
while (!feof ($socket)) {
|
||||
$html = fgets ($socket, 1024);
|
||||
if ($html == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
# we only want to search in HTML documents
|
||||
if (preg_match ('/.*Content-Type:.*/si', $html, $contenttype)) {
|
||||
if ( ! preg_match ('/text\/html/si', $contenttype[0])) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (preg_match ('/<link[^>]+rel="(?:shortcut )?icon".*>/si', $html, $tag)) {
|
||||
#echo "found favicon in html header\n";
|
||||
if (preg_match ('/<link[^>]+href="([^"]+)".*>/si', $tag[0], $location)) {
|
||||
# the favicon location is an url
|
||||
if (substr($location[1], 0, 7) == 'http://') {
|
||||
$favicon = $location[1];
|
||||
}
|
||||
# the favicon location is an absolute path
|
||||
else if (substr ($location[1], 0, 1) == '/') {
|
||||
$favicon = $this->parsed_url['scheme'] . '://' . $this->parsed_url['host'] . ":" . $this->parsed_url['port'] . $location[1];
|
||||
}
|
||||
# else the path can only be something useless
|
||||
# or a relative path, looking like this.
|
||||
# ./path/to/favicon.ico
|
||||
# path/to/favicon.ico
|
||||
else {
|
||||
# The location we called is either a file or a directory.
|
||||
# We have to guess. We assume it is a directory if there is a trailing slash
|
||||
if (substr ($this->parsed_url['path'], strlen($this->parsed_url['path'])-1) == "/") {
|
||||
$favicon = $this->parsed_url['scheme'] . '://' . $this->parsed_url['host'] . ":" . $this->parsed_url['port'] . $this->parsed_url['path'] . $location[1];
|
||||
}
|
||||
else {
|
||||
$favicon = $this->parsed_url['scheme'] . '://' . $this->parsed_url['host'] . ":" . $this->parsed_url['port'] . dirname ($this->parsed_url['path']) . '/' . $location[1];
|
||||
}
|
||||
}
|
||||
return $favicon;
|
||||
}
|
||||
}
|
||||
else if (preg_match ('/.*<\/head.*>/si', $html)) {
|
||||
#echo "html header end found, giving up\n";
|
||||
return false;
|
||||
}
|
||||
}
|
||||
fclose ($socket);
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
###
|
||||
### returns an array with parts of the given url
|
||||
###
|
||||
function return_parse_url ($url) {
|
||||
if ($parsed = @parse_url ($url)) {
|
||||
if (!isset ($parsed['scheme']) || $parsed['scheme'] == "") {
|
||||
$parsed['scheme'] = "http";
|
||||
}
|
||||
else if ($parsed['scheme'] != "http") {
|
||||
return false;
|
||||
}
|
||||
if (!isset ($parsed['host']) || $parsed['host'] == "") {
|
||||
return false;
|
||||
}
|
||||
if (!isset ($parsed['port']) || $parsed['port'] == "") {
|
||||
$parsed['port'] = 80;
|
||||
}
|
||||
if (!isset ($parsed['path']) || $parsed['path'] == "") {
|
||||
$parsed['path'] = "/";
|
||||
}
|
||||
return ($parsed);
|
||||
}
|
||||
else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
112
folder_delete.php
Normal file
112
folder_delete.php
Normal file
@@ -0,0 +1,112 @@
|
||||
<?php
|
||||
require_once ("./header.php");
|
||||
logged_in_only ();
|
||||
|
||||
$noconfirm = set_get_noconfirm ();
|
||||
|
||||
# the root folder cannot be deleted
|
||||
if ($folderid == "" || $folderid == 0){
|
||||
message ("No Folder selected");
|
||||
}
|
||||
else if (!$settings['confirm_delete'] || $noconfirm) {
|
||||
# lets do the deletion if the confirm variable is set to FALSE or after confirmation
|
||||
require_once (ABSOLUTE_PATH . "folders.php");
|
||||
$tree = & new folder;
|
||||
$tree->get_children ($folderid);
|
||||
|
||||
# we need $parent_folders for javascript code below.
|
||||
$parent_folders = $tree->get_path_to_root ($folderid);
|
||||
if (count ($parent_folders) > 1) {
|
||||
$parent_folder = $parent_folders[1];
|
||||
}
|
||||
else {
|
||||
$parent_folder = 0;
|
||||
}
|
||||
|
||||
array_push ($tree->get_children, $folderid);
|
||||
$folders = implode (",", $tree->get_children);
|
||||
# first delete all subfolders
|
||||
$query = sprintf ("DELETE FROM folder WHERE childof IN (%s) AND user='%s'",
|
||||
$mysql->escape ($folders),
|
||||
$mysql->escape ($username));
|
||||
if (!$mysql->query ($query)) {
|
||||
message ($mysql->error);
|
||||
}
|
||||
|
||||
# of course, we want to delete all bookmarks as well
|
||||
$query = sprintf ("DELETE FROM bookmark WHERE childof IN (%s) AND user='%s'",
|
||||
$mysql->escape ($folders),
|
||||
$mysql->escape ($username));
|
||||
if (!$mysql->query ($query)) {
|
||||
message ($mysql->error);
|
||||
}
|
||||
|
||||
# now delete the folder itself
|
||||
$query = sprintf ("DELETE FROM folder WHERE id=%d AND user='%s'",
|
||||
$mysql->escape ($folderid),
|
||||
$mysql->escape ($username));
|
||||
if (!$mysql->query ($query)) {
|
||||
message ($mysql->error);
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<script language="JavaScript">
|
||||
<!--
|
||||
function reloadparentwindow() {
|
||||
var path = window.opener.document.URL;
|
||||
searchstring = /(folderid=[0-9]*)/gi;
|
||||
result = searchstring.test(path);
|
||||
|
||||
if(result == false) {
|
||||
urlparams = window.opener.location.search;
|
||||
if (urlparams == "") {
|
||||
result = path + "?folderid=<?php echo $parent_folder; ?>";
|
||||
}
|
||||
else {
|
||||
result = path + "&folderid=<?php echo $parent_folder; ?>";
|
||||
}
|
||||
}
|
||||
else {
|
||||
result = path.replace (searchstring,"folderid=<?php echo $parent_folder; ?>");
|
||||
}
|
||||
window.opener.location = result;
|
||||
window.close();
|
||||
}
|
||||
reloadparentwindow();
|
||||
//-->
|
||||
</script>
|
||||
|
||||
<?php
|
||||
}
|
||||
else {
|
||||
# if there was no confirmation, as to _really_ delete the whole stuff
|
||||
# print the verification form
|
||||
$query = sprintf ("SELECT name, public FROM folder WHERE id=%d AND user='%s' AND deleted!='1'",
|
||||
$mysql->escape ($folderid),
|
||||
$mysql->escape ($username));
|
||||
|
||||
if ($mysql->query ($query)) {
|
||||
if (mysql_num_rows ($mysql->result) == 0){
|
||||
message ("Folder does not exist");
|
||||
}
|
||||
$row = mysql_fetch_object ($mysql->result);
|
||||
?>
|
||||
|
||||
<p class="title">Delete this Folder?</p>
|
||||
<p><?php echo $row->public ? $folder_opened_public : $folder_opened; echo " " . $row->name; ?></p>
|
||||
|
||||
<form action="<?php echo $_SERVER['SCRIPT_NAME'] . "?folderid=" . $folderid . "&noconfirm=1";?>" method="POST" name="fdelete">
|
||||
<input type="submit" value=" OK ">
|
||||
<input type="button" value=" Cancel " onClick="self.close()">
|
||||
</form>
|
||||
|
||||
<?php
|
||||
}
|
||||
else {
|
||||
message ($mysql->error);
|
||||
}
|
||||
}
|
||||
|
||||
require_once (ABSOLUTE_PATH . "footer.php");
|
||||
?>
|
||||
104
folder_edit.php
Normal file
104
folder_edit.php
Normal file
@@ -0,0 +1,104 @@
|
||||
<?php
|
||||
require_once ("./header.php");
|
||||
logged_in_only ();
|
||||
|
||||
$foldername = set_post_foldername ();
|
||||
$public = set_post_bool_var ("public", false);
|
||||
$inherit = set_post_bool_var ("inherit", false);
|
||||
|
||||
if ($folderid == "" || $folderid == "0"){
|
||||
message ("No Folder selected");
|
||||
}
|
||||
else if ($foldername == "") {
|
||||
$query = sprintf ("SELECT name, public FROM folder WHERE id='%d' AND user='%s' AND deleted!='1'",
|
||||
$mysql->escape ($folderid),
|
||||
$mysql->escape ($username));
|
||||
|
||||
if ($mysql->query ($query)) {
|
||||
if (mysql_num_rows ($mysql->result) == 1) {
|
||||
$row = mysql_fetch_object ($mysql->result);
|
||||
}
|
||||
else {
|
||||
message ("No Folder to edit.");
|
||||
}
|
||||
}
|
||||
else {
|
||||
message ($mysql->error);
|
||||
}
|
||||
?>
|
||||
|
||||
<p class="title">Edit Folder</p>
|
||||
<form action="<?php echo $_SERVER['SCRIPT_NAME'] . "?folderid=" . $folderid; ?>" id="fedit" method="POST">
|
||||
<p><input type=text name="foldername" size="50" value="<?php echo $row->name; ?>"> <?php echo $row->public ? $folder_opened_public : $folder_opened; ?></p>
|
||||
<p><input type="checkbox" name="public" <?php if ($row->public) {echo "checked";} ?>> Public</p>
|
||||
<p><input type="checkbox" name="inherit"> Inherit Public Status to all Subfolders and Bookmarks</p>
|
||||
<input type="submit" value=" OK ">
|
||||
<input type="button" value=" Cancel " onClick="self.close()">
|
||||
</form>
|
||||
<script>
|
||||
this.focus();
|
||||
document.getElementById('fedit').foldername.focus();
|
||||
</script>
|
||||
|
||||
<?php
|
||||
}
|
||||
else {
|
||||
|
||||
$query = sprintf ("UPDATE folder SET name='%s', public='%d' WHERE id='%d' AND user='%s'",
|
||||
$mysql->escape ($foldername),
|
||||
$mysql->escape ($public),
|
||||
$mysql->escape ($folderid),
|
||||
$mysql->escape ($username));
|
||||
|
||||
if ($mysql->query ($query)) {
|
||||
if ($inherit) {
|
||||
require_once (ABSOLUTE_PATH . "folders.php");
|
||||
$tree = & new folder;
|
||||
$tree->get_children ($folderid);
|
||||
if (count ($tree->get_children) > 0) {
|
||||
$sub_folders = implode (",", $tree->get_children);
|
||||
|
||||
# set subfolders to public
|
||||
$query = sprintf ("UPDATE folder SET public='%d' WHERE id IN (%s) AND user='%s'",
|
||||
$mysql->escape ($public),
|
||||
$mysql->escape ($sub_folders),
|
||||
$mysql->escape ($username));
|
||||
if (! $mysql->query ($query)) {
|
||||
message ($mysql->error);
|
||||
}
|
||||
|
||||
$sub_folders .= "," . $folderid;
|
||||
# set bookmarks to public as well
|
||||
$query = sprintf ("UPDATE bookmark SET public='%d' WHERE childof IN (%s) AND user='%s'",
|
||||
$mysql->escape ($public),
|
||||
$mysql->escape ($sub_folders),
|
||||
$mysql->escape ($username));
|
||||
if ($mysql->query ($query)) {
|
||||
echo '<script language="JavaScript">reloadclose();</script>';
|
||||
}
|
||||
else {
|
||||
message ($mysql->error);
|
||||
}
|
||||
}
|
||||
else {
|
||||
$query = sprintf ("UPDATE bookmark SET public='%d' WHERE childof='%d' AND user='%s'",
|
||||
$mysql->escape ($public),
|
||||
$mysql->escape ($folderid),
|
||||
$mysql->escape ($username));
|
||||
if ($mysql->query ($query)) {
|
||||
echo '<script language="JavaScript">reloadclose();</script>';
|
||||
}
|
||||
else {
|
||||
message ($mysql->error);
|
||||
}
|
||||
}
|
||||
}
|
||||
echo '<script language="JavaScript">reloadclose();</script>';
|
||||
}
|
||||
else {
|
||||
message ($mysql->error);
|
||||
}
|
||||
}
|
||||
|
||||
require_once (ABSOLUTE_PATH . "footer.php");
|
||||
?>
|
||||
60
folder_move.php
Normal file
60
folder_move.php
Normal file
@@ -0,0 +1,60 @@
|
||||
<?php
|
||||
require_once ("./header.php");
|
||||
logged_in_only ();
|
||||
require_once (ABSOLUTE_PATH . "folders.php");
|
||||
|
||||
$sourcefolder = set_post_sourcefolder ();
|
||||
$tree = & new folder;
|
||||
$parents = $tree->get_path_to_root ($folderid);
|
||||
|
||||
if ($sourcefolder == "") {
|
||||
?>
|
||||
|
||||
<p class="title">Move Folder</p>
|
||||
<form action="<?php echo $_SERVER['SCRIPT_NAME'] . "?folderid=" . $folderid . "&expand=" . implode (",", $expand);?>" method="POST" id="fmove">
|
||||
|
||||
<div style="width:100%; height:330px; overflow:auto;">
|
||||
|
||||
<?php
|
||||
$tree->make_tree (0);
|
||||
$tree->print_tree ();
|
||||
?>
|
||||
|
||||
</div>
|
||||
<br>
|
||||
<input type="hidden" name="sourcefolder">
|
||||
<input type="submit" value=" OK ">
|
||||
<input type="button" value=" Cancel " onClick="self.close()">
|
||||
<input type="button" value=" New Folder " onClick="self.location.href='javascript:foldernew(<?php echo $folderid; ?>)'">
|
||||
|
||||
</form>
|
||||
|
||||
<script type="text/javascript">
|
||||
this.focus();
|
||||
document.getElementById('fmove').sourcefolder.value = self.name;
|
||||
</script>
|
||||
|
||||
<?php
|
||||
}
|
||||
else if ($sourcefolder == $folderid) {
|
||||
echo '<script language="JavaScript">self.close();</script>';
|
||||
}
|
||||
else if (in_array ($sourcefolder, $parents)){
|
||||
message ("A folder cannot be moved to one of its own subfolders");
|
||||
}
|
||||
else if ($sourcefolder != "" && $sourcefolder != $folderid){
|
||||
$query = sprintf ("UPDATE folder SET childof='%d' WHERE id='%d' AND user='%s'",
|
||||
$mysql->escape ($folderid),
|
||||
$mysql->escape ($sourcefolder),
|
||||
$mysql->escape ($username));
|
||||
|
||||
if ($mysql->query ($query)) {
|
||||
echo "Folder moved<br>\n";
|
||||
echo '<script language="JavaScript">reloadclose();</script>';
|
||||
}
|
||||
else {
|
||||
message ($mysql->error);
|
||||
}
|
||||
}
|
||||
require_once (ABSOLUTE_PATH . "footer.php");
|
||||
?>
|
||||
41
folder_new.php
Normal file
41
folder_new.php
Normal file
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
require_once ("./header.php");
|
||||
logged_in_only ();
|
||||
|
||||
$foldername = set_post_foldername ();
|
||||
$public = set_post_bool_var ("public", false);
|
||||
|
||||
if ($foldername == "") {
|
||||
?>
|
||||
|
||||
<p class="title">New Folder</p>
|
||||
<form action="<?php echo $_SERVER['SCRIPT_NAME'] . "?folderid=" . $folderid; ?>" id="fnew" method="POST">
|
||||
<p><input type=text name="foldername" size="50" value="<?php echo $foldername; ?>"></p>
|
||||
<p><input type="checkbox" name="public"> Public</p>
|
||||
<input type="submit" value=" OK ">
|
||||
<input type="button" value=" Cancel " onClick="self.close()">
|
||||
</form>
|
||||
<script>
|
||||
this.focus();
|
||||
document.getElementById('fnew').foldername.focus();
|
||||
</script>
|
||||
|
||||
<?php
|
||||
}
|
||||
else {
|
||||
$query = sprintf ("INSERT INTO folder (childof, name, public, user) values ('%d', '%s', '%d', '%s')",
|
||||
$mysql->escape ($folderid),
|
||||
$mysql->escape ($foldername),
|
||||
$mysql->escape ($public),
|
||||
$mysql->escape ($username));
|
||||
if ($mysql->query ($query)) {
|
||||
echo "Folder successfully created<br>\n";
|
||||
echo '<script language="JavaScript">reloadclose();</script>';
|
||||
}
|
||||
else {
|
||||
message ($mysql->error);
|
||||
}
|
||||
}
|
||||
|
||||
require_once (ABSOLUTE_PATH . "footer.php");
|
||||
?>
|
||||
312
folders.php
Normal file
312
folders.php
Normal file
@@ -0,0 +1,312 @@
|
||||
<?php
|
||||
if (basename ($_SERVER['SCRIPT_NAME']) == basename (__FILE__)) {
|
||||
die ("no direct access allowed");
|
||||
}
|
||||
|
||||
class folder {
|
||||
|
||||
function folder ($user = false) {
|
||||
global $settings;
|
||||
|
||||
$this->username = $GLOBALS['username'];
|
||||
$this->folderid = $GLOBALS['folderid'];
|
||||
$this->folders = array ();
|
||||
$this->tree = array ();
|
||||
$this->get_children = array ();
|
||||
$this->level = 0;
|
||||
$this->foreign_username = false;
|
||||
$this->expand = $GLOBALS['expand'];
|
||||
|
||||
if ($user) {
|
||||
$this->get_shared_data ($user);
|
||||
}
|
||||
else {
|
||||
$this->get_user_data ();
|
||||
}
|
||||
|
||||
if ($settings['simple_tree_mode']) {
|
||||
$this->expand = $this->get_path_to_root ($this->folderid);
|
||||
}
|
||||
|
||||
# searching for invalid folderid in GET variable
|
||||
if ( ! array_key_exists ($this->folderid, $this->folders)) {
|
||||
$this->folderid = 0;
|
||||
}
|
||||
|
||||
# searching for invalid expand entries
|
||||
foreach ($this->expand as $key => $value) {
|
||||
if (! array_key_exists ($value, $this->folders)) {
|
||||
unset ($this->expand[$key]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function get_user_data () {
|
||||
global $mysql;
|
||||
$query = sprintf ("SELECT id, childof, name, public FROM folder WHERE user='%s' AND deleted!='1' ORDER BY name",
|
||||
$mysql->escape ($_SESSION['username']));
|
||||
if ($mysql->query ($query)) {
|
||||
while ($row = mysql_fetch_assoc ($mysql->result)) {
|
||||
$this->folders[$row['id']] = $row;
|
||||
if (!isset ($this->children[$row['childof']])) {
|
||||
$this->children[$row['childof']] = array ();
|
||||
}
|
||||
array_push ($this->children[$row['childof']], $row['id']);
|
||||
}
|
||||
}
|
||||
else {
|
||||
message ($mysql->error);
|
||||
}
|
||||
}
|
||||
|
||||
function get_shared_data ($username) {
|
||||
global $mysql;
|
||||
|
||||
# does the user exist in the database?
|
||||
if (check_username ($username)) {
|
||||
$this->foreign_username = $username;
|
||||
}
|
||||
else {
|
||||
$this->foreign_username = $GLOBALS['username'];
|
||||
}
|
||||
|
||||
# get all shared folders for the given user
|
||||
$query = "SELECT id, childof, name, public FROM folder 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 = array ();
|
||||
while ($row = mysql_fetch_assoc ($mysql->result)) {
|
||||
$this->folders[$row['id']] = $row;
|
||||
if (!isset ($this->children[$row['childof']])) {
|
||||
$this->children[$row['childof']] = array ();
|
||||
}
|
||||
array_push ($this->children[$row['childof']], $row['id']);
|
||||
array_push ($shared_children, $row['id']);
|
||||
}
|
||||
|
||||
$this->children[0] = array ();
|
||||
# the childof fields of each folder with no parent is being set to 0, so it 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, array (
|
||||
'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 () {
|
||||
global $settings, $folder_opened, $folder_closed, $folder_opened_public, $folder_closed_public, $plus, $minus, $neutral;
|
||||
|
||||
# depending on whom's bookmarks are being displayed, we set some variables differently
|
||||
if ($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 = array (
|
||||
'level' => 0,
|
||||
'id' => 0,
|
||||
'name' => $root_folder_name,
|
||||
'symbol' => null,
|
||||
'public' => 0,
|
||||
);
|
||||
array_unshift ($this->tree, $root_folder);
|
||||
|
||||
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 = '<div style="margin-left:' . $value['level'] * 20 . 'px;">';
|
||||
echo $spacer;
|
||||
|
||||
if ($value['id'] == $this->folderid) {
|
||||
$folder_name = '<span class="active">' . $value['name'] . '</span>';
|
||||
if (!$this->foreign_username && $value['public']) {
|
||||
$folder_image = $folder_opened_public;
|
||||
}
|
||||
else {
|
||||
$folder_image = $folder_opened;
|
||||
}
|
||||
}
|
||||
else {
|
||||
$folder_name = $value['name'];
|
||||
if (!$this->foreign_username && $value['public']) {
|
||||
$folder_image = $folder_closed_public;
|
||||
}
|
||||
else {
|
||||
$folder_image = $folder_closed;
|
||||
}
|
||||
}
|
||||
|
||||
if ($key > 5) {
|
||||
$ankor = "#" . $this->tree[$key - 5]['id'];
|
||||
}
|
||||
else {
|
||||
$ankor = "";
|
||||
}
|
||||
|
||||
if ($value['symbol'] == "plus" || $value['symbol'] == "minus") {
|
||||
if ($value['symbol'] == "plus") {
|
||||
$symbol = $plus;
|
||||
$expand_s = $this->add_to_expand_list ($value['id']);
|
||||
if ($settings['fast_folder_plus']) {
|
||||
$expand_f = $expand_s;
|
||||
}
|
||||
else {
|
||||
$expand_f = $this->expand;
|
||||
}
|
||||
}
|
||||
else if ($value['symbol'] == "minus") {
|
||||
$symbol = $minus;
|
||||
$expand_s = $this->remove_from_expand_list ($value['id']);
|
||||
if ($settings['fast_folder_minus'] && $value['id'] == $this->folderid) {
|
||||
$expand_f = $expand_s;
|
||||
}
|
||||
else {
|
||||
$expand_f = $this->expand;
|
||||
}
|
||||
}
|
||||
if ($settings['fast_symbol']) {
|
||||
$folderid = $value['id'];
|
||||
}
|
||||
else {
|
||||
$folderid = $this->folderid;
|
||||
}
|
||||
# this prints the symbol (plus or minus) with its appropriate link
|
||||
echo '<a class="f" href="' . $_SERVER['SCRIPT_NAME'] . '?expand=' . implode(",", $expand_s);
|
||||
echo '&folderid=' . $folderid . $user_var . $ankor . '">' . $symbol . '</a>';
|
||||
}
|
||||
else {
|
||||
$symbol = $neutral;
|
||||
$expand_f = $this->expand;
|
||||
echo $symbol;
|
||||
}
|
||||
|
||||
# this prints the folder name with its appropriate link
|
||||
echo '<a class="f" href="' . $_SERVER['SCRIPT_NAME'] . '?expand=' . implode(",", $expand_f);
|
||||
echo '&folderid=' . $value['id'] . $user_var . $ankor . '" name="' . $value['id'] . '">' . $folder_image . " " . $folder_name . '</a>';
|
||||
# and this is the end of the line
|
||||
echo "</div>\n";
|
||||
}
|
||||
}
|
||||
|
||||
###
|
||||
### removes a value from the expand list
|
||||
###
|
||||
function remove_from_expand_list ($id){
|
||||
$expand = $this->expand;
|
||||
foreach ($expand as $key => $value) {
|
||||
if ($value == $id) {
|
||||
unset ($expand[$key]);
|
||||
}
|
||||
}
|
||||
return $expand;
|
||||
}
|
||||
|
||||
###
|
||||
### adds a value to the expand list
|
||||
###
|
||||
function add_to_expand_list ($id){
|
||||
$expand = $this->expand;
|
||||
array_push ($expand, $id);
|
||||
return $expand;
|
||||
}
|
||||
|
||||
###
|
||||
### returns an array containing all folder id's from
|
||||
### a given folder up to the root folder
|
||||
###
|
||||
function get_path_to_root ($id) {
|
||||
$path = array ();
|
||||
while ($id > 0) {
|
||||
array_push ($path, $id);
|
||||
if (!isset ($this->folders[$id])) {
|
||||
#echo "Folder Nr. $id does not have a parent";
|
||||
return array ();
|
||||
}
|
||||
else {
|
||||
$id = $this->folders[$id]['childof'];
|
||||
}
|
||||
}
|
||||
return $path;
|
||||
}
|
||||
|
||||
###
|
||||
### prints a path
|
||||
###
|
||||
function print_path ($id) {
|
||||
global $settings;
|
||||
$parents = $this->get_path_to_root ($id);
|
||||
$parents = array_reverse ($parents);
|
||||
# the following if condition has been disabled. could be enabled to
|
||||
# allow the "show_root_folder" function.
|
||||
#if ($GLOBALS['show_root_folder']){
|
||||
$path = $GLOBALS['delimiter'] . $settings['root_folder_name'];
|
||||
#}
|
||||
foreach ($parents as $value) {
|
||||
$path .= $GLOBALS['delimiter'] . $this->folders[$value]['name'];
|
||||
}
|
||||
return $path;
|
||||
}
|
||||
|
||||
###
|
||||
### returns an array containing all folder id's that
|
||||
### are children from a given folder
|
||||
###
|
||||
function get_children ($id) {
|
||||
if (isset ($this->children[$id])) {
|
||||
foreach ($this->children[$id] as $value) {
|
||||
array_push ($this->get_children, $value);
|
||||
$this->get_children ($value);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
7
footer.php
Normal file
7
footer.php
Normal file
@@ -0,0 +1,7 @@
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
<?php
|
||||
exit ();
|
||||
?>
|
||||
50
header.php
Normal file
50
header.php
Normal file
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
define ("ABSOLUTE_PATH", dirname (__FILE__) . "/");
|
||||
|
||||
if (extension_loaded ('zlib')) {
|
||||
ob_start ('ob_gzhandler');
|
||||
}
|
||||
|
||||
require_once (ABSOLUTE_PATH . "lib/webstart.php");
|
||||
if (! is_file (ABSOLUTE_PATH . "config/config.php")) {
|
||||
die ('You have to <a href="./install.php">install</a> Online-Bookmarks.');
|
||||
}
|
||||
else {
|
||||
require_once (ABSOLUTE_PATH . "config/config.php");
|
||||
}
|
||||
require_once (ABSOLUTE_PATH . "lib/mysql.php");
|
||||
$mysql = & new mysql;
|
||||
require_once (ABSOLUTE_PATH . "lib/auth.php");
|
||||
$auth = & new Auth;
|
||||
require_once (ABSOLUTE_PATH . "lib/lib.php");
|
||||
require_once (ABSOLUTE_PATH . "lib/login.php");
|
||||
|
||||
?>
|
||||
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>Online-Bookmarks</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<meta http-equiv="Pragma" content="No-cache">
|
||||
<link rel="stylesheet" type="text/css" href="./style.css">
|
||||
<link rel="shortcut icon" href="favicon.ico">
|
||||
<script type="text/javascript" src="./lib/lib.js"></script>
|
||||
<!--[if lt IE 7]>
|
||||
<script defer type="text/javascript" src="./lib/pngfix.js"></script>
|
||||
<![endif]-->
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<?php
|
||||
|
||||
if (is_file (ABSOLUTE_PATH . "install.php")) {
|
||||
message ('Remove "install.php" before using Online-Bookmarks.');
|
||||
}
|
||||
|
||||
if ($display_login_form) {
|
||||
$auth->display_login_form ();
|
||||
require_once (ABSOLUTE_PATH . "footer.php");
|
||||
}
|
||||
|
||||
?>
|
||||
359
import.php
Normal file
359
import.php
Normal file
@@ -0,0 +1,359 @@
|
||||
<?php
|
||||
require_once ("./header.php");
|
||||
logged_in_only ();
|
||||
?>
|
||||
|
||||
<table class="caption">
|
||||
<tr>
|
||||
<td><span class="caption"><img src="./images/logo.png" alt=""> Import Bookmarks</span>
|
||||
</td>
|
||||
|
||||
<td class="captionright">
|
||||
<div><?php object_count (); ?></div>
|
||||
<div><?php print_footer (); ?></div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
<table class="main">
|
||||
<tr>
|
||||
<td class="main1">
|
||||
<table class="menu">
|
||||
<tr>
|
||||
<th class="menuhead">Bookmarks</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="menu">
|
||||
<a href="./index.php">My Bookmarks</a><br>
|
||||
<a href="./shared.php">Shared Bookmarks</a><br>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<br>
|
||||
|
||||
<table class="menu">
|
||||
<tr>
|
||||
<th class="menuhead">Tools</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="menu">
|
||||
<?php if (admin_only ()) { ?>
|
||||
<a href="./admin.php">Admin</a><br>
|
||||
<?php } ?>
|
||||
<a href="./import.php">Import</a><br>
|
||||
<a href="./export.php">Export</a><br>
|
||||
<a href="./sidebar.php">View as Sidebar</a><br>
|
||||
<a href="./settings.php">Settings</a><br>
|
||||
<a href="javascript:chpw()">Change Password</a><br>
|
||||
<a href="./index.php?logout=1">Logout</a><br>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<td class="">
|
||||
<img src="./images/spacer.gif" alt="" class="main2">
|
||||
</td>
|
||||
<td class="main4">
|
||||
|
||||
<?php
|
||||
|
||||
if (!isset ($_FILES['importfile']['tmp_name']) || $_FILES['importfile']['tmp_name'] == null){
|
||||
# get the browser type for default setting below if possible
|
||||
if( eregi ("opera", $_SERVER['HTTP_USER_AGENT'])){
|
||||
$default_browser = "opera";
|
||||
}
|
||||
else{
|
||||
$default_browser = "netscape";
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<form enctype="multipart/form-data" action="<?php echo $_SERVER['SCRIPT_NAME'];?>" method="post">
|
||||
<table valign="top" border="0">
|
||||
<tr>
|
||||
<td>
|
||||
from Browser:
|
||||
</td>
|
||||
<td>
|
||||
<select name="browser">
|
||||
<option value="netscape"<?php if ($default_browser=="netscape"){echo " selected";} ?>>Netscape / Mozilla / IE</option>
|
||||
<option value="opera"<?php if ($default_browser=="opera"){echo " selected";} ?>>Opera .adr</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
select File:
|
||||
</td>
|
||||
<td>
|
||||
<input type="file" name="importfile">
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>Character encoding:</td>
|
||||
<td>
|
||||
<select name="charset">
|
||||
<?php
|
||||
$charsets = return_charsets ();
|
||||
foreach ($charsets as $value) {
|
||||
$selected = '';
|
||||
if ($value == 'UTF-8') {$selected = ' selected';}
|
||||
echo '<option value="'.$value.'"'.$selected.'>'.$value.'</option>' . "\n";
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>Make them:</td>
|
||||
<td>
|
||||
<select name="public">
|
||||
<option value="1">public</option>
|
||||
<option value="0" selected>private</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
Destination Folder:
|
||||
</td>
|
||||
<td>
|
||||
<div style="width:<?php echo $column_width_folder; ?>; height:350px; overflow:auto;">
|
||||
|
||||
<?php
|
||||
require_once (ABSOLUTE_PATH . "folders.php");
|
||||
$tree = & new folder;
|
||||
$tree->make_tree (0);
|
||||
$tree->print_tree ();
|
||||
?>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<p><input type="button" value=" New Folder " onClick="self.location.href='javascript:foldernew(<?php echo $folderid; ?>)'"></p>
|
||||
<input type="hidden" name="parentfolder" value="<?php echo $folderid; ?>">
|
||||
<input type="submit" value="Import">
|
||||
<input type="button" value=" Cancel " onClick="self.location.href='./index.php'">
|
||||
</td>
|
||||
<td>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
</form>
|
||||
|
||||
<?php
|
||||
}
|
||||
else{
|
||||
if(!isset($_POST['browser']) || $_POST['browser'] == ""){
|
||||
message ("no browser selected");
|
||||
}
|
||||
|
||||
$parentfolder = set_post_parentfolder ();
|
||||
$import = & new import;
|
||||
|
||||
if ($_POST['browser'] == "opera") {
|
||||
$import->import_opera ();
|
||||
}
|
||||
else if ($_POST['browser'] == "netscape") {
|
||||
$import->import_netscape ();
|
||||
}
|
||||
echo "$import->count_folders folders and $import->count_bookmarks bookmarks imported.<br>\n";
|
||||
echo '<a href="./index.php">My Bookmarks</a>';
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<?php
|
||||
|
||||
class import {
|
||||
function import () {
|
||||
# open the importfile
|
||||
$this->fp = fopen ($_FILES['importfile']['tmp_name'], "r");
|
||||
if ($this->fp == null){
|
||||
message ("Failed to open file");
|
||||
}
|
||||
|
||||
$this->charset = set_post_charset ();
|
||||
$this->public = set_post_bool_var ("public", false);
|
||||
|
||||
$this->count_folders = 0;
|
||||
$this->count_bookmarks = 0;
|
||||
|
||||
$this->username = $GLOBALS['username'];
|
||||
$this->parent_folder = $GLOBALS['parentfolder'];
|
||||
$this->current_folder = $this->parent_folder;
|
||||
|
||||
$this->folder_depth = array ();
|
||||
|
||||
$this->mysql = $GLOBALS['mysql'];
|
||||
|
||||
}
|
||||
|
||||
function import_opera () {
|
||||
while (!feof ($this->fp)) {
|
||||
$line = trim (fgets ($this->fp, 4096));
|
||||
|
||||
# a folder has been found
|
||||
if ($line == "#FOLDER") {
|
||||
$item = "Folder";
|
||||
}
|
||||
# a bookmark has been found
|
||||
else if ($line == "#URL") {
|
||||
$item = "Bookmark";
|
||||
}
|
||||
# if a line starts with NAME= ...
|
||||
else if (substr ($line, 0, strlen("NAME=")) == "NAME=") {
|
||||
$line = substr ($line, strlen ("NAME="));
|
||||
# ... depending on the value of "$item" we assign the name to
|
||||
# either folder or bookmark.
|
||||
if ($item == "Folder") {
|
||||
$this->name_folder = input_validation ($line, $this->charset);
|
||||
}
|
||||
else if ($item == "Bookmark") {
|
||||
$this->name_bookmark = input_validation ($line, $this->charset);
|
||||
}
|
||||
}
|
||||
# only bookmarks can have a description or/and an url.
|
||||
else if (substr ($line, 0, strlen ("DESCRIPTION=")) == "DESCRIPTION=") {
|
||||
$this->description = substr (input_validation ($line, $this->charset), strlen ("DESCRIPTION="));
|
||||
}
|
||||
else if (substr ($line, 0, strlen ("URL=")) == "URL="){
|
||||
$this->url = substr (input_validation ($line, $this->charset), strlen ("URL="));
|
||||
}
|
||||
# process the corresponding item, if there is an empty line found
|
||||
else if ($line == "") {
|
||||
if (isset ($item) && $item == "Folder") {
|
||||
$this->folder_new ();
|
||||
unset ($item);
|
||||
}
|
||||
else if (isset ($item) && $item == "Bookmark") {
|
||||
$this->bookmark_new ();
|
||||
unset ($item);
|
||||
}
|
||||
}
|
||||
# this indicates, that the folder is being closed
|
||||
else if ($line == "-") {
|
||||
$this->folder_close ();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function import_netscape () {
|
||||
while (!feof ($this->fp)){
|
||||
$line = trim (fgets ($this->fp));
|
||||
|
||||
# a folder has been found
|
||||
if (ereg ("<DT><H3", $line)) {
|
||||
$this->name_folder = input_validation (ereg_replace ("^( *<DT><[^>]*>)([^<]*)(.*)", "\\2", $line), $this->charset);
|
||||
$this->folder_new ();
|
||||
}
|
||||
# a bookmark has been found
|
||||
else if (ereg("<DT><A", $line)){
|
||||
$this->name_bookmark = input_validation (ereg_replace ("^( *<DT><[^>]*>)([^<]*)(.*)", "\\2", $line), $this->charset);
|
||||
$this->url = input_validation (ereg_replace ("([^H]*HREF=\")([^\"]*)(\".*)", "\\2", $line), $this->charset);
|
||||
$this->bookmark_new ();
|
||||
$insert_id = mysql_insert_id ();
|
||||
}
|
||||
# this is a description. it is only being saved
|
||||
# if a bookmark has been saved previously
|
||||
else if (ereg("<DD>*", $line)) {
|
||||
if (isset ($insert_id)) {
|
||||
$this->description = input_validation (ereg_replace ("^( *<DD>)(.*)", "\\2", $line), $this->charset);
|
||||
$query = sprintf ("UPDATE bookmark SET description='%s' WHERE id='%d' and user='%s'",
|
||||
$this->mysql->escape ($this->description),
|
||||
$this->mysql->escape ($insert_id),
|
||||
$this->mysql->escape ($this->username));
|
||||
|
||||
@$this->mysql->query ($query);
|
||||
unset ($this->description);
|
||||
unset ($insert_id);
|
||||
}
|
||||
}
|
||||
# this indicates, that the folder is being closed
|
||||
else if ($line == "</DL><p>") {
|
||||
$this->folder_close ();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function folder_new () {
|
||||
if (!isset ($this->name_folder)) {
|
||||
$this->name_folder == "";
|
||||
}
|
||||
$query = sprintf ("INSERT INTO folder (childof, name, user, public) values ('%d', '%s', '%s', '%d')",
|
||||
$this->mysql->escape ($this->current_folder),
|
||||
$this->mysql->escape ($this->name_folder),
|
||||
$this->mysql->escape ($this->username),
|
||||
$this->mysql->escape ($this->public));
|
||||
|
||||
if ($this->mysql->query ($query)) {
|
||||
$this->current_folder = mysql_insert_id ();
|
||||
array_push ($this->folder_depth, $this->current_folder);
|
||||
unset ($this->name_folder);
|
||||
$this->count_folders++;
|
||||
}
|
||||
else {
|
||||
message ($this->mysql->error);
|
||||
}
|
||||
}
|
||||
|
||||
function bookmark_new () {
|
||||
if (!isset ($this->name_bookmark)) {
|
||||
$this->name_bookmark = "";
|
||||
}
|
||||
if (!isset ($this->url)) {
|
||||
$this->url = "";
|
||||
}
|
||||
if (!isset ($this->description)) {
|
||||
$this->description = "";
|
||||
}
|
||||
$query = sprintf ("INSERT INTO bookmark (user, title, url, description, childof, public)
|
||||
values ('%s', '%s', '%s', '%s', '%d', '%d')",
|
||||
$this->mysql->escape ($this->username),
|
||||
$this->mysql->escape ($this->name_bookmark),
|
||||
$this->mysql->escape ($this->url),
|
||||
$this->mysql->escape ($this->description),
|
||||
$this->mysql->escape ($this->current_folder),
|
||||
$this->mysql->escape ($this->public));
|
||||
|
||||
if ($this->mysql->query ($query)) {
|
||||
unset ($this->name_bookmark, $this->url, $this->description);
|
||||
$this->count_bookmarks++;
|
||||
}
|
||||
else {
|
||||
message ($this->mysql->error);
|
||||
}
|
||||
}
|
||||
|
||||
function folder_close () {
|
||||
if (count ($this->folder_depth) <= 1) {
|
||||
$this->folder_depth = array ();
|
||||
$this->current_folder = $this->parent_folder;
|
||||
}
|
||||
else{
|
||||
# remove the last folder from the folder history
|
||||
unset ($this->folder_depth[count ($this->folder_depth) - 1]);
|
||||
$this->folder_depth = array_values ($this->folder_depth);
|
||||
# set the last folder to the current folder
|
||||
$this->current_folder = $this->folder_depth[count ($this->folder_depth) - 1];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
require_once (ABSOLUTE_PATH . "footer.php");
|
||||
?>
|
||||
226
index.php
Normal file
226
index.php
Normal file
@@ -0,0 +1,226 @@
|
||||
<?php
|
||||
require_once ("./header.php");
|
||||
logged_in_only ();
|
||||
|
||||
$search = set_get_string_var ('search');
|
||||
if ($search != '') {
|
||||
$search_mode = true;
|
||||
}
|
||||
else {
|
||||
$search_mode = false;
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
|
||||
|
||||
|
||||
<table class="caption">
|
||||
<tr>
|
||||
<td><span class="caption"><img src="./images/logo.png" alt=""> Online-Bookmarks of <?php echo $username; ?></span>
|
||||
</td>
|
||||
|
||||
<td class="captionright">
|
||||
<div><?php object_count (); ?></div>
|
||||
<div><?php print_footer (); ?></div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<table class="main">
|
||||
<tr>
|
||||
<td class="main1">
|
||||
|
||||
<table class="menu">
|
||||
<tr>
|
||||
<th class="menuhead">Search</th>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="menu">
|
||||
<form action="<?php echo $_SERVER['SCRIPT_NAME']; ?>" method="GET">
|
||||
<input type="text" name="search" size="10" value="<?php echo $search; ?>">
|
||||
<input type="submit" value="Go" name="submit">
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<br>
|
||||
|
||||
<table class="menu">
|
||||
<tr>
|
||||
<th class="menuhead">Bookmarks</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="menu">
|
||||
<a href="javascript:bookmarknew('<?php echo $folderid; ?>')">New Bookmark</a><br>
|
||||
<a href="javascript:bookmarkedit(checkselected())">Edit Bookmarks</a><br>
|
||||
<a href="javascript:bookmarkmove(checkselected())">Move Bookmarks</a><br>
|
||||
<a href="javascript:bookmarkdelete(checkselected())">Delete Bookmarks</a><br>
|
||||
<a href="javascript:selection('toggle')">Toggle Selection</a><br>
|
||||
<a href="./shared.php">Shared Bookmarks</a><br>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<br>
|
||||
|
||||
<table class="menu">
|
||||
<tr>
|
||||
<th class="menuhead">Folders</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="menu">
|
||||
<a href="javascript:foldernew('<?php echo $folderid; ?>')">New Folder</a><br>
|
||||
<a href="javascript:folderedit('<?php echo $folderid; ?>')">Edit Folder</a><br>
|
||||
<a href="javascript:foldermove('<?php echo $folderid; ?>')">Move Folder</a><br>
|
||||
<a href="javascript:folderdelete('<?php echo $folderid; ?>')">Delete Folder</a><br>
|
||||
<a href="./index.php?expand=&folderid=0">Collapse All</a><br>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<br>
|
||||
|
||||
<table class="menu">
|
||||
<tr>
|
||||
<th class="menuhead">Tools</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="menu">
|
||||
<a href="./admin.php">Admin</a><br>
|
||||
<a href="./import.php">Import</a><br>
|
||||
<a href="./export.php">Export</a><br>
|
||||
<a href="./sidebar.php">View as Sidebar</a><br>
|
||||
<a href="./settings.php">Settings</a><br>
|
||||
<a href="javascript:chpw()">Change Password</a><br>
|
||||
<a href="./index.php?logout=1">Logout</a><br>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</td>
|
||||
<td class="">
|
||||
<img src="./images/spacer.gif" alt="" class="main2">
|
||||
</td>
|
||||
|
||||
<?php if ($search_mode): ?>
|
||||
|
||||
<td class="main4">
|
||||
<div style="height: <?php echo $table_height; ?>; overflow:auto;">
|
||||
|
||||
<?php
|
||||
$query = sprintf ("SELECT bookmark.title,
|
||||
bookmark.url,
|
||||
bookmark.description,
|
||||
UNIX_TIMESTAMP(bookmark.date) AS timestamp,
|
||||
bookmark.childof,
|
||||
bookmark.id,
|
||||
bookmark.favicon,
|
||||
bookmark.public,
|
||||
folder.name,
|
||||
folder.id AS fid,
|
||||
folder.public AS fpublic
|
||||
|
||||
FROM bookmark LEFT JOIN folder ON bookmark.childof=folder.id
|
||||
WHERE bookmark.user='%s'
|
||||
AND bookmark.deleted!='1'
|
||||
AND (title LIKE ('%%%s%%')
|
||||
OR description LIKE ('%%%s%%')
|
||||
OR url LIKE ('%%%s%%'))
|
||||
ORDER BY title",
|
||||
$mysql->escape ($username),
|
||||
$mysql->escape ($search),
|
||||
$mysql->escape ($search),
|
||||
$mysql->escape ($search));
|
||||
|
||||
if ($mysql->query ($query)) {
|
||||
$bookmarks = array ();
|
||||
while ($row = mysql_fetch_assoc ($mysql->result)) {
|
||||
array_push ($bookmarks, $row);
|
||||
}
|
||||
if (count ($bookmarks) > 0) {
|
||||
require_once (ABSOLUTE_PATH . "bookmarks.php");
|
||||
list_bookmarks ($bookmarks,
|
||||
true,
|
||||
true,
|
||||
$settings['show_bookmark_icon'],
|
||||
true,
|
||||
$settings['show_bookmark_description'],
|
||||
$settings['show_column_date'],
|
||||
$settings['show_column_edit'],
|
||||
$settings['show_column_move'],
|
||||
$settings['show_column_delete'],
|
||||
true);
|
||||
}
|
||||
else {
|
||||
echo '<div> No Bookmarks found matching ' . $search . '.</div>';
|
||||
}
|
||||
}
|
||||
else {
|
||||
message ($mysql->error);
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
|
||||
<?php else: ?>
|
||||
|
||||
<td class="main3" style="width: <?php echo $column_width_folder; ?>;">
|
||||
<div style="height: <?php echo $table_height; ?>; width: <?php echo $column_width_folder; ?>; overflow:auto;">
|
||||
<?php
|
||||
require_once (ABSOLUTE_PATH . "folders.php");
|
||||
$tree = & new folder;
|
||||
$tree->make_tree (0);
|
||||
$tree->print_tree ();
|
||||
?>
|
||||
</div>
|
||||
</td>
|
||||
<td class="main4">
|
||||
<div style="height: <?php echo $table_height; ?>; width: <?php echo $column_width_bookmark; ?>; overflow:auto;">
|
||||
|
||||
<?php
|
||||
require_once (ABSOLUTE_PATH . "bookmarks.php");
|
||||
$query = sprintf ("SELECT title, url, description, UNIX_TIMESTAMP(date) AS timestamp, id, favicon, public
|
||||
FROM bookmark
|
||||
WHERE user='%s'
|
||||
AND childof='%d'
|
||||
AND deleted!='1'
|
||||
ORDER BY title",
|
||||
$mysql->escape ($username),
|
||||
$mysql->escape ($folderid));
|
||||
|
||||
if ($mysql->query ($query)) {
|
||||
$bookmarks = array ();
|
||||
while ($row = mysql_fetch_assoc ($mysql->result)) {
|
||||
array_push ($bookmarks, $row);
|
||||
}
|
||||
list_bookmarks ($bookmarks,
|
||||
true,
|
||||
false,
|
||||
$settings['show_bookmark_icon'],
|
||||
true,
|
||||
$settings['show_bookmark_description'],
|
||||
$settings['show_column_date'],
|
||||
$settings['show_column_edit'],
|
||||
$settings['show_column_move'],
|
||||
$settings['show_column_delete'],
|
||||
$settings['show_public']);
|
||||
}
|
||||
else {
|
||||
message ($mysql->error);
|
||||
}
|
||||
?>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
<?php endif; ?>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<?php
|
||||
require_once (ABSOLUTE_PATH . "footer.php");
|
||||
?>
|
||||
164
register.php
Normal file
164
register.php
Normal file
@@ -0,0 +1,164 @@
|
||||
<?php
|
||||
require_once ("./header.php");
|
||||
|
||||
$secret = "dDWUc72sCcs20cXskcw";
|
||||
$reg_register = set_post_bool_var ('reg_register', false);
|
||||
$reg_username = set_post_string_var ('reg_username');
|
||||
$reg_email = set_post_string_var ('reg_email');
|
||||
$confirm = set_get_string_var ('confirm');
|
||||
|
||||
if ($reg_register) {
|
||||
if ($reg_username != "") {
|
||||
if (check_username ($reg_username)) {
|
||||
echo '<div style="color:red;">$username is an already registered user. Choose another one.</div>'."\n";
|
||||
$username = false;
|
||||
}
|
||||
else {
|
||||
$username = $reg_username;
|
||||
}
|
||||
}
|
||||
else {
|
||||
echo '<div style="color:red;">Please enter a Username.</div>'."\n";
|
||||
$username = false;
|
||||
}
|
||||
|
||||
if (isset ($_POST['reg_password1']) && $_POST['reg_password1'] != "" &&
|
||||
isset ($_POST['reg_password2']) && $_POST['reg_password2'] != "") {
|
||||
if (md5 ($_POST['reg_password1']) != md5 ($_POST['reg_password2'])) {
|
||||
echo '<div style="color:red;">Passwords do not match.</div>'."\n";
|
||||
$password = false;
|
||||
}
|
||||
else {
|
||||
$password = md5 ($_POST['reg_password1']);
|
||||
}
|
||||
}
|
||||
else {
|
||||
echo '<div style="color:red;">Please fill out both password fields.</div>'."\n";
|
||||
$password = false;
|
||||
}
|
||||
|
||||
if ($reg_email != '') {
|
||||
if (preg_match ('/^[A-Z0-9._%-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$/i', $reg_email)) {
|
||||
$query = "SELECT COUNT(*) AS result FROM user WHERE email='$reg_email'";
|
||||
if ($mysql->query ($query)) {
|
||||
if (mysql_result ($result, 0) > 0) {
|
||||
echo '<div style="color:red;">A User Account with this email address aready exists.</div>'."\n";
|
||||
$email = false;
|
||||
}
|
||||
else {
|
||||
$email = $reg_email;
|
||||
}
|
||||
}
|
||||
else {
|
||||
$email = false;
|
||||
message ($mysql->error);
|
||||
}
|
||||
}
|
||||
else {
|
||||
echo '<div style="color:red;">Email address is invalid.</div>'."\n";
|
||||
$email = false;
|
||||
}
|
||||
}
|
||||
else {
|
||||
echo '<div style="color:red;">Please enter a valid email address.</div>'."\n";
|
||||
$email = false;
|
||||
}
|
||||
|
||||
|
||||
if ($username && $password && $email) {
|
||||
$query = " INSERT INTO user
|
||||
(username, password, email, active)
|
||||
VALUES
|
||||
('$username', md5('$password'), '$email', '0')";
|
||||
|
||||
if (mysql_query ("$query")) {
|
||||
# dieser key wird als username und secret md5 hash an den
|
||||
# user geschickt und f<>r die verifikation der registrierung gebraucht.
|
||||
$key = md5 ($username . $secret);
|
||||
|
||||
$headers = "From: noreply@yourdomain.com\r\n" .
|
||||
$subject = 'Your registration at yourdomain.com';
|
||||
$message = "Hi $username,\r\n\r\n";
|
||||
$message .= "This email confirms the creation of your Online-Bookmarks user account. ";
|
||||
$message .= "Your username is '$username'. For security reasons your password is not ";
|
||||
$message .= "included in this email. To activate your account, visit the following URL:\r\n\r\n";
|
||||
$message .= "http://www.yourdomain.com/register.php?confirm=$key\r\n\r\n";
|
||||
$message .= "In case of complications regarding this user account registration, ";
|
||||
$message .= "please contact support@yourdomain.com\r\n\r\n";
|
||||
$message .= "With kind regards, your yourdomain.com Team";
|
||||
|
||||
mail($email, $subject, $message, $headers);
|
||||
|
||||
echo " you have been successfully registered.
|
||||
Read your email and click the link to activate your account.";
|
||||
}
|
||||
else {
|
||||
echo mysql_error ();
|
||||
}
|
||||
}
|
||||
else {
|
||||
display_register_form ();
|
||||
}
|
||||
}
|
||||
else if ($confirm != '' && strlen ($confirm) === 32) {
|
||||
$query = "SELECT username FROM user WHERE MD5(CONCAT(username,'$secret'))='$confirm' AND active='0'";
|
||||
$result = mysql_query ("$query");
|
||||
if (mysql_num_rows ($result) == 1) {
|
||||
# the registration confirmation was successufull,
|
||||
# thus we can enable the useraccount in the database.
|
||||
$username = mysql_result ($result, 0);
|
||||
$query = "UPDATE user SET active='1' WHERE username='$username' AND active='0'";
|
||||
if (mysql_query ($query)) {
|
||||
echo "You are now registered. Happy bookmarking!";
|
||||
}
|
||||
}
|
||||
else {
|
||||
display_register_form ();
|
||||
}
|
||||
}
|
||||
else {
|
||||
display_register_additional_text ();
|
||||
display_register_form ();
|
||||
}
|
||||
|
||||
function display_register_form () {
|
||||
?>
|
||||
|
||||
<form method="POST" action="<?php echo $_SERVER["PHP_SELF"]; ?>" name="loginform">
|
||||
<table border="0">
|
||||
<tr>
|
||||
<td>Username:</td>
|
||||
<td><input name="reg_username" type="text" value=""></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Password:</td>
|
||||
<td><input name="reg_password1" type="password" value=""></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Password Verification:</td>
|
||||
<td><input name="reg_password2" type="password" value=""></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Email Address:</td>
|
||||
<td><input name="reg_email" type="text" value=""></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td><input type="submit" value="Register" name="reg_register"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
|
||||
<?php
|
||||
}
|
||||
|
||||
function display_register_additional_text () {
|
||||
?>
|
||||
<p>Please provide the information bellow to register.</p>
|
||||
|
||||
<p>If you are already a registered user, <a class="orange" href="./index.php">you can log in here.</a></p>
|
||||
<?php
|
||||
}
|
||||
|
||||
require_once ("./footer.php");
|
||||
?>
|
||||
26
select_folder.php
Normal file
26
select_folder.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
require_once ('./header.php');
|
||||
logged_in_only ();
|
||||
?>
|
||||
|
||||
<p class="title">Select Folder</p>
|
||||
|
||||
<div style="width:100%; height:330px; overflow:auto;">
|
||||
|
||||
<?php
|
||||
require_once ('./folders.php');
|
||||
$tree = & new folder;
|
||||
$tree->make_tree (0);
|
||||
$tree->print_tree ();
|
||||
$path = $tree->print_path ($folderid);
|
||||
?>
|
||||
|
||||
</div>
|
||||
<br>
|
||||
<input type="submit" value=" OK " onClick="javascript:opener.childof.value = '<?php echo $folderid; ?>';opener.path.value = '<?php echo $path; ?>'; self.close()">
|
||||
<input type="button" value="Cancel" onClick="window.close()">
|
||||
<input type="button" value=" New Folder " onClick="self.location.href='javascript:foldernew(<?php echo $folderid; ?>)'">
|
||||
|
||||
<?php
|
||||
require_once (ABSOLUTE_PATH . "footer.php");
|
||||
?>
|
||||
368
settings.php
Normal file
368
settings.php
Normal file
@@ -0,0 +1,368 @@
|
||||
<?php
|
||||
require_once ("./header.php");
|
||||
logged_in_only ();
|
||||
|
||||
$message = '';
|
||||
|
||||
if (isset ($_POST['settings_apply'])) {
|
||||
$settings = array (
|
||||
'root_folder_name' => set_post_foldername ("settings_root_folder_name"),
|
||||
'column_width_folder' => check_num_var ("settings_column_width_folder"),
|
||||
'column_width_bookmark' => check_num_var ("settings_column_width_bookmark"),
|
||||
'table_height' => check_num_var ("settings_table_height"),
|
||||
'confirm_delete' => set_post_bool_var ("settings_confirm_delete", false),
|
||||
'open_new_window' => set_post_bool_var ("settings_open_new_window", false),
|
||||
'show_bookmark_description' => set_post_bool_var ("settings_show_bookmark_description", false),
|
||||
'show_bookmark_icon' => set_post_bool_var ("settings_show_bookmark_icon", false),
|
||||
'show_column_date' => set_post_bool_var ("settings_show_column_date", false),
|
||||
'date_format' => check_date_format (),
|
||||
'show_column_edit' => set_post_bool_var ("settings_show_column_edit", false),
|
||||
'show_column_move' => set_post_bool_var ("settings_show_column_move", false),
|
||||
'show_column_delete' => set_post_bool_var ("settings_show_column_delete", false),
|
||||
'fast_folder_minus' => set_post_bool_var ("settings_fast_folder_minus", false),
|
||||
'fast_folder_plus' => set_post_bool_var ("settings_fast_folder_plus", false),
|
||||
'fast_symbol' => set_post_bool_var ("settings_fast_symbol", false),
|
||||
'simple_tree_mode' => set_post_bool_var ("settings_simple_tree_mode", false),
|
||||
'show_public' => set_post_bool_var ("settings_show_public", false),
|
||||
);
|
||||
|
||||
$query = sprintf ("UPDATE user SET
|
||||
root_folder_name ='%s',
|
||||
column_width_folder ='%d',
|
||||
column_width_bookmark ='%d',
|
||||
table_height ='%d',
|
||||
confirm_delete ='%d',
|
||||
open_new_window ='%d',
|
||||
show_bookmark_description ='%d',
|
||||
show_bookmark_icon ='%d',
|
||||
show_column_date ='%d',
|
||||
date_format ='%s',
|
||||
show_column_edit ='%d',
|
||||
show_column_move ='%d',
|
||||
show_column_delete ='%d',
|
||||
fast_folder_minus ='%d',
|
||||
fast_folder_plus ='%d',
|
||||
fast_symbol ='%d',
|
||||
simple_tree_mode ='%d',
|
||||
show_public ='%d'
|
||||
WHERE username='%s'",
|
||||
|
||||
$mysql->escape ($settings['root_folder_name']),
|
||||
$settings['column_width_folder'],
|
||||
$settings['column_width_bookmark'],
|
||||
$settings['table_height'],
|
||||
$settings['confirm_delete'],
|
||||
$settings['open_new_window'],
|
||||
$settings['show_bookmark_description'],
|
||||
$settings['show_bookmark_icon'],
|
||||
$settings['show_column_date'],
|
||||
$mysql->escape ($settings['date_format']),
|
||||
$settings['show_column_edit'],
|
||||
$settings['show_column_move'],
|
||||
$settings['show_column_delete'],
|
||||
$settings['fast_folder_minus'],
|
||||
$settings['fast_folder_plus'],
|
||||
$settings['fast_symbol'],
|
||||
$settings['simple_tree_mode'],
|
||||
$settings['show_public'],
|
||||
$mysql->escape ($username));
|
||||
|
||||
if ($mysql->query ($query)) {
|
||||
$message = "Settings applied.";
|
||||
}
|
||||
else {
|
||||
message ($mysql->error);
|
||||
}
|
||||
}
|
||||
|
||||
# I really don't feel like putting these very specific function into lib.php...
|
||||
function check_num_var ($varname) {
|
||||
if (!is_numeric ($_POST[$varname])) {
|
||||
return 280;
|
||||
}
|
||||
else if ($_POST[$varname] == 0 && $varname == "settings_column_width_bookmark") {
|
||||
return 0;
|
||||
}
|
||||
else if ($_POST[$varname] < 100) {
|
||||
return 100;
|
||||
}
|
||||
else if ($_POST[$varname] > 800) {
|
||||
return 800;
|
||||
}
|
||||
else {
|
||||
return $_POST[$varname];
|
||||
}
|
||||
}
|
||||
|
||||
function check_date_format () {
|
||||
global $date_formats;
|
||||
$date_format = set_post_num_var ('settings_date_format');
|
||||
|
||||
if ($date_format < 0 || $date_format > count ($date_formats)) {
|
||||
return 0;
|
||||
}
|
||||
else {
|
||||
return $date_format;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<table class="caption">
|
||||
<tr>
|
||||
<td><span class="caption"><img src="./images/logo.png" alt=""> My Settings</span>
|
||||
</td>
|
||||
|
||||
<td class="captionright">
|
||||
<div><?php object_count (); ?></div>
|
||||
<div><?php print_footer (); ?></div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
<table class="main">
|
||||
<tr>
|
||||
<td class="main1">
|
||||
<table class="menu">
|
||||
<tr>
|
||||
<th class="menuhead">Bookmarks</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="menu">
|
||||
<a href="./index.php">My Bookmarks</a><br>
|
||||
<a href="./shared.php">Shared Bookmarks</a><br>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<br>
|
||||
|
||||
<table class="menu">
|
||||
<tr>
|
||||
<th class="menuhead">Tools</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="menu">
|
||||
<?php if (admin_only ()) { ?>
|
||||
<a href="./admin.php">Admin</a><br>
|
||||
<?php } ?>
|
||||
<a href="./import.php">Import</a><br>
|
||||
<a href="./export.php">Export</a><br>
|
||||
<a href="./sidebar.php">View as Sidebar</a><br>
|
||||
<a href="./settings.php">Settings</a><br>
|
||||
<a href="javascript:chpw()">Change Password</a><br>
|
||||
<a href="./index.php?logout=1">Logout</a><br>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<td class="">
|
||||
<img src="./images/spacer.gif" alt="" class="main2">
|
||||
</td>
|
||||
<td class="main4">
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<form action="<?php echo $_SERVER['SCRIPT_NAME']; ?>" method="POST">
|
||||
<table>
|
||||
<tr>
|
||||
<td>Name of the root folder</td>
|
||||
<td>
|
||||
<input type="text" name="foldername" value="<?php echo $settings['root_folder_name']; ?>">
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>The width in pixels of the folder column<br>100 - 800 pixel</td>
|
||||
<td>
|
||||
<input type="text" name="settings_column_width_folder" value="<?php echo $settings['column_width_folder']; ?>" size="5">
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>The width in pixels of the bookmark column<br>100 - 800 pixel or 0 for 100%</td>
|
||||
<td>
|
||||
<input type="text" name="settings_column_width_bookmark" value="<?php echo $settings['column_width_bookmark']; ?>" size="5">
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>The height in pixels of the main table<br>100 - 800 pixel</td>
|
||||
<td>
|
||||
<input type="text" name="settings_table_height" value="<?php echo $settings['table_height']; ?>" size="5">
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>Confirm deletions of bookmarks an folders</td>
|
||||
<td>
|
||||
<input type="checkbox" name="settings_confirm_delete" <?php if ($settings['confirm_delete'] == 1) {echo "checked";}?>></input>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>Open a new window when clicking a bookmark</td>
|
||||
<td>
|
||||
<input type="checkbox" name="settings_open_new_window" <?php if ($settings['open_new_window'] == 1) {echo "checked";}?>></input>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>Show the bookmarks description in the overview</td>
|
||||
<td>
|
||||
<input type="checkbox" name="settings_show_bookmark_description" <?php if ($settings['show_bookmark_description'] == 1) {echo "checked";}?>></input>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>Enable favicon support: <?php echo $bookmark_image; ?></td>
|
||||
<td>
|
||||
<input type="checkbox" name="settings_show_bookmark_icon" <?php if ($settings['show_bookmark_icon'] == 1) {echo "checked";}?>></input>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>Show the column with the change date: <?php echo date ("d.m.Y"); ?></td>
|
||||
<td>
|
||||
<input type="checkbox" name="settings_show_column_date" <?php if ($settings['show_column_date'] == 1) {echo "checked";}?>></input>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>Date format:</td>
|
||||
<td>
|
||||
<select name="settings_date_format">
|
||||
<?php
|
||||
foreach ($date_formats as $format_key => $format) {
|
||||
echo '<option value="'.$format_key.'"';
|
||||
if ($settings['date_format'] == $format_key) {echo ' selected';}
|
||||
echo '>'.date ($format)."</option>\n";
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>Show the private/public column: <span class="private">private</span></td>
|
||||
<td>
|
||||
<input type="checkbox" name="settings_show_public" <?php if ($settings['show_public'] == 1) {echo "checked";}?>></input>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>Show the column to edit a bookmark: <?php echo $edit_image; ?></td>
|
||||
<td>
|
||||
<input type="checkbox" name="settings_show_column_edit" <?php if ($settings['show_column_edit'] == 1) {echo "checked";}?>></input>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>Show the column to move a bookmark: <?php echo $move_image; ?></td>
|
||||
<td>
|
||||
<input type="checkbox" name="settings_show_column_move" <?php if ($settings['show_column_move'] == 1) {echo "checked";}?>></input>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>Show the column to delete a bookmark: <?php echo $delete_image; ?></td>
|
||||
<td>
|
||||
<input type="checkbox" name="settings_show_column_delete" <?php if ($settings['show_column_delete'] == 1) {echo "checked";}?>></input>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>Collapse tree when clicking on folder icon: <?php echo $minus . $folder_opened; ?></td>
|
||||
<td>
|
||||
<input type="checkbox" name="settings_fast_folder_minus" <?php if ($settings['fast_folder_minus'] == 1) {echo "checked";}?>></input>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>Expand tree when clicking on folder icon: <?php echo $plus . $folder_opened; ?></td>
|
||||
<td>
|
||||
<input type="checkbox" name="settings_fast_folder_plus" <?php if ($settings['fast_folder_plus'] == 1) {echo "checked";}?>></input>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>Select folder when clicking on plus/minus symbol</td>
|
||||
<td>
|
||||
<input type="checkbox" name="settings_fast_symbol" <?php if ($settings['fast_symbol'] == 1) {echo "checked";}?>></input>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>Allways open just one tree</td>
|
||||
<td>
|
||||
<input type="checkbox" name="settings_simple_tree_mode" <?php if ($settings['simple_tree_mode'] == 1) {echo "checked";}?>></input>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>
|
||||
<input type="submit" value="Apply" name="settings_apply"> <?php echo $message; ?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</td>
|
||||
|
||||
<td style="width: 40%;">
|
||||
<?php
|
||||
if (isset($_SERVER['HTTPS'])) {
|
||||
$scheme = 'https://';
|
||||
}
|
||||
else {
|
||||
$scheme = 'http://';
|
||||
}
|
||||
if (dirname ($_SERVER['SCRIPT_NAME']) == '/') {
|
||||
$path = '';
|
||||
}
|
||||
else {
|
||||
$path = dirname ($_SERVER['SCRIPT_NAME']);
|
||||
}
|
||||
|
||||
$js_url = $scheme . $_SERVER['SERVER_NAME'] . $path;
|
||||
|
||||
?>
|
||||
<p>
|
||||
You can add a button to your browsers "Link Bar" or "Hotlist" so that any homepage
|
||||
can be bookmarked with one click. Title and URL of the current homepage are being preset.
|
||||
Basically you can make Online-Bookmarks behave in two different ways showing its
|
||||
dialog. Either a new window pops up or it shows it in the same window.
|
||||
</p>
|
||||
<p>
|
||||
To show the Online-Bookmarks dialog in a new window, drag this link to the
|
||||
Link Bar.<br>
|
||||
|
||||
<a href="javascript:(function(){bmadd=window.open('<?php echo $js_url; ?>/bookmark_new.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();});})();" title="bookmark">
|
||||
<img src="./images/bookmark.gif" alt="bookmark" title="bookmark">
|
||||
</a><br>
|
||||
</p>
|
||||
<p>
|
||||
To open the Online-Bookmarks dialog in the same window, drag this link to the
|
||||
Link Bar.<br>
|
||||
<a href="javascript:location.href='<?php echo $js_url; ?>/bookmark_add.php?title='+encodeURIComponent(document.title)+'&url='+encodeURIComponent(location.href)" title="bookmark">
|
||||
<img src="./images/bookmark.gif" alt="bookmark" title="bookmark">
|
||||
</a><br>
|
||||
</p>
|
||||
<p>
|
||||
Note that if your browser has a Popup Blocker enabled you might experience difficulties using
|
||||
the upper link.
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<?php
|
||||
require_once (ABSOLUTE_PATH . "footer.php");
|
||||
?>
|
||||
168
shared.php
Normal file
168
shared.php
Normal file
@@ -0,0 +1,168 @@
|
||||
<?php
|
||||
require_once ('./header.php');
|
||||
|
||||
if ($_SESSION['logged_in']) {
|
||||
$user = set_get_string_var ('user', $username);
|
||||
}
|
||||
else {
|
||||
$user = set_get_string_var ('user');
|
||||
}
|
||||
$display_shared = false;
|
||||
?>
|
||||
|
||||
<table class="caption">
|
||||
<tr>
|
||||
<td><span class="caption"><img src="./images/logo.png" alt=""> Shared Bookmarks</span>
|
||||
</td>
|
||||
|
||||
<td class="captionright">
|
||||
<div><?php object_count (); ?></div>
|
||||
<div><?php print_footer (); ?></div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
<table class="main">
|
||||
<tr>
|
||||
<td class="main1">
|
||||
<table class="menu">
|
||||
<tr>
|
||||
<th class="menuhead">Bookmarks</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="menu">
|
||||
<a href="./index.php">My Bookmarks</a><br>
|
||||
<a href="./shared.php">Shared Bookmarks</a><br>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<br>
|
||||
|
||||
<table class="menu">
|
||||
<tr>
|
||||
<th class="menuhead">Tools</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="menu">
|
||||
<?php if (admin_only ()) { ?>
|
||||
<a href="./admin.php">Admin</a><br>
|
||||
<?php } ?>
|
||||
<a href="./import.php">Import</a><br>
|
||||
<a href="./export.php">Export</a><br>
|
||||
<a href="./sidebar.php">View as Sidebar</a><br>
|
||||
<a href="./settings.php">Settings</a><br>
|
||||
<a href="javascript:chpw()">Change Password</a><br>
|
||||
<?php
|
||||
if (isset ($_SESSION['logged_in']) && $_SESSION['logged_in']) {
|
||||
$link = '<a href="./index.php?logout=1">Logout</a>';
|
||||
}
|
||||
else {
|
||||
$link = '<a href="./index.php">Login</a>';
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
<?php echo $link; ?><br>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<td class="">
|
||||
<img src="./images/spacer.gif" alt="" class="main2">
|
||||
</td>
|
||||
<td class="main4">
|
||||
|
||||
<?php
|
||||
if (isset ($_GET['user']) && check_username ($user)) {
|
||||
?>
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<div style="height: <?php echo $table_height; ?>; width: 400px; overflow:auto;">
|
||||
|
||||
<?php
|
||||
require_once (ABSOLUTE_PATH . "folders.php");
|
||||
$tree = & new folder ($user);
|
||||
$tree->make_tree (0);
|
||||
$tree->print_tree ();
|
||||
?>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
<td style="width: 100%;">
|
||||
<div style="height: <?php echo $table_height; ?>; width: 100%; overflow:auto;">
|
||||
|
||||
<?php
|
||||
require_once (ABSOLUTE_PATH . "bookmarks.php");
|
||||
$query = sprintf ("SELECT title, url, description, UNIX_TIMESTAMP(date) AS timestamp, id, favicon
|
||||
FROM bookmark
|
||||
WHERE user='%s'
|
||||
AND childof='%d'
|
||||
AND deleted!='1'
|
||||
AND public='1'
|
||||
ORDER BY title",
|
||||
$mysql->escape ($user),
|
||||
$mysql->escape ($folderid));
|
||||
|
||||
if ($mysql->query ($query)) {
|
||||
$bookmarks = array ();
|
||||
while ($row = mysql_fetch_assoc ($mysql->result)) {
|
||||
array_push ($bookmarks, $row);
|
||||
}
|
||||
list_bookmarks ($bookmarks,
|
||||
false,
|
||||
false,
|
||||
$settings['show_bookmark_icon'],
|
||||
true,
|
||||
$settings['show_bookmark_description'],
|
||||
$settings['show_column_date'],
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
false);
|
||||
}
|
||||
else {
|
||||
message ($mysql->error);
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<?php
|
||||
}
|
||||
else {
|
||||
$query = "SELECT user, SUM(bookmarks) AS bookmarks, SUM(folders) AS folders FROM (
|
||||
SELECT user, 1 AS bookmarks, 0 AS folders FROM bookmark WHERE public='1' AND deleted!='1'
|
||||
UNION ALL
|
||||
SELECT user, 0 AS bookmarks , 1 AS folders FROM folder WHERE public='1' AND deleted!='1'
|
||||
) AS tmp GROUP BY user";
|
||||
|
||||
if ($mysql->query ($query)) {
|
||||
echo '<div style="height: ' . $table_height . '; width: 100%; padding-left: 20px;">' . "\n";
|
||||
while ($row = mysql_fetch_object ($mysql->result)) {
|
||||
echo '<p><a href="' . $_SERVER['SCRIPT_NAME'] . '?user=' . $row->user . '&folderid=0"><b>' . $row->user . "</b><br>\n";
|
||||
echo "Shares $row->folders Folders and $row->bookmarks Bookmarks</a></p>\n";
|
||||
}
|
||||
echo "</div>";
|
||||
}
|
||||
else {
|
||||
message ($mysql->error);
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<?php
|
||||
require_once (ABSOLUTE_PATH . "footer.php");
|
||||
?>
|
||||
156
sidebar.php
Normal file
156
sidebar.php
Normal file
@@ -0,0 +1,156 @@
|
||||
<?php
|
||||
define ("ABSOLUTE_PATH", dirname (__FILE__) . "/");
|
||||
require_once (ABSOLUTE_PATH . "lib/webstart.php");
|
||||
require_once (ABSOLUTE_PATH . "config/config.php");
|
||||
require_once (ABSOLUTE_PATH . "lib/mysql.php");
|
||||
$mysql = & new mysql;
|
||||
require_once (ABSOLUTE_PATH . "lib/auth.php");
|
||||
$auth = & new Auth;
|
||||
require_once (ABSOLUTE_PATH . "lib/lib.php");
|
||||
require_once (ABSOLUTE_PATH . "lib/login.php");
|
||||
|
||||
class sidebar {
|
||||
function sidebar () {
|
||||
# collect the folder data
|
||||
require_once (ABSOLUTE_PATH . "folders.php");
|
||||
$this->tree = & new folder;
|
||||
$this->tree->folders[0] = array ('id' => 0, 'childof' => null, 'name' => $GLOBALS['settings']['root_folder_name']);
|
||||
|
||||
global $username, $mysql;
|
||||
|
||||
$this->counter = 0;
|
||||
|
||||
# collect the bookmark data
|
||||
$query = sprintf ("SELECT title, url, description, childof, id, favicon
|
||||
FROM bookmark
|
||||
WHERE user='%s'
|
||||
AND deleted!='1' ORDER BY title",
|
||||
$mysql->escape ($username));
|
||||
|
||||
if ($mysql->query ($query)) {
|
||||
while ($row = mysql_fetch_assoc ($mysql->result)) {
|
||||
if (!isset ($this->bookmarks[$row['childof']])) {
|
||||
$this->bookmarks[$row['childof']] = array ();
|
||||
}
|
||||
array_push ($this->bookmarks[$row['childof']], $row);
|
||||
}
|
||||
}
|
||||
else {
|
||||
message ($mysql->error);
|
||||
}
|
||||
}
|
||||
|
||||
function make_tree ($folderid) {
|
||||
if (isset ($this->tree->children[$folderid])) {
|
||||
$this->counter++;
|
||||
foreach ($this->tree->children[$folderid] as $value) {
|
||||
$this->print_folder ($value);
|
||||
$this->make_tree ($value);
|
||||
$this->print_folder_close ($value);
|
||||
}
|
||||
$this->counter--;
|
||||
}
|
||||
$this->print_bookmarks ($folderid);
|
||||
}
|
||||
|
||||
function print_folder ($folderid) {
|
||||
echo str_repeat (" ", $this->counter) . '<li class="closed"><img src="./jquery/images/folder.gif" alt=""> ' . $this->tree->folders[$folderid]['name'] . "\n";
|
||||
if (isset ($this->tree->children[$folderid]) || isset ($this->bookmarks[$folderid])) {
|
||||
echo str_repeat (" ", $this->counter + 1) . "<ul>\n";
|
||||
}
|
||||
}
|
||||
|
||||
function print_folder_close ($folderid) {
|
||||
if (isset ($this->tree->children[$folderid]) || isset ($this->bookmarks[$folderid])) {
|
||||
echo str_repeat (" ", $this->counter + 1) . "</ul>\n";
|
||||
}
|
||||
echo str_repeat (" ", $this->counter) . "</li>\n";
|
||||
}
|
||||
|
||||
function print_bookmarks ($folderid) {
|
||||
$spacer = str_repeat (" ", $this->counter);
|
||||
if (isset ($this->bookmarks[$folderid])) {
|
||||
foreach ($this->bookmarks[$folderid] as $value) {
|
||||
if ($value['favicon'] && is_file ($value['favicon'])) {
|
||||
$icon = '<img src="' . $value['favicon'] . '" width="16" height="16" border="0" alt="">';
|
||||
}
|
||||
else {
|
||||
$icon = '<img src="./jquery/images/file.gif" alt="">';
|
||||
}
|
||||
echo $spacer . ' <li><a href="' . $value['url'] . '" target="_blank">' . $icon . " " . $value['title'] . "</a></li>\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
<head>
|
||||
|
||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
||||
<title>Online-Bookmarks</title>
|
||||
<link rel="stylesheet" type="text/css" href="./style.css">
|
||||
|
||||
<script src="./jquery/jquery.js" type="text/javascript"></script>
|
||||
<script src="./jquery/jquery.treeview.js" type="text/javascript"></script>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function(){
|
||||
$("#browser").Treeview();
|
||||
});
|
||||
</script>
|
||||
<style type="text/css">
|
||||
html, body {height:100%; margin: 0; padding: 0; }
|
||||
|
||||
html>body {
|
||||
font-size: 16px;
|
||||
font-size: 68.75%;
|
||||
} /* Reset Base Font Size */
|
||||
|
||||
body {
|
||||
font-family: Verdana, helvetica, arial, sans-serif;
|
||||
font-size: 68.75%;
|
||||
background: #fff;
|
||||
color: #333;
|
||||
padding-left: 20px;
|
||||
} /* Reset Font Size */
|
||||
|
||||
.treeview, .treeview ul {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
.treeview li {
|
||||
margin: 0;
|
||||
padding: 3px 0pt 3px 16px;
|
||||
}
|
||||
|
||||
ul.dir li { padding: 2px 0 0 16px; }
|
||||
|
||||
.treeview li { background: url(./jquery/images/tv-item.gif) 0 0 no-repeat; }
|
||||
.treeview .collapsable { background-image: url(./jquery/images/tv-collapsable.gif); }
|
||||
.treeview .expandable { background-image: url(./jquery/images/tv-expandable.gif); }
|
||||
.treeview .last { background-image: url(./jquery/images/tv-item-last.gif); }
|
||||
.treeview .lastCollapsable { background-image: url(./jquery/images/tv-collapsable-last.gif); }
|
||||
.treeview .lastExpandable { background-image: url(./jquery/images/tv-expandable-last.gif); }
|
||||
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<p><a href="./">Back to Online-Bookmarks</a></p>
|
||||
|
||||
<?php
|
||||
|
||||
logged_in_only ();
|
||||
|
||||
$sidebar = & new sidebar;
|
||||
|
||||
echo '<ul id="browser" class="dir">' . "\n";
|
||||
$sidebar->make_tree (0);
|
||||
echo "</ul>\n";
|
||||
|
||||
require_once (ABSOLUTE_PATH . "footer.php");
|
||||
?>
|
||||
176
style.css
Normal file
176
style.css
Normal file
@@ -0,0 +1,176 @@
|
||||
body,input,textarea,option {
|
||||
font-family:verdana;
|
||||
color:#555555;
|
||||
font-size:10pt;
|
||||
}
|
||||
table {
|
||||
border:0px solid black;
|
||||
vertical-align:top;
|
||||
}
|
||||
td {
|
||||
border:0px solid black;
|
||||
vertical-align:top;
|
||||
padding:3px;
|
||||
}
|
||||
img {
|
||||
border: 0px solid #FFFFFF;
|
||||
vertical-align:middle;
|
||||
margin: 0px;
|
||||
}
|
||||
fieldset {
|
||||
padding: 10px;
|
||||
margin: 10px;
|
||||
}
|
||||
a {
|
||||
color:#555555;
|
||||
text-decoration:none;
|
||||
}
|
||||
|
||||
/* The Links */
|
||||
a.f {
|
||||
color:#555555;
|
||||
text-decoration:none;
|
||||
}
|
||||
a:hover.f {
|
||||
color:#000000;
|
||||
text-decoration:none;
|
||||
}
|
||||
a:visited {
|
||||
text-decoration:none;
|
||||
}
|
||||
a:active {
|
||||
text-decoration:none;
|
||||
}
|
||||
a:hover {
|
||||
color:#AE1A1A;
|
||||
text-decoration:underline;
|
||||
}
|
||||
|
||||
|
||||
input.invisible {
|
||||
visibility:hidden;
|
||||
background-color:#FFFFFF;
|
||||
border:1px solid #FFFFFF;
|
||||
font:1pt Verdana;
|
||||
color:#FFFFFF;
|
||||
}
|
||||
p.title {
|
||||
font-weight:bold;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
This is for the caption table
|
||||
*/
|
||||
table.caption {
|
||||
border: 1px solid black;
|
||||
width: 100%;
|
||||
margin-top: 10px;
|
||||
background-image:url(./images/background.jpg);
|
||||
background-repeat:no-repeat;
|
||||
padding: 5px;
|
||||
background-color:#DADADA;
|
||||
}
|
||||
td.captionright {
|
||||
text-align: right;
|
||||
width: 400px;
|
||||
white-space:nowrap;
|
||||
}
|
||||
span.caption {
|
||||
white-space:nowrap;
|
||||
font-size:16pt;
|
||||
font-weight: bold;
|
||||
padding: 10px;
|
||||
vertical-align:middle;
|
||||
}
|
||||
|
||||
/*
|
||||
This is for the main table content
|
||||
*/
|
||||
table.main {
|
||||
width: 100%;
|
||||
margin-top: 10px;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
td.main1{
|
||||
width: 150px;
|
||||
}
|
||||
td.main2,img.main2 {
|
||||
width: 10px;
|
||||
}
|
||||
td.main3{
|
||||
border: 1px solid black;
|
||||
}
|
||||
td.main4{
|
||||
border: 1px solid black;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
/*
|
||||
This is for the menu table
|
||||
*/
|
||||
table.menu {
|
||||
border: 1px solid black;
|
||||
background-color:#DADADA;
|
||||
width: 150px;
|
||||
border-collapse: collapse;
|
||||
margin: 0px;
|
||||
}
|
||||
th.menuhead {
|
||||
background-color:#969696;
|
||||
border-bottom: 1px solid black;
|
||||
padding: 5px;
|
||||
text-align: left;
|
||||
margin: 0px;
|
||||
}
|
||||
td.menu {
|
||||
padding: 5px;
|
||||
margin: 0px;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
This is for the folders
|
||||
*/
|
||||
span.active {
|
||||
background-color:#C1D2EE;
|
||||
border:1px #316AC5 solid;
|
||||
color:#000000;
|
||||
padding:1px;
|
||||
}
|
||||
|
||||
/*
|
||||
This is for the Bookmarks
|
||||
*/
|
||||
div.description {
|
||||
padding: 2px;
|
||||
}
|
||||
td.ten {
|
||||
width: 10px;
|
||||
}
|
||||
div.private {
|
||||
background-color: #E7FBE9;
|
||||
color: #177F23;
|
||||
text-align: center;
|
||||
}
|
||||
div.public {
|
||||
background-color: #F9E7E9;
|
||||
color: #E42037;
|
||||
text-align: center;
|
||||
}
|
||||
div.private,div.public,div.description,div.date,div.footer {
|
||||
font-size: smaller;
|
||||
font-style: italic;
|
||||
}
|
||||
div.date {
|
||||
white-space:nowrap;
|
||||
}
|
||||
span.private {
|
||||
background-color: #E7FBE9;
|
||||
color: #177F23;
|
||||
font-size: smaller;
|
||||
font-style: italic;
|
||||
}
|
||||
.sh:hover {
|
||||
background-color: #E8E6E6;
|
||||
}
|
||||
Reference in New Issue
Block a user