Gossamer Forum
Quote Reply
next_span global example
  
Hi,

Using yogi's next_span global im hoping to change the end of the page set URL's.

ATM the global add's on a class for CSS styling of links:

Code:
sub {
# next_span_rating
my $next_span = shift;
$next_span =~ s,(href=".+?"),$1 class="my_class",g;
return $next_span;
}

which outputs:

<a href="http://www.somesite.com/somepage/" class="my_class">1</a>
2
<a href="http://www.somesite.com/somepage/more3.php" class="my_class">3</a>
etc.


What's im hoping to do is using Mod_rewrite add a Sort by option for the category pages, example:

<a href="http://www.somesite.com/somepage/rating/">1</a>
2
<a href="http://www.somesite.com/somepage/more3.php/rating/">3</a>
etc.

The example URL's work great when you test them but how would I go about changing that global to add on a /rating/ at the end of the h ref attribute?

thanks for your help,


CHarlie



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

Last edited by:

Chas-a: Aug 13, 2004, 7:59 AM
Quote Reply
Re: [Chas-a] next_span global example In reply to
Figured it out, did a Google search for perl replace string Cool

Code:
sub {
# next_span_rating
my $next_span = shift;
$next_span =~ s,">,/rating/">,g;
return $next_span;
}



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