Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#151 2011-07-26 15:48:26

progre55
Member
Registered: 2006-05-02
Posts: 668

Re: smd_random_banner: Random banner image for advertising

thanks.

progre55

Offline

#152 2011-07-26 16:39:14

Destry
Member
From: Haut-Rhin
Registered: 2004-08-04
Posts: 4,912
Website

Re: smd_random_banner: Random banner image for advertising

Bloke wrote:

Not natively in the plugin. You could perhaps tally the number of times a particular banner has been displayed using rvm_counter…

I’m always just focking stunned at how well you know you’re plugins work (or not) with other plugins…

As if you don’t already have enough plugins (among other things) of your own to keep straight.

Impressive.

Offline

#153 2012-10-22 06:24:48

tye
Member
From: Pottsville, NSW
Registered: 2005-07-06
Posts: 859
Website

Re: smd_random_banner: Random banner image for advertising

Hey Stef – how’s things?

The urls were not validating for me…. so I took a look in the code and changed this (line 266 on my file):

$varstr = do_list($paramVal, “&”);

to this

$varstr = do_list($paramVal, “&”);

and it validated :)

nope, I was lying – it doesn’t work

Last edited by tye (2012-10-22 07:06:12)

Offline

#154 2021-04-01 00:31:53

visualpeople
Member
From: Corvallis, Oregon - USA
Registered: 2005-11-16
Posts: 73
Website

Re: smd_random_banner: Random banner image for advertising

** Update **
Disregard my ramblings below, I think I pretty much figured out a way around this with <txp:images> Sorry to bother you.

I feel like I may be exhuming some ancient relic by posting here, but here I go…

I’ve got a super old (shocker!) site using this & smd_random_txt to show three images in a row (I can’t for the life of me remember exactly why) but it works and has for ages now.

However, today, I upgraded from Txp 4.8.2 straight to 4.8.5 and I suspect something in the image tag change in 4.8.3 may have messed things up???

Anyway, with smd_random_banner tag on a page I’m getting this error:

Fatal error: Uncaught Error: Call to undefined function image() in /home/xxx/public_html/textpattern/plugins/smd_random_banner/smd_random_banner.php:336 Stack trace: #0 [internal function]: smd_random_banner(Array, NULL) #1 /home/xxx/public_html/textpattern/vendors/Textpattern/Tag/Registry.php(140): call_user_func('smd_random_bann...', Array, NULL) #2 /home/xxx/public_html/textpattern/lib/txplib_publish.php(549): Textpattern\Tag\Registry->process('smd_random_bann...', Array, NULL) #3 /home/xxx/public_html/textpattern/lib/txplib_publish.php(406): processTags('smd_random_bann...', 'category="banne...', NULL, false) #4 /home/xxx/public_html/textpattern/plugins/smd_random_text/smd_random_text.php(174): parse('\r\n<txp:smd_rand...') #5 [internal function]: smd_random_text(Array, '\r\n<txp:smd_rand...') #6 /home/xxx/public_html/textpattern/vendors/Textpattern/Tag/Registry.php(140): call_user_func('smd_random_text', Array, '\r\n<txp:smd_rand...') #7 /home/xxx/public_html/textpattern/lib/txplib_publish.php(54 in /home/xxx/public_html/textpattern/plugins/smd_random_banner/smd_random_banner.php on line 336

and line 336 of smd_random_banner.php is:

						$objOut = (($thumb) ? thumbnail($imgOptions) : image($imgOptions));

Running all the latest smd_random_banner (.42), smd_random_text (.14) and smd_lib (.37) plugins and PHP 7.4 on this server…

Any thoughts on something I could do to fix this in less than 5 minutes?

If not it’s completely fine, I’ll try something else or maybe use this as leverage to get this client to FINALLY update their site…

- Ryan

Last edited by visualpeople (2021-04-01 00:45:58)

Offline

#155 2021-04-01 06:39:14

etc
Developer
Registered: 2010-11-11
Posts: 5,666
Website GitHub

Re: smd_random_banner: Random banner image for advertising

Hmm, yes, since the introduction of global attributes, direct calls to ‘tag’ functions are deprecated. Some of these functions get removed/replaced, as it was the case of image() in 4.8.5. You can replace image($imgOptions) with thumbnail($imgOptions + array('thumbnail' => false)), but a more future-proof way would be using processTags():

processTags('image', $imgOptionsString);

Offline

#156 2021-04-01 07:36:50

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 12,428
Website GitHub

Re: smd_random_banner: Random banner image for advertising

Glad you got it sorted. This plugin is so ooooold. I should stop using direct calls and throw everything through parse(). Thanks for the report


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

Hire Txp Builders – finely-crafted code, design and Txp

Offline

#157 2021-04-01 17:45:32

visualpeople
Member
From: Corvallis, Oregon - USA
Registered: 2005-11-16
Posts: 73
Website

Re: smd_random_banner: Random banner image for advertising

Thanks so much for your quick replies!

In case anyone else comes across this replacing line 336 of smd_random_banner.php with:

$objOut = (($thumb) ? thumbnail($imgOptions) : thumbnail($imgOptions + array('thumbnail' => false)));

Worked like a charm (at least for now…)

I couldn’t get the ProcessTags… to work, but that’s probably just because I didn’t know what I was doing there.

Offline

#158 2021-04-01 21:08:49

etc
Developer
Registered: 2010-11-11
Posts: 5,666
Website GitHub

Re: smd_random_banner: Random banner image for advertising

visualpeople wrote #329635:

I couldn’t get the ProcessTags… to work, but that’s probably just because I didn’t know what I was doing there.

You must convert $imgOptions to string:

processTags('image', join_atts($imgOptions));

Offline

#159 2021-04-01 21:30:13

visualpeople
Member
From: Corvallis, Oregon - USA
Registered: 2005-11-16
Posts: 73
Website

Re: smd_random_banner: Random banner image for advertising

Even better! Thanks so much.

Offline

#160 2021-04-02 10:31:13

etc
Developer
Registered: 2010-11-11
Posts: 5,666
Website GitHub

Re: smd_random_banner: Random banner image for advertising

It will be possible (and better) to directly pass arrays to processTags() in 4.8.6:

processTags('image', $imgOptions);

Offline

Board footer

Powered by FluxBB