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] 2   Go Down

Author Topic: Additional Custom Fields  (Read 37764 times)

0 Members and 1 Guest are viewing this topic.

Doggy

  • Contributor
  • Coppermine regular visitor
  • ***
  • Offline Offline
  • Posts: 63
Additional Custom Fields
« on: August 22, 2006, 09:39:58 pm »

You can add 16 Custom Fields with this modification:

Author :  Doggy

1. The file to modify.

  • db_input.php
  • displayimage.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

Download this files and make a Backup before the moditications !

Make this next modifications (the file will replaced in the ftp at the last moment !!).

Open: db_input.php
Find:
Code: [Select]
        $user1 = addslashes($_POST['user1']);
        $user2 = addslashes($_POST['user2']);
        $user3 = addslashes($_POST['user3']);
        $user4 = addslashes($_POST['user4']);

Add below:
Code: [Select]
$user5 = addslashes($_POST['user5']);
$user6 = addslashes($_POST['user6']);
$user7 = addslashes($_POST['user7']);
$user8 = addslashes($_POST['user8']);
$user9 = addslashes($_POST['user9']);
$user10 = addslashes($_POST['user10']);
$user11 = addslashes($_POST['user11']);
        $user12 = addslashes($_POST['user12']);
        $user13 = addslashes($_POST['user13']);
        $user14 = addslashes($_POST['user14']);
$user15 = addslashes($_POST['user15']);
$user16 = addslashes($_POST['user16']);
$user17 = addslashes($_POST['user17']);
$user18 = addslashes($_POST['user18']);
$user19 = addslashes($_POST['user19']);
$user20 = addslashes($_POST['user20']);


Find:
Code: [Select]
$user1, $user2, $user3, $user4,
Add below:
Code: [Select]
$user5, $user6, $user7, $user8, $user9, $user10, $user11, $user12, $user13, $user14, $user15, $user16, $user17, $user18, $user19, $user20,
Save & Close : db_input.php


Open: displayimage.php
Find:
Code: [Select]
for ($i = 1; $i <= 4; $i++)
Replace 4 by 20:
Code: [Select]
for ($i = 1; $i <= 20; $i++)
Save & Close : displayimage.php


Open: editOnePic.php
Find:
Code: [Select]
    $user1        = $_POST['user1'];
    $user2        = $_POST['user2'];
    $user3        = $_POST['user3'];
    $user4        = $_POST['user4'];

Add below :
Code: [Select]
$user5        = $_POST['user5'];
$user6        = $_POST['user6'];
$user7        = $_POST['user7'];
$user8        = $_POST['user8'];
$user9        = $_POST['user9'];
$user10        = $_POST['user10'];
    $user11        = $_POST['user11'];
    $user12        = $_POST['user12'];
    $user13        = $_POST['user13'];
    $user14        = $_POST['user14'];
$user15        = $_POST['user15'];
$user16        = $_POST['user16'];
$user17        = $_POST['user17'];
$user18        = $_POST['user18'];
$user19        = $_POST['user19'];
$user20        = $_POST['user20'];


Find:
Code: [Select]
    $update .= ", user1 = '".addslashes($user1)."'";
    $update .= ", user2 = '".addslashes($user2)."'";
    $update .= ", user3 = '".addslashes($user3)."'";
    $update .= ", user4 = '".addslashes($user4)."'";

Add below :
Code: [Select]
$update .= ", user5 = '".addslashes($user5)."'";
$update .= ", user6 = '".addslashes($user6)."'";
$update .= ", user7 = '".addslashes($user7)."'";
$update .= ", user8 = '".addslashes($user8)."'";
$update .= ", user9 = '".addslashes($user9)."'";
$update .= ", user10 = '".addslashes($user10)."'";
    $update .= ", user11 = '".addslashes($user11)."'";
    $update .= ", user12 = '".addslashes($user12)."'";
    $update .= ", user13 = '".addslashes($user13)."'";
    $update .= ", user14 = '".addslashes($user14)."'";
$update .= ", user15 = '".addslashes($user15)."'";
$update .= ", user16 = '".addslashes($user16)."'";
$update .= ", user17 = '".addslashes($user17)."'";
$update .= ", user18 = '".addslashes($user18)."'";
$update .= ", user19 = '".addslashes($user19)."'";
$update .= ", user20 = '".addslashes($user20)."'";


Find:
Code: [Select]
EOT;
if ($CONFIG['user_field1_name'] != ''){
echo <<<EOT
        <tr>
            <td class="tableb" style="white-space: nowrap;">
                {$CONFIG['user_field1_name']}
                </td>
                <td width="100%" class="tableb" valign="top">
                                <input type="text" style="width: 100%" name="user1" maxlength="255" value="{$CURRENT_PIC['user1']}" class="textinput" />
                        </td>
        </tr>
EOT;
}
if ($CONFIG['user_field2_name'] != ''){
echo <<<EOT
        <tr>
            <td class="tableb" style="white-space: nowrap;">
                {$CONFIG['user_field2_name']}
                </td>
                <td width="100%" class="tableb" valign="top">
                <input type="text" style="width: 100%" name="user2" maxlength="255" value="{$CURRENT_PIC['user2']}" class="textinput" />
                        </td>
        </tr>
EOT;
}if ($CONFIG['user_field3_name'] != ''){
echo <<<EOT
        <tr>
            <td class="tableb" style="white-space: nowrap;">
                {$CONFIG['user_field3_name']}
                </td>
                <td width="100%" class="tableb" valign="top">
                <input type="text" style="width: 100%" name="user3" maxlength="255" value="{$CURRENT_PIC['user3']}" class="textinput" />
                        </td>
        </tr>
EOT;
}if ($CONFIG['user_field4_name'] != ''){
echo <<<EOT
        <tr>
            <td class="tableb" style="white-space: nowrap;">
                {$CONFIG['user_field4_name']}
                </td>
                <td width="100%" class="tableb" valign="top">
                <input type="text" style="width: 100%" name="user4" maxlength="255" value="{$CURRENT_PIC['user4']}" class="textinput" />
                        </td>
        </tr>
EOT;
}

Add below :
Code: [Select]
if ($CONFIG['user_field5_name'] != ''){
echo <<<EOT
        <tr>
            <td class="tableb" style="white-space: nowrap;">
                {$CONFIG['user_field5_name']}
                </td>
                <td width="100%" class="tableb" valign="top">
                <input type="text" style="width: 100%" name="user5" maxlength="255" value="{$CURRENT_PIC['user5']}" class="textinput" />
                        </td>
        </tr>
EOT;
}if ($CONFIG['user_field6_name'] != ''){
echo <<<EOT
        <tr>
            <td class="tableb" style="white-space: nowrap;">
                {$CONFIG['user_field6_name']}
                </td>
                <td width="100%" class="tableb" valign="top">
                <input type="text" style="width: 100%" name="user6" maxlength="255" value="{$CURRENT_PIC['user6']}" class="textinput" />
                        </td>
        </tr>
EOT;
}if ($CONFIG['user_field7_name'] != ''){
echo <<<EOT
        <tr>
            <td class="tableb" style="white-space: nowrap;">
                {$CONFIG['user_field7_name']}
                </td>
                <td width="100%" class="tableb" valign="top">
                <input type="text" style="width: 100%" name="user7" maxlength="255" value="{$CURRENT_PIC['user7']}" class="textinput" />
                        </td>
        </tr>
EOT;
}if ($CONFIG['user_field8_name'] != ''){
echo <<<EOT
        <tr>
            <td class="tableb" style="white-space: nowrap;">
                {$CONFIG['user_field8_name']}
                </td>
                <td width="100%" class="tableb" valign="top">
                <input type="text" style="width: 100%" name="user8" maxlength="255" value="{$CURRENT_PIC['user8']}" class="textinput" />
                        </td>
        </tr>
EOT;
}if ($CONFIG['user_field9_name'] != ''){
echo <<<EOT
        <tr>
            <td class="tableb" style="white-space: nowrap;">
                {$CONFIG['user_field9_name']}
                </td>
                <td width="100%" class="tableb" valign="top">
                <input type="text" style="width: 100%" name="user9" maxlength="255" value="{$CURRENT_PIC['user9']}" class="textinput" />
                        </td>
        </tr>
EOT;
}if ($CONFIG['user_field10_name'] != ''){
echo <<<EOT
        <tr>
            <td class="tableb" style="white-space: nowrap;">
                {$CONFIG['user_field10_name']}
                </td>
                <td width="100%" class="tableb" valign="top">
                <input type="text" style="width: 100%" name="user10" maxlength="255" value="{$CURRENT_PIC['user10']}" class="textinput" />
                        </td>
        </tr>
EOT;
}if ($CONFIG['user_field11_name'] != ''){
echo <<<EOT
        <tr>
            <td class="tableb" style="white-space: nowrap;">
                {$CONFIG['user_field11_name']}
                </td>
                <td width="100%" class="tableb" valign="top">
                                <input type="text" style="width: 100%" name="user11" maxlength="255" value="{$CURRENT_PIC['user11']}" class="textinput" />
                        </td>
        </tr>
EOT;
}
if ($CONFIG['user_field12_name'] != ''){
echo <<<EOT
        <tr>
            <td class="tableb" style="white-space: nowrap;">
                {$CONFIG['user_field12_name']}
                </td>
                <td width="100%" class="tableb" valign="top">
                <input type="text" style="width: 100%" name="user12" maxlength="255" value="{$CURRENT_PIC['user12']}" class="textinput" />
                        </td>
        </tr>
EOT;
}if ($CONFIG['user_field13_name'] != ''){
echo <<<EOT
        <tr>
            <td class="tableb" style="white-space: nowrap;">
                {$CONFIG['user_field13_name']}
                </td>
                <td width="100%" class="tableb" valign="top">
                <input type="text" style="width: 100%" name="user13" maxlength="255" value="{$CURRENT_PIC['user13']}" class="textinput" />
                        </td>
        </tr>
EOT;
}if ($CONFIG['user_field14_name'] != ''){
echo <<<EOT
        <tr>
            <td class="tableb" style="white-space: nowrap;">
                {$CONFIG['user_field14_name']}
                </td>
                <td width="100%" class="tableb" valign="top">
                <input type="text" style="width: 100%" name="user14" maxlength="255" value="{$CURRENT_PIC['user14']}" class="textinput" />
                        </td>
        </tr>
EOT;
}if ($CONFIG['user_field15_name'] != ''){
echo <<<EOT
        <tr>
            <td class="tableb" style="white-space: nowrap;">
                {$CONFIG['user_field15_name']}
                </td>
                <td width="100%" class="tableb" valign="top">
                <input type="text" style="width: 100%" name="user15" maxlength="255" value="{$CURRENT_PIC['user15']}" class="textinput" />
                        </td>
        </tr>
EOT;
}if ($CONFIG['user_field16_name'] != ''){
echo <<<EOT
        <tr>
            <td class="tableb" style="white-space: nowrap;">
                {$CONFIG['user_field16_name']}
                </td>
                <td width="100%" class="tableb" valign="top">
                <input type="text" style="width: 100%" name="user16" maxlength="255" value="{$CURRENT_PIC['user16']}" class="textinput" />
                        </td>
        </tr>
EOT;
}if ($CONFIG['user_field17_name'] != ''){
echo <<<EOT
        <tr>
            <td class="tableb" style="white-space: nowrap;">
                {$CONFIG['user_field17_name']}
                </td>
                <td width="100%" class="tableb" valign="top">
                <input type="text" style="width: 100%" name="user17" maxlength="255" value="{$CURRENT_PIC['user17']}" class="textinput" />
                        </td>
        </tr>
EOT;
}if ($CONFIG['user_field18_name'] != ''){
echo <<<EOT
        <tr>
            <td class="tableb" style="white-space: nowrap;">
                {$CONFIG['user_field18_name']}
                </td>
                <td width="100%" class="tableb" valign="top">
                <input type="text" style="width: 100%" name="user18" maxlength="255" value="{$CURRENT_PIC['user18']}" class="textinput" />
                        </td>
        </tr>
EOT;
}if ($CONFIG['user_field19_name'] != ''){
echo <<<EOT
        <tr>
            <td class="tableb" style="white-space: nowrap;">
                {$CONFIG['user_field19_name']}
                </td>
                <td width="100%" class="tableb" valign="top">
                <input type="text" style="width: 100%" name="user19" maxlength="255" value="{$CURRENT_PIC['user19']}" class="textinput" />
                        </td>
        </tr>

EOT;
}if ($CONFIG['user_field20_name'] != ''){
echo <<<EOT
        <tr>
            <td class="tableb" style="white-space: nowrap;">
                {$CONFIG['user_field20_name']}
                </td>
                <td width="100%" class="tableb" valign="top">
                <input type="text" style="width: 100%" name="user20" maxlength="255" value="{$CURRENT_PIC['user20']}" class="textinput" />
                        </td>
        </tr>
EOT;
}

Find:
Code: [Select]
if ($CONFIG['user_field1_name'] != '') $THUMB_ROWSPAN++;
if ($CONFIG['user_field2_name'] != '') $THUMB_ROWSPAN++;
if ($CONFIG['user_field3_name'] != '') $THUMB_ROWSPAN++;
if ($CONFIG['user_field4_name'] != '') $THUMB_ROWSPAN++;

Add below :
Code: [Select]
if ($CONFIG['user_field6_name'] != '') $THUMB_ROWSPAN++;
if ($CONFIG['user_field7_name'] != '') $THUMB_ROWSPAN++;
if ($CONFIG['user_field8_name'] != '') $THUMB_ROWSPAN++;
if ($CONFIG['user_field9_name'] != '') $THUMB_ROWSPAN++;
if ($CONFIG['user_field10_name'] != '') $THUMB_ROWSPAN++;
if ($CONFIG['user_field11_name'] != '') $THUMB_ROWSPAN++;
if ($CONFIG['user_field12_name'] != '') $THUMB_ROWSPAN++;
if ($CONFIG['user_field13_name'] != '') $THUMB_ROWSPAN++;
if ($CONFIG['user_field14_name'] != '') $THUMB_ROWSPAN++;
if ($CONFIG['user_field15_name'] != '') $THUMB_ROWSPAN++;
if ($CONFIG['user_field16_name'] != '') $THUMB_ROWSPAN++;
if ($CONFIG['user_field17_name'] != '') $THUMB_ROWSPAN++;
if ($CONFIG['user_field18_name'] != '') $THUMB_ROWSPAN++;
if ($CONFIG['user_field19_name'] != '') $THUMB_ROWSPAN++;
if ($CONFIG['user_field20_name'] != '') $THUMB_ROWSPAN++;


Save & Close : editOnePic.php
« Last Edit: August 23, 2006, 05:37:48 am by GauGau »
Logged

Doggy

  • Contributor
  • Coppermine regular visitor
  • ***
  • Offline Offline
  • Posts: 63
Re: Additional Custom Fields
« Reply #1 on: August 22, 2006, 09:42:28 pm »

Open: editpics.php
Find:
Code: [Select]
        array($CONFIG['user_field1_name'], 'user1', 0, 255),
        array($CONFIG['user_field2_name'], 'user2', 0, 255),
        array($CONFIG['user_field3_name'], 'user3', 0, 255),
        array($CONFIG['user_field4_name'], 'user4', 0, 255),

Add below:
Code: [Select]
array($CONFIG['user_field5_name'], 'user5', 0, 255),
array($CONFIG['user_field6_name'], 'user6', 0, 255),
array($CONFIG['user_field7_name'], 'user7', 0, 255),
array($CONFIG['user_field8_name'], 'user8', 0, 255),
array($CONFIG['user_field9_name'], 'user9', 0, 255),
array($CONFIG['user_field10_name'], 'user10', 0, 255),
    array($CONFIG['user_field11_name'], 'user11', 0, 255),
        array($CONFIG['user_field12_name'], 'user12', 0, 255),
        array($CONFIG['user_field13_name'], 'user13', 0, 255),
        array($CONFIG['user_field14_name'], 'user14', 0, 255),
array($CONFIG['user_field15_name'], 'user15', 0, 255),
array($CONFIG['user_field16_name'], 'user16', 0, 255),
array($CONFIG['user_field17_name'], 'user17', 0, 255),
array($CONFIG['user_field18_name'], 'user18', 0, 255),
array($CONFIG['user_field19_name'], 'user19', 0, 255),
array($CONFIG['user_field20_name'], 'user20', 0, 255),

Find:
Code: [Select]
                $user1       = get_post_var('user1', $pid);
                $user2       = get_post_var('user2', $pid);
                $user3       = get_post_var('user3', $pid);
                $user4       = get_post_var('user4', $pid);

Add below:
Code: [Select]
$user5       = get_post_var('user5', $pid);
$user6       = get_post_var('user6', $pid);
$user7       = get_post_var('user7', $pid);
$user8       = get_post_var('user8', $pid);
$user9       = get_post_var('user9', $pid);
$user10       = get_post_var('user10', $pid);
            $user11       = get_post_var('user11', $pid);
                $user12       = get_post_var('user12', $pid);
                $user13       = get_post_var('user13', $pid);
                $user14       = get_post_var('user14', $pid);
$user15       = get_post_var('user15', $pid);
$user16       = get_post_var('user16', $pid);
$user17       = get_post_var('user17', $pid);
$user18       = get_post_var('user18', $pid);
$user19       = get_post_var('user19', $pid);
$user20       = get_post_var('user20', $pid);

Find:
Code: [Select]
                $update .= ", user1 = '".addslashes($user1)."'";
                $update .= ", user2 = '".addslashes($user2)."'";
                $update .= ", user3 = '".addslashes($user3)."'";
                $update .= ", user4 = '".addslashes($user4)."'";

Add below:
Code: [Select]
$update .= ", user5 = '".addslashes($user5)."'";
$update .= ", user6 = '".addslashes($user6)."'";
$update .= ", user7 = '".addslashes($user7)."'";
$update .= ", user8 = '".addslashes($user8)."'";
$update .= ", user9 = '".addslashes($user9)."'";
$update .= ", user10 = '".addslashes($user10)."'";
                $update .= ", user11 = '".addslashes($user11)."'";
                $update .= ", user12 = '".addslashes($user12)."'";
                $update .= ", user13 = '".addslashes($user13)."'";
                $update .= ", user14 = '".addslashes($user14)."'";
$update .= ", user15 = '".addslashes($user15)."'";
$update .= ", user16 = '".addslashes($user16)."'";
$update .= ", user17 = '".addslashes($user17)."'";
$update .= ", user18 = '".addslashes($user18)."'";
$update .= ", user19 = '".addslashes($user19)."'";
$update .= ", user20 = '".addslashes($user20)."'";

Find:
Code: [Select]
if ($CONFIG['user_field1_name'] != '') $THUMB_ROWSPAN++;
if ($CONFIG['user_field2_name'] != '') $THUMB_ROWSPAN++;
if ($CONFIG['user_field3_name'] != '') $THUMB_ROWSPAN++;
if ($CONFIG['user_field4_name'] != '') $THUMB_ROWSPAN++;

Add below:
Code: [Select]
if ($CONFIG['user_field5_name'] != '') $THUMB_ROWSPAN++;
if ($CONFIG['user_field6_name'] != '') $THUMB_ROWSPAN++;
if ($CONFIG['user_field7_name'] != '') $THUMB_ROWSPAN++;
if ($CONFIG['user_field8_name'] != '') $THUMB_ROWSPAN++;
if ($CONFIG['user_field9_name'] != '') $THUMB_ROWSPAN++;
if ($CONFIG['user_field10_name'] != '') $THUMB_ROWSPAN++;
if ($CONFIG['user_field11_name'] != '') $THUMB_ROWSPAN++;
if ($CONFIG['user_field12_name'] != '') $THUMB_ROWSPAN++;
if ($CONFIG['user_field13_name'] != '') $THUMB_ROWSPAN++;
if ($CONFIG['user_field14_name'] != '') $THUMB_ROWSPAN++;
if ($CONFIG['user_field15_name'] != '') $THUMB_ROWSPAN++;
if ($CONFIG['user_field16_name'] != '') $THUMB_ROWSPAN++;
if ($CONFIG['user_field17_name'] != '') $THUMB_ROWSPAN++;
if ($CONFIG['user_field18_name'] != '') $THUMB_ROWSPAN++;
if ($CONFIG['user_field19_name'] != '') $THUMB_ROWSPAN++;
if ($CONFIG['user_field20_name'] != '') $THUMB_ROWSPAN++;

Save & Close : editpics.php


Open: lang/english.php
Find:
Code: [Select]
  array('Field 1 name', 'user_field1_name', 0, 'f=index.htm&amp;as=admin_custom_image&amp;ae=admin_custom_image_end'), //cpg1.4
  array('Field 2 name', 'user_field2_name', 0),
  array('Field 3 name', 'user_field3_name', 0),
  array('Field 4 name', 'user_field4_name', 0),

Add below:
Code: [Select]
  array('Field 5 name', 'user_field5_name', 0),
  array('Field 6 name', 'user_field6_name', 0),
  array('Field 7 name', 'user_field7_name', 0),
  array('Field 8 name', 'user_field8_name', 0),
  array('Field 9 name', 'user_field9_name', 0),
  array('Field 10 name', 'user_field10_name', 0),
  array('Field 11 name', 'user_field11_name', 0),
  array('Field 12 name', 'user_field12_name', 0),
  array('Field 13 name', 'user_field13_name', 0),
  array('Field 14 name', 'user_field14_name', 0),
  array('Field 15 name', 'user_field15_name', 0),
  array('Field 16 name', 'user_field16_name', 0),
  array('Field 17 name', 'user_field17_name', 0),
  array('Field 18 name', 'user_field18_name', 0),
  array('Field 19 name', 'user_field19_name', 0),
  array('Field 20 name', 'user_field20_name', 0),

Save & Close : lang/english.php


Open: lang/french.php
Find:
Code: [Select]
  array('Nom du champ 1', 'user_field1_name', 0, 'f=index.htm&amp;as=admin_custom_image&amp;ae=admin_custom_image_end'), //cpg1.4
  array('Nom du champ 2', 'user_field2_name', 0),
  array('Nom du champ 3', 'user_field3_name', 0),
  array('Nom du champ 4', 'user_field4_name', 0),

Add below:
Code: [Select]
  array('Nom du champ 5', 'user_field5_name', 0),
  array('Nom du champ 6', 'user_field6_name', 0),
  array('Nom du champ 7', 'user_field7_name', 0),
  array('Nom du champ 8', 'user_field8_name', 0),
  array('Nom du champ 9', 'user_field9_name', 0),
  array('Nom du champ 10', 'user_field10_name', 0),
  array('Nom du champ 11', 'user_field11_name', 0),
  array('Nom du champ 12', 'user_field12_name', 0),
  array('Nom du champ 13', 'user_field13_name', 0),
  array('Nom du champ 14', 'user_field14_name', 0),
  array('Nom du champ 15', 'user_field15_name', 0),
  array('Nom du champ 16', 'user_field16_name', 0),
  array('Nom du champ 17', 'user_field17_name', 0),
  array('Nom du champ 18', 'user_field18_name', 0),
  array('Nom du champ 19', 'user_field19_name', 0),
  array('Nom du champ 20', 'user_field20_name', 0),

Save & Close : lang/french.php
Logged

Doggy

  • Contributor
  • Coppermine regular visitor
  • ***
  • Offline Offline
  • Posts: 63
Re: Additional Custom Fields
« Reply #2 on: August 22, 2006, 09:44:36 pm »

Open: image_processor.php
Find:
Code: [Select]
global $user1;
global $user2;
global $user3;
global $user4;

Add below:
Code: [Select]
global $user5;
global $user6;
global $user7;
global $user8;
global $user9;
global $user10;
global $user11;
global $user12;
global $user13;
global $user14;
global $user15;
global $user16;
global $user17;
global $user18;
global $user19;
global $user20;

Find:
Code: [Select]
print "<input type=\"hidden\" name=\"user1\" value=\"$user1\" />";
print "<input type=\"hidden\" name=\"user2\" value=\"$user2\" />";
print "<input type=\"hidden\" name=\"user3\" value=\"$user3\" />";
print "<input type=\"hidden\" name=\"user4\" value=\"$user4\" />";

Add below:
Code: [Select]
print "<input type=\"hidden\" name=\"user5\" value=\"$user5\" />";
print "<input type=\"hidden\" name=\"user6\" value=\"$user6\" />";
print "<input type=\"hidden\" name=\"user7\" value=\"$user7\" />";
print "<input type=\"hidden\" name=\"user8\" value=\"$user8\" />";
print "<input type=\"hidden\" name=\"user9\" value=\"$user9\" />";
print "<input type=\"hidden\" name=\"user10\" value=\"$user10\" />";
print "<input type=\"hidden\" name=\"user11\" value=\"$user11\" />";
print "<input type=\"hidden\" name=\"user12\" value=\"$user12\" />";
print "<input type=\"hidden\" name=\"user13\" value=\"$user13\" />";
print "<input type=\"hidden\" name=\"user14\" value=\"$user14\" />";
print "<input type=\"hidden\" name=\"user15\" value=\"$user15\" />";
print "<input type=\"hidden\" name=\"user16\" value=\"$user16\" />";
print "<input type=\"hidden\" name=\"user17\" value=\"$user17\" />";
print "<input type=\"hidden\" name=\"user18\" value=\"$user18\" />";
print "<input type=\"hidden\" name=\"user19\" value=\"$user19\" />";
print "<input type=\"hidden\" name=\"user20\" value=\"$user20\" />";

Find:
Code: [Select]
        $user1    = $_POST['user1'];
        $user2    = $_POST['user2'];
        $user3    = $_POST['user3'];
        $user4    = $_POST['user4'];

Add below:
Code: [Select]
$user5    = $_POST['user5'];
$user6    = $_POST['user6'];
$user7    = $_POST['user7'];
$user8    = $_POST['user8'];
$user9    = $_POST['user9'];
$user10    = $_POST['user10'];
        $user11    = $_POST['user11'];
        $user12    = $_POST['user12'];
        $user13    = $_POST['user13'];
        $user14    = $_POST['user14'];
$user15    = $_POST['user15'];
$user16    = $_POST['user16'];
$user17    = $_POST['user17'];
$user18    = $_POST['user18'];
$user19    = $_POST['user19'];
$user20    = $_POST['user20'];

Find:
Code: [Select]
        $user1    = $_POST['user1'];
        $user2    = $_POST['user2'];
        $user3    = $_POST['user3'];
        $user4    = $_POST['user4'];

Add below:
Code: [Select]
$user5    = $_POST['user5'];
$user6    = $_POST['user6'];
$user7    = $_POST['user7'];
$user8    = $_POST['user8'];
$user9    = $_POST['user9'];
$user10    = $_POST['user10'];
        $user11    = $_POST['user11'];
        $user12    = $_POST['user12'];
        $user13    = $_POST['user13'];
        $user14    = $_POST['user14'];
$user15    = $_POST['user15'];
$user16    = $_POST['user16'];
$user17    = $_POST['user17'];
$user18    = $_POST['user18'];
$user19    = $_POST['user19'];
$user20    = $_POST['user20'];

Find:
Code: [Select]
                print "<input type=\"hidden\" name=\"user1\" value=\"$user1\" />";
                print "<input type=\"hidden\" name=\"user2\" value=\"$user2\" />";
                print "<input type=\"hidden\" name=\"user3\" value=\"$user3\" />";
                print "<input type=\"hidden\" name=\"user4\" value=\"$user4\" />";

Add below:
Code: [Select]
print "<input type=\"hidden\" name=\"user5\" value=\"$user5\" />";
print "<input type=\"hidden\" name=\"user6\" value=\"$user6\" />";
print "<input type=\"hidden\" name=\"user7\" value=\"$user7\" />";
print "<input type=\"hidden\" name=\"user8\" value=\"$user8\" />";
print "<input type=\"hidden\" name=\"user9\" value=\"$user9\" />";
print "<input type=\"hidden\" name=\"user10\" value=\"$user10\" />";
print "<input type=\"hidden\" name=\"user11\" value=\"$user11\" />";
                print "<input type=\"hidden\" name=\"user12\" value=\"$user12\" />";
                print "<input type=\"hidden\" name=\"user13\" value=\"$user13\" />";
                print "<input type=\"hidden\" name=\"user14\" value=\"$user14\" />";
print "<input type=\"hidden\" name=\"user15\" value=\"$user15\" />";
print "<input type=\"hidden\" name=\"user16\" value=\"$user16\" />";
print "<input type=\"hidden\" name=\"user17\" value=\"$user17\" />";
print "<input type=\"hidden\" name=\"user18\" value=\"$user18\" />";
print "<input type=\"hidden\" name=\"user19\" value=\"$user19\" />";
print "<input type=\"hidden\" name=\"user20\" value=\"$user20\" />";

Save & Close : image_processor.php


Open: include/picmgmt.inc.php
Find:
Code: [Select]
$user1 = '', $user2 = '', $user3 = '', $user4 = '',
Add below:
Code: [Select]
$user5 = '', $user6 = '', $user7 = '', $user8 = '', $user9 = '', $user10 = '', $user11 = '', $user12 = '', $user13 = '', $user14 = '', $user15 = '', $user16 = '', $user17 = '', $user18 = '', $user19 = '', $user20 = '',
Find:
Code: [Select]
    $CURRENT_PIC_DATA['user1'] = $user1;
    $CURRENT_PIC_DATA['user2'] = $user2;
    $CURRENT_PIC_DATA['user3'] = $user3;
    $CURRENT_PIC_DATA['user4'] = $user4;

Add below:
Code: [Select]
$CURRENT_PIC_DATA['user5'] = $user5;
$CURRENT_PIC_DATA['user6'] = $user6;
$CURRENT_PIC_DATA['user7'] = $user7;
$CURRENT_PIC_DATA['user8'] = $user8;
$CURRENT_PIC_DATA['user9'] = $user9;
$CURRENT_PIC_DATA['user10'] = $user10;
    $CURRENT_PIC_DATA['user11'] = $user11;
    $CURRENT_PIC_DATA['user12'] = $user12;
    $CURRENT_PIC_DATA['user13'] = $user13;
    $CURRENT_PIC_DATA['user14'] = $user14;
$CURRENT_PIC_DATA['user15'] = $user15;
$CURRENT_PIC_DATA['user16'] = $user16;
$CURRENT_PIC_DATA['user17'] = $user17;
$CURRENT_PIC_DATA['user18'] = $user18;
$CURRENT_PIC_DATA['user19'] = $user19;
$CURRENT_PIC_DATA['user20'] = $user20;

Save & Close : include/picmgmt.inc.php


Open: include/search.inc.php
Find:
Code: [Select]
'user1', 'user2', 'user3', 'user4'
Add below:
Code: [Select]
, 'user5', 'user6', 'user7', 'user8', 'user9', 'user10', 'user11', 'user12', 'user13', 'user14', 'user15', 'user16', 'user17', 'user18', 'user19', 'user20'
Save & Close : include/search.inc.php
Logged

Doggy

  • Contributor
  • Coppermine regular visitor
  • ***
  • Offline Offline
  • Posts: 63
Re: Additional Custom Fields
« Reply #3 on: August 22, 2006, 09:47:46 pm »

Open: thumbnails.php
Find:
Code: [Select]
'user1', 'user2', 'user3', 'user4'
Add below:
Code: [Select]
, 'user5', 'user6', 'user7', 'user8', 'user9', 'user10', 'user11', 'user12', 'user13', 'user14', 'user15', 'user16', 'user17', 'user18', 'user19', 'user20'
Save & Close : thumbnails.php


Open: upload.php
Find:
Code: [Select]
        if(!empty($CONFIG['user_field1_name'])) {
            $form_array[] = array($CONFIG['user_field1_name'], 'user1', 0, 255, 1);
        }

        if(!empty($CONFIG['user_field2_name'])) {
            $form_array[] = array($CONFIG['user_field2_name'], 'user2', 0, 255, 1);
        }

        if(!empty($CONFIG['user_field3_name'])) {
            $form_array[] = array($CONFIG['user_field3_name'], 'user3', 0, 255, 1);
        }

        if(!empty($CONFIG['user_field4_name'])) {
            $form_array[] = array($CONFIG['user_field4_name'], 'user4', 0, 255, 1);
        }

Add below:
Code: [Select]

        if(!empty($CONFIG['user_field5_name'])) {
            $form_array[] = array($CONFIG['user_field5_name'], 'user5', 0, 255, 1);
        }
       
if(!empty($CONFIG['user_field6_name'])) {
            $form_array[] = array($CONFIG['user_field6_name'], 'user6', 0, 255, 1);
        }
       
if(!empty($CONFIG['user_field7_name'])) {
            $form_array[] = array($CONFIG['user_field7_name'], 'user7', 0, 255, 1);
        }

        if(!empty($CONFIG['user_field8_name'])) {
            $form_array[] = array($CONFIG['user_field8_name'], 'user8', 0, 255, 1);
        }

        if(!empty($CONFIG['user_field9_name'])) {
            $form_array[] = array($CONFIG['user_field9_name'], 'user9', 0, 255, 1);
        }

        if(!empty($CONFIG['user_field10_name'])) {
            $form_array[] = array($CONFIG['user_field10_name'], 'user10', 0, 255, 1);
        }

        if(!empty($CONFIG['user_field11_name'])) {
            $form_array[] = array($CONFIG['user_field11_name'], 'user11', 0, 255, 1);
        }

        if(!empty($CONFIG['user_field12_name'])) {
            $form_array[] = array($CONFIG['user_field12_name'], 'user12', 0, 255, 1);
        }

        if(!empty($CONFIG['user_field13_name'])) {
            $form_array[] = array($CONFIG['user_field13_name'], 'user13', 0, 255, 1);
        }

        if(!empty($CONFIG['user_field14_name'])) {
            $form_array[] = array($CONFIG['user_field14_name'], 'user14', 0, 255, 1);
        }

        if(!empty($CONFIG['user_field15_name'])) {
            $form_array[] = array($CONFIG['user_field15_name'], 'user15', 0, 255, 1);
        }
       
if(!empty($CONFIG['user_field16_name'])) {
            $form_array[] = array($CONFIG['user_field16_name'], 'user16', 0, 255, 1);
        }
       
if(!empty($CONFIG['user_field17_name'])) {
            $form_array[] = array($CONFIG['user_field17_name'], 'user17', 0, 255, 1);
        }

        if(!empty($CONFIG['user_field18_name'])) {
            $form_array[] = array($CONFIG['user_field18_name'], 'user18', 0, 255, 1);
        }

        if(!empty($CONFIG['user_field19_name'])) {
            $form_array[] = array($CONFIG['user_field19_name'], 'user19', 0, 255, 1);
        }

        if(!empty($CONFIG['user_field20_name'])) {
            $form_array[] = array($CONFIG['user_field20_name'], 'user20', 0, 255, 1);
        }

Find:
Code: [Select]
    if(!empty($CONFIG['user_field1_name'])) {
        $form_array[] = array($CONFIG['user_field1_name'], 'user1', 0, 255, 1);
    }

    if(!empty($CONFIG['user_field2_name'])) {
        $form_array[] = array($CONFIG['user_field2_name'], 'user2', 0, 255, 1);
    }

    if(!empty($CONFIG['user_field3_name'])) {
        $form_array[] = array($CONFIG['user_field3_name'], 'user3', 0, 255, 1);
    }

    if(!empty($CONFIG['user_field4_name'])) {
        $form_array[] = array($CONFIG['user_field4_name'], 'user4', 0, 255, 1);
    }

Add below:
Code: [Select]
    if(!empty($CONFIG['user_field5_name'])) {
        $form_array[] = array($CONFIG['user_field5_name'], 'user5', 0, 255, 1);
    }

    if(!empty($CONFIG['user_field6_name'])) {
        $form_array[] = array($CONFIG['user_field6_name'], 'user6', 0, 255, 1);
    }

    if(!empty($CONFIG['user_field7_name'])) {
        $form_array[] = array($CONFIG['user_field7_name'], 'user7', 0, 255, 1);
    }

    if(!empty($CONFIG['user_field8_name'])) {
        $form_array[] = array($CONFIG['user_field8_name'], 'user8', 0, 255, 1);
    }

    if(!empty($CONFIG['user_field9_name'])) {
        $form_array[] = array($CONFIG['user_field9_name'], 'user9', 0, 255, 1);
    }

    if(!empty($CONFIG['user_field10_name'])) {
        $form_array[] = array($CONFIG['user_field10_name'], 'user10', 0, 255, 1);
    }

    if(!empty($CONFIG['user_field11_name'])) {
        $form_array[] = array($CONFIG['user_field11_name'], 'user11', 0, 255, 1);
    }

    if(!empty($CONFIG['user_field12_name'])) {
        $form_array[] = array($CONFIG['user_field12_name'], 'user12', 0, 255, 1);
    }

    if(!empty($CONFIG['user_field13_name'])) {
        $form_array[] = array($CONFIG['user_field13_name'], 'user13', 0, 255, 1);
    }

    if(!empty($CONFIG['user_field14_name'])) {
        $form_array[] = array($CONFIG['user_field14_name'], 'user14', 0, 255, 1);
    }

    if(!empty($CONFIG['user_field15_name'])) {
        $form_array[] = array($CONFIG['user_field15_name'], 'user15', 0, 255, 1);
    }

    if(!empty($CONFIG['user_field16_name'])) {
        $form_array[] = array($CONFIG['user_field16_name'], 'user16', 0, 255, 1);
    }

    if(!empty($CONFIG['user_field17_name'])) {
        $form_array[] = array($CONFIG['user_field17_name'], 'user17', 0, 255, 1);
    }

    if(!empty($CONFIG['user_field18_name'])) {
        $form_array[] = array($CONFIG['user_field18_name'], 'user18', 0, 255, 1);
    }

    if(!empty($CONFIG['user_field19_name'])) {
        $form_array[] = array($CONFIG['user_field19_name'], 'user19', 0, 255, 1);
    }

    if(!empty($CONFIG['user_field20_name'])) {
        $form_array[] = array($CONFIG['user_field20_name'], 'user20', 0, 255, 1);
    }

Find:
Code: [Select]
        $user1 = addslashes($_POST['user1']);
        $user2 = addslashes($_POST['user2']);
        $user3 = addslashes($_POST['user3']);
        $user4 = addslashes($_POST['user4']);

Add below:
Code: [Select]
$user5 = addslashes($_POST['user5']);
$user6 = addslashes($_POST['user6']);
$user7 = addslashes($_POST['user7']);
$user8 = addslashes($_POST['user8']);
$user9 = addslashes($_POST['user9']);
$user10 = addslashes($_POST['user10']);
        $user11 = addslashes($_POST['user11']);
        $user12 = addslashes($_POST['user12']);
        $user13 = addslashes($_POST['user13']);
        $user14 = addslashes($_POST['user14']);
$user15 = addslashes($_POST['user15']);
$user16 = addslashes($_POST['user16']);
$user17 = addslashes($_POST['user17']);
$user18 = addslashes($_POST['user18']);
$user19 = addslashes($_POST['user19']);
$user20 = addslashes($_POST['user20']);

Find:
Code: [Select]
$user1, $user2, $user3, $user4,
Add below:
Code: [Select]
$user5, $user6, $user7, $user8, $user9, $user10, $user11, $user12, $user13, $user14, $user15, $user16, $user17, $user18, $user19, $user20,
Save & Close : upload.php


Open: xp_publish.php
Find:
Code: [Select]
    $user1 = '';
    $user2 = '';
    $user3 = '';
    $user4 = '';

Add below:
Code: [Select]
$user5 = '';
$user6 = '';
$user7 = '';
$user8 = '';
$user9 = '';
    $user10 = '';
    $user11 = '';
    $user12 = '';
    $user13 = '';
    $user14 = '';
$user15 = '';
$user16 = '';
$user17 = '';
$user18 = '';
$user19 = '';
    $user20 = '';

Find:
Code: [Select]
$user1, $user2, $user3, $user4,
Add below:
Code: [Select]
$user5, $user6, $user7, $user8, $user9, $user10, $user11, $user12, $user13, $user14, $user15, $user16, $user17, $user18, $user19, $user20,
Save & Close : xp_publish.php
Logged

Doggy

  • Contributor
  • Coppermine regular visitor
  • ***
  • Offline Offline
  • Posts: 63
Re: Additional Custom Fields
« Reply #4 on: August 22, 2006, 09:57:44 pm »

2. The data base to modify.

Save your data base and make a Backup before the modifications !

Go to the config page of Coppermine, empty all the fields.

Make another safeguard of your data base and make the next modifications on this one, then import the data base.

(Change "table Prefix" to the prefix that you use for your tables.)

Find in "table Prefix"_pictures:
Code: [Select]
  `user1` varchar(255) collate latin1_german2_ci NOT NULL default '',
  `user2` varchar(255) collate latin1_german2_ci NOT NULL default '',
  `user3` varchar(255) collate latin1_german2_ci NOT NULL default '',
  `user4` varchar(255) collate latin1_german2_ci NOT NULL default '',

Add below:
Code: [Select]
  `user5` varchar(255) collate latin1_german2_ci NOT NULL default '',
  `user6` varchar(255) collate latin1_german2_ci NOT NULL default '',
  `user7` varchar(255) collate latin1_german2_ci NOT NULL default '',
  `user8` varchar(255) collate latin1_german2_ci NOT NULL default '',
  `user9` varchar(255) collate latin1_german2_ci NOT NULL default '',
  `user10` varchar(255) collate latin1_german2_ci NOT NULL default '',
  `user11` varchar(255) collate latin1_german2_ci NOT NULL default '',
  `user12` varchar(255) collate latin1_german2_ci NOT NULL default '',
  `user13` varchar(255) collate latin1_german2_ci NOT NULL default '',
  `user14` varchar(255) collate latin1_german2_ci NOT NULL default '',
  `user15` varchar(255) collate latin1_german2_ci NOT NULL default '',
  `user16` varchar(255) collate latin1_german2_ci NOT NULL default '',
  `user17` varchar(255) collate latin1_german2_ci NOT NULL default '',
  `user18` varchar(255) collate latin1_german2_ci NOT NULL default '',
  `user19` varchar(255) collate latin1_german2_ci NOT NULL default '',
  `user20` varchar(255) collate latin1_german2_ci NOT NULL default '',

Find in "table Prefix"_config:
Code: [Select]
INSERT INTO `cpg148_config` VALUES ('user_field1_name', '');
INSERT INTO `cpg148_config` VALUES ('user_field2_name', '');
INSERT INTO `cpg148_config` VALUES ('user_field3_name', '');
INSERT INTO `cpg148_config` VALUES ('user_field4_name', '');

Add below:
Code: [Select]
INSERT INTO `cpg148_config` VALUES ('user_field5_name', '');
INSERT INTO `cpg148_config` VALUES ('user_field6_name', '');
INSERT INTO `cpg148_config` VALUES ('user_field7_name', '');
INSERT INTO `cpg148_config` VALUES ('user_field8_name', '');
INSERT INTO `cpg148_config` VALUES ('user_field9_name', '');
INSERT INTO `cpg148_config` VALUES ('user_field10_name', '');
INSERT INTO `cpg148_config` VALUES ('user_field11_name', '');
INSERT INTO `cpg148_config` VALUES ('user_field12_name', '');
INSERT INTO `cpg148_config` VALUES ('user_field13_name', '');
INSERT INTO `cpg148_config` VALUES ('user_field14_name', '');
INSERT INTO `cpg148_config` VALUES ('user_field15_name', '');
INSERT INTO `cpg148_config` VALUES ('user_field16_name', '');
INSERT INTO `cpg148_config` VALUES ('user_field17_name', '');
INSERT INTO `cpg148_config` VALUES ('user_field18_name', '');
INSERT INTO `cpg148_config` VALUES ('user_field19_name', '');
INSERT INTO `cpg148_config` VALUES ('user_field20_name', '');


Upload ALL THE MODIFIED FILES  and that will be good.

Sorry for my english, I'm French and I have still much to learn ;).
Logged

Pascal YAP

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: fr
  • Offline Offline
  • Gender: Male
  • Posts: 13833
  • Hello World :-)
    • CPG 1.5.x ExperiMental website
Re: Additional Custom Fields
« Reply #5 on: August 23, 2006, 09:04:02 am »

Oki Doggy  ;D

Nice job !
For those who want this MOD, but in french : HERE

PYAP
Logged

emaluzer

  • Coppermine newbie
  • Offline Offline
  • Posts: 4
Re: Additional Custom Fields
« Reply #6 on: September 17, 2006, 12:51:12 am »

I tried all the steps outlined,  now I cant upload a file, or edit a file.  When I want to upload it gives me this error:

Quote
There was an error while processing a database query.
While executing query "INSERT INTO cpg_pictures (aid, filepath, filename, filesize, total_filesize, pwidth, pheight, ctime, owner_id, owner_name, title, caption, keywords, approved, user1, user2, user3, user4, user5, user6, pic_raw_ip, pic_hdr_ip, position) VALUES ('14', 'userpics/10001/', 'darkwing~6.jpg', '49408', '71641', '640', '480', '1158446518', '1', 'emaluzer','dw', '', '', 'YES', '', '', '', '', '', '', '65.43.167.8', '65.43.167.8', '0')" on 0

mySQL error: Unknown column 'user5' in 'field list'
[Edit GauGau]Removed debug_output from posting. Only post it if a supporters asks you to do so[/edit]


As you can see there is a user7 in the edit, and a user5 in the upload.  After having problems with user5 I changed 5 to 7 in all the files, but for some reason it still appears in the upload error.  I believe that means I missed it somewhere.

I also added the neccessary user7 to my database as well as user_field7_name. 

I see this posted alot but no fix so sorry if I missed the fix or if it is on another post
emaluzer
« Last Edit: September 17, 2006, 02:07:47 pm by GauGau »
Logged

emaluzer

  • Coppermine newbie
  • Offline Offline
  • Posts: 4
Re: Additional Custom Fields
« Reply #7 on: September 17, 2006, 05:34:26 am »

never mind I found a reload of coppermine actually fixed the problem

Thanks anyway
Logged

buuben

  • Coppermine newbie
  • Offline Offline
  • Posts: 5
Re: Additional Custom Fields
« Reply #8 on: September 21, 2006, 03:34:25 am »

 :) nice mod, thanks doggy

But just one question or hack request, if you like:

I'd like to add a one custom field which contains a drop-down list ( <select>...). I would like that my members could take the easiest way and choose their country from a drop down list. Is there any way to do this in Coppermine?
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47844
  • aka "GauGau"
    • gaugau.de
Re: Additional Custom Fields
« Reply #9 on: September 22, 2006, 10:25:52 pm »

Question not related to this mod. Please re-post your question on the regular support board.
Logged

hozyali

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 109
  • HozyAli
    • Starcom Hosting
Re: Additional Custom Fields
« Reply #10 on: December 07, 2006, 08:30:27 am »

Hello,

The mod works fine. Having one problem.

I have allowed an album to have uploads by guests too on admin approval.
Once guest uploads a pic, its uploaded fine.
in Admin, it shows the pic as pending approval, when I view that pic it does not show the field values from 5 and so on. however it shows 4 custom fields values fine. also if I enter information in the next custom fields, then it shows the values...

also when I approve the file, it shows an error on the next page...
No image to display

File: /home/.hasbro/stangor/bookstocollect.com/gallery/editpics.php - Line: 566
----------------------

can anyone help please ?

HozyAli


Logged

jianzhan

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 25
Re: Additional Custom Fields
« Reply #11 on: March 31, 2007, 02:58:30 am »

picmgmt.inc.php in include folder should be also change the following code: then it works.

 $query = "INSERT INTO {$CONFIG['TABLE_PICTURES']} (aid, filepath, filename, filesize, total_filesize, pwidth, pheight, ctime, owner_id, owner_name, title, caption, keywords, approved, user1, user2, user3, user4, user5, user6, user7, user8, user9, user10, user11, user12, user13, user14, user15, user16, user17, user18, user19, user20, pic_raw_ip, pic_hdr_ip, position) VALUES ('{$CURRENT_PIC_DATA['aid']}', '" . addslashes($CURRENT_PIC_DATA['filepath']) . "', '" . addslashes($CURRENT_PIC_DATA['filename']) . "', '{$CURRENT_PIC_DATA['filesize']}', '{$CURRENT_PIC_DATA['total_filesize']}', '{$CURRENT_PIC_DATA['pwidth']}', '{$CURRENT_PIC_DATA['pheight']}', '" . time() . "', '{$CURRENT_PIC_DATA['owner_id']}', '{$CURRENT_PIC_DATA['owner_name']}','{$CURRENT_PIC_DATA['title']}', '{$CURRENT_PIC_DATA['caption']}', '{$CURRENT_PIC_DATA['keywords']}', '{$CURRENT_PIC_DATA['approved']}', '{$CURRENT_PIC_DATA['user1']}', '{$CURRENT_PIC_DATA['user2']}', '{$CURRENT_PIC_DATA['user3']}', '{$CURRENT_PIC_DATA['user4']}','{$CURRENT_PIC_DATA['user5']}', '{$CURRENT_PIC_DATA['user6']}', '{$CURRENT_PIC_DATA['user7']}','{$CURRENT_PIC_DATA['user8']}','{$CURRENT_PIC_DATA['user9']}','{$CURRENT_PIC_DATA['user10']}','{$CURRENT_PIC_DATA['user11']}', '{$CURRENT_PIC_DATA['user12']}', '{$CURRENT_PIC_DATA['user13']}', '{$CURRENT_PIC_DATA['user14']}','{$CURRENT_PIC_DATA['user15']}', '{$CURRENT_PIC_DATA['user16']}', '{$CURRENT_PIC_DATA['user17']}','{$CURRENT_PIC_DATA['user18']}','{$CURRENT_PIC_DATA['user19']}','{$CURRENT_PIC_DATA['user20']}','{$CURRENT_PIC_DATA['pic_raw_ip']}', '{$CURRENT_PIC_DATA['pic_hdr_ip']}', '{$CURRENT_PIC_DATA['position']}')";

Jian
Logged

jianzhan

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 25
Re: Additional Custom Fields
« Reply #12 on: March 31, 2007, 03:00:11 am »

incldue folder's file: picmgmt.inc.php should be also changed the following codes and it works fine:

$query = "INSERT INTO {$CONFIG['TABLE_PICTURES']} (aid, filepath, filename, filesize, total_filesize, pwidth, pheight, ctime, owner_id, owner_name, title, caption, keywords, approved, user1, user2, user3, user4, user5, user6, user7, user8, user9, user10, user11, user12, user13, user14, user15, user16, user17, user18, user19, user20, pic_raw_ip, pic_hdr_ip, position) VALUES ('{$CURRENT_PIC_DATA['aid']}', '" . addslashes($CURRENT_PIC_DATA['filepath']) . "', '" . addslashes($CURRENT_PIC_DATA['filename']) . "', '{$CURRENT_PIC_DATA['filesize']}', '{$CURRENT_PIC_DATA['total_filesize']}', '{$CURRENT_PIC_DATA['pwidth']}', '{$CURRENT_PIC_DATA['pheight']}', '" . time() . "', '{$CURRENT_PIC_DATA['owner_id']}', '{$CURRENT_PIC_DATA['owner_name']}','{$CURRENT_PIC_DATA['title']}', '{$CURRENT_PIC_DATA['caption']}', '{$CURRENT_PIC_DATA['keywords']}', '{$CURRENT_PIC_DATA['approved']}', '{$CURRENT_PIC_DATA['user1']}', '{$CURRENT_PIC_DATA['user2']}', '{$CURRENT_PIC_DATA['user3']}', '{$CURRENT_PIC_DATA['user4']}','{$CURRENT_PIC_DATA['user5']}', '{$CURRENT_PIC_DATA['user6']}', '{$CURRENT_PIC_DATA['user7']}','{$CURRENT_PIC_DATA['user8']}','{$CURRENT_PIC_DATA['user9']}','{$CURRENT_PIC_DATA['user10']}','{$CURRENT_PIC_DATA['user11']}', '{$CURRENT_PIC_DATA['user12']}', '{$CURRENT_PIC_DATA['user13']}', '{$CURRENT_PIC_DATA['user14']}','{$CURRENT_PIC_DATA['user15']}', '{$CURRENT_PIC_DATA['user16']}', '{$CURRENT_PIC_DATA['user17']}','{$CURRENT_PIC_DATA['user18']}','{$CURRENT_PIC_DATA['user19']}','{$CURRENT_PIC_DATA['user20']}','{$CURRENT_PIC_DATA['pic_raw_ip']}', '{$CURRENT_PIC_DATA['pic_hdr_ip']}', '{$CURRENT_PIC_DATA['position']}')";

Jian Zhan
Logged

masksmaster

  • Coppermine newbie
  • Offline Offline
  • Posts: 11
Re: Additional Custom Fields
« Reply #13 on: March 09, 2008, 01:05:19 am »

Thanks SO MUCH!
I completely didn't notice "table Prefix"_config: changes and couldn't figure out what went wrong. Your list of changes helped me figure it out!
Logged

masksmaster

  • Coppermine newbie
  • Offline Offline
  • Posts: 11
Re: Additional Custom Fields
« Reply #14 on: March 09, 2008, 03:12:08 am »

It seems like I followed all the steps. I got fields to display and be populated in DB. The only thing I have trouble with is the fact that new user fields are not searchable. Would anybody happen to know what could be wrong? I added this to include\search.inc.php
Code: [Select]
$allowed = array('title', 'caption', 'keywords', 'owner_name', 'filename', 'pic_raw_ip', 'pic_hrd_ip', 'user1', 'user2', 'user3', 'user4', 'user5', 'user6', 'user7', 'user8', 'user9', 'user10', 'user11', 'user12');
Is there anything else I need to change there to make the search locate info from those fields?

Thanks in advance!!!

Logged

Jittery Jim

  • Coppermine newbie
  • Offline Offline
  • Posts: 9
Re: Additional Custom Fields
« Reply #15 on: November 06, 2008, 05:52:50 am »

2. The data base to modify.

Save your data base and make a Backup before the modifications !

Go to the config page of Coppermine, empty all the fields.

Make another safeguard of your data base and make the next modifications on this one, then import the data base.

(Change "table Prefix" to the prefix that you use for your tables.)

Find in "table Prefix"_pictures:

* snip *

Looking for assistance with this step - I'm not quite sure where or how I make these modifications. Any assistance is greatly appreciated.
Logged

Stevo

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 86
Re: Additional Custom Fields
« Reply #16 on: May 11, 2009, 09:46:31 am »

Many thanks Doggy, it's working fine for me.

Have only 1 problem. If I use my searchbox he only search in the 4 original fields.
Code: [Select]
<form method="get" action="thumbnails.php" name="searchcpg">
                    <input type="hidden" name="album" value="search">

                  <input type="hidden" name="type" value="full">
            <td bgcolor="#DFDEDE" align="center" height="60"><input type="input" style="width: 90%" name="search" maxlength="180" value="" class="textinput"></td>
                        <script language="javascript" type="text/javascript">
                        <!--
                        document.searchcpg.search.focus();
                        -->
                        </script>
            </tr>
            <tr><td bgcolor="#DFDEDE" colspan="8" align="center"><input type="submit" value="Search Gallery" class="button"></td>
                    </form>

I'm still using searchbox from cpg133.
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47844
  • aka "GauGau"
    • gaugau.de
Re: Additional Custom Fields
« Reply #17 on: May 11, 2009, 09:50:21 pm »

Then stop using it, as cpg1.3.x and everything related to it goes unsupported.
Logged

Stevo

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 86
Re: Additional Custom Fields
« Reply #18 on: May 12, 2009, 11:26:05 am »

Then stop using it, as cpg1.3.x and everything related to it goes unsupported.
Hey Joachim,
I understand that everything related to cpg 1.3.x is unsupportered, but maybe you can help me with this question
http://forum.coppermine-gallery.net/index.php/topic,59379.0.html
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47844
  • aka "GauGau"
    • gaugau.de
Re: Additional Custom Fields
« Reply #19 on: May 13, 2009, 01:07:00 pm »

Stop double-posting / cross posting. I have read that other thread and decided not to reply.
Logged
Pages: [1] 2   Go Up
 

Page created in 0.046 seconds with 21 queries.