Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#811 2011-03-09 22:13:31
- uli
- Moderator

- From: Cologne
- Registered: 2006-08-15
- Posts: 4,316
Re: glz_custom_fields
Custom fields are varchar128. Try to make it varchar256 in phpMyAdmin.
Edit: No, I lied, they’re varchar 255 right now. Set it higher, anyway.
Last edited by uli (2011-03-09 22:24:54)
In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links
Offline
#812 2011-03-09 22:25:11
Re: glz_custom_fields
dreamer wrote:
I set up a custom field for colors. My client told me that the plugin only allows for them to check off up to 26 colors. So no matter if they check off more than 26 colors, they will still be limited to 26. Suggestions?
I think they are limited to 255 characters if memory serves well. Try modifying the column type (MySQL or phpmyadmin) to VARCHAR(65535), the maximum allowed size for this type of column.
Offline
#813 2011-03-14 21:17:27
- dreamer
- Member
- Registered: 2007-06-08
- Posts: 242
Re: glz_custom_fields
I’m assuming I should modify the Length/Values field in the Value box to 65535? Sorry, total php newb.
EDIT: I tried setting it to 65000 (65535 didn’t seem to work) but this has no effect on allowing me to tick off more colors.
Last edited by dreamer (2011-03-14 21:27:31)
Offline
#814 2011-03-14 21:30:13
- dreamer
- Member
- Registered: 2007-06-08
- Posts: 242
Re: glz_custom_fields
Also, is there a way to align the boxes next to the name? On my site, the boxes are 1 row above the actual name of the field so it is confusing to figure out which box goes with which field. See example http://whatilovemost.com/custom-colors.jpg
Offline
#815 2011-03-14 22:09:50
- uli
- Moderator

- From: Cologne
- Registered: 2006-08-15
- Posts: 4,316
Re: glz_custom_fields
dreamer wrote:
align the boxes next to the name
Have a look at this post and also at the reply of alanfluff.
In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links
Offline
#816 2011-03-14 22:11:13
- els
- Moderator

- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: glz_custom_fields
dreamer wrote:
EDIT: I tried setting it to 65000 (65535 didn’t seem to work) but this has no effect on allowing me to tick off more colors.
You can only set it to (max) 65535 in MySQL 5.0.3 or higher, before that the limit is 255.
Last edited by els (2011-03-14 22:11:47)
Offline
#817 2011-03-15 05:52:07
- dreamer
- Member
- Registered: 2007-06-08
- Posts: 242
Re: glz_custom_fields
uli wrote:
align the boxes next to the name
Have a look at this post and also at the reply of alanfluff.
Unfortunately, that doesn’t seem to do anything at all.
Last edited by dreamer (2011-03-15 05:52:27)
Offline
#818 2011-03-15 06:07:51
Re: glz_custom_fields
Just try something like:
custom_field_group .glz_custom_checkbox_field span input{width:30px;}
change the width value until it suits, or try width: auto; again
Offline
#819 2011-03-15 10:18:22
Offline
#820 2011-03-16 14:43:41
Re: glz_custom_fields
hi
first of all thank your for that plug-in. got it running on plenty projects..
and today i saw the datepicker function and i want to implement it into another one :)
but i have one question:
in the extensions tab: Date format: wouldnt it be possible to put the the values in by myself? im askin because of the separators.
(ok ok, i could hack those via jquery or something) just askin if this wouldnt be possible as well.
like you have a text field and put this in manually..
like dd-mm-yy, dd.mm.yyyy, mm***dd***yyyy (just playing with the constalation of the separators..)
or another thought:
make it a textfield and lets put in the value like in <txp:posted *format=""* /> strftime()
would that be possible, or am i nuts..? cause that would also make my next question needless..
cause i also want those weekdays.. cant they also be put into the custom field..?
just askin for a feature ill need once in a lifetime, but it would be geil..
tell me what you think..
Last edited by jens31 (2011-03-16 14:45:11)
Offline
#821 2011-03-19 03:43:10
Re: glz_custom_fields
Hi all.
Here is a little hack for the plugin:
// evals a PHP script and displays output right under the custom field label
function glz_custom_script($script, $custom, $custom_id, $custom_value) {
// hack starts
global $prefs;
// test if $script is an absolute path (i.e. /home/path/to/script/).
$abs_path = strcmp(substr($script, 0, 1),'/') === 0 ? true : false;
// if it's not an absolute path, then it's a relative path (i.e. just the script name,
if (!$abs_path) {
// then, recreate the full path by appending the value of custom_scripts_path (i.e. /
$script = rtrim($prefs['custom_scripts_path'],'/') . '/' . $script;
}
// hack ends
if ( is_file($script) ) {
include_once($script);
$custom_function = basename($script, ".php");
...
Look for the correct line (the one defining glz_custom_script function) and edit the first line so the code lookslike the above snippet.
This mod will let you use both relative or full path when specifyng the filesystem path to a glz_custom_field custom script. So you could put just the custom script name, like “my_image.php” instead of the full path (“/home/path/to/my_image.php”), making it easier to deploy or share a DB with other dev.
Gerhard, do you think it could be possible to pass the custom field’s name to the custom script function? I mean, as now, that you pass the $custom_id and/or $custom_value. Having the custom field name would open the possibility to write more reusable custom scripts .
Offline
#822 2011-03-25 15:31:28
- element
- Member
- Registered: 2009-11-18
- Posts: 99
Re: glz_custom_fields
Question: I’m using glz_custom_field (obviously) and I need to use if_custom_field for a field > 10. What is the solution?
Offline
#823 2011-03-25 16:22:20
Re: glz_custom_fields
If you’re using the latest version of Textpattern, txp:if_custom_field should work fine.
Offline
#824 2011-03-25 17:45:11
- element
- Member
- Registered: 2009-11-18
- Posts: 99
Re: glz_custom_fields
Using TXP 4.2.0, and it doesn’t work.
Offline
#825 2011-03-25 20:07:22
Re: glz_custom_fields
I have a new feature request for the plugin and would love to know if it might be helpful to others or easy to implement:
Add a custom field option that allows an article to be associated with other articles in the site. I’m thinking of a pull down menu (or multi-select menu) that lists article titles from a specified section (or sections). Then, in the article form, the custom field would output as permlinked title(s) to the corresponding article(s). This would be helpful to me because it would avoid typos/user errors and, as a designer, I would have control over where the links show up in the layout of the article (versus just writing links with textile in the body or excerpt)
Maybe I am the only one interested it in this… thought I’d throw it out there to see if anyone else likes the idea.
I initially thought about it in this thread.
Offline