Additional custom fields Additional custom fields
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

Additional custom fields

Started by FrA1l3, August 10, 2018, 11:43:49 PM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

FrA1l3

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!  :)

ron4mac

For CPG 1.6.x, in the file displayimage.php at around line number 184, change:
    for ($i = 1; $i <= 4; $i++) {
to:
    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.

FrA1l3

Quote from: ron4mac on August 11, 2018, 02:39:52 PM
For CPG 1.6.x, in the file displayimage.php at around line number 184, change:
    for ($i = 1; $i <= 4; $i++) {
to:
    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!

ron4mac

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)
        for ($i = 1; $i <= 8; $i++) {

FrA1l3

Quote from: ron4mac 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)
        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!

FrA1l3

the sample...  ;D

BusAmerica

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

ron4mac

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

BusAmerica

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

FrA1l3

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!

BusAmerica

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

FrA1l3

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

BusAmerica

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

FrA1l3

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