Gossamer Forum
Home : Products : Gossamer Links : Version 1.x :

random numbers for banners

Quote Reply
random numbers for banners
Hi

I was wondering if someone could give me a clear understanding of how to use the random number <%random%>, feature in Links SQL works for targeting banners. At this point I am using the hyperseek bannermaster script but can't figure out how to target the ads, thought maybe it was able to be done using the random numbers.

Another thought I had was, if banner targeting can't be done with random numbers using bannermaster maybe someone would be interested in installing for me a script that can. I would be quite willing to pay for this service. Please email me if you are interested.

Any help would be very much appreciated. Thanks in advance.



Quote Reply
Re: random numbers for banners In reply to
Hi,

do a search for <%random%> for some hints and helps about 6-7 months ago.

I believe I also posted a few threads with full explanations in the FAQ area about the same time.

I was one of the vocal ones for this feature, and once it came out, have put it to good use in many, many different areas.

BTW... you need to think about it for a minute, since if you need to use the <%random%> tag in more than one place, and have it be the same number, you need to assign it to a variable, and pass it as a tag (hence, the random1, random2, and random3 variables). If you are just using the <%random%> for a single use random number, you'll find that assigned in the %GLOBALS hash, and every time you use it, you'll get a different number (since it's defined as a reference to a sub). All explained in some older threads :)



http://www.postcards.com
FAQ: http://www.postcards.com/FAQ/LinkSQL/

Quote Reply
Re: random numbers for banners In reply to
Thanks for replying to my post. I now have spent hours doing numerous searches, using every variation on the word "random' and cannot find a clear explanation on how to use this feature.
I found this post http://gossamer-threads.com/perl/forum/showflat.pl?ubb=000329:Forum9 but unless I'm missing something it really didn't tell me how to target banners to the different categories. I would very much appreciate if your could direct me to the posts you are referring to.

Thanks again

Quote Reply
Re: random numbers for banners In reply to
Searching can be frustrating, but it can also be very fruitful.

Try generate random.

http://gossamer-threads.com/...ew=&sb=&vc=1

I promise all these perl tid bits will be better organized in the new FAQ, but I want to roll that out with the next version of Links, since that is a "live" test site that is not "mission critial".

http://www.postcards.com
FAQ: http://www.postcards.com/FAQ/LinkSQL/

Quote Reply
Re: random numbers for banners In reply to
Thanks Pugdog for all your help. Unfortunately I am still not getting this concept but will continue looking in the forum and reading all the available information.. BTW could you possibly tell me how to remove the "hits, ratings, and vote" on each link. I would just like the title and description of link visible. Thanks again.

Quote Reply
Re: random numbers for banners In reply to
Just edit the "links.html" template, and/or the "subcategory.html" template and get rid of the tags that insert those values.

As for the random numbers, the thread I pointed you to had the snippets of code you need to add to the HTML_Templates.pm file, and the nph-build.cgi file (depending on routine).

It also showed the "static random" number such as <%random1%> in the category build routine so you can make a link:

<a href = <tag><%random1%> ><img src=<tag><%random1%> > </A>

So that both instances of <%random1%> gave the same value, where as:

<a href = <tag><%random%> ><img src=<tag><%random%> > </A>

each instance of <%random%> was a different value.

Make sense?


http://www.postcards.com
FAQ: http://www.postcards.com/FAQ/LinkSQL/

Quote Reply
Re: random numbers for banners In reply to
To remove those fields from printing...all you have to do is edit the link.html file. If you do not want to use these features, it would entail a lot of code tweaking of the nph-build.cgi script.

Regards,

Eliot Lee

Quote Reply
Re: random numbers for banners In reply to
Hi Pugdog
Thanks once again for your help. Would you believe I looked everywhere for the hit tag except the link.html page..I feel very foolish.
As for the random concept, although its getting a bit clearer, I'm not quite getting it. I can't understand how you would associate it with the individual categories. Would you start with the first category and assign it
<%random1%> and just increase the numbers for each category.

You've been very helpful and I feel that I'm probably wasting your time. I think the simplest way would be to hire someone that actually knows what they are doing and save myself the frustration. Would you be able to recommend someone, or would you be interested yourself?

Barb

Quote Reply
Re: random numbers for banners In reply to
If you look at the forum post referenced above, the $random1, $random2 and $random3 variables are assigned to the $OUT{} hash _EACH_ time through the loop.

These variables are initialized on every pass through the loop, so every category has a new set of random numbers.

you use <%random1%><%page%> (or whatever the "page" tag is). What that does, is use the same random numbers for each category page, but you get 3 different numbers on _each_ page due to the page increments.

To just get a _random_ number, you use <%random%> which is a reference to a sub that generates a random number, so every time that tag is evaluated, a new number appears.

http://www.postcards.com
FAQ: http://www.postcards.com/FAQ/LinkSQL/