length of custom fields length of custom fields
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

length of custom fields

Started by DomS, September 30, 2007, 09:32:55 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

DomS

Hi all,


I was wondering: is there a simple solution to increase the max length of custom fields?

I'm starting a page on architecture and heraldry, where custom fields would be an excellent place to add some relevant information. Only the 256 (?) chars are too little, I've noticed.
(I'm using the current stable version plus plugins final_extract, backup, display fields)

PS: Thanks to everybody giving so much input here - I've spent nearly all of my Sunday browsing this forum and getting many hints and solutions for my little problems. :)


cheers,
DomS

just_some_guy

I would suggest using a tool like phpmyadmin and edit the column to a higher varchar
Tambien, Hablo Español      PHP - Achieve Anything
"The Internet is becoming the town square for the global village of tomorrow. " - Bill Gates
Windows 7 Forums

Joachim Müller

You might want to take a look at the plugin MiniCMS as well.

DomS

Thanks for your hints - I will have a look at MiniCMS when I get home.

Has anyone already altered the database entries successfully?
This would be only one half of the solution, because there is a form maxlength="255" in the entry form. I just can't find the proper file to edit and change this. :(

DomS

I have now installed MiniCMS. If I understand this entry correct, it's not possible to display MiniCMS elements below the image details.

So I will have to use the custom fields instead.
I will try to find the max length entry again tonight - will let you know when I come up with a solution.

DomS

I have found my completely working solution! :)

I changed the database column from varchar(255) to text, as 255 is the maximum varchar allows.
You have to enter "cpg14x_pictures" - "user1" (user2, user3, user4) and change from "varchar(255)" to "text", giving your desired amount of characters.
So I can enter my long comments into the database directly and they show up the way I want in the gallery.

Then I went again, looking for the right place to change maxlength="255" in the entry form, so it would allow me to make changes directly within the gallery interface.
The file to edit is "editOnePic.php" - lines 340-380 you'll find entries for all four custom fields: name="user2" maxlength="255".
Change "maxlength" according to the changes made in the database...

Works perfectly!

To add a little comfort, I changed the height of my now extended input fields by changing the same lines, adding rows="5" cols="40".


Thanks everybody for your help and ideas! Maybe this little change might be useful for another user one day.

dwo

Does not work for me, unfortunately.

dwo

Hello.

I refer to this topic: http://forum.coppermine-gallery.net/index.php/topic,47267.0.html

As it did not work, I tried to figure out why.

Following was what I did:

First: in template.css integrate textarea {overflow: hidden;}
This prevents scrollbars and users writing long lines.

Then in upload.php line 159 choose the numer of rows, lines and the table width you desire  <textarea name="$name" rows="8" cols="20" class="textinput" style="width: 65%;"

Then on line 2543 change to following(textarea): $form_array[] = array($CONFIG['user_field4_name'], 'user4', 3, $CONFIG['max_img_desc_length']);  [/b]

The same things you have to change in editpics.php, because there users will change settings, too. See line 368 and line 75
array($CONFIG['user_field4_name'], 'user4', 2, $CONFIG['max_img_desc_length']),  [/b]


The change in the SQL to text remains the same. So you have to do it.

thanks, regards, Dietmar