Textpattern Forum

You are not logged in. Register | Login | Help

#11 2012-01-05 11:44:18

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 5,714
Website

Re: [howto] How to add more Form types

makss wrote:

Small fix in Line 302, set class and size

Good catch, thanks. I’ll add that later once I’ve finished constantly retuning my new Ukulele every 8 chords or so (bah! new strings syndrome…)


The smd plugin menagerie — for when you need one more gribble of power from Textpattern.

Txp Builders – finely-crafted code, design and Txp

Offline

#12 2012-01-05 12:55:01

uli
Moderator
From: Cologne/Köln
Registered: 2006-08-15
Posts: 2,951

Re: [howto] How to add more Form types

Strikes me that the field shouldn’t show up on the default form page.


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

#13 2012-01-05 14:03:36

makss
Plugin Author
From: Ukraine
Registered: 2008-10-21
Posts: 248
Website

Re: [howto] How to add more Form types

uli wrote:

Strikes me that the field shouldn’t show up on the default form page.

Maybe this code will solve the issue? Just download the code, backup your existing include/txp_form.php and overwrite it with this one.


aks_cron : Cron inside Textpattern | aks_article : extended article_custom tag
aks_cache : cache for TxP | aks_meta | aks_header : Compress your pages on the fly

Offline

#14 2012-01-05 14:34:47

makss
Plugin Author
From: Ukraine
Registered: 2008-10-21
Posts: 248
Website

Re: [howto] How to add more Form types

LastMod patch – add new field LastMod in txp_form table.
Some code was taken from a file include/txp_article.php
This patch should not cause conflicts with other modules or plug-ins.

Install:
1. In phpMyAdmin add new field LastMod in txp_form table with type datetime

or run sql

ALTER TABLE `txp_form` ADD `LastMod` datetime NOT NULL default '0000-00-00 00:00:00'

or run inside TxP

safe_alter("txp_form", "add `LastMod` datetime NOT NULL default '0000-00-00 00:00:00' ");

2. Download LastMod patch , backup your existing include/txp_form.php and overwrite it with this one.

Last edited by makss (2012-01-05 15:24:27)


aks_cron : Cron inside Textpattern | aks_article : extended article_custom tag
aks_cache : cache for TxP | aks_meta | aks_header : Compress your pages on the fly

Offline

#15 2012-01-05 15:09:45

uli
Moderator
From: Cologne/Köln
Registered: 2006-08-15
Posts: 2,951

Re: [howto] How to add more Form types

makss wrote:

Maybe this code will solve the issue?

That’s Stef’s file, as far as I can tell.

makss wrote:

or run safe_alter("txp_form", "add `LastMod` datetime NOT NULL default '0000-00-00 00:00:00' ");

Gives back an SQL error (#1064)


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

#16 2012-01-05 15:29:39

makss
Plugin Author
From: Ukraine
Registered: 2008-10-21
Posts: 248
Website

Re: [howto] How to add more Form types

uli wrote:

That’s Stef’s file, as far as I can tell.

Yes, this is Stef’s code with my little patch.

Gives back an SQL error (#1064)

I corrected the previous post and posted there pure sql

Last edited by makss (2012-01-05 15:32:17)


aks_cron : Cron inside Textpattern | aks_article : extended article_custom tag
aks_cache : cache for TxP | aks_meta | aks_header : Compress your pages on the fly

Offline

#17 2012-01-05 15:42:17

uli
Moderator
From: Cologne/Köln
Registered: 2006-08-15
Posts: 2,951

Re: [howto] How to add more Form types

makss wrote:

Yes, this is Stef’s code with my little patch.

No, sorry, I did a diff: identical files.


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

#18 2012-01-05 15:43:31

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 5,714
Website

Re: [howto] How to add more Form types

uli wrote:

Strikes me that the field shouldn’t show up on the default form page.

Why not? Just because you can’t rename the form doesn’t mean you can’t put it in another category. Even in the current (non-patched) screen I can reassign my default form to the ‘Links’ category if I so desired.

Please explain why you think people should not be able to move it to an arbitrary area of their choosing? (e.g. they could collect all non-deletable forms into one group called “Static”). Might be something I’ve overlooked.

Last edited by Bloke (2012-01-05 15:44:50)


The smd plugin menagerie — for when you need one more gribble of power from Textpattern.

Txp Builders – finely-crafted code, design and Txp

Offline

#19 2012-01-05 15:53:52

uli
Moderator
From: Cologne/Köln
Registered: 2006-08-15
Posts: 2,951

Re: [howto] How to add more Form types

Bloke wrote:

Even in the current (non-patched) screen I can reassign my default form to the ‘Links’ category if I so desired.

Thats true, I missed that. But I find it irritating, nevertheless. And in working environments with several people cooperating it might be confusing to not find the default form, counter-intuitively, on its traditional place. Just my 0.02 €.


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

#20 2012-01-05 16:06:16

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 5,714
Website

Re: [howto] How to add more Form types

uli wrote:

it might be confusing to not find the default form, counter-intuitively, on its traditional place.

So you’re proposing that this patch goes the extra step of removing the select list and text box (or making them static like makss did in his patch-of-my-patch) when anyone is editing a non-deletable form, thus forbidding anyone from moving it to a new category? Seems a bit drastic, but if your view represents the majority then who am I to argue!

Last edited by Bloke (2012-01-05 16:12:43)


The smd plugin menagerie — for when you need one more gribble of power from Textpattern.

Txp Builders – finely-crafted code, design and Txp

Offline

Board footer

Powered by FluxBB