1
0

Added header above bookmarks in order to sort by name or date.

This commit is contained in:
Stefan Frech
2008-06-10 19:45:39 +00:00
committed by Jonas Kattendick
parent d564552f05
commit 53c9c035c4
7 changed files with 54 additions and 13 deletions

View File

@@ -21,7 +21,7 @@ function list_bookmarks ($bookmarks, $show_checkbox, $show_folder, $show_icon, $
$tree = & new folder;
}
echo '<form name="bookmarks" action="">' . "\n";
echo '<form name="bookmarks" action="" class="nav">' . "\n";
foreach ($bookmarks as $value) {
echo '<div class="bookmark">' . "\n";

BIN
images/ascending.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 82 B

BIN
images/descending.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 82 B

View File

@@ -3,6 +3,7 @@ require_once ("./header.php");
logged_in_only ();
$search = set_get_string_var ('search');
$order = set_get_order ();
if ($search != '') {
$search_mode = true;
}
@@ -10,6 +11,7 @@ else {
$search_mode = false;
}
?>
<h1 id="caption"><?php echo $username; ?>&#039;s Online Bookmarks</h1>
@@ -71,7 +73,7 @@ else {
<div style="height: <?php echo $table_height; ?>; overflow:auto;">
<div class="bookmark">
<a class="f" href="./index.php?expand=&folderid=0#0"><img src="./images/folder_open.gif" alt=""> My Bookmarks</a>
<a class="f" href="./index.php"><img src="./images/folder_open.gif" alt=""> My Bookmarks</a>
</div>
<?php
@@ -115,7 +117,8 @@ else {
<?php else: ?>
<!-- Folders starts here. -->
<div id="folders" style="width: <?php echo $column_width_folder; ?>; height: <?php echo $table_height; ?>;">
<div class="folders" style="width: <?php echo $column_width_folder; ?>; height: <?php echo $table_height; ?>;">
<?php
require_once (ABSOLUTE_PATH . "folders.php");
@@ -128,16 +131,36 @@ else {
</div>
<!-- Bookmarks starts here. -->
<div id="bookmarks" style="height: <?php echo $table_height; ?>;">
<div class="bookmarks" style="height: <?php echo $table_height; ?>;">
<div class="bookmarkcaption" style="background-color: #bbb;">
<div class="bmleft">
<input class="link" type="checkbox">
<img src="./images/bookmark_image.gif" alt="" class="invisible">
</div>
<div class="bmright">
<span class="date">
<a href="./index.php?expand=<?php echo implode(",", $expand); ?>&folderid=<?php echo $folderid; ?>&order=date" class="f">Date <img src="./images/ascending.gif" alt="">
</span>
<img src="./images/edit.gif" alt="" class="invisible">
<img src="./images/move.gif" alt="" class="invisible">
<img src="./images/delete.gif" alt="" class="invisible">
</div>
<div class="link">
<a href="./index.php?expand=<?php echo implode(",", $expand); ?>&folderid=<?php echo $folderid; ?>" class="f">Name <img src="./images/ascending.gif" alt=""></a>
</div>
</div>
<?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",
ORDER BY $order",
$mysql->escape ($username),
$mysql->escape ($folderid));

View File

@@ -172,6 +172,22 @@ function set_get_noconfirm () {
return $return;
}
function set_get_order () {
if (!isset ($_GET['order']) || $_GET['order'] == '') {
$return = "title";
}
else if ($_GET['order'] == 'date') {
$return = 'date';
}
else if ($_GET['order'] == 'title') {
$return = 'title';
}
else {
$return = 'title';
}
return $return;
}
/*
* Verify some POST variables
*/
@@ -265,8 +281,6 @@ function set_post_browser () {
return input_validation ($return);
}
#########################################################
###

View File

@@ -58,7 +58,7 @@ if (isset ($_GET['user']) && check_username ($user)) {
<!-- Folders starts here. -->
<div id="folders" style="width: <?php echo $column_width_folder; ?>; height: <?php echo $table_height; ?>;">
<div class="folders" style="width: <?php echo $column_width_folder; ?>; height: <?php echo $table_height; ?>;">
<?php
require_once (ABSOLUTE_PATH . "folders.php");
@@ -71,7 +71,7 @@ if (isset ($_GET['user']) && check_username ($user)) {
</div>
<!-- Bookmarks starts here. -->
<div id="bookmarks" style="height: <?php echo $table_height; ?>;">
<div class="bookmarks" style="height: <?php echo $table_height; ?>;">
<?php
require_once (ABSOLUTE_PATH . "bookmarks.php");

View File

@@ -82,7 +82,7 @@ ul.nav a:visited {
text-decoration: none;
}
ul.nav a:hover {
text-decoration: underline;
text-decoration: none;
color: #AE1A1A;
background-color: #ddd;
}
@@ -94,7 +94,7 @@ form.nav {
}
/* Folders section */
div#folders {
div.folders {
float: left;
overflow: auto;
}
@@ -122,7 +122,7 @@ span.active {
}
/* Bookmarks section */
div#bookmarks {
div.bookmarks {
overflow:auto;
padding: 0px;
display: block;
@@ -130,7 +130,10 @@ div#bookmarks {
}
div.bookmark {
border-bottom: 1px solid #bbb;
padding: 2px;
padding: 4px;
}
div.bookmarkcaption {
padding: 2px 2px 2px 4px;
}
div.bookmark:hover {
background-color: #eee;
@@ -174,6 +177,7 @@ input.link {
div#main {
margin-left: 140px;
border: 1px solid #bbb;
margin-bottom: 10px;
}
div#content {
margin: 10px;