Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#136 2005-12-08 09:04:56
- Jick
- Member
- Registered: 2004-11-27
- Posts: 14
Re: [plugin] [ORPHAN] zem_image_replace, version 2
> mary wrote:
> The method “img” outputs invalid (x)html, i.e:
> <img src="/path/to/image.png" alt="Second Post" title="Second Post">Second Post</img>
Has this been fixed yet? I’m trying to use the img method and it’s outputting that invalid code so it’s causing me all sorts of hassles. Can someone suggest a temporary fix possibly?
I’m not sure exactly what all is going on but I am pretty sure the problem has something to do with the tag() function. He seems to be referencing that function when it comes time to build the output code in the plugin. I don’t see that function within the plugin code itself so I must assume that the tag() function is a built-in function of Textpattern. I’m not sure exactly where that function resides in the Textpattern files so I can’t really say how the function works. Since I don’t know how the function works I can’t tell if the error is with the tag() function or the plugin.
I can’t imagine it would be that hard to fix either way. I’ll do some searching through the Textpattern files for the tag() function and post my findings tomorrow if nobody has come up with a solution by then. If nobody posts I may end up coming up with my own solution. I’ll post that if all else fails and I figure it out.
Thanks to anyone who can help.
Offline
#137 2005-12-08 09:42:38
- Jick
- Member
- Registered: 2004-11-27
- Posts: 14
Re: [plugin] [ORPHAN] zem_image_replace, version 2
Nevermind! I figured it out. It was easier then I thought it was gonna be. I simply added this to the plugin:
<code>function zem_ir_tag($content,$tag,$atts=’‘)
{
if($tag == ‘img’)
{
return ($content) ? ‘<’.$tag.$atts.’ />’ : ‘’;
}
else
{
return ($content) ? ‘<’.$tag.$atts.’>’.$content.’</’.$tag.’>’ : ‘’;
}
}</code>
Then I changed all references to the tag() function to zem_ir_tag(). Boom! There you have it. Works perfectly.
Edit: Code didn’t show up right. Hopefully it’s displaying right now…
Last edited by Jick (2005-12-08 09:47:59)
Offline
#138 2005-12-08 14:03:11
- Niconemo
- Member

- From: Rhône-Alpes, France
- Registered: 2005-04-18
- Posts: 557
Re: [plugin] [ORPHAN] zem_image_replace, version 2
> mrdale wrote:
I’ve found compatability with typefaces and this plugin to be pretty hit and miss. Most of my Mac typefaces wont work. Not sure why.
It should never work simply because “classic” Mac TrueType fonts are not .ttf file and the plugin requires .ttf files (I think I ever answered to your question once 2 pages back). ;-)
Use a font converter utility to convert typefaces to windows trutype before uploading to the server. This seems to work in most all cases.
It should work in any case
Sidebar Headers still display with space on the left rather than left aligned.
It’s a graphic problem due to the design of the font itself (a glyph in a font has a kerning and spacing that can’t be reproduced as an image) a negative left margin should be a solution.
Is there any way to make this plug work on all headers of a particular variety without explicily wrapping them in a tag? eg. all h3s?
no but you can define a zem_ir group in a form loaded in every page to make the tag lighter.
Nico
Offline
#139 2005-12-08 14:04:16
Re: [plugin] [ORPHAN] zem_image_replace, version 2
Jick, Can you please post the modified version as a whole? That’d be extremly cool!
“Take a point, stretch it into a line, curl it into a circle, twist it into a sphere, and punch through the sphere.”
— Albert Einstein
Offline
#140 2005-12-08 14:19:44
- Mary
- Sock Enthusiast
- Registered: 2004-06-27
- Posts: 6,236
Re: [plugin] [ORPHAN] zem_image_replace, version 2
The plugin accepts otf too.
Offline
#141 2005-12-08 21:13:11
- Jick
- Member
- Registered: 2004-11-27
- Posts: 14
Re: [plugin] [ORPHAN] zem_image_replace, version 2
> creativesplash wrote:
> Jick, Can you please post the modified version as a whole? That’d be extremly cool!
Umm… well I don’t think files can be posted on this forum and I don’t dare post all that code directly seeing as it might screw it up so I’ll just link you to a text file copy of it on my server.
Offline
#142 2005-12-11 17:18:38
Re: [plugin] [ORPHAN] zem_image_replace, version 2
Hey Jick! Thank you so much for putting up the file! It works very well!
“Take a point, stretch it into a line, curl it into a circle, twist it into a sphere, and punch through the sphere.”
— Albert Einstein
Offline
#143 2005-12-12 03:23:01
- Jick
- Member
- Registered: 2004-11-27
- Posts: 14
Re: [plugin] [ORPHAN] zem_image_replace, version 2
No problem. ;) I just hope that it can be adapted (in some form) into the actual plugin someday. It’s really quite an easy fix so it shouldn’t take much work at all to add it in. I doubt zem will fix it in exactly that manner but my method takes care of the problem just fine until he updates his plugin.
Offline
#144 2006-03-13 12:58:25
Re: [plugin] [ORPHAN] zem_image_replace, version 2
I managed to hack the code of this great plugin to make it works.
Originally, the url for the image produced was wrong. The image was created and cached, but img url had an excedding “/” in the url. I don’t know why, maybe some setting of mine.
Anyway, I modified the $url creation in the zem_ir function:
Before it was:
$url = $pfr . $cachedir . "/" . $data;
I changed this to:
if ($pfr != "/") {$url = $pfr . $cachedir . "/" . $data;} else {$url = $cachedir . "/" . $data;}
And it seems to work properly.
No idea if this may help someone else or if it is a bug, but that is.
Bye
Z-
Offline
#145 2006-03-13 13:35:18
- marios
- Archived Plugin Author

- Registered: 2005-03-12
- Posts: 1,253
Re: [plugin] [ORPHAN] zem_image_replace, version 2
One question I’d like o ask, before I test this, does this have the ability to normaly flow text inline, as is ?
regards marios
⌃ ⇧ < ⎋ ⌃ ⇧ >
Offline
#146 2006-04-18 07:55:52
- -P-
- Member

- From: Finland
- Registered: 2005-09-10
- Posts: 211
Re: [plugin] [ORPHAN] zem_image_replace, version 2
Els wrote:
<blockquote> First, this is a great plugin, thank you!
I did this:
<code><a href=”/”><txp:zem_ir font=”/html/fonts/CHILLER.TTF” fontsize=“100” color=”#336699” backgroundcolor=”#336699”><txp:page_title /></txp:zem_ir></a></code>
to make it a link to the home page. It works, but the page doesn’t validate anymore because of the h1 tags inside the anchor tags. I tried wraptag=”“, but that doesn’t make the h1 tags disappear.
Is there a way to solve this, or is the plugin just not meant to be used this way?
EDIT: This:
<code><txp:zem_ir font=”/html/fonts/CHILLER.TTF” fontsize=“100” color=”#336699” backgroundcolor=”#336699”><a href=”/”><txp:page_title /></a></txp:zem_ir></code>
seems to create valid html, but it doesn’t give me a working link.</blockquote>
Has anybody found a solution how to fix this? I would really like to have both, zem_ir and valid code with working link.
As Els wrote in his later post, this is not just IE problem. Any way to remove for example the wraptags totally? wraptag=”“ sets it back to default, h1.
Offline
#147 2006-04-18 14:18:28
- Niconemo
- Member

- From: Rhône-Alpes, France
- Registered: 2005-04-18
- Posts: 557
Re: [plugin] [ORPHAN] zem_image_replace, version 2
Pwrote:
Has anybody found a solution how to fix this? I would really like to have both, zem_ir and valid code with working link.
I’d like to fix that too… No idea ?
Last edited by Niconemo (2006-04-18 14:19:25)
Nico
Offline
#148 2006-05-10 03:13:37
Re: [plugin] [ORPHAN] zem_image_replace, version 2
Hey there,
Don’t know if anyone has any thoughts on this, but I wanted to get some wisdom if there was any?
I’m trying to use this plugin with an opentype font, and I get different results locally than I do on dreamhosted server.
The small “i” is “thicker” than it should be?
Must be some weird font thing, but if you have any suggestions, lemme know.
The font I am using is bundled with Adobe’s stuff : its Kozuka Gothic.
- I am Squared Eye and I
am launchinghave launched Pattern Tap
Offline
#149 2006-08-18 17:39:07
Re: [plugin] [ORPHAN] zem_image_replace, version 2
I can’t seem to get it right, whatever combination of tags results to NOTHING — either a blank page or a
<>h1 Title-Name
=/ any kind of tag wont do… and yes, I have installed the plugin correctly, did all what the documents instructed, and even copied other people’s codes but to no avail… :( am I missing something here?
Offline