Gossamer Forum
Quote Reply
Page ID
Alex,

Something that I meant to post, and was reminded of in the mods forum, is a page_id.

Because banner rotations require a unique ID, usually numerical, Links should have the internal ability to generate and increment a "page_id" every time it writes out a page.

This way, a 'random' and 'unique' number is passed to the banner advertising, and for people who need multiple banners they can just append a 1,2... to the uses in their HTML.

But, rather than making people do all sorts of hurdles, creating a global variable that is used for _build_ and for any CGI call, and which is incremented by each of the 'write' routines in the program, would solve many, many problems.

I'm sure you see what I'm saying. Search and other dynamic cgi programs can initialize and access the variable (say, with the time) just as any other routine can, so it simply becomes a 'unique' identifier that is different, and incremented each time a page is printed, saved, or returned.

Quote Reply
Re: Page ID In reply to
Hello!

A simple random routine generator is no difficult to have or find. However if this is a part of links SQL, that would be great.

Thanks, Mr. Pataki! YOu sems to be really on the run. Soon may be I may start www.Congratulation.com! Smile

------------------
rajani











Quote Reply
Re: Page ID In reply to
I was planning to do the random number thing with in search.cgi for Links 2 . i use SSI on my categpry pages so i wont need it there.

if you do this thing for Links SQL, i think it wont be hard to implement one for Links 2.


[This message has been edited by Laith (edited September 04, 1999).]
Quote Reply
Re: Page ID In reply to
If you look, I posted a way to get a unique category page and detail page ID in Links 2.0, but you still have to use some other method for the other pages (I use "time").

Quote Reply
Re: Page ID In reply to
Added to the TODO list. =)

Cheers,

Alex
Quote Reply
Re: Page ID In reply to
Try doing:

random => sub { return int rand (10000); }

to the globals list. You can then use <%random%> wherever you like.

Let me know if that works for you!

Cheers,

Alex
Quote Reply
Re: Page ID In reply to
That works, in that it returns a random number, but most advertising programs require the random number to be the same for the IMG and HREF tags, and sometimes for a 3rd tag.

What would have to happen is a 'static' random number... perhaps <%random1%>, <%random2%>, <%random3%>, <%random4%>, etc.

In any single page, each random tag stays the same, so that each <%randomX%. can be used as many times as needed. Couldn't this be dynamically generated using a random[] array?

<%random1%> parses to $random[1]

<%random2%> parses to $random[2]

etc.

Quote Reply
Re: Page ID In reply to
Oh...

And <%random%> would parse to a random number each time it's called.