1
0

initial version

This commit is contained in:
Stefan Frech
2008-04-20 13:26:26 +00:00
committed by Jonas Kattendick
parent 1a36b5e190
commit dc8236ccb0
29 changed files with 3724 additions and 0 deletions

168
shared.php Normal file
View 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");
?>