Advanced search  

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]

Pages: [1]   Go Down

Author Topic: length of custom fields  (Read 4009 times)

0 Members and 1 Guest are viewing this topic.

DomS

  • Coppermine newbie
  • Offline Offline
  • Posts: 4
length of custom fields
« on: September 30, 2007, 09:32:55 pm »

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
« Last Edit: October 03, 2007, 01:23:21 am by Nibbler »
Logged

just_some_guy

  • Supporter
  • Coppermine addict
  • ****
  • Offline Offline
  • Posts: 539
  • I am currently on holiday, back in a few weeks. :D
Re: length of custom fields
« Reply #1 on: September 30, 2007, 10:02:01 pm »

I would suggest using a tool like phpmyadmin and edit the column to a higher varchar
Logged
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

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: length of custom fields
« Reply #2 on: October 01, 2007, 08:25:31 am »

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

DomS

  • Coppermine newbie
  • Offline Offline
  • Posts: 4
Re: length of custom fields
« Reply #3 on: October 01, 2007, 11:13:48 am »

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. :(
Logged

DomS

  • Coppermine newbie
  • Offline Offline
  • Posts: 4
Re: length of custom fields
« Reply #4 on: October 02, 2007, 11:03:20 am »

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.
Logged

DomS

  • Coppermine newbie
  • Offline Offline
  • Posts: 4
Re: length of custom fields
« Reply #5 on: October 03, 2007, 01:06:48 am »

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.
Logged

dwo

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 143
Re: length of custom fields
« Reply #6 on: June 04, 2008, 09:43:24 am »

Does not work for me, unfortunately.
Logged

dwo

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 143
length of custom fields
« Reply #7 on: June 17, 2008, 04:11:42 pm »

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
Code: [Select]
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  <
Code: [Select]
textarea name="$name" rows="8" cols="20" class="textinput" style="width: 65%;"
Then on line 2543 change to following(textarea):
Code: [Select]
$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
Code: [Select]
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


Logged
Pages: [1]   Go Up
 

Page created in 0.023 seconds with 20 queries.