1
0

Adjusted order function so that arrow changes direction when changing order

This commit is contained in:
Stefan Frech
2008-08-01 08:11:47 +00:00
committed by Jonas Kattendick
parent 9a1e3a77c2
commit 132a3c4c0d
4 changed files with 34 additions and 7 deletions

View File

@@ -26,3 +26,5 @@
- Changed the look of the footer
- Added sort by Title and Date to bookmarks header
01.08.2008, Version 0.8.13_beta
- Adjusted order function so that arrow changes direction when changing order.

View File

@@ -1 +1 @@
0.8.12_beta
0.8.13_beta

View File

@@ -20,8 +20,31 @@ function list_bookmarks ($bookmarks, $show_checkbox, $show_folder, $show_icon, $
# print the bookmark header if enabled.
# Yes, it's ugly PHP code, but beautiful HTML code.
if ($show_header) {
$order[0] == 'titleasc' ? $sort_t = 'titledesc' : $sort_t = 'titledasc';
$order[0] == 'dateasc' ? $sort_d = 'datedesc' : $sort_d = 'dateasc';
if ($order[0] == 'titleasc') {
$sort_t = 'titledesc';
$img_t = '<img src="./images/ascending.gif" alt="">';
}
else if ($order[0] == 'titledesc') {
$sort_t = 'titleasc';
$img_t = '<img src="./images/descending.gif" alt="">';
}
else {
$sort_t = 'titleasc';
$img_t = '<img src="./images/descending.gif" alt="" class="invisible">';
}
if ($order[0] == 'dateasc') {
$sort_d = 'datedesc';
$img_d = '<img src="./images/ascending.gif" alt="">';
}
else if ($order[0] == 'datedesc') {
$sort_d = 'dateasc';
$img_d = '<img src="./images/descending.gif" alt="">';
}
else {
$sort_d = 'dateasc';
$img_d = '<img src="./images/descending.gif" alt="" class="invisible">';
}
echo '<div class="bookmarkcaption">' . "\n";
if ($show_folder) {
@@ -39,12 +62,12 @@ function list_bookmarks ($bookmarks, $show_checkbox, $show_folder, $show_icon, $
'order' => $sort_d,
);
if (isset ($GLOBALS['user']) && $GLOBALS['user'] != '') {
$query_data ['user'] = $GLOBALS['user'];
$query_data['user'] = $GLOBALS['user'];
}
$query_string = assemble_query_string ($query_data);
echo "\t\t" . '<div class="bmright">' . "\n";
echo "\t\t\t" . '<span class="date">' . "\n";
echo "\t\t\t\t" . '<a href="' . $_SERVER['SCRIPT_NAME'] . '?' . $query_string . '" class="f">Date <img src="./images/ascending.gif" alt=""></a>' . "\n";
echo "\t\t\t\t" . '<a href="' . $_SERVER['SCRIPT_NAME'] . '?' . $query_string . '" class="f">Date ' . $img_d . '</a>' . "\n";
echo "\t\t\t" . '</span>' . "\n";
if ($show_edit) {
echo "\t\t\t" . '<img src="./images/edit.gif" alt="" class="invisible">' . "\n";
@@ -63,7 +86,7 @@ function list_bookmarks ($bookmarks, $show_checkbox, $show_folder, $show_icon, $
}
$query_data ['order'] = $sort_t;
$query_string = assemble_query_string ($query_data);
echo "\t\t\t" . '<a href="' . $_SERVER['SCRIPT_NAME'] . '?' . $query_string . '" class="f">Title <img src="./images/ascending.gif" alt=""></a>' . "\n";
echo "\t\t\t" . '<a href="' . $_SERVER['SCRIPT_NAME'] . '?' . $query_string . '" class="f">Title ' . $img_t . '</a>' . "\n";
echo "\t\t" . '</div>' . "\n";
echo "\t" . '</div>' . "\n\n";
}

View File

@@ -16,6 +16,8 @@ else {
$title = "Shared Online-Bookmarks";
}
$order = set_get_order ();
?>
<h1 id="caption"><?php echo $title; ?></h1>
@@ -82,7 +84,7 @@ if (isset ($_GET['user']) && check_username ($user)) {
AND childof='%d'
AND deleted!='1'
AND public='1'
ORDER BY title",
ORDER BY $order[1]",
$mysql->escape ($user),
$mysql->escape ($folderid));