Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Changing more2.html to /2/index.html

Quote Reply
Changing more2.html to /2/index.html
 
Hi, Wondering if this is possable.

Im trying to figure a way of changing the next pages from more2.html to /2/index.html - referencing them using <%next_span%>

Going through Build.pm I see the functions listed here:

Code:
# If we are spanning pages, figure out toolbars and such.
if ($CFG->{build_span_pages}) {
my $lpp = $CFG->{build_links_per_page};
my $nh = $opts->{nh};
my $url = $CFG->{build_root_url} . "/" . $clean_name;
$display{next} = $display{prev} = "";
if ($numlinks > ($nh * $lpp)) {
$display{next} = $url . "/more" . ($nh+1) . "$CFG->{build_extension}";
}
if ($nh == 2) {
$display{prev} = $url . "/" . $CFG->{build_index};
}
elsif ($nh > 2) {
$display{prev} = $url . "/more" . ($nh-1) . "$CFG->{build_extension}";
}
$display{'next_span'} = build ('toolbar', { url => $url, numlinks => $numlinks, nh => $nh}) if ($display{next} or $display{prev});
}

return Links::SiteHTML::display ('category', \%display);
}

and the Altavista style toolbar:

Code:
sub build_toolbar {
# --------------------------------------------------------
# Create an Altavista style toolbar for the next and previous pages.
#
my $opts = shift;

my $root_url = $opts->{url};
my $first_url = $opts->{first_url} || ($root_url . '/' . $CFG->{build_index});
my $next_url = $opts->{next_url} || ($root_url . '/more');
my $numhits = $opts->{numlinks};
my $nh = $opts->{nh};
my $maxhits = $opts->{mh} || $CFG->{build_links_per_page};

my ($next_hit, $prev_hit, $left, $right, $upper, $lower, $url, $i);
$next_hit = $nh + 1;
$prev_hit = $nh - 1;

Have updated the top set of code like this:

$display{next} = $url . "/" . ($nh+1) . "/$CFG->{build_extension}";

Which isn't working - so i figure there are other places where i need to update where /more is set?

thanks for your help.

Charlie



Comedy Quotes - Glinks 3.3.0, PageBuilder, StaticURLtr, CAPTCHA, User_Edit_Profile

Quote Reply
Re: [Chas-a] Changing more2.html to /2/index.html In reply to
Rather than modifying the code, and if you have access to mod_rewrite, then you may consider a rewrite rule that will work it out, and link to the normal ones...i.e.

Reference/more2.html

to

Reference/2/index.html

It should be pretty easy... just get the category folder, grab the digit in the 'next' page, and then print the page number (i.e 2), and then index.html.

I'm afraid my knowledge of mod_rewrite isn't that great. I can install them fine, but when it comes to writing them, I wouldn't have a clue Crazy

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Changing more2.html to /2/index.html In reply to
 
Hi Andy,

Gave that a try and for some reason I can't parse static pages with mod_rewrite...

RewriteEngine on
Options All
RewriteBase /
RewriteRule ^dirname/([^./]+)/([0-9]+)/?$ $1/more$2.html [L]

Returns a 404.

Also the dynamic version deosn't seem to be able to handle uri encoding eg.

RewriteRule ^dirname/([^./]+)/([0-9]+)/?$ cgi-bin/page.cgi?g=$1%2Fmore$2.html [L]

Returns a LinksSQL error page: No category called thiscatnameFmore2.html

Tried without the encoded forward slash but LinksSQL can't parse this? eg.

RewriteRule ^dirname/([^./]+)/([0-9]+)/?$ cgi-bin/page.cgi?g=$1/more$2.html [L]

I see mod_rewrite should be able to handle encoded info using escape and unescape - any idear?

Im on Apache/1.3.27.

thanks,



Comedy Quotes - Glinks 3.3.0, PageBuilder, StaticURLtr, CAPTCHA, User_Edit_Profile

Quote Reply
Re: [Chas-a] Changing more2.html to /2/index.html In reply to
Afraid I can't be of much help. Maybe Alex / yogi, or someone with a bit more mod_rewrite knowledge could shed some light?

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Changing more2.html to /2/index.html In reply to
 
np Andy, hopfully either Alex or yogi will spot this post in the next few days and be able to comment.



Comedy Quotes - Glinks 3.3.0, PageBuilder, StaticURLtr, CAPTCHA, User_Edit_Profile