Adjusted order function so that arrow changes direction when changing order
This commit is contained in:
2
CHANGES
2
CHANGES
@@ -26,3 +26,5 @@
|
|||||||
- Changed the look of the footer
|
- Changed the look of the footer
|
||||||
- Added sort by Title and Date to bookmarks header
|
- 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.
|
||||||
|
|||||||
@@ -20,8 +20,31 @@ function list_bookmarks ($bookmarks, $show_checkbox, $show_folder, $show_icon, $
|
|||||||
# print the bookmark header if enabled.
|
# print the bookmark header if enabled.
|
||||||
# Yes, it's ugly PHP code, but beautiful HTML code.
|
# Yes, it's ugly PHP code, but beautiful HTML code.
|
||||||
if ($show_header) {
|
if ($show_header) {
|
||||||
$order[0] == 'titleasc' ? $sort_t = 'titledesc' : $sort_t = 'titledasc';
|
if ($order[0] == 'titleasc') {
|
||||||
$order[0] == 'dateasc' ? $sort_d = 'datedesc' : $sort_d = 'dateasc';
|
$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";
|
echo '<div class="bookmarkcaption">' . "\n";
|
||||||
if ($show_folder) {
|
if ($show_folder) {
|
||||||
@@ -39,12 +62,12 @@ function list_bookmarks ($bookmarks, $show_checkbox, $show_folder, $show_icon, $
|
|||||||
'order' => $sort_d,
|
'order' => $sort_d,
|
||||||
);
|
);
|
||||||
if (isset ($GLOBALS['user']) && $GLOBALS['user'] != '') {
|
if (isset ($GLOBALS['user']) && $GLOBALS['user'] != '') {
|
||||||
$query_data ['user'] = $GLOBALS['user'];
|
$query_data['user'] = $GLOBALS['user'];
|
||||||
}
|
}
|
||||||
$query_string = assemble_query_string ($query_data);
|
$query_string = assemble_query_string ($query_data);
|
||||||
echo "\t\t" . '<div class="bmright">' . "\n";
|
echo "\t\t" . '<div class="bmright">' . "\n";
|
||||||
echo "\t\t\t" . '<span class="date">' . "\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";
|
echo "\t\t\t" . '</span>' . "\n";
|
||||||
if ($show_edit) {
|
if ($show_edit) {
|
||||||
echo "\t\t\t" . '<img src="./images/edit.gif" alt="" class="invisible">' . "\n";
|
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_data ['order'] = $sort_t;
|
||||||
$query_string = assemble_query_string ($query_data);
|
$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\t" . '</div>' . "\n";
|
||||||
echo "\t" . '</div>' . "\n\n";
|
echo "\t" . '</div>' . "\n\n";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,6 +16,8 @@ else {
|
|||||||
$title = "Shared Online-Bookmarks";
|
$title = "Shared Online-Bookmarks";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$order = set_get_order ();
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<h1 id="caption"><?php echo $title; ?></h1>
|
<h1 id="caption"><?php echo $title; ?></h1>
|
||||||
@@ -82,7 +84,7 @@ if (isset ($_GET['user']) && check_username ($user)) {
|
|||||||
AND childof='%d'
|
AND childof='%d'
|
||||||
AND deleted!='1'
|
AND deleted!='1'
|
||||||
AND public='1'
|
AND public='1'
|
||||||
ORDER BY title",
|
ORDER BY $order[1]",
|
||||||
$mysql->escape ($user),
|
$mysql->escape ($user),
|
||||||
$mysql->escape ($folderid));
|
$mysql->escape ($folderid));
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user