Gossamer Forum
Home : Products : Gossamer Links : Development, Plugins and Globals :

Re: [Payooo] PageBuilder to generate users pages...

Quote Reply
Re: [Payooo] PageBuilder to generate users pages... In reply to
Hi,

The span global above is really for use with pages like

page.cgi?p=list

where you have a new template called list.html. (You can use it on other pages - just takes a bit of modification).

To get the span, copy the global and call it span_pages and then where you want the span in the template <%span_pages%>

Near the top of the page (above the span) you'll need

<%ifnot nh%><%set nh=1%><%endif%>


Optional tags:

<%set maxhits=10%> - or what ever number of links you want per page (you can just set this in the global - but this means you can use the span global for different lists with different numbers of records per page).

<%set numhits=100%> - again you can set this in the global. You may want to look up the exact number of records in the global rather than using a fixed number.


You should be able to use this straight away and get a span list with the correct number of pages - try it and see - if you don't let me know, I may have missed out something.

The next problem is to get the correct links/records on each page.

This is where you need another global which selects the links/records. In the global you need to make sure that you have these lines:

my $tags = shift;
my $db = $DB->table ('Links'); #or whichever table you are taking records from
my $nh = $tags->{nh}||1;
my $mh = $tags->{maxhits}||15; #Make sure this matches the value you're using in the span global
my $offset = ($nh-1) * $mh;
$db->select_options ("ORDER BY Fieldname DESC", "LIMIT $offset, $mh");

I hope that helps a bit.

Laura.
The UK High Street
Subject Author Views Date
Thread PageBuilder to generate users pages... katabd 5393 Aug 8, 2003, 2:22 PM
Thread Re: [katabd] PageBuilder to generate users pages...
afinlr 5298 Aug 8, 2003, 2:51 PM
Thread Re: [afinlr] PageBuilder to generate users pages...
katabd 5283 Aug 9, 2003, 8:20 PM
Thread Re: [katabd] PageBuilder to generate users pages...
afinlr 5271 Aug 10, 2003, 4:33 AM
Post Re: [afinlr] PageBuilder to generate users pages...
net_wiz 5255 Aug 10, 2003, 2:04 PM
Thread Re: [afinlr] PageBuilder to generate users pages...
Payooo 5293 Aug 10, 2003, 3:31 PM
Thread Re: [Payooo] PageBuilder to generate users pages...
afinlr 5244 Aug 10, 2003, 4:33 PM
Post Re: [afinlr] PageBuilder to generate users pages...
Payooo 5240 Aug 10, 2003, 5:44 PM
Thread Re: [afinlr] PageBuilder to generate users pages...
katabd 5164 Sep 16, 2003, 10:03 PM
Thread Re: [katabd] PageBuilder to generate users pages...
afinlr 5132 Sep 17, 2003, 1:46 AM
Thread Re: [afinlr] PageBuilder to generate users pages...
katabd 5125 Sep 17, 2003, 5:51 PM
Post Re: [katabd] PageBuilder to generate users pages...
afinlr 5140 Sep 17, 2003, 5:59 PM
Thread Re: [afinlr] PageBuilder to generate users pages...
Essam 4903 Sep 16, 2004, 10:58 AM
Thread Re: [Essam] PageBuilder to generate users pages...
afinlr 4909 Sep 17, 2004, 4:13 PM
Post Re: [afinlr] PageBuilder to generate users pages...
Jag 4881 Sep 17, 2004, 8:10 PM