Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#37 2006-10-18 02:12:20

mercury
Member
Registered: 2006-05-12
Posts: 26

Re: smd_random_banner: Random banner image for advertising

it is random banner image. but for a certain circumstances in new 4.0.4 txp the images doesn’t rotate and almost everytime i see the same image on the page. in 4.0.3 all worked fine.

Offline

#38 2006-10-18 21:51:36

mercury
Member
Registered: 2006-05-12
Posts: 26

Re: smd_random_banner: Random banner image for advertising

solved. Send Last-Modified Header in preferences set to “no”

Offline

#39 2006-10-20 07:16:07

Kjeld
Member
From: Tokyo, Japan
Registered: 2005-02-05
Posts: 453
Website

Re: smd_random_banner: Random banner image for advertising

Thanks!


Old Photos of Japan – Japan in the 1850s~1960s (100% txp)
MeijiShowa – Stock photos of Japan in the 1850s~1960s (100% txp)
JapaneseStreets.com – Japanese street fashion (mostly txp)

Offline

#40 2006-10-21 16:09:46

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,447
Website GitHub

Re: smd_random_banner: Random banner image for advertising

Sorry for the delay in replying guys. I thought I was subscribed to the topic but wasn’t, so I didn’t spot your problems until just now.

mercury wrote:

about generating links in v0.15 i suggest to wait for clearing from author

You’re exactly right mercury. I’d made a function so I didn’t have to repeat a large chunk of code and forgot to pass the linkcaption in. I’d also made the same mistake with referer. Dumbass dumbass dumbass. That then had the knock-on effect of breaking the code if you left the caption blank, as you spotted.

sigh that’ll teach me not to check the code in “Testing” or “Debug” mode on a site. Many thanks for putting that right mercury. That’s the 2nd time you’ve bailed me out: I owe you a pint if you’re ever round this way.

My slapdash approach to testing is probably also the reason why I don’t write code for air traffic control :-)

v0.15a is now available that patches these issues. Any more probs, just shout.

Last edited by Bloke (2006-10-21 16:49:05)


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#41 2006-10-21 16:21:46

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,447
Website GitHub

Re: smd_random_banner: Random banner image for advertising

mercury wrote:

it is random banner image. but for a certain circumstances in new 4.0.4 txp the images doesn’t rotate and almost everytime i see the same image on the page. in 4.0.3 all worked fine…
solved. Send Last-Modified Header in preferences set to “no”

Curious. Must admit I haven’t downloaded 4.0.4 yet to check the plugin works ok with it (cf above post about lackadaisical testing!)

If Send Last-Modified Header is going to be on by default in 4.0.4 that will cause a problem because it’s likely to keep using the cached copy. Although it’s a bit of a kludge, the only way I can think to get round this is to add a random nonce value to the image so the URL ‘looks’ different to the server each request.

Not pretty, but maybe I should add a cache-defeat="1" option to future releases which adds something like ?rnd=5289AD6B to the url? Any better ideas?


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#42 2006-10-21 21:45:00

mercury
Member
Registered: 2006-05-12
Posts: 26

Re: smd_random_banner: Random banner image for advertising

adding rnd will cause browser to instantly download the images, each page refresh. (this will increase your traffic and webserver load) i don’t think this is a good idea.

i’d say it will be much better to give a notice of this behavior in 4.0.4 before downloading of plugin. or auto-set “Send Last-Modified Header” directly in db to 0, and surely notify webmaster about that.

Offline

#43 2006-10-21 23:47:41

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,447
Website GitHub

Re: smd_random_banner: Random banner image for advertising

mercury wrote:

adding rnd will cause browser to instantly download the images, each page refresh. (this will increase your traffic and webserver load) i don’t think this is a good idea.

I’d be inclined to agree. Even though the whole point of smd_random_banner is to get a different image each page load, at some point you will likely get a repeat image; and then it would be a Very Good Thing<sup>(TM)</sup> to have the browser recognise this and retrieve the local cached copy for the reasons you state.

i’d say it will be much better to give a notice of this behavior in 4.0.4 before downloading of plugin. or auto-set “Send Last-Modified Header” directly in db to 0, and surely notify webmaster about that.

I’ll go with the former; mainly since I don’t know how to set the Send Last-Modified Header from the code! Also I don’t think it’s very friendly to mess with someone’s settings.

I have placed a brief ‘Troubleshooting’ section in the help file to highlight the possible problem. Must admit I had no problems here with Send Last-Modified Header in either ‘on’ or ‘off’ state: I got a random image every time. Perhaps that is just luck, or down to my browser settings/hoster.

Anyway, I’ve updated the plugin to v0.16 and fixed a few minor v4.0.4 issues. It is backwards compatible with txp v4.0.3. Enjoy.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#44 2006-10-22 00:41:29

Kjeld
Member
From: Tokyo, Japan
Registered: 2005-02-05
Posts: 453
Website

Re: smd_random_banner: Random banner image for advertising

Thanks for the updates, Stef. It appears to be working well.

I use links in the captions and they now have ‘?-bid=[image number]’ added to them on the page where the image is displayed. I can’t remember noticing that in the earlier versions of smd_random_banner. What is the function of this extra code?


Old Photos of Japan – Japan in the 1850s~1960s (100% txp)
MeijiShowa – Stock photos of Japan in the 1850s~1960s (100% txp)
JapaneseStreets.com – Japanese street fashion (mostly txp)

Offline

#45 2006-10-22 01:11:02

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,447
Website GitHub

Re: smd_random_banner: Random banner image for advertising

Kjeld wrote:

I use links in the captions and they now have ‘?-bid=[image number]’ added to them on the page where the image is displayed. I can’t remember noticing that in the earlier versions of smd_random_banner.

That’s because it was broken in v0.15! :-(

What is the function of this extra code?

It allows you to track which banners have been clicked by your visitors. Look in admin->visitor logs and you’ll see the images with the associated bid (“banner id”) of each visitor who clicked on a banner pic. Very useful to track the effectiveness of your adverts and maybe see which ones generate the best response.

If you don’t need the feature, add referer="" as an attribute. If you would like it to say something else instead of ‘bid’, put that in the quotes of the referer option (e.g. referer="clicked").

Hope that helps.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#46 2006-10-22 01:15:05

Kjeld
Member
From: Tokyo, Japan
Registered: 2005-02-05
Posts: 453
Website

Re: smd_random_banner: Random banner image for advertising

I was just going to edit my post above, because I found your explanations for ‘bid’ on the plugin page.

Really sorry for letting you have to repeat yourself.

But thanks for the great service, Stef! It is wonderful to have people like you.


Old Photos of Japan – Japan in the 1850s~1960s (100% txp)
MeijiShowa – Stock photos of Japan in the 1850s~1960s (100% txp)
JapaneseStreets.com – Japanese street fashion (mostly txp)

Offline

#47 2006-10-22 01:31:11

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,447
Website GitHub

Re: smd_random_banner: Random banner image for advertising

Kjeld wrote:

Really sorry for letting you have to repeat yourself.

Hehehe, no probs. Always helps to have re-iterations of individual points in the discussion thread because the 1st post looks really daunting with all that tonne of text in it!

I notice from your profile you speak “cat”. Do you happen to know the cat for “please get off my lap because I’d like to go to bed”?! It’s 2:30am and my cat’s taken up residency on my knees. Despite being curled up semi-asleep, every time I move she digs her claws into my leg or swipes at my face. sigh Guess I’m sleeping in the chair tonight :-D


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#48 2006-10-22 01:39:05

Kjeld
Member
From: Tokyo, Japan
Registered: 2005-02-05
Posts: 453
Website

Re: smd_random_banner: Random banner image for advertising

Bloke wrote:

Hehehe, no probs. Always helps to have re-iterations of individual points in the discussion thread because the 1st post looks really daunting with all that tonne of text in it!

Thanks for the understanding!

I notice from your profile you speak “cat”. Do you happen to know the cat for “please get off my lap because I’d like to go to bed”?! It’s 2:30am and my cat’s taken up residency on my knees. Despite being curled up semi-asleep, every time I move she digs her claws into my leg or swipes at my face. sigh Guess I’m sleeping in the chair tonight :-D

LOL You have one smart cat! Try throwing a pen somewhere in the room. She will think it is food and go for it. And leave a big gap in your leg probably as she jumps off … :)


Old Photos of Japan – Japan in the 1850s~1960s (100% txp)
MeijiShowa – Stock photos of Japan in the 1850s~1960s (100% txp)
JapaneseStreets.com – Japanese street fashion (mostly txp)

Offline

Board footer

Powered by FluxBB