Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#376 2011-01-19 03:17:16

hicks
Member
From: Portland, OR, USA (ex-UK)
Registered: 2009-05-08
Posts: 106
Website

Re: [plugin] [ORPHAN] upm_image: More powerful image display

Thanks! Didn’t think of using that txp:upm_img_full_url bit. Your code almost worked right off the bat; only the wraptags didn’t work between each image+caption, for some reason. Here’s what’s working, though:

<div>
<txp:upm_article_image limit="1">
	<img src="<txp:upm_img_full_url />" width="<txp:upm_img_full_width />" height="<txp:upm_img_full_height />" alt="<txp:upm_img_alt />" />
	<txp:upm_img_caption wraptag="p" />
</txp:upm_article_image>
</div>

<txp:upm_article_image offset="1"><div>
	<img src="<txp:upm_img_full_url />" width="<txp:upm_img_full_width />" height="<txp:upm_img_full_height />" alt="<txp:upm_img_alt />" class="hidden" />
	<txp:upm_img_caption wraptag="p" class="hidden" />
</div></txp:upm_article_image>

Thanks again! I'll post a link when I've got the article in question online.

h.

Offline

#377 2011-01-25 01:59:41

hicks
Member
From: Portland, OR, USA (ex-UK)
Registered: 2009-05-08
Posts: 106
Website

Re: [plugin] [ORPHAN] upm_image: More powerful image display

Here’s how it came out —just how I’d hoped. Thanks again, Mary.

hicks.

Offline

#378 2011-03-05 19:53:36

kemie
Plugin Author
From: mexico<-->sweden
Registered: 2004-05-20
Posts: 495
Website

Re: [plugin] [ORPHAN] upm_image: More powerful image display

hey mary, having a little problem with an apparent bug.
I’m using upm_image with this form

<txp:upm_article_image form="fonttabs" wraptag="ul" class="idTabs"/>

and within the fonttabs form:

<li><a href="#i<txp:upm_img_id />"><txp:upm_img_alt /></a></li>

now this works perfectly when I have several article images, but when I have only one, the wraptag does not get output. i just get the <li> without a <ul>

any clue as to what could be the problem?


~~~~~~~~~~~~~| monolinea.com | pixilate.com | istockphoto.com/kemie |~~~~~~~~~~~~~

Offline

#379 2011-03-07 15:55:40

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: [plugin] [ORPHAN] upm_image: More powerful image display

Hmm. Does tag trace provide any enlightenment?

Offline

#380 2011-03-09 09:17:40

kemie
Plugin Author
From: mexico<-->sweden
Registered: 2004-05-20
Posts: 495
Website

Re: [plugin] [ORPHAN] upm_image: More powerful image display

Hi Mary,
Sorry I hadn’t had time to follow up.
here’s the relevant part of the tag trace:

<txp:if_individual_article>
	[<txp:if_individual_article>: true]
	<txp:article limit="10" form="font" listform="article_listing"/>
		[SQL (0.00090217590332031): select Form from txp_form where name='font']
		[Form: font]
		<txp:title />
		<txp:upm_article_image form="fonttabs" wraptag="ul" class="idTabs"/>
			[SQL (0.00090503692626953): select * from txp_image where id = '80' limit 0, 1]
			[SQL (0.00071597099304199): select Form from txp_form where name='fonttabs']
			[Form: fonttabs]
			<txp:upm_img_id />
			<txp:upm_img_alt />
		<txp:upm_article_image form="fontimg"/>
			[SQL (0.00063490867614746): select * from txp_image where id = '80' limit 0, 1]
			[SQL (0.0007469654083252): select Form from txp_form where name='fontimg']
			[Form: fontimg]
			<txp:upm_img_id />
			<txp:upm_img_full_url />
			<txp:upm_img_alt />
		<txp:body />
		<txp:if_article_category name="handwriting-fonts" number="1">
			[<txp:if_article_category name="handwriting-fonts" number="1">: false]
		</txp:if_article_category>
		<txp:tru_tags_if_has_tags>
			[SQL (0.0010678768157959): select Keywords from textpattern where ID='58' AND Keywords <> '']
			[<txp:tru_tags_if_has_tags>: true]
			<txp:tru_tags_from_article />
				[SQL (0.00057792663574219): select name from txp_section where searchable != '1']
				[SQL (0.0038959980010986): select Keywords from textpattern where Keywords <> ''and Section != ''and Section != 'tag' and Section != 'newsletter' and Status >= '4' and Posted <= now() and (now() <= Expires or Expires = '0000-00-00 00:00:00')]
		</txp:tru_tags_if_has_tags>
		<txp:if_custom_field name="Format">
			[<txp:if_custom_field name="Format">: true]
			<txp:custom_field name="Format" />
		</txp:if_custom_field>
		<txp:if_custom_field name="Price">
			[<txp:if_custom_field name="Price">: true]
			<txp:custom_field name="Price" />
		</txp:if_custom_field>
		<txp:if_custom_field name="carturl">
			[<txp:if_custom_field name="carturl">: true]
			<txp:custom_field name="carturl" />
		</txp:if_custom_field>
		<txp:upm_article_file_list />
			[SQL (0.004396915435791): select custom_3 from textpattern where `ID` = '58' limit 1]
</txp:if_individual_article>

the full (gigantanormous) tag trace is on pastebin

I can’t see anything VERY obviously wrong, but I’m a bit code-illiterate…

thanks for taking a look!


~~~~~~~~~~~~~| monolinea.com | pixilate.com | istockphoto.com/kemie |~~~~~~~~~~~~~

Offline

#381 2011-03-10 15:27:54

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: [plugin] [ORPHAN] upm_image: More powerful image display

Found the problem. I’ll try and update the plugin with a fix soon.

In the meantime, you should be able to work around this by making use of upm_if_article_image_list inside your form (if list, do nothing, else insert a ul tag with your class manually).

Offline

#382 2011-03-10 19:19:55

kemie
Plugin Author
From: mexico<-->sweden
Registered: 2004-05-20
Posts: 495
Website

Re: [plugin] [ORPHAN] upm_image: More powerful image display

thanks mary! :)


~~~~~~~~~~~~~| monolinea.com | pixilate.com | istockphoto.com/kemie |~~~~~~~~~~~~~

Offline

#383 2011-04-06 10:59:52

oliverker
Plugin Author
From: Huddersfield
Registered: 2008-07-14
Posts: 90
Website

Re: [plugin] [ORPHAN] upm_image: More powerful image display

Im trying to use a php image resizer by joe designs from as it adds the white space to make the image square – it is particular needed for showing client logos where they are different sizes, as you can see here I could maybe use some CSS to make it work, but perforable would be to have it as an image.

I was using timthumb.php with the following code

<img src="<txp:site_url/>thumb.php?src=<txp:upm_img_full_url />&w=200" alt="<txp:upm_img_alt />"/>

And have tried

<img src="<?php echo resize("<txp:upm_img_full_url />",array("w"=>200,"h"=>200)); ?>" alt="<txp:upm_img_alt />" />

as per the demo suggests, but think it is because it’s essentially a php script inside a php script

Any help as to how to get this work is much appreciated

Offline

#384 2011-04-06 13:50:39

photonomad
Member
Registered: 2005-09-10
Posts: 290
Website

Re: [plugin] [ORPHAN] upm_image: More powerful image display

Oliver, use <txp:php></txp:php> instead of <?php ?>

More info about using php code in textpattern here: http://textpattern.com/faq/34/how-do-i-use-php-code

not sure if that will solve your problems with the image resizing script, but it might be a start in the right direction

Offline

#385 2011-04-06 14:01:56

oliverker
Plugin Author
From: Huddersfield
Registered: 2008-07-14
Posts: 90
Website

Re: [plugin] [ORPHAN] upm_image: More powerful image display

photonomad wrote:

Oliver, use <txp:php></txp:php> instead of <?php ?>

Thanks but that didn’t work, Im sure all <txp:php> is replace <?php?> ? I think its more the fact im trying to parse php inside string…

Is there a php variable or some I can use? The Full code Id like is

<txp:upm_article_image >   
<img src="<txp:php> echo resize("<txp:upm_img_full_url />,array("w"=>200,"h"=>200)); </txp:php>" />
</txp:upm_article_image > 

but some thing to replace <txp:upm_img_full_url /> to make it work?

Offline

#386 2011-04-06 14:11:04

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

Re: [plugin] [ORPHAN] upm_image: More powerful image display

oliverker

You can’t use TXP tags inside PHP. Well, not directly like that. You need to choose to either:

a) wrap the tag in a call to parse() so it can be interpreted

or

b) call the tag directly using, for example:

<txp:php>
   echo resize(upm_img_full_url(array()), array("w"=>200,"h"=>200));
</txp:php>

And, for the record, yes it does matter if you use <?php vs <txp:php>. By default, Textpattern does not allow the former syntax so you’ll see errors or your code will not run.

Last edited by Bloke (2011-04-06 14:11:24)


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

#387 2011-04-06 14:24:15

oliverker
Plugin Author
From: Huddersfield
Registered: 2008-07-14
Posts: 90
Website

Re: [plugin] [ORPHAN] upm_image: More powerful image display

Bloke wrote:

You can’t use TXP tags inside PHP. Well, not directly like that. You need to choose to either:
a) wrap the tag in a call to parse() so it can be interpreted
or
b) call the tag directly using, for example:

Thanks for your help but neither of those solutions work? Sorry, Im (as you guessed) not very good at php

this is the page I’m trying to get to work http://earthymarketing.co.uk/clients/

Offline

#388 2011-04-06 14:35:58

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

Re: [plugin] [ORPHAN] upm_image: More powerful image display

oliverker wrote:

neither of those solutions work

They will. Once you get rid of the Syntax errors in your code. Look at the page source code and you’ll see lots of “<b>Parse error</b>: syntax error, unexpected T_STRING…” messages. Fix those and the problem will go away.

What does your code look like now?

Last edited by Bloke (2011-04-06 14:36:40)


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

#389 2011-04-06 18:08:23

oliverker
Plugin Author
From: Huddersfield
Registered: 2008-07-14
Posts: 90
Website

Re: [plugin] [ORPHAN] upm_image: More powerful image display

Bloke wrote:

What does your code look like now?

Thanks for you help Bloke, Think Ive got the script work now, but It seems like it doesn’t like the full image url? You can see from the link above that when just sending it:

<img src="<txp:php> echo resize('images/uploads/19.jpg', array("w"=>200,"h"=>200)); </txp:php>" />

then it is ok with that domain, but

<img src="<txp:php>
   echo resize(upm_img_full_url(array()), array("w"=>200,"h"=>200));
</txp:php>" />

must be something in the script with the full url? Is there a way of removing the url?

Many thanks

Offline

#390 2011-08-14 18:56:53

roelof
Member
Registered: 2005-03-27
Posts: 647

Re: [plugin] [ORPHAN] upm_image: More powerful image display

Hello,

A time ago I asked how I can get multiple images next to each other with this plugin.
Some one said i have to use inline.

Now Im back from holidays and still I have questions.

I have this :

<txp:upm_image type=“image” image_id=“26” class=“image” />

Where in the css do I have to use the inline ?

Roelof

Offline

Board footer

Powered by FluxBB