Advanced search  

News:

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

Pages: [1]   Go Down

Author Topic: Additional custom fields  (Read 695 times)

0 Members and 1 Guest are viewing this topic.

FrA1l3

  • Translator
  • Coppermine novice
  • **
  • Country: es
  • Offline Offline
  • Gender: Male
  • Posts: 49
Additional custom fields
« on: August 10, 2018, 11:43:49 pm »

hello I do not expect support from this, but I wanted to know if you can tell me how to solve a small visualization fault that I have.

As you know, here: http://forum.coppermine-gallery.net/index.php/topic,35263.20.html
I have been adding the improvement of adding custom fields since several versions to my coppermine gallery.

The fact is that everything works fine, except that I'm going to show you.

The display of data in the file displayimage.php of the fields added afterwards (from user 5 to user20) fails, however in the files edit_one_pic.php or editpics.php they look perfectly.


I have found the manual way to visualize the name of the fields in this way:
but I still can not upload the data of the database:


I wanted to see the possibility, if you wish, to include more user fields by default or the mechanism to extend them. Or if not, see if you can help me to continue modifying the files with the arrangement.

Thanks in advance!  :)
Logged

ron4mac

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Posts: 947
Re: Additional custom fields
« Reply #1 on: August 11, 2018, 02:39:52 pm »

For CPG 1.6.x, in the file displayimage.php at around line number 184, change:
Code: [Select]
    for ($i = 1; $i <= 4; $i++) {to:
Code: [Select]
    for ($i = 1; $i <= 20; $i++) {
And, yes, I agree that we should make CPG able to work with as many user fields as you want.
Logged

FrA1l3

  • Translator
  • Coppermine novice
  • **
  • Country: es
  • Offline Offline
  • Gender: Male
  • Posts: 49
Re: Re: Additional custom fields
« Reply #2 on: August 11, 2018, 11:18:00 pm »

For CPG 1.6.x, in the file displayimage.php at around line number 184, change:
Code: [Select]
    for ($i = 1; $i <= 4; $i++) {to:
Code: [Select]
    for ($i = 1; $i <= 20; $i++) {
And, yes, I agree that we should make CPG able to work with as many user fields as you want.

Thank you for the reply, but if you see the attached file "code.png" you can view that the file had this modification yet, but it can't show the data.

Best regards!
Logged

ron4mac

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Posts: 947
Re: Additional custom fields
« Reply #3 on: August 12, 2018, 02:29:10 pm »

You must also make a similar change in include/functions.inc.php at around line 1356:
(should set to the exact number of user fields you are using)
Code: [Select]
        for ($i = 1; $i <= 8; $i++) {
Logged

FrA1l3

  • Translator
  • Coppermine novice
  • **
  • Country: es
  • Offline Offline
  • Gender: Male
  • Posts: 49
Re: Re: Additional custom fields
« Reply #4 on: August 13, 2018, 09:34:20 am »

You must also make a similar change in include/functions.inc.php at around line 1356:
(should set to the exact number of user fields you are using)
Code: [Select]
        for ($i = 1; $i <= 8; $i++) {

Hello, thank you very much for the information. I had not seen that code in functions.php, it has been modifying that loop and everything works perfectly. I leave a sample.

Once again, thank you very much ron4mac   ;D ;D
I owe you a beer or two!
Logged

FrA1l3

  • Translator
  • Coppermine novice
  • **
  • Country: es
  • Offline Offline
  • Gender: Male
  • Posts: 49
Re: Additional custom fields
« Reply #5 on: August 13, 2018, 09:34:59 am »

the sample...  ;D
Logged
Pages: [1]   Go Up
 

Page created in 0.022 seconds with 20 queries.