Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

poj's scratchpad

by poj (Priest)
on Jun 12, 2013 at 17:16 UTC ( #1038520=scratchpad: print w/ replies, xml ) Need Help??

#!perl use strict; use CGI; use Data::SpreadPagination; my $q = new CGI; my $pageInfo = Data::SpreadPagination->new({ totalEntries => 1000, entriesPerPage => 8, maxPages => 8, currentPage => $q->param('page'), }); my $first_page = $pageInfo->first_page; my $last_page = $pageInfo->last_page; my $prev_page = $pageInfo->previous_page; my $next_page = $pageInfo->next_page; # create page my $css = do{ local $/="";<DATA> }; print $q->header,$q->start_html(-title=>'title',-style=>{ -code=>$css +}); print qq(<ul class="tsc_pagination tsc_paginationA tsc_paginationA09"> +\n); print qq(<li><a href="?page=1">First</a></li>\n); print qq(<li><a href="?page=$prev_page">Prev</a></li>\n); for my $page ( $pageInfo->pages_in_spread() ){ if (! defined $page){ print qq(<li>&hellip;</li>\n); } elsif ($page == $pageInfo->current_page){ print qq(<li><a href="?page=$page" class="current">$page</a></li>\ +n); } else { print qq(<li><a href="?page=$page">$page</a></li>\n); } } print qq(<li><a href="?page=$next_page">Next</a></li>\n); print qq(<li><a href="?page=$last_page">Last</a></li>\n); print qq(</ul>); print $q->end_html; __DATA__ ul.tsc_pagination { margin:4px 0; padding:0px; height:100%; overflow:hidden; font:12px 'Tahoma'; list-style-type:none; } ul.tsc_pagination li { float:left; margin:0px; padding:0px; margin-left:5px; } ul.tsc_pagination li:first-child { margin-left:0px; } ul.tsc_pagination li a { color:black; display:block; text-decoration:none; padding:7px 10px 7px 10px; } ul.tsc_pagination li a img { border:none; } ul.tsc_paginationA li a { color:#FFFFFF; border-radius:3px; -moz-border-radius:3px; -webkit-border-radius:3px; } ul.tsc_paginationA09 li a { background:#5A7075; background:-moz-linear-gradient(top, #788C90, #5A7075); background:-webkit-gradient(linear, 0 0, 0 100%, from(#788C90), to(# +5A7075)); } ul.tsc_paginationA09 li a:hover, ul.tsc_paginationA09 li a.current { color:#355DDD; background:#DDE8FE; }
Log In?
Username:
Password:

What's my password?
Create A New User
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (4)
As of 2014-09-21 23:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (176 votes), past polls