Hi all,
Im trying to add the page viewed numbers on the category page.
i.e: Links: 1-10 of 50 , Links: 11-20 of 50 etc...
and also i want to add the page number .
i.e: Page:1 , Page:2 etc...
I found one GLOBAL posted by SeanP that almost worked for me, heres the global:
my $tags = shift;
my $total = $tags->{total};
my $high = $Links::CFG->{build_links_per_page};
my $low = 1;
my $name = $tags->{Full_Name};
$name =~ s/\//\: /g;
$name =~ s/$name/$name: Page /g;
my $page = $tags->{title};
$page =~ s/$name//g;
if ($page > 1) {
$low = (($page - 1) * $high) + 1;
}else{
$page = 1;
}
my $top = ($high + $low > $total) ? $total : (($high + $low) - 1);
$low =~ s/^([-+]?\d+)(\d{3})/$1,$2/;
$top =~ s/^([-+]?\d+)(\d{3})/$1,$2/;
$total =~ s/^([-+]?\d+)(\d{3})/$1,$2/;
return "$low - $top of $total";
}
But with that global im getting results like (Links: 868017,751 - 50 of 50 instead of Links: 1-10 of 50)
I tryed to play with that global to see if i could get it to work and after a couple of days trying without getting anywhere i decided to ask for help here on the forum.
Since i dont know how to do that by myself, i appreciated if you can help me in anyway.
Also can anyone tell me how can i show only the numbers of links found on the search results page instead of showing all the category and links.
i.e: lets say my search found 130 category and 20 links and im showing 10 links per page i want it to ignore (hide) the category and show only the links like, page:1 2 Next instead of showing everything like Page: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 Next etc...
P.S. Im using LinkSQL 3.0.4
Thanks in advance for any help guys.
Im trying to add the page viewed numbers on the category page.
i.e: Links: 1-10 of 50 , Links: 11-20 of 50 etc...
and also i want to add the page number .
i.e: Page:1 , Page:2 etc...
I found one GLOBAL posted by SeanP that almost worked for me, heres the global:
Code:
sub { my $tags = shift;
my $total = $tags->{total};
my $high = $Links::CFG->{build_links_per_page};
my $low = 1;
my $name = $tags->{Full_Name};
$name =~ s/\//\: /g;
$name =~ s/$name/$name: Page /g;
my $page = $tags->{title};
$page =~ s/$name//g;
if ($page > 1) {
$low = (($page - 1) * $high) + 1;
}else{
$page = 1;
}
my $top = ($high + $low > $total) ? $total : (($high + $low) - 1);
$low =~ s/^([-+]?\d+)(\d{3})/$1,$2/;
$top =~ s/^([-+]?\d+)(\d{3})/$1,$2/;
$total =~ s/^([-+]?\d+)(\d{3})/$1,$2/;
return "$low - $top of $total";
}
But with that global im getting results like (Links: 868017,751 - 50 of 50 instead of Links: 1-10 of 50)
I tryed to play with that global to see if i could get it to work and after a couple of days trying without getting anywhere i decided to ask for help here on the forum.
Since i dont know how to do that by myself, i appreciated if you can help me in anyway.
Also can anyone tell me how can i show only the numbers of links found on the search results page instead of showing all the category and links.
i.e: lets say my search found 130 category and 20 links and im showing 10 links per page i want it to ignore (hide) the category and show only the links like, page:1 2 Next instead of showing everything like Page: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 Next etc...
P.S. Im using LinkSQL 3.0.4
Thanks in advance for any help guys.