Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2006-10-19 10:19:12

jayrope
Plugin Author
From: Berlin
Registered: 2006-07-06
Posts: 687
Website Mastodon

use count in forms tab

Morning,

thrilled by the release (and previous testing already) of 4.0.4 i wish myself this:

a use count of forms in the forms tab.
over time one’s building many forms, and it seems, that there’s loads after a while on a site, which are not being used anymore.
to be able to remove them safely it’ll be awesome to have a use count displayed after the name of it in brackets (all on the roight side of the tab in the list of forms) -

uhm, if i had a clue, where this particular page is being built in the textpattern .php files, then i’d go ahead and start the mod/patch myself.

anyone?


A hole turned upside down is a dome, when there’s also gravity.

Offline

#2 2006-10-19 11:30:29

wet
Developer Emeritus
From: Schoerfling, Austria
Registered: 2005-06-06
Posts: 3,323
Website Mastodon

Re: use count in forms tab

This page is built by .../textpattern/include/txp_form.php. How would you know where to hunt for forms?

Offline

#3 2006-10-19 12:05:37

jayrope
Plugin Author
From: Berlin
Registered: 2006-07-06
Posts: 687
Website Mastodon

Re: use count in forms tab

Thanx much!

i don’t get that one (erm don’t i now?):
“How would you know where to hunt for forms?”

German limited by exaggerated seriousness over here 8-)


A hole turned upside down is a dome, when there’s also gravity.

Offline

#4 2006-10-19 12:13:29

wet
Developer Emeritus
From: Schoerfling, Austria
Registered: 2005-06-06
Posts: 3,323
Website Mastodon

Re: use count in forms tab

If you wanted to count all occurences of a form wherever it is used, you will have to consider at least:

  • all page templates
  • all other forms
  • all articles
  • all php snippets calling a form via PHP (something like this: <txp:php> echo output_form( array('form' => 'foo'); </txp:php>)
  • something else I surely didn’t think of in the first place…

So, I’m just curious how you plan to find these, as I also wanted to have that feature more than once and coudn’t dream up a suitable method besides brute Regex force over all affected database tables.

If such a method would come alive, it will be of immense usefulness, and could even be expanded not only to count but also to provide a form cross reference of sorts.

Last edited by wet (2006-10-19 12:13:50)

Offline

#5 2006-10-19 12:31:40

jayrope
Plugin Author
From: Berlin
Registered: 2006-07-06
Posts: 687
Website Mastodon

Re: use count in forms tab

thinking

… i think i’d be perfectly content with the page templates in the first place.
i realize i don’t know enough about textpattern internals (hopefully yet) to holler a straight concept out, but nevertheless it seems would probably need
a sort of routine, which checks every single form name (the strings i guess) from mySql against all page forms – just to get it starting.
this routine, then, could surely be adapted for the other checks you mentioned aswell.
as these checks only have to take place, when a user of the txp backend is logged in, they at least won’t slow down the server too much, other than on a backend user entering the form tab.

sounds like a mayor task. my php skills are “sort of”, i don’t think i can realize that myself. i’ll look into it, nevertheless.

could you give me a hint on where to find the mySQL routines in the txp .php ?


A hole turned upside down is a dome, when there’s also gravity.

Offline

#6 2006-10-19 12:38:04

wet
Developer Emeritus
From: Schoerfling, Austria
Registered: 2005-06-06
Posts: 3,323
Website Mastodon

Re: use count in forms tab

.../textpattern/lib/txplib_db.php. You might also benefit from this overview: TXP Defined Functions

Offline

Board footer

Powered by FluxBB