Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#49 2006-10-23 12:00:49

lukepermsn
Member
From: london
Registered: 2004-07-15
Posts: 57
Website

Re: smd_random_banner: Random banner image for advertising

hey stef

one more thing … i just realised that using the limit function doesn’t respect anything in the ‘avoid_text’ attribute, hence loads of images i don’t want to appear, basically, are.

what do you think the best approach is to this?

as it is not possible to assign a parent category, that will pick up all sub cats within, i’m having to use the tag on the entire image library, using ‘avoid_text’ to not display certain images…

so i’m guessing one or the other is needed! the limit function to respect ‘avoid_text’, or the ability to use a parent category.

should give you something to think about anyway ;-)

on another note – i’ve been trying to think of a way i can reciprocate all the effort you have put into this plug-in, so was wondering if you’d like me to have a go at the help text, to perhaps make it a little more penetrable? :D

bye for now.
L.


“Absorb what is useful, Discard what is not, Add what is uniquely your own” – Bruce Lee

Offline

#50 2006-10-23 16:02:44

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

Re: smd_random_banner: Random banner image for advertising

lukepermsn wrote:

one more thing … i just realised that using the limit function doesn’t respect anything in the ‘avoid_text’ attribute, hence loads of images i don’t want to appear, basically, are.

Oo-er, does it? Must admit I can’t get it to misbehave here. I’m using:

<txp:smd_random_banner category="mugshot" avoid_text="?,stef" limit="6" />

and it’s ignoring any pics that have my name and/or the section name in the filename. Also works with use_alt="1" : if I put my name and/or the name of the section in the alt text somewhere, it ignores those images. Do you have a specific example of a tag I can try and emulate over here to figure out where it’s falling over? You’re using the latest v0.16 right? 0.15 was unfortunately brain damaged and may well exhibit the behaviour you describe :-(

as it is not possible to assign a parent category, that will pick up all sub cats within…

Guess I’ll have to get my ass in gear and work on the subcat support then. Been fixing it up for txp 4.0.4 over the past few days so now that’s out the way I can finally turn to that. I’ll see if I can get it going this week, assuming the music/remixes don’t suck away too much of my life.

on another note… was wondering if you’d like me to have a go at the help text, to perhaps make it a little more penetrable?

Cooool. That’s be grand. In the effort to make this darn plugin be something approaching useful from its humble beginnings, the docs are getting more and more unwieldy with each option. And me being my usual wordy self doesn’t help, as you’ve spotted! Thanks matey. You can get hold of me via my web site if you’ve not got my email address already.


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

#51 2006-10-25 09:25:45

lukepermsn
Member
From: london
Registered: 2004-07-15
Posts: 57
Website

Re: smd_random_banner: Random banner image for advertising

Ahh. Somehow I missed your update to 0.16! How careless of me ;-)

I’ll have to wait until I get home to test drive the updated version, due to my firewall probs here at the office…

the tag i’m using FYI is:

<txp:smd_random_banner use_alt=“1” match_text=”?” avoid_text=“Schools,School,Project,landscape,details” look_in=“title,category” limit=“2” always_display=“1” />

On the help text things, I’ll be glad to have a go at it. Yeah, I got ur email from ur site once before. My wife is due to go into labour any day, so that’ll give me something to do whilst hanging out on the maternity ward ;-)

L.


“Absorb what is useful, Discard what is not, Add what is uniquely your own” – Bruce Lee

Offline

#52 2006-11-30 17:04:59

dbIcon
New Member
Registered: 2006-11-29
Posts: 6
Website

Re: smd_random_banner: Random banner image for advertising

Thanks for everybody’s work on this!
When I go to update to 0.16, I keep getting the error “Badly formed or empty plugin code.”
Can I get a fresh copy of the code to try?

Thanks!

Offline

#53 2006-11-30 21:23:04

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

Re: smd_random_banner: Random banner image for advertising

dbIcon wrote:

When I go to update to 0.16, I keep getting the error “Badly formed or empty plugin code.”

Weird. I just downloaded and installed it on a couple of my other sites to test (both txp 4.0.3 and 4.0.4), and it installed fine for me :-s

Is it just my plugin that you’re having trouble installing? Could it be a character encoding issue when you save or copy the plugin code off my site? Like a Dos/Unix line feed thing? *shrug *

Can I get a fresh copy of the code to try?

Sure. I’ve uploaded a 2nd copy to my record label site. You’re welcome to try that one instead. Sorry I can’t be of any more help at the moment.

P.S. to anyone waiting with partially bated breath for v2.0, I still haven’t got round to looking at it yet… been unfeasibly busy remixing. Apologies…


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

#54 2007-01-09 22:48:08

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

Re: smd_random_banner: Random banner image for advertising

In the words of Pink: I’m Not Dead.

Just released an interim/maintenance version with a couple more convenience options and a minor bugfix to the referer/limit option that was causing the referer string to go mad if you used a limit greater than 1.

The new options are:

thumb="1" if you wish to output the image thumbnail instead of the full picture
linkalt="1" if you want to make the link from the image’s alt text instead of its caption
linkprefix="someSection" if you want to always prefix your link with a particular string. This is useful if you have a load of image captions (or alts) that contain the product name and you rearrange your site, moving all your products to a new txp section. Instead of having to go through all your images and prefix the captions/alts with MyNewSection/, you can just add linkprefix="MyNewSection" to the tag and it’ll make the correct links for you (trailing slash included).

Two things to note about the new options:

  1. If you use caption/alt text that already has a “full” URL in it (i.e. one that starts with http://) the linkprefix option will be ignored for that image
  2. If you specify both linkalt and linkcaption (by mistake, surely!) the linkcaption will take precedence.

Here’s the latest 0.17 version. Any questions/probs/bugs just shout.

Enjoy.

Last edited by Bloke (2007-01-09 22:54:00)


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

#55 2007-02-04 23:49:00

Papuass
Member
From: Rīga, Latvija
Registered: 2006-03-28
Posts: 21
Website

Re: smd_random_banner: Random banner image for advertising

Found a bug: Referrer parameter is added with ‘?’ in front, even if there are existing URL parameters (using messy link mode, no mod_rewrite). This breaks links. You should check if there are any parameters set and use ‘&’ if neccesary.

Offline

#56 2007-02-05 00:02:49

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

Re: smd_random_banner: Random banner image for advertising

Papuass wrote:

Found a bug: Referrer parameter is added with ‘?’ in front, even if there are existing URL parameters

Arse, you’re right. I never tested it in messy mode but I should have spotted it anyway. In fact, I ran into this when I developed smd_slimbox because I was adding parameters to the end of the url there.

I’ll grab the URL-processing code from that plugin and bung it in this one as soon as I get a chance.

Thanks for the catch!


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

#57 2007-02-05 08:43:48

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

Re: smd_random_banner: Random banner image for advertising

Bloke wrote:

I’ll grab the URL-processing code from that plugin and bung it in this one as soon as I get a chance.

Fixed in v0.17a


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

#58 2007-02-11 17:47:37

DigitalRealm
Member
From: Greenville, SC
Registered: 2006-07-22
Posts: 139
Website

Re: smd_random_banner: Random banner image for advertising

Would it be possible to add the ability to attach a class attribute to the images? Or, maybe there is an easier way to do this without adding to the plugin?

I need to add a class to each image that is randomly displayed without putting it in a div or anything. My mind is just simply not working today, so I may be overlooking some obvious, easy way to do this!

Offline

#59 2007-02-11 20:29:52

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

Re: smd_random_banner: Random banner image for advertising

DigitalRealm wrote:

Would it be possible to add the ability to attach a class attribute to the images? I need to add a class to each image that is randomly displayed without putting it in a div or anything.

Good idea. It’s not something I ever considered because I always put mine in a container div. But you’re right, there’s no easy way to get at it (at least with my CSS knowledge!) without wrapping it in a container. Bit of an oversight on my part.

My original philosophy was that it was better to simply wrap it in a div because it adds no visual weight to the markup and has the benefit that it usually works out at fewer bytes to add a single div around all the random images and reference .divname img {} in CSS, than to add class="divname" to each image. Marginal difference in byte count with only a single image I guess.

Having said all that, since adding a container div is a no-go for you, I shall don my coding hat and jolly well add the option. Watch this space…

Edit: New option imgclass now added in v0.18.

Last edited by Bloke (2007-02-11 21:10:50)


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

#60 2007-02-12 02:18:34

DigitalRealm
Member
From: Greenville, SC
Registered: 2006-07-22
Posts: 139
Website

Re: smd_random_banner: Random banner image for advertising

Wow, thanks dude! I really needed that option. I appreciate it!

Offline

Board footer

Powered by FluxBB