coppermine-gallery.com/forum

Support => cpg1.4.x Support => Older/other versions => cpg1.4 miscellaneous => Topic started by: buuben on September 22, 2006, 01:01:31 AM

Title: Different Custom Fields?
Post by: buuben on September 22, 2006, 01:01:31 AM
The problem is the additional custom fields when you add some pictures in upload.php. I tried to modify the text_box field on the code but it appears that Coppermine generates all the fields from one piece of script. And I would like to add a drop-down list for one choice but with my skills I haven't figured out how the h*ll to do that.

Please, tell me is there any solution for this or am I going to drown myself in to the sea of frustration...
Title: Re: Different Custom Fields?
Post by: buuben on September 27, 2006, 02:20:14 AM
Well, since no one was interested about this I started to modify Coppermine with my almost non existent PHP-skills.

I managed to create a dropdown menu in upload page and get the data to MySQL as a one parameter for a picture. The dropdown is done to upload.php-file in a very simple way like this:

// Trying to get the dropdown shit workin...
function country_input($name) {
  global $CONFIG, $lang_upload_php;
  $name = "country";

    // start dropdown
    echo <<<EOT
<tr><td class="tableb">Country</td><td class="tableb" valign="top">
<select name="$name" class="listbox">
<option value=''>Select Country</option>
EOT;

include ("maat.txt");

  // And the ending shit...
  echo <<<EOT
</select> </td></tr>
EOT;

}


Well, now the real problem is this: That text include is very problematic if I want to add a similar dropdown to another place. Say when a member or admin wants to change the country-parameter of the picture...

Has anyone a suggestions or ideas to do this adding "thingy" in much more better way?


Title: Re: Different Custom Fields?
Post by: Joachim Müller on October 01, 2006, 03:17:59 PM
Doesn't work that way. Modifying the output is easy. Modifying the forms and database queries are not. Without intermediate to good PHP skills, you won't be able to accomplish this. However, there is a mod that let's you add more custom fields - please use the search (http://forum.coppermine-gallery.net/index.php?action=search).
Title: Re: Different Custom Fields?
Post by: buuben on October 02, 2006, 04:43:25 PM
Thanks GauGau, after a while I figured it out also.

Actually, I asked one of my friends with good PHP-skills to do this with me. So, if we can get a proped mod for the search we will post it to mod-section...

t, buuben
Title: Re: Different Custom Fields?
Post by: Joachim Müller on October 02, 2006, 06:08:28 PM
OK, great. Please post your mod here (you won't be able to start new threads on the mods board) - a moderator will move your thread if applicable.

Cheers

Joachim