Gossamer Forum
Home : Products : Gossamer Links : Discussions :

numbered links and av mod

Quote Reply
numbered links and av mod
Hi,

I managed to get both numbered links and the altavista 1,2,3 [next >>] mods to work with LinksSQL1.1.

Will the same modifications work for LinksSQL2.x? I really want to have numbered links instead of <li>. Surely this is an obvious extension to Alex's great product?

Jeffb

Quote Reply
Re: numbered links and av mod In reply to
Hi,

The mods should be very similiar, you just need to edit Links/Build.pm.

Cheers,

Alex

--
Gossamer Threads Inc.
Quote Reply
Re: numbered links and av mod In reply to
Alex or anyone,

I took a look at the suggestion by Pugdog at this link for numbers in front of the links:
http://www.gossamer-threads.com/...isc&Number=95980

But all the references pugdog makes aren't relevant to LinksSQL 2.x because it is set up differently. I took a look at the files Alex suggests, links.pm/build.pm but they didn't really make any sense to me!

Could some (clever) person take a look and try and work out how you get numbered links.

Let me know. I am happy to help and debug this.

Jeffb

Quote Reply
Re: numbered links and av mod In reply to
April 18, 2001...

Has anyone come up with solutions to this? I want to have numbered links in the Category results. I could use <ol></ol> but I want the numbers to continue on to the next and previous pages, i.e. not 1 to 10 on each page but 1 to 10, 11 to 20 etc.

Any fresh ideas? This thread is very old :-)

Quote Reply
Re: numbered links and av mod In reply to
Anyone had a chance to look at this? I took Alex's advice and looked at Build.pm but the code is different to that in LinksSQL1.x and I found it hard with what to do. I think the bit of code that needs editing is:
Code:
$display{total} = $numlinks = $catlink_db->hits;
while ($link = $sth->fetchrow_hashref) {
$display{links} .= Links::SiteHTML::display ('link', $link);
}
Can anyone else help me? I am surprised that Alex didn't make numbered links a feature?!

JeffB

Quote Reply
Re: numbered links and av mod In reply to
After being away for a week I was upset to see that noone had tried to help me on this. These boards have always been very helpful in the past but I worry that people aren't taking the time to help others nowadays.

JeffB




Quote Reply
Re: numbered links and av mod In reply to
Actually we do nothing BUT help people (well most of the time). We aren't employed by GT and get no payment and are all volunteers, therefore we aren't all able to post solutions 24/7.

If you want immediate assistance then you will need to pay GT or experienced Links SQL users for it.

Paul
Installations:http://wiredon.net/gt/
Support: http://wiredon.net/forum/

Quote Reply
Re: numbered links and av mod In reply to
Damn straight! We are volunteers here and it does take time to respond to Threads. Jeff, I have posted about, hmmm.., let's see, five Threads in the last six or so months, and most of them are NOT answered in the first 24 or even a week after posting...I have to be patient and give it time for people to respond...

Please don't take the following saying the wrong way:

"I've got the smallest violen playing on my thumb and it's playin','my hearts bleeding for ya'." Wink

but, please be more patient...

Thank you.

Regards,

Eliot Lee
Quote Reply
Re: numbered links and av mod In reply to
Hi,

Code:
$display{total} = $numlinks = $catlink_db->hits;
my $count = 0;
while ($link = $sth->fetchrow_hashref) {
$link->{row_num} = $count++;
$display{links} .= Links::SiteHTML::display ('link', $link);
}
And then use <%row_num%>. I think that should do the trick.

Cheers,

Alex

--
Gossamer Threads Inc.
Quote Reply
Re: numbered links and av mod In reply to
Eliot/Paul.

Sorry if I came across as being ungrateful because I never meant to do that. Both of you have helped me in the past and I have really appreciated it.

Eliot when you say "be patient" I assume you mean I need to wait more that 8 weeks?! If you look at my posting then you will see it was on Feb 15.

Anyway, I will try Alex's solution and let you know if it works. But I do think that I have been patient - what do you think? Is 8 weeks long enough?

Thanks for your help.

JeffB

Quote Reply
Re: numbered links and av mod In reply to
Jeff,

The NG version (2.X) of LINKS SQL is leaps and bounds away from 1.X and it has taken many of the users, including pugdog, weeks to understand the inner workings and how the plugin system works...so, while 8 weeks may seem like a long time, it really isn't in terms of overcoming a learning curve of this new advanced application.

Regards,

Eliot Lee
Quote Reply
Re: numbered links and av mod In reply to
Hi Guys,

Hope you are all having a good summer. Just revisiting this old thread because when I finally got around to testing it, I encountered a small problem. Basically Alex's code (below) works fine but when you go to the 2nd page of category or search results the first link is No.1 and not No.11 as it should be.

Code:
$display{total} = $numlinks = $catlink_db->hits;
my $count = 0; actually 1 otherwise first link is 0
while ($link = $sth->fetchrow_hashref) {
$link->{row_num} = $count++;
$display{links} .= Links::SiteHTML::display 'link', $link); }
So how can we get the numbers to "carry over"? For your reference I am using LinksSQL 2.0.3

Let me know what you can do.

Jeff

Quote Reply
Re: numbered links and av mod In reply to
Hi,

I also noticed that you get "tag unknown" on the search results pages. Alex's solution above is very simple and is exactly the same as us <ol> </ol>.

Has anyone got a complete solution?

JeffB

Quote Reply
Re: numbered links and av mod In reply to
Two things...

This all will become moot in the next release.

Using <%loop%> gives you access to <%rownum%> as well as odd/even flags.

To keep the count incrementing from page to page, you'd need to multiply mh by nh and add that to <%rownum%>



PUGDOG® Enterprises, Inc.
FAQ:http://LinkSQL.com/FAQ
Plugins:http://LinkSQL.com/plugin
Quote Reply
Re: numbered links and av mod In reply to
Hi,

Where about in build.pm would this go? Also, regarding this becoming redundant in the next version - I tend to wait 6 months before upgrading so it is worthwile in the meantime.

JeffB

Quote Reply
Re: numbered links and av mod In reply to
Still hoping for someone to crack this one! I have been referring to my Perl books but this is a little over my head Smile. Basically, Alex's solution kind of works but only for category results and it resets on every sub page of results. I need one that counts correctly and will also work on search results.

JeffB

Quote Reply
Re: numbered links and av mod In reply to
Hi,

Give:

Code:
$display{total} = $numlinks = $catlink_db->hits;
my $count = ($args->{nh}-1) * $args->{mh};
while ($link = $sth->fetchrow_hashref) {
$link->{row_num} = $count++;
$display{links} .= Links::SiteHTML::display ('link', $link);
}
a try.

Cheers,

Alex

--
Gossamer Threads Inc.
Quote Reply
Re: numbered links and av mod In reply to
The above would most likely only work on 2.0.4. If you are using an earlier version you may need to adapt it to:

Code:
$display{total} = $numlinks = $catlink_db->hits;
my $count = ($IN->param('nh')-1) * $IN->param('mh');
while ($link = $sth->fetchrow_hashref) {
$link->{row_num} = $count++;
$display{links} .= Links::SiteHTML::display ('link', $link);
}
Cheers,

Alex

--
Gossamer Threads Inc.
Quote Reply
Re: numbered links and av mod In reply to
Alex,

Thanks for your help. This second solution stops the error occurring on the build but the links start at "-1" instead of "1" and still do not carry on over to the 2nd, 3rd pages...

This is weird, I am suprised no-one wants this feature.

JeffB

Quote Reply
Re: [jeffb] numbered links and av mod In reply to
Jeff,

If it's ANY consolation to you, I have this thread bookmarked because I too want this feature. I'm just waiting until someone has offered a solution that has been tested and known to work. I certainly do appreciate the way you're beating these guys up for one. Pirate

Regards,
Quote Reply
Re: [surfsafely] numbered links and av mod In reply to
Ok,

This is just off my head, and not really thought through.

If the links renumber on each page, you need a way to keep incrementing -- ie: the page number or offset passed in.

If it's a page number, you have to multiply by items per page, for each page#-1 (this needs to be 0 based page wise so page 1 has a 0 offset)

If you are using the offset, then you simply add that.

That is part of the scripts, and passed as a tag to the templates, so the next search page can be displayed properly.

When forming the item numbers, simply add that value (the page offset) to the value of the <%loop%> counter, and you'll get what works out to:

previous_offset + current_offset or the number of the link on the page.

If you are on page 4 of a 25 per page listing, 75 links have been displayed previously. previous_offset is now 75. The first link on the page has a loop counter value of 1. Add that to 75 and you have 76. Use that as the link number in the link template.

make sense?

Again, I have not tested it, but these values should be available, or easily caclulated at the start of a template run.

Gee, I can't get this right... the offset on page 4 (which is the page you are working on) will include the total of the links on the current page. This is why you need to caculate the offset value as (page#-1 x links per page). For page 4, that would be (4-1)x25 or 75



PUGDOG� Enterprises, Inc.

The best way to contact me is to NOT use Email.
Please leave a PM here.

Last edited by:

pugdog: Oct 17, 2001, 1:28 PM
Quote Reply
Re: [pugdog] numbered links and av mod In reply to
if you put (i have no idea what the tags are in LinksSql.)
<ol start=<%num%>>
<%links%>
</ol>
then in the links.html file or whatever it is, put <li>
before the link.
Then you would have to make
$num eq one by default. I can't really help past that, but there would be a loop to make spanned pages, and then $num would have $maxhits per page or something added to it each time. So basically the <ol> will work as long as you use <ol start=1>

Just basic suggestions
Lavon Russell
LookHard Mods
lavon@lh.links247.net