Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

  1. Index
  2. » Archives
  3. » Plug-in: zem_contact_reborn

#421 2006-03-31 20:09:23

tinyfly
Member
From: Dallas, Texas
Registered: 2004-05-10
Posts: 462
Website

Re: Plug-in: zem_contact_reborn

The tag that would need to be output to be valid is <input type="image" src="path/to/image.gif" value="Send it" />. How ever this is initialized is up to you.

I was thinking you could use the same zem_contact_submit like so: <txp:zem_contact_submit label="Send it" source="/path/to/image.gif" /> then it would output the image button but if you use this: <txp:zem_contact_submit label="Send it" /> it would output the current submit button

Offline

#422 2006-03-31 20:54:27

thebombsite
Archived Plugin Author
From: Exmouth, England
Registered: 2004-08-24
Posts: 3,251
Website

Re: Plug-in: zem_contact_reborn

No. You are missing my point. For you to be able to use an attribute “src” the src tag needs to be in the “input element” or “button element” to begin with in the plug-in code, whether you decide to use it or not, thus, if you don’t use it you will end up with <code>src=”“</code> which isn’t a problem as long as it validates. Adding a “type” attribute isn’t a problem as it will default to “submit” unless you use type=“image” in your tag but you can’t have a default for “src”.


Stuart

In a Time of Universal Deceit
Telling the Truth is Revolutionary.

Offline

#423 2006-03-31 21:16:08

tinyfly
Member
From: Dallas, Texas
Registered: 2004-05-10
Posts: 462
Website

Re: Plug-in: zem_contact_reborn

I’m not sure I agree with you there Stuart. You can structure it with conditionals where if there is no source attribute present in the txp tag then nothing gets outputted in the html tag. Isn’t that how label=”“, wraptag=”“, labeltag=”“, etc… work?

You could make source=“yes” and path=”/path/to/image.gif” seperate attributes if you need to. <txp:zem_contact_submit label="Send it" source="yes" path="/path/to/image.gif />

<code>
‘source’ => ‘’,
‘path’ => ‘’,
</code>

or all-in-one

<code>
‘source’ => ‘’,
if (source){src=“source”}
</code>

Stumbling around here but I think it could work some way like that, I’m not much of a coder though.

Offline

#424 2006-03-31 22:13:05

thebombsite
Archived Plugin Author
From: Exmouth, England
Registered: 2004-08-24
Posts: 3,251
Website

Re: Plug-in: zem_contact_reborn

Well neither am I but it’s never stopped me. ;)

In the mean while my partner in crime around here has been talking to me (I get these weird voices in my head from time to time) and we feel that the safest way to deal with this from a security point-of-view, which is what we are concentrating on in version .18 is as follows:-

We split <code><zem_contact_submit /></code> into 3 separate tags. You choose which ever suits your purpose.

<code><zem_contact_submit /></code> would output an “input element” of “type=submit” like we are mostly used to around here. This would enable us to remove the “button” attribute which is safer.<br /><br />

<code><zem_contact_button /></code> would output a “button element” but without the need for the “button” attribute.<br /><br />

<code><zem_contact_image /></code> would output an “input element” of “type=image” and would require an “id” attribute. As TXP allocates “ids” to images in the /images/ directory all it would need from you is that id number. The path to the /images/ directory would be hardcoded into the tag so that the “id” can simply be appended to it. For those who don’t use the /images/ directory – hard luck. This is one image that will need to go there. We will also need to sort out an error message for those who forget to enter the “id” into the tag – something like“Oi! Where’s the bloody image id you prat?”
<br />

Now don’t hold me to those tag names but they look about right don’t they? Anyway, how does that sound? I think it provides for everyone’s needs and it’s safer.

Last edited by thebombsite (2006-03-31 22:20:42)


Stuart

In a Time of Universal Deceit
Telling the Truth is Revolutionary.

Offline

#425 2006-03-31 22:32:06

tinyfly
Member
From: Dallas, Texas
Registered: 2004-05-10
Posts: 462
Website

Re: Plug-in: zem_contact_reborn

Sounds like a good idea.

Though I don’t necessarily like being forced to use txp’s image upload. I keep all my design related images in a separate directory (i.e. background images, buttons, icons, etc…) and only use txp’s upload for content related images, but I am just picky like that. Just having the ability to use image buttons is great.

Offline

#426 2006-03-31 22:43:38

thebombsite
Archived Plugin Author
From: Exmouth, England
Registered: 2004-08-24
Posts: 3,251
Website

Re: Plug-in: zem_contact_reborn

Well the main point here is safety. If we allow for the input of a “path” then this is potentially a security risk, whereas, if the path is hard-coded and you can only enter a number, that hazard is removed. In order to do that we have to restrict the path to the /images/ directory as it is the same for everyone.


Stuart

In a Time of Universal Deceit
Telling the Truth is Revolutionary.

Offline

#427 2006-03-31 22:47:15

tinyfly
Member
From: Dallas, Texas
Registered: 2004-05-10
Posts: 462
Website

Re: Plug-in: zem_contact_reborn

Ahh, I see. I understand now.

Offline

#428 2006-03-31 22:52:30

thebombsite
Archived Plugin Author
From: Exmouth, England
Registered: 2004-08-24
Posts: 3,251
Website

Re: Plug-in: zem_contact_reborn

I’m glad somebody does. You realise that my weekend just disappeared. ;)


Stuart

In a Time of Universal Deceit
Telling the Truth is Revolutionary.

Offline

#429 2006-04-01 01:54:29

squaredeye
Member
From: Greenville, SC
Registered: 2005-07-31
Posts: 1,495
Website

Re: Plug-in: zem_contact_reborn

Stuart,
While your at it, and Saturday begins to dwindle away, lets add the option for assigning different id’s to the input tags :) hee hee hee.

Have a pint on me. How many are we up to now?

M


Offline

#430 2006-04-01 02:25:45

thebombsite
Archived Plugin Author
From: Exmouth, England
Registered: 2004-08-24
Posts: 3,251
Website

Re: Plug-in: zem_contact_reborn

Matthew, I sorted that for you or did you miss my post? I have enough to do without you piling it on ta muchly. ;)

And I think we’re into gallons. Pints went by ages ago. ;)

(I wonder if he can afford the mortgage on a pub?)


Stuart

In a Time of Universal Deceit
Telling the Truth is Revolutionary.

Offline

#431 2006-04-01 02:49:36

squaredeye
Member
From: Greenville, SC
Registered: 2005-07-31
Posts: 1,495
Website

Re: Plug-in: zem_contact_reborn

Ooops :)
I better get homebrewin!

M


Offline

#432 2006-04-01 02:54:27

thebombsite
Archived Plugin Author
From: Exmouth, England
Registered: 2004-08-24
Posts: 3,251
Website

Re: Plug-in: zem_contact_reborn

:)


Stuart

In a Time of Universal Deceit
Telling the Truth is Revolutionary.

Offline

  1. Index
  2. » Archives
  3. » Plug-in: zem_contact_reborn

Board footer

Powered by FluxBB