diff options
author | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2006-09-15 06:12:52 +0000 |
---|---|---|
committer | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2006-09-15 06:12:52 +0000 |
commit | 063e67887b48ea9ba5570638dcfaf5439f0337da (patch) | |
tree | 6c8e958435d96505408f9dd63e76e038220f16bc /templates | |
parent | b469b70195a92f7087d3b9c15bbc10797e0411a7 (diff) | |
download | ampache-063e67887b48ea9ba5570638dcfaf5439f0337da.tar.gz ampache-063e67887b48ea9ba5570638dcfaf5439f0337da.tar.bz2 ampache-063e67887b48ea9ba5570638dcfaf5439f0337da.zip |
browse by title and page header hotness
Diffstat (limited to 'templates')
-rw-r--r-- | templates/list_header.inc | 47 | ||||
-rw-r--r-- | templates/show_artists.inc | 2 | ||||
-rw-r--r-- | templates/show_songs.inc | 14 | ||||
-rw-r--r-- | templates/sidebar.inc.php | 1 |
4 files changed, 48 insertions, 16 deletions
diff --git a/templates/list_header.inc b/templates/list_header.inc index 488b55f6..1ca08c4c 100644 --- a/templates/list_header.inc +++ b/templates/list_header.inc @@ -31,25 +31,24 @@ if (!$total_items) { $total_items = $_SESSION['view_total_items']; } // do some math here -if ($view->offset >= $view->offset_limit) { - $offset2 = $view->offset - 25; +if ($GLOBALS['view']->offset >= $GLOBALS['view']->offset_limit) { + $offset2 = $GLOBALS['view']->offset - 25; } else { - $offset2 = $view->offset; - if (!$view->offset) { $offset2 = "0"; } + $offset2 = $GLOBALS['view']->offset; + if (!$GLOBALS['view']->offset) { $offset2 = "0"; } } - // Get the prev page offset -$offset1 = $view->offset - $view->offset_limit; +$offset1 = $GLOBALS['view']->offset - $GLOBALS['view']->offset_limit; if ($offset1 < 1) { $offset1 = 0; } // since we have an array of objects, let's build a purdy thingie -$pages = ceil($total_items/$view->offset_limit); +$pages = ceil($total_items/$GLOBALS['view']->offset_limit); $offset4 = ($pages - 1); -$offset4 = ($offset4 * $view->offset_limit); +$offset4 = ($offset4 * $GLOBALS['view']->offset_limit); //We do this one last to make sure we don't go beyond offset4 -$offset3 = $view->offset + $view->offset_limit; +$offset3 = $GLOBALS['view']->offset + $GLOBALS['view']->offset_limit; if ($offset3 >= $offset4) { $offset3 = $offset4; } @@ -68,19 +67,37 @@ if (($pages > 1) && ($_SESSION['view_script'])) { </td> <td align="center"> <?php + $page_limit = '10'; $counter = 1; $offset_pages = 0; while ($counter <= $pages) { - if ($view->offset == $offset_pages) { - ?> <a href="<?php echo $script; ?>?<?php echo $action ; ?>&sort_type=<?php echo $view->sort_type ; ?>&offset=<?php echo $offset_pages ; ?>&keep_view=true"><b><?php echo $counter; ?></b></a> + if ($GLOBALS['view']->offset == $offset_pages) { + ?> <a href="<?php echo $script; ?>?<?php echo $action ; ?>&sort_type=<?php echo $GLOBALS['view']->sort_type ; ?>&offset=<?php echo $offset_pages ; ?>&keep_view=true"><b><?php echo $counter; ?></b></a> <?php } else { ?> - <a href="<?php echo $script; ?>?<?php echo $action; ?>&sort_type=<?php echo $view->sort_type; ?>&offset=<?php echo $offset_pages; ?>&keep_view=true"><?php echo $counter; ?></a> + <a href="<?php echo $script; ?>?<?php echo $action; ?>&sort_type=<?php echo $GLOBALS['view']->sort_type; ?>&offset=<?php echo $offset_pages; ?>&keep_view=true"><?php echo $counter; ?></a> <?php - } // end if ($view->offset == $offset_pages) and else - $offset_pages += $view->offset_limit; + } // end if ($GLOBALS['view']->offset == $offset_pages) and else + $offset_pages += $GLOBALS['view']->offset_limit; + if ($counter == $page_limit AND $pages > ($page_limit*2)) { break; } $counter++; - } // end while ($counter <= $pages) ?> + } // end while ($counter <= $pages) + + if ($counter < $pages) { + echo "[.....]"; + $counter = $pages - $page_limit; + while ($counter <= $pages) { + if ($GLOBALS['view']->offset == $offset_pages) { ?> + <a href="<?php echo $script; ?>?<?php echo $action ; ?>&sort_type=<?php echo $GLOBALS['view']->sort_type ; ?>&offset=<?php echo $offset_pages ; ?>&keep_view=true"><b><?php echo $counter; ?></b></a> + <?php } else { ?> + <a href="<?php echo $script; ?>?<?php echo $action; ?>&sort_type=<?php echo $GLOBALS['view']->sort_type; ?>&offset=<?php echo $offset_pages; ?>&keep_view=true"><?php echo $counter; ?></a> + <?php + } // end if ($GLOBALS['view']->offset == $offset_pages) and else + $offset_pages += $GLOBALS['view']->offset_limit; + $counter++; + } // end while ($counter <= $pages) + } // end while if we had to do a second half + ?> </td> <td align="center" valign="top"> <a href="<?php echo $script; ?>?<?php echo $action; ?>&offset=<?php echo $offset3; ?>&keep_view=true">[ <?php echo _("Next"); ?> ]</a> diff --git a/templates/show_artists.inc b/templates/show_artists.inc index c0bd8510..074bdf5a 100644 --- a/templates/show_artists.inc +++ b/templates/show_artists.inc @@ -32,7 +32,7 @@ $total_items = $view->total_items; <table class="border" cellspacing="0" cellpadding="0" border="0"> <tr class="even" align="center"> <td colspan="5"> - <?php if ($view->offset_limit) { require (conf('prefix') . "/templates/list_header.inc"); } ?> + <?php if ($GLOBALS['view']->offset_limit) { require (conf('prefix') . "/templates/list_header.inc"); } ?> </td> </tr> <tr class="table-header"> diff --git a/templates/show_songs.inc b/templates/show_songs.inc index 7d2c5620..09ebc31a 100644 --- a/templates/show_songs.inc +++ b/templates/show_songs.inc @@ -30,6 +30,13 @@ if (is_object($playlist) && ($GLOBALS['user']->username == $playlist->user || $G ?> <form id="songs" method="post" enctype="multipart/form-data" action="#" style="Display:inline;"> <table class="border" cellspacing="0" cellpadding="0" border="0"> +<?php if (is_object($GLOBALS['view'])) { ?> +<tr class="even" align="center"> + <td colspan="12"> + <?php if ($GLOBALS['view']->offset_limit) { require (conf('prefix') . "/templates/list_header.inc"); } ?> + </td> +</tr> +<?php } ?> <tr class="table-header"> <th> <a href="#" onclick="check_songs(); return false;">Select</a></th> <?php if ($playlist_owner) { ?> @@ -160,6 +167,13 @@ $num = count($song_ids); <td></td> <td colspan="2"></td> </tr> +<?php if (is_object($GLOBALS['view'])) { ?> +<tr class="even" align="center"> + <td colspan="12"> + <?php if ($GLOBALS['view']->offset_limit) { require (conf('prefix') . "/templates/list_header.inc"); } ?> + </td> +</tr> +<?php } ?> </table> <p class="header2"><?php echo _('** Indicates flagged songs'); ?></p> <br /> diff --git a/templates/sidebar.inc.php b/templates/sidebar.inc.php index 5449baef..5f5fdde1 100644 --- a/templates/sidebar.inc.php +++ b/templates/sidebar.inc.php @@ -36,6 +36,7 @@ $admin_items[] = array('title'=>_('Modules'),'url'=>'admin/modules.php','active' $browse_items[] = array('title'=>_("Albums"),'url'=>'albums.php','active'=>$location['page']); $browse_items[] = array('title'=>_("Artists"),'url'=>'artists.php','active'=>$location['page']); $browse_items[] = array('title'=>_("Genre"),'url'=>'browse.php?action=genre','active'=>$location['page']); +$browse_items[] = array('title'=>_('Song Title'),'url'=>'browse.php?action=song_title','active'=>$location['page']); $browse_items[] = array('title'=>_("Lists"),'url'=>'browse.php','active'=>$location['page']); //$browse_items[] = array('title'=>'File','url'=>'files.php','active'=>''); <!--pb1dft: this can be cleaned up --> |