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: Additional custom fields  (Read 15878 times)

0 Members and 1 Guest are viewing this topic.

FrA1l3

  • Translator
  • Coppermine regular visitor
  • **
  • Country: es
  • Offline Offline
  • Posts: 78
    • ACMSB
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

  • Administrator
  • Coppermine addict
  • *****
  • Country: us
  • Offline Offline
  • Posts: 2026
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 regular visitor
  • **
  • Country: es
  • Offline Offline
  • Posts: 78
    • ACMSB
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

  • Administrator
  • Coppermine addict
  • *****
  • Country: us
  • Offline Offline
  • Posts: 2026
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 regular visitor
  • **
  • Country: es
  • Offline Offline
  • Posts: 78
    • ACMSB
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 regular visitor
  • **
  • Country: es
  • Offline Offline
  • Posts: 78
    • ACMSB
Re: Additional custom fields
« Reply #5 on: August 13, 2018, 09:34:59 am »

the sample...  ;D
Logged

BusAmerica

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 66
Re: Additional custom fields
« Reply #6 on: May 21, 2020, 05:58:06 pm »

Hello, and sorry if i have to open a new thread on this same topic. I take the CPG 1.6.x

*I modified code in
displayimage.php (in line 181)
with:
        for ($i = 1; $i <= 10; $i++) {

*And I modified
include/functions.inc.php (in line 1356)
with:
        for ($i = 1; $i <= 8; $i++) {

Like ron4mac gentily explicate, but not extra fields appears.

Is necessary to modified, like the olds CPG versions, all of these files (like Doggy expained: https://forum.coppermine-gallery.net/index.php/topic,35263.0.html) ?

    db_input.php
    editOnePic.php
    editpics.php
    lang/english.php
    lang/french.php
    image_processor.php
    include/picmgmt.inc.php
    include/search.inc.php
    thumbnails.php
    upload.php
    xp_publish.php


Thanks in advance
Best regards
Logged

ron4mac

  • Administrator
  • Coppermine addict
  • *****
  • Country: us
  • Offline Offline
  • Posts: 2026
Re: Additional custom fields
« Reply #7 on: May 21, 2020, 06:50:03 pm »

There are many files in the CPG package that would need to be modified to successfully add and manage more custom user fields for images. And the fields would actually need to be added to the database. And all those changes would need to be done again after a CPG update.

You might consider doubling or tripling up on using what custom fields there are.
Instead of:
Quote
(field1) Make: Chevrolet
(field2) Model: Impala
(field3) Year: 1995
(field4) Color: Maroon
image info could be entered as:
Quote
(field1) Car: 1995 | Chevrolet | Impala | Maroon
And, if it is a matter of being able to search, it would be much easier to improve search capability than to make all the modifications needed for additional custom fields.

That all said ... if there were to be a significant outpouring of users requesting a variable number of custom fields, it could be worked into a future release.
« Last Edit: May 21, 2020, 06:55:29 pm by ron4mac »
Logged

BusAmerica

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 66
Re: Additional custom fields
« Reply #8 on: May 22, 2020, 12:36:06 am »

Thanks Ron.

You are the one who knows, so I 'll follow your advice. I do it since 2008, when I created the gallery.
But with these metod I don't order , like subfiles, the different characteristics

Now
Quote
(field1) CARROCERIA ( Marca / Modelo ): CAMETAL / JUMBUS

The ideal
(field1) CARROCERIA ( Marca ): CAMETAL
(field2) CARROCERIA ( Modelo ): JUMBUS

Complemented with an order system, which allows grouping all: (field2) CARROCERIA ( Modelo )
The field2 insert in field 1

Like this site, who processing millions of images:
https://onibusbrasil.com/modelos/carroceria/cametal/jumbus (similary field 2)
https://onibusbrasil.com/modelos/carroceria/cametal (similary field 1)

I'll post my wish, in "Feature Requests".
And 'll follow your advice.

Very thankful
Best regards
Logged

FrA1l3

  • Translator
  • Coppermine regular visitor
  • **
  • Country: es
  • Offline Offline
  • Posts: 78
    • ACMSB
Re: Additional custom fields
« Reply #9 on: May 23, 2020, 12:05:35 pm »

Hello,

I have been modifying custom fields for several versions, I have lost count, I do not know if I have had to modify them for about 6 versions or so. As @ron4mac says
all of these changes would have to be done again after a CPG update. And it gets very heavy, trust me.

Anyway, it personally compensates me and I always try to be up-to-date on updates due to security issues.

For example in my case to have 100% functionality with 20 additional fields, in version 1.6.07 I have modified the following files:

 
albmgr.php
db_input.php
displayimage.php
edit_one_pic.php
editpics.php
profile.php
thumbnails.php
*uniload.php
update.php
include/admin.inc.php
include/functions.inc.php
*include/picmgmt.inc.php
*include/search.inc.php
*plugins/upload_h5a/codebase.php
*plugins/upload_h5a/admin.php
*plugins/upload_h5a/config.php
*plugins/upload_h5a/initialize.inc.php
*plugins/upload_sgl/codebase.php
lang/english.php

best regads!
Logged

BusAmerica

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 66
Re: Additional custom fields
« Reply #10 on: April 17, 2021, 06:33:39 am »

Thanks FrA1-3

I am grateful for the task they do.

As I responded to Ron, I will take your advice. But allowing to implement more lockers or include them as sub folders, it would be very good

Best regards
Logged

FrA1l3

  • Translator
  • Coppermine regular visitor
  • **
  • Country: es
  • Offline Offline
  • Posts: 78
    • ACMSB
Re: Additional custom fields
« Reply #11 on: May 04, 2021, 04:16:54 pm »

Hello,

I know Ron's solution is easier, but I like to have each field separate for cleanliness when navigating with a small device, such as a mobile phone.
I have applied the change in version 1.6.12 and they are still the same files to modify since the last post, regards!  :D
Logged

BusAmerica

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 66
Re: Additional custom fields
« Reply #12 on: May 28, 2021, 02:01:39 pm »

Thanks for the info

I also consider that it is better to have the option of more fields

But modifying all those files correctly without errors is a difficult task for a newbie like me.

As always thanks for the homework and helpful comments.

Best regards

********************

Gracias por la información

Yo también considero que es mejor tener la opción de mas campos

Mas, modificar todos esos archivos correctamente si errores, es una tarea dificil para un novato como yo.

Como siempre gracias por la tarea y los comentarios de ayuda.

Saludos cordiales
Logged

FrA1l3

  • Translator
  • Coppermine regular visitor
  • **
  • Country: es
  • Offline Offline
  • Posts: 78
    • ACMSB
Re: Additional custom fields
« Reply #13 on: November 25, 2023, 02:41:31 pm »

Mods for 1.6.25:

You need to use Fileseek for example and search this words:

  • user4
  • user_field4_name
  • usr4
  • user_field
  • user4

Other words to search (but you can find it with usr4 as well:
   enabusr4
   usr4fld
   usr4checked

And this is the list of files to modify to get 100% functionality:
db_imput.php
edit_one_pic.php
editpics.php
thumbnails.php
uniload.php
update.php
search.php
include/admin.inc.php
include/functions.inc.php
include/picmgmt.inc.php
include/search.inc.php
include/codebase.php
plugins/upload_h5a/admin.php
plugins/upload_h5a/config.php
plugins/upload_h5a/initialize.inc.php
plugins/upload_h5a/js/upload.js
plugins/upload_h5a/js/upload.min.js
plugins/upload_sgl/codebase.php
sql/schema.sql
sql/basic.sql
Logged
Pages: [1]   Go Up
 

Page created in 0.026 seconds with 19 queries.