forum.coppermine-gallery.net
No Support => Modifications/Add-Ons/Hacks => Mods: Miscellaneous => Topic started by: pslawinski on November 13, 2005, 12:16:12 am
-
I got tired of having to add more user fields by copying and pasting code each time I wanted to add another custom field. So, I created this mod that allows you to add more Custom Fields through the Config page. An extra field is added to the config page that allows you to select how many fields you want. You can have any number greater than 4, though you might have some problems if you try to add an unreasonable number.
Currently this works for 1.4 only, but with a little work it could easlily be adapted for previous versions.
So let's start from the beginning:
First step:
Add the user_field_num row to the config table in mySQL.
(Note: change <tablePrefix> to the prefix you use for your tables.)
INSERT INTO `<tablePrefix>_config` ( `name` , `value` ) VALUES ('user_field_num', '4');
Now for the code additions:
lang/english.php
I coded for english.php but you can easlily adapt this for any language by changing the values.
Find:
'Custom fields for image description (leave blank if unused)',
array('Field 1 name', 'user_field1_name', 0, 'f=index.htm&as=admin_custom_image&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),
'Cookies settings',
array('Cookie name', 'cookie_name', 0, 'f=index.htm&as=admin_cookie_name&ae=admin_cookie_name_end'), //cpg1.4
array('Cookie path', 'cookie_path', 0, 'f=index.htm&as=admin_cookie_path&ae=admin_cookie_path_end'), //cpg1.4
'Email settings (usually nothing has to be changed here; leave all fields blank when not sure)', //cpg1.4
array('SMTP Host (when left blank, sendmail will be used)', 'smtp_host', 0, 'f=index.htm&as=admin_email&ae=admin_email_end'), //cpg1.4
array('SMTP Username', 'smtp_username', 0), //cpg1.4
array('SMTP Password', 'smtp_password', 0), //cpg1.4
'Logging and statistics', //cpg1.4
array('Logging mode <a href="#notice3" class="clickable_option">***</a>', 'log_mode', 11, 'f=index.htm&as=admin_logging_log_mode&ae=admin_logging_log_mode_end'), //cpg1.4
array('Log ecards', 'log_ecards', 1, 'f=index.htm&as=admin_general_log_ecards&ae=admin_general_log_ecards_end'), //cpg1.4
array('Keep detailed vote statistics','vote_details',1, 'f=index.htm&as=admin_logging_votedetails&ae=admin_logging_votedetails_end'), //cpg1.4
array('Keep detailed hit statistics','hit_details',1, 'f=index.htm&as=admin_logging_hitdetails&ae=admin_logging_hitdetails_end'), //cpg1.4
'Maintenance settings', //cpg1.4
array('Enable debug mode', 'debug_mode', 9, 'f=index.htm&as=debug_mode&ae=debug_mode_end'), //cpg1.4
array('Display notices in debug mode', 'debug_notice', 1, 'f=index.htm&as=admin_misc_debug_notices&ae=admin_misc_debug_notices_end'), //cpg1.4
array('Gallery is offline', 'offline', 1, 'f=index.htm&as=admin_general_offline&ae=admin_general_offline_end'), //cpg1.4
);
Replace With:
'Number of custom Fields to display',
array('Number of user fields', 'user_field_num', 0, 'f=index.htm&as=admin_custom_image&ae=admin_custom_image_end'),
'Custom fields for image description (leave blank if unused)',
array('Field 1 name', 'user_field1_name', 0, 'f=index.htm&as=admin_custom_image&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),
);
//let's start the count at 5 since 4 fields have already been declared
for($i = 5; $i <= $CONFIG['user_field_num']; $i++)
{
$lang_admin_data[] = array("Field " . $i . " name", "user_field" . $i . "_name", 0);
}
$lang_admin_data[] = 'Cookies settings';
$lang_admin_data[] = array('Cookie name', 'cookie_name', 0, 'f=index.htm&as=admin_cookie_name&ae=admin_cookie_name_end'); //cpg1.4
$lang_admin_data[] = array('Cookie path', 'cookie_path', 0, 'f=index.htm&as=admin_cookie_path&ae=admin_cookie_path_end'); //cpg1.4
$lang_admin_data[] = 'Email settings (usually nothing has to be changed here; leave all fields blank when not sure)'; //cpg1.4
$lang_admin_data[] = array('SMTP Host (when left blank, sendmail will be used)', 'smtp_host', 0, 'f=index.htm&as=admin_email&ae=admin_email_end'); //cpg1.4
$lang_admin_data[] = array('SMTP Username', 'smtp_username', 0); //cpg1.4
$lang_admin_data[] = array('SMTP Password', 'smtp_password', 0); //cpg1.4
$lang_admin_data[] = 'Logging and statistics'; //cpg1.4
$lang_admin_data[] = array('Logging mode <a href="#notice3" class="clickable_option">***</a>', 'log_mode', 11, 'f=index.htm&as=admin_logging_log_mode&ae=admin_logging_log_mode_end'); //cpg1.4
$lang_admin_data[] = array('Log ecards', 'log_ecards', 1, 'f=index.htm&as=admin_general_log_ecards&ae=admin_general_log_ecards_end'); //cpg1.4
$lang_admin_data[] = array('Keep detailed vote statistics','vote_details',1, 'f=index.htm&as=admin_logging_votedetails&ae=admin_logging_votedetails_end'); //cpg1.4
$lang_admin_data[] = array('Keep detailed hit statistics','hit_details',1, 'f=index.htm&as=admin_logging_hitdetails&ae=admin_logging_hitdetails_end'); //cpg1.4
$lang_admin_data[] = 'Maintenance settings'; //cpg1.4
$lang_admin_data[] = array('Enable debug mode', 'debug_mode', 9, 'f=index.htm&as=debug_mode&ae=debug_mode_end'); //cpg1.4
$lang_admin_data[] = array('Display notices in debug mode', 'debug_notice', 1, 'f=index.htm&as=admin_misc_debug_notices&ae=admin_misc_debug_notices_end'); //cpg1.4
$lang_admin_data[] = array('Gallery is offline', 'offline', 1, 'f=index.htm&as=admin_general_offline&ae=admin_general_offline_end'); //cpg1.4
admin.php
Find:
if ($CONFIG[$element[1]] !== stripslashes($value))
Replace with:
//create field if it does not exist
if (!isset($CONFIG[$element[1]]))
{
cpg_db_query("INSERT INTO {$CONFIG['TABLE_CONFIG']} ( `name` , `value` ) VALUES ('{$element[1]}', '$value')");
$processAnyways = true;
}
if ($CONFIG[$element[1]] !== stripslashes($value) || isset($processAnyways))
include/search.inc.php
Find:
$allowed = array('title', 'caption', 'keywords', 'owner_name', 'filename', 'pic_raw_ip', 'pic_hrd_ip', 'user1', 'user2', 'user3', 'user4');
Replace with:
$allowed = array('title', 'caption', 'keywords', 'owner_name', 'filename', 'pic_raw_ip', 'pic_hrd_ip');
//add user fields to allowed array
for($i = 1; $i <= $CONFIG['user_field_num']; $i++)
{
$uI = "user" . $i;
$allowed[] = $uI;
}
xp_publish.php
I have not tested this code since I do not use this
Find:
$keywords = '';
Replace all the user vars with:
$userFields = array();
Find:
$result = add_picture($album, $filepath, $picture_name, $position, $title, $caption, $keywords, $user1, $user2, $user3, $user4, $category);
Replace with:
$result = add_picture($album, $filepath, $picture_name, $position, $title, $caption, $keywords, $userFields, $category);
upload.php
Find
// We have incoming placement data. Let's capture it.
$album = (int)$_POST['album'];
$title = addslashes($_POST['title']);
$caption = addslashes($_POST['caption']);
$keywords = addslashes($_POST['keywords']);
Replace all the user vars with:
//add user fields to userFields array
for($i = 1; $i <= $CONFIG['user_field_num']; $i++)
{
$uI = "user" . $i;
$userFields[] = addslashes($HTTP_POST_VARS[$uI]);
}
Find:
$result = add_picture($album, $filepath, $picture_name, 0,$title, $caption, $keywords, $user1, $user2, $user3, $user4, $category, $raw_ip, $hdr_ip, $movie_wd, $movie_ht);
Replace With:
$result = add_picture($album, $filepath, $picture_name, 0,$title, $caption, $keywords, $userFields, $category, $raw_ip, $hdr_ip, $movie_wd, $movie_ht);
Find:
array($CONFIG['user_field1_name'], 'user1', 0, 255, 1),
array($CONFIG['user_field2_name'], 'user2', 0, 255, 1),
array($CONFIG['user_field3_name'], 'user3', 0, 255, 1),
array($CONFIG['user_field4_name'], 'user4', 0, 255, 1),
);
Replace With:
);
// Check for user defined fields.
for($i = 1; $i <= $CONFIG['user_field_num']; $i++)
{
$uFN = "user_field". $i . "_name";
$uI = "user" . $i;
if(!empty($CONFIG[$uFN]))
{
$form_array[] = array($CONFIG[$uFN], $uI, 0, 255, 1);
}
}
image_processor.php
Find:
global $user1;
global $user2;
global $user3;
global $user4;
Replace with:
global $userFields;
Find:
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\">";
Replace with:
//print user fields
for($i = 1; $i <= $CONFIG['user_field_num']; $i++)
{
$userData = $userFields[$i-1];
print "<input type=\"hidden\" name=\"user$i\" value=\"$userData\">";
}
Find:
$user1 = $HTTP_POST_VARS['$user1'];
$user2 = $HTTP_POST_VARS['$user2'];
$user3 = $HTTP_POST_VARS['$user3'];
$user4 = $HTTP_POST_VARS['$user4'];
Replace With:
//set user fields
for($i = 1; $i <= $CONFIG['user_field_num']; $i++)
{
$uI = "user" . $i;
$userFields[] = $HTTP_POST_VARS['$uI'];
}
Find:
$user1 = $_POST['$user1'];
$user2 = $_POST['$user2'];
$user3 = $_POST['$user3'];
$user4 = $_POST['$user4'];
Replace With:
//set user fields
for($i = 1; $i <= $CONFIG['user_field_num']; $i++)
{
$uI = "user" . $i;
$userFields[] = $_POST['$uI'];
}
Find:
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\">";
Replace with:
//print user fields
for($i = 1; $i <= $CONFIG['user_field_num']; $i++)
{
$userData = $userFields[$i-1];
print "<input type=\"hidden\" name=\"user$i\" value=\"$userData\">";
}
editpics.php
Find:
$THUMB_ROWSPAN=5;
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++;
Replace With:
$THUMB_ROWSPAN=5;
//get rowspan value
for($i = 1; $i <= $CONFIG['user_field_num']; $i++)
{
$uFN = "user_field" . $i . "_name";
if ($CONFIG[$uFN] != '') $THUMB_ROWSPAN++;
}
Find:
$data = array(
array($lang_editpics_php['pic_info'], '', 3),
array($lang_editpics_php['album'], 'aid', 1),
array($lang_editpics_php['title'], 'title', 0, 255),
array($captionLabel, 'caption', 2, $CONFIG['max_img_desc_length']),
array($lang_editpics_php['keywords'], 'keywords', 0, 255),
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),
array('', '', 4)
);
Replace With:
$data = array(
array($lang_editpics_php['pic_info'], '', 3),
array($lang_editpics_php['album'], 'aid', 1),
array($lang_editpics_php['title'], 'title', 0, 255),
array($captionLabel, 'caption', 2, $CONFIG['max_img_desc_length']),
array($lang_editpics_php['keywords'], 'keywords', 0, 255),
);
//add user fields to data
for($i = 1; $i <= $CONFIG['user_field_num']; $i++)
{
$uFN = "user_field" . $i . "_name";
$uI = "user" . $i;
$data[] = array($CONFIG[$uFN], $uI, 0, 255);
}
$data[] = array('', '', 4);
Find:
$user1 = get_post_var('user1', $pid);
$user2 = get_post_var('user2', $pid);
$user3 = get_post_var('user3', $pid);
$user4 = get_post_var('user4', $pid);
Replace With:
//set userFields
for($i = 1; $i <= $CONFIG['user_field_num']; $i++)
{
$userFields[] = get_post_var("user$i", $pid);
}
Find:
$update .= ", user1 = '".addslashes($user1)."'";
$update .= ", user2 = '".addslashes($user2)."'";
$update .= ", user3 = '".addslashes($user3)."'";
$update .= ", user4 = '".addslashes($user4)."'";
Replace With:
//add user fields to update
for($i = 1; $i <= $CONFIG['user_field_num']; $i++)
{
$update .= ", user$i = '".addslashes($userFields[$i-1])."'";
}
editOnePic.php
Find:
$user1 = $_POST['user1'];
$user2 = $_POST['user2'];
$user3 = $_POST['user3'];
$user4 = $_POST['user4'];
Replace With:
//add user fields to array
for($i = 1; $i <= $CONFIG['user_field_num']; $i++)
{
$userFields[]=$_POST["user$i"];
}
Find:
$THUMB_ROWSPAN=6;
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++;
Replace With:
$THUMB_ROWSPAN=6;
for($i = 1; $i <= $CONFIG['user_field_num']; $i++)
{
if ($CONFIG["user_field$1_name"] != '') $THUMB_ROWSPAN++;
}
Find:
$update .= ", user1 = '".addslashes($user1)."'";
$update .= ", user2 = '".addslashes($user2)."'";
$update .= ", user3 = '".addslashes($user3)."'";
$update .= ", user4 = '".addslashes($user4)."'";
Replace With:
//add user fields to update
for($i = 1; $i <= $CONFIG['user_field_num']; $i++)
{
$update .= ", user$i = '".addslashes($userFields[$i-1])."'";
}
Find:
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;
}
Replace With:
//print out form fields
for($i = 1; $i <= $CONFIG['user_field_num']; $i++)
{
$uFN = "user_field" . $i . "_name";
$uI = "user" . $i;
if ($CONFIG[$uFN] != ''){
echo <<<EOT
<tr>
<td class="tableb" style="white-space: nowrap;">
{$CONFIG[$uFN]}
</td>
<td width="100%" class="tableb" valign="top">
<input type="text" style="width: 97%" name="$uI" maxlength="255" value="{$CURRENT_PIC[$uI]}" class="textinput" />
</td>
</tr>
EOT;
}
}
-
db_input.php
Find:
$user1 = addslashes($_POST['user1']);
$user2 = addslashes($_POST['user2']);
$user3 = addslashes($_POST['user3']);
$user4 = addslashes($_POST['user4']);
Replace With;
//add user fields to array
for($i = 1; $i <= $CONFIG['user_field_num']; $i++)
{
$uI = "user" . $i;
$userFields[]=addslashes($HTTP_POST_VARS[$uI]);
}
Find:
$result = add_picture($album, $filepath, $picture_name, 0, $title, $caption, $keywords, $user1, $user2, $user3, $user4, $category, $raw_ip, $hdr_ip,(int) $_POST['width'],(int) $_POST['height']);
Replace With:
$result = add_picture($album, $filepath, $picture_name, 0, $title, $caption, $keywords, $userFields, $category, $raw_ip, $hdr_ip,(int) $_POST['width'],(int) $_POST['height']);
include/picmgmt.inc.php
Find:
function add_picture($aid, $filepath, $filename, $position = 0, $title = '', $caption = '', $keywords = '', $user1 = '', $user2 = '', $user3 = '', $user4 = '', $category = 0, $raw_ip = '', $hdr_ip = '')
Replace With:
function add_picture($aid, $filepath, $filename, $position = 0, $title = '', $caption = '', $keywords = '', $userFields = array(), $category = 0, $raw_ip = '', $hdr_ip = '')
Find:
$CURRENT_PIC_DATA['user1'] = $user1;
$CURRENT_PIC_DATA['user2'] = $user2;
$CURRENT_PIC_DATA['user3'] = $user3;
$CURRENT_PIC_DATA['user4'] = $user4;
$CURRENT_PIC_DATA['pic_raw_ip'] = $raw_ip;
$CURRENT_PIC_DATA['pic_hdr_ip'] = $hdr_ip;
$CURRENT_PIC_DATA['position'] = $position;
$CURRENT_PIC_DATA = CPGPluginAPI::filter('add_file_data',$CURRENT_PIC_DATA);
$query = "INSERT INTO {$CONFIG['TABLE_PICTURES']} (pid, aid, filepath, filename, filesize, total_filesize, pwidth, pheight, ctime, owner_id, owner_name, title, caption, keywords, approved, user1, user2, user3, user4, 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['pic_raw_ip']}', '{$CURRENT_PIC_DATA['pic_hdr_ip']}', '{$CURRENT_PIC_DATA['position']}')";
Replace With:
for($i = 1; $i <= $CONFIG['user_field_num']; $i++)
{
$CURRENT_PIC_DATA["user$i"] = $userFields[$i-1];
}
$CURRENT_PIC_DATA['pic_raw_ip'] = $raw_ip;
$CURRENT_PIC_DATA['pic_hdr_ip'] = $hdr_ip;
$CURRENT_PIC_DATA['position'] = $position;
$CURRENT_PIC_DATA = CPGPluginAPI::filter('add_file_data',$CURRENT_PIC_DATA);
//Create query string
$rowNames = '';
$rowData = '';
for($i = 1; $i <= $CONFIG['user_field_num']; $i++)
{
$rowNames .= "user$i, ";
$rowData .= "'" . $userFields[$i-1] . "', ";
}
$query = "INSERT INTO {$CONFIG['TABLE_PICTURES']} (pid, aid, filepath, filename, filesize, total_filesize, pwidth, pheight, ctime, owner_id, owner_name, title, caption, keywords, approved, $rowNames 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']}', $rowData '{$CURRENT_PIC_DATA['pic_raw_ip']}', '{$CURRENT_PIC_DATA['pic_hdr_ip']}', '{$CURRENT_PIC_DATA['position']}')";
displayimage.php
Find:
for ($i = 1; $i <= 4; $i++) {
if ($CONFIG['user_field' . $i . '_name']) {
if ($CURRENT_PIC_DATA['user' . $i] != "") {
$info[$CONFIG['user_field' . $i . '_name']] = make_clickable($CURRENT_PIC_DATA['user' . $i]);
}
}
}
Replace With:
for($i = 1; $i <= $CONFIG['user_field_num']; $i++)
{
if ($CONFIG['user_field' . $i . '_name'])
{
if ($CURRENT_PIC_DATA['user' . $i] != "")
{
$info[$CONFIG['user_field' . $i . '_name']] = make_clickable($CURRENT_PIC_DATA['user' . $i]);
}
}
}
After editing all files upload them to your server and enjoy being able to add custom fields from the config page.
I've added a grab from my admin menu showing the fields.
-
I like the looks of this mod, and got it nearly working. But it is telling me a database error when I try to save a picture.
Critical error
There was an error while processing a database query
I am not sure which file it is, possible the database one. db_input.php on account it is a database query. But maybe it is the picmgmt.inc.php file even. I am not sure. Maybe it is the image_processor.php or admin.php. I susplect one of these 4 files but I am not sure which it could be. Is there any way to fix this? I copied everything alright but still get this error.
Thanks! This is an awesome mod and I got to to work in the config and show the fields and everything. Its really cool. Thank you for your marvelous work!
Ryan
-
I feel like this is a bit odd.
//Create query string
$rowNames = '';
$rowData = '';
for($i = 1; $i <= $CONFIG['user_field_num']; $i++)
{
$rowNames .= "user$i, ";
$rowData .= "'" . $userFields[$i-1] . "', ";
}
$query = "INSERT INTO {$CONFIG['TABLE_PICTURES']} (pid, aid, filepath, filename, filesize, total_filesize, pwidth, pheight, ctime, owner_id, owner_name, title, caption, keywords, approved, [b]$rowNames[/b] 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']}', [b]$rowData[/b] '{$CURRENT_PIC_DATA['pic_raw_ip']}', '{$CURRENT_PIC_DATA['pic_hdr_ip']}', '{$CURRENT_PIC_DATA['position']}')";
The way it uses the $rowNames and $rowdata just doesnt seem right to me but I cant figure out what to do with it. Any ideas?
-
Go to Config and enable debug mode. Then go back to the page and you should get a more detailed error message.
-
Thanks! That did the trick. I never even realized there was a debug mode I should use. Very nice!
Ok, well the message it is saying is mySQL error: Unknown column 'user5' in 'field list'
Which means I have to create those extra fields in the database which is fine. I thought I saw some code that did that though but maybe I am wrong. It is the only problem and I can easily create those columns in the database.
Thanks again!
Ryan
-
oh and maybe it has something to do with the google maps thing I am using too but I dont think it is. I think it fails to create the extra user fields thats all.
I will send you the debug info so you can see it.
This appears at the error box.
While executing query "UPDATE cpg142_pictures SET aid = '6', title = 'test', caption = 'test', keywords = 'test', user1 = '', user2 = '', user3 = '', user4 = '', user5 = '', user6 = '', user7 = '', user8 = '', user9 = '', user10 = '', latitude = '33.74832232784014', longitude = '-84.39216613769531' WHERE pid='5' LIMIT 1" on 0
mySQL error: Unknown column 'user5' in 'field list'
This is the debug info.
USER:
------------------
Array
(
[ID] => 25279aea3d53206717f5cbe9960ee4fb
[am] => 1
[lang] => english
[liv] => Array
(
- => 1
[1] => 3
[2] => 4
[3] => 5
)
)
==========================
USER DATA:
------------------
Array
(
[user_id] => 1
[user_name] => admin
[groups] => Array
(
)
[disk_max] => 0
[disk_min] => 0
[can_rate_pictures] => 0
[can_send_ecards] => 1
[ufc_max] => 3
[ufc_min] => 3
[custom_user_upload] => 0
[num_file_upload] => 5
[num_URI_upload] => 3
[can_post_comments] => 0
[can_upload_pictures] => 0
[can_create_albums] => 1
[has_admin_access] => 1
[pub_upl_need_approval] => 0
[priv_upl_need_approval] => 0
[group_name] => Administrators
[upload_form_config] => 3
[group_quota] => 0
[can_see_all_albums] => 1
[group_id] => 1
)
==========================
Queries:
------------------
Array
(
- => SELECT extension, mime, content, player FROM cpg142_filetypes; (0.002s)
[1] => select * from cpg142_plugins order by priority asc; (0.001s)
[2] => delete from `kan145gh`.cpg142_sessions where time<1138397142 and remember=0; (0.001s)
[3] => delete from `kan145gh`.cpg142_sessions where time<1137191142; (0.001s)
[4] => select user_id from `kan145gh`.cpg142_sessions where session_id=md5("9e9c2de0d6699f6f64ce463e536ebf260b6e1a608ffb2cd153e381201a336529"); (0.001s)
[5] => select user_id as id, user_password as password from `kan145gh`.cpg142_users where user_id=1 (0.001s)
[6] => SELECT u.user_id AS id, u.user_name AS username, u.user_password AS password, u.user_group+100 AS group_id FROM `kan145gh`.cpg142_users AS u INNER JOIN `kan145gh`.cpg142_usergroups AS g ON u.user_group=g.group_id WHERE u.user_id='1' (0s)
[7] => SELECT user_group_list FROM `kan145gh`.cpg142_users AS u WHERE user_id='1' and user_group_list <> ''; (0s)
[8] => SELECT MAX(group_quota) as disk_max, MIN(group_quota) as disk_min, MAX(can_rate_pictures) as can_rate_pictures, MAX(can_send_ecards) as can_send_ecards, MAX(upload_form_config) as ufc_max, MIN(upload_form_config) as ufc_min, MAX(custom_user_upload) as custom_user_upload, MAX(num_file_upload) as num_file_upload, MAX(num_URI_upload) as num_URI_upload, MAX(can_post_comments) as can_post_comments, MAX(can_upload_pictures) as can_upload_pictures, MAX(can_create_albums) as can_create_albums, MAX(has_admin_access) as has_admin_access, MIN(pub_upl_need_approval) as pub_upl_need_approval, MIN( priv_upl_need_approval) as priv_upl_need_approval FROM cpg142_usergroups WHERE group_id in (1) (0.001s)
[9] => SELECT group_name FROM cpg142_usergroups WHERE group_id= 1 (0.001s)
[10] => update `kan145gh`.cpg142_sessions set time='1138400742' where session_id=md5('9e9c2de0d6699f6f64ce463e536ebf260b6e1a608ffb2cd153e381201a336529'); (0.001s)
[11] => SELECT user_favpics FROM cpg142_favpics WHERE user_id = 1 (0.001s)
[12] => DELETE FROM cpg142_banned WHERE expiry < '2006-01-27 22:25:42' (0.001s)
[13] => SELECT * FROM cpg142_banned WHERE (ip_addr='70.49.0.139' OR ip_addr='70.49.0.139' OR user_id=1) AND brute_force=0 (0.003s)
[14] => SELECT p.* FROM cpg142_pictures AS p, cpg142_albums AS a WHERE a.aid = p.aid AND pid = '5' (0.001s)
[15] => UPDATE cpg142_pictures SET aid = '6', title = 'test', caption = 'test', keywords = 'test', user1 = '', user2 = '', user3 = '', user4 = '', user5 = '', user6 = '', user7 = '', user8 = '', user9 = '', user10 = '', latitude = '33.74832232784014', longitude = '-84.39216613769531' WHERE pid='5' LIMIT 1 (0.001s)
[16] => SELECT COUNT(*) FROM cpg142_pictures WHERE approved = 'NO' (0.001s)
)
==========================
GET :
------------------
Array
(
)
==========================
POST :
------------------
Array
(
[id] => 5
[aid] => 6
[title] => test
[filename] => 8sheet.jpg
[caption] => test
[keywords] => test
[user1] => test
[user2] => test
[user3] => test
[user4] => test
[user5] =>
[user6] =>
[user7] =>
[user8] =>
[user9] =>
[user10] =>
[coordinates] => 33.74832232784014,-84.39216613769531
[submitDescription] => Apply modifications
)
==========================
VERSION INFO :
------------------
PHP version: 4.3.11 - OK
------------------
mySQL version: 4.0.24-max-log
------------------
Coppermine version: 1.4.3(stable)
==========================
Module: GD
------------------
GD Version: bundled (2.0.28 compatible)
FreeType Support: 1
FreeType Linkage: with freetype
T1Lib Support:
GIF Read Support: 1
GIF Create Support: 1
JPG Support: 1
PNG Support: 1
WBMP Support: 1
XBM Support: 1
JIS-mapped Japanese Font Support:
==========================
Module: mysql
------------------
MySQL Supportenabled
Active Persistent Links 0
Active Links 1
Client API version 3.23.49
MYSQL_MODULE_TYPE builtin
MYSQL_SOCKET /tmp/mysql.sock
MYSQL_INCLUDE no value
MYSQL_LIBS no value
==========================
Module: zlib
------------------
ZLib Support enabled
Compiled Version 1.1.4
Linked Version 1.1.4
==========================
Server restrictions (safe mode)?
------------------
Directive | Local Value | Master Value
safe_mode | Off | Off
safe_mode_exec_dir | no value | no value
safe_mode_gid | Off | Off
safe_mode_include_dir | ~ | ~
safe_mode_exec_dir | no value | no value
sql.safe_mode | Off | Off
disable_functions | no value | no value
file_uploads | On | On
include_path | .:/usr/local/lib/php | .:/usr/local/lib/php
open_basedir | no value | no value
==========================
email
------------------
Directive | Local Value | Master Value
sendmail_from | me@localhost.com | me@localhost.com
sendmail_path | /usr/sbin/sendmail -t -i | /usr/sbin/sendmail -t -i
SMTP | relay-hosting.secureserver.net | relay-hosting.secureserver.net
smtp_port | 25 | 25
==========================
Size and Time
------------------
Directive | Local Value | Master Value
max_execution_time | 30 | 30
max_input_time | 60 | 60
upload_max_filesize | 8M | 8M
post_max_size | 8M | 8M
==========================
Page generated in 0.097 seconds - 17 queries in 0.018 seconds - Album set : ; Meta set: ;
-
Hmmm, interesting. Now it saves nothing to the user fields. blank.
So maybe my theory that the $rowname and $rowuser was right because they dont appear to be sending the info through. Or maybe there is something before that even that isnt working right. ???
I dont know but I will have to soon find out, but first, some really awesome veggie lasagna. My girlfriend makes the best lasagna in the world I think and I am not going to think clearly until I eat some.
-
Does anyone have any idea from what i have posted here why it isnt saving the user fields? Thanks :D
-
Same issues here, nothing saving and having to manually add the fields in the db.
-
Okay, I think I see the problem here. It appears that the extra user info fields in the pictures table are missing. I'll look over the code and try this again later today. For now I suggest that you manually add the extra cols to your pictures table e.g. user5, user6...
-
Where did this get to?
I love the mod - it became the tipping point for selecting Coppermine.
I added 16 fields - all came up in the config files. Uploaded some images using Batch upload. The first image accepted my data in each fieled - and every image after that repeated the same data as contained in the first image. Checked the datatbase - all 20 user fields are there.
Then went to edit the data for each image - nothing changed. Checked with debug running. Debug does not report anything - in fact it appears that nothing happened at all.
Any thoughts?
Fred
-
Perhaps what this mod really needs is a rewrite. I coded the mod for my coppermine install specifically and then rewrote it to work on the regular version. It appears that the error is occuring with the code that automatically adds the necessary fields to the DB. I can look into this later this week perhaps, unless someone beats me to it.
@Fred It sounds as if the data is not being written to your database, however, I can't be sure.
-
One contribution to make this change (slightly) smaller in scope. The first mod to lang/english.php to add the new form fields to $lang_admin_data can be made less invasive using the array_push() function as follows (with 1 unmodified line at top and bottom for context):
array('Field 4 name', 'user_field4_name', 0),
);
//let's start the count at 5 since 4 fields have already been declared
for($i = 5; $i <= $CONFIG['user_field_num']; $i++)
{
$lang_admin_data[] = array("Field " . $i . " name", "user_field" . $i . "_name", 0);
}
array_push($lang_admin_data,
'Cookies settings',
With this code, one more change is needed, which is to remove the final comma from the last line in the array() initializer since a trailing comma is valid in an array() operator, but not in an array_push() function call. Change this (only middle line has changed):
array('Display notices in debug mode', 'debug_notice', 1, 'f=index.htm&as=admin_misc_debug_notices&ae=admin_misc_debug_notices_end'), //cpg1.4
array('Gallery is offline', 'offline', 1, 'f=index.htm&as=admin_general_offline&ae=admin_general_offline_end'), //cpg1.4
);
to this:
array('Display notices in debug mode', 'debug_notice', 1, 'f=index.htm&as=admin_misc_debug_notices&ae=admin_misc_debug_notices_end'), //cpg1.4
array('Gallery is offline', 'offline', 1, 'f=index.htm&as=admin_general_offline&ae=admin_general_offline_end') //cpg1.4
);
-
[My apologies if some of the following sounds like newbie SQL questions - I do not come from an SQL background, though I've done a small bit of cut-and-past SQL work based on reading some tutorials.]
I was looking to modify this in a couple of ways, but I have some questions which someone who is more familiar with SQL can help me with:
First, the ideas I was going to pursue:
- I was planning to have the "number of user fields" form entry appear in the same tabbed group on the config page as the field names themselves. The fix as proposed looks like it creates a whole new config tab for that setting, but that seemed unnecessary to me.
- I was going to add the new rows to _config and the new columns to _pictures when the "number of user fields" was changed on the config screen, rather than trying to "auto add them when they are used" later. This seems more straightforward and hopefully more robust.
- I was going to leave old fields in the database if the number of fields was ever reduced. Possibly add an "admin tool" to "discard unreferenced user field data" by explicit action of a gallery administrator. I could go either way on that, but it seems less destructive to only delete data when they specifically request it and you can describe to them that the data cannot be recovered - which seems easier to do on the Admin Tools page...
Feedback on those plans would be appreciated, but meanwhile...
I'm pretty sure I can get started on this if I keep a field 'user_field_created_count' in the _config table that remembers how many such fields have already been created, but it would be nice to base it on the structure of the database instead as I think it is a weak design to store (meta-)data in the database which describes the structure of the database. Unfortunately, that is where my SQL knowledge reaches its point of confusion over what kinds of statements are portable (in general and/or relative to the portability concerns of this code base). Tutorials and code inspection have taught me the basics, but I have no formal SQL training nor much experience to know what is good for the long run.
I suppose I could also do queries on the _config table for "user_fieldN_name" and check the cardinality of the result set, but that doesn't help with the columns in the _pictures table (though I suppose I could infer that the columns exist from whether or not the field_name row exists in _config). Also, if I'm going to go with a meta-data solution, 'user_field_created_count' is a bit more straightforward and quick to implement.
-
OK, here is some code to automatically add the field_name rows to the _config table and the userN columns to the _pictures table. Note that it modifies the database as soon as you change the number of fields on the config web page. Also, it deletes all of the old data if you lower the value (but doesn't let you lower it below 4):
Find this in admin.php (near line 820):
if ($CONFIG[$element[1]] !== stripslashes($value))
{
and add this right after it (inside the braces):
//handle changes in 'user_field_num'
if ($element[1] == 'user_field_num') {
if (!isset($CONFIG['user_field_count'])) {
cpg_db_query("INSERT INTO {$CONFIG['TABLE_CONFIG']} ( `name` , `value` ) VALUES ('user_field_count', '4')");
$userfieldcount = 4;
} else {
$userfieldcount = $CONFIG['user_field_count'];
}
$newfieldcount = max(4, (int)$value);
for ($i = $userfieldcount+1; $i <= $newfieldcount; $i++) {
$fldname = "user_field" . $i . "_name";
cpg_db_query("INSERT INTO {$CONFIG['TABLE_CONFIG']} ( `name` , `value` ) VALUES ('{$fldname}', '')");
$fldname = "user" . $i;
cpg_db_query("ALTER TABLE {$CONFIG['TABLE_PICTURES']} ADD $fldname varchar(255) NOT NULL");
}
for ($i = $userfieldcount; $i > $newfieldcount; $i--) {
$fldname = "user_field" . $i . "_name";
cpg_db_query("DELETE FROM {$CONFIG['TABLE_CONFIG']} WHERE name = '{$fldname}'");
$fldname = "user" . $i;
cpg_db_query("ALTER TABLE {$CONFIG['TABLE_PICTURES']} DROP COLUMN $fldname");
}
cpg_db_query("UPDATE {$CONFIG['TABLE_CONFIG']} SET value = '$newfieldcount' WHERE name = 'user_field_count'");
$value = $newfieldcount; // make sure minimum value is 4
}
Using this code the only manual change you need to make to your database is to create the 'user_field_num' entry in your _config table, modify your other files as indicated previously, then go to the Config page, change the number of fields, save the new configuration, and the database should be modified. Go back to the Config page and now you should be able to enter field names for all of the new user fields, etc.
-
Thanks for your additions flar. I have to admit that I have not looked at this code for quite some time and I was not looking forward to the prospect of having to dig it back up.
-
any chance of getting this in a plugin?
-
Unfortunately it is impossible to make this a plugin.
-
god this will take a whie to add this into the gallery, if i upgrade the gallery i lose all the changes right?
-
Yes, you will have to reinstall the mod if you upgrade to another version of CPG
-
Yes. After upgrading, you will have to re-apply every mod.
-
Its just a shame that you cant make every mod into a plugin, maybe for the future, but im content at the moment.
-
GauGau, what would it take to get this considered for integration into the main source? I'd be willing to do some work to clean it up to make it worthwhile to integrate.
-
In my last updates to this mod I created a "number of user fields" form entry on the config page to change the num_user_fields. This does the job, but I'm wondering if that is the best UI for this. The main issue I see with it is that you have to change the number, then commit the changes, then reload the config page to be able to type in the field names. It's relatively straightforward, but a little indirect.
An alternative that I considered was to always show "N+1" textfield form items on that page with the extra "N+1th" field being blank, obviously. If it gets filled in, then the number of user fields is automatically increased to match and the next time the page is loaded there will now be a new N+2th blank textfield. I didn't really like that idea as it seemed a little indirect and it raises bizarre issues like "what if they fill in the N+1 textfield, but empty out the N-1 textfield - should we try to compact which fields are named or reuse the now unused N-1th field?" Also, to add several fields you have to add them one at a time and commit each new field separately.
Another alternative would be to add a form button to the bottom of that tab that says "Add another user field". Ideally some javascript could add the new field dynamically and immediately without having to reload the page, but I'm not the world's greatest javascript expert. If it did have to reload the page then that raises the question of whether or not to commit any current changes, and if not then ideally we should reload it with all of the current edits intact without commiting them which I'm guessing isn't trivial.
I suppose that some javascript could also be written to automatically add the new textfield entries when the user changes the "number of user fields" item in the current solution as well. Some javascript could/should probably also be added to verify that the field contains a number and it is >= 4.
Any other ideas or thoughts on these alternatives?
-
or the other option is having the custom feilds manager seperate, like the plugins, then you'd have something like this
(https://forum.coppermine-gallery.net/proxy.php?request=http%3A%2F%2Fwww.dc-6.com%2Fdrpreacox%2Fidea.jpg&hash=67562ea0da21427dd69ec6ca7764019c27a2199e)
I think this would be a good option. what say you?
postscript: if the image is taking bandwith (its on my server) then I'll make it a link.
-
postscript: if the image is taking bandwith (its on my server) then I'll make it a link.
You can attach the image in advanced post options.
-
Hi,
I also had the problem that the custom fields were set back to empty when I set the custom fields. The problem turned out to be that the line
$userFields[]=$_POST['user$i'];
in editOnePic.php (around line 45) should have been:
$userFields[]=$_POST["user$i"];
The single quotes were preventing variable substitution.
Thanks for the great modification. Should definitely be a part of the release version.
Darren.
Where did this get to?
I love the mod - it became the tipping point for selecting Coppermine.
I added 16 fields - all came up in the config files. Uploaded some images using Batch upload. The first image accepted my data in each fieled - and every image after that repeated the same data as contained in the first image. Checked the datatbase - all 20 user fields are there.
Then went to edit the data for each image - nothing changed. Checked with debug running. Debug does not report anything - in fact it appears that nothing happened at all.
Any thoughts?
Fred
-
Thanks for pointing out that error dbh123.
I used code which was slightly different than what you see here for my own gallery.
I have fixed the errors you mentioned in the code posted at the beginning of this topic.
-
I got it working after a bit of trial and error. Thank you.
Only issue is that is that the additional fields don't work in the search: they are listed but always return a result of no matches.
-
Well, it seems that several people are having a problem with the database error of:
----------------------
While executing query "UPDATE cpg14x_pictures SET aid = '107', title = 'Frog', caption = '', keywords = '', user1 = 'Jul 1996', user2 = 'Fiberglass', user3 = 'H2', user4 = '1840', user5 = '' WHERE pid='348' LIMIT 1" on 0
mySQL error: Unknown column 'user5' in 'field list'
----------------------
However, I do not see any solutions.
What is the mysql command in order to add this to the database?
-
ALTER TABLE cpg14x_pictures ADD user5 VARCHAR(255)
or use a GUI like phpmyadmin.
-
ALTER TABLE cpg14x_pictures ADD user5 VARCHAR(255)
or use a GUI like phpmyadmin.
Thank you. Works like a charm. Too bad I have to do this everytime I add a new custom field, but nevermind. I appreciate the work you all did and thank you for solving my problem..
-
I'm no coder by any means and I'm trying to edit my files and use this awesome mod.
But This is what I run into. I'm running the latest version of Coppermine and my upload.php file looks like this:
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);
}
The instruction say to look for:array($CONFIG['user_field1_name'], 'user1', 0, 255, 1),
array($CONFIG['user_field2_name'], 'user2', 0, 255, 1),
array($CONFIG['user_field3_name'], 'user3', 0, 255, 1),
array($CONFIG['user_field4_name'], 'user4', 0, 255, 1),
);
and replace it with:
// Check for user defined fields.
for($i = 1; $i <= $CONFIG['user_field_num']; $i++)
{
$uFN = "user_field". $i . "_name";
$uI = "user" . $i;
if(!empty($CONFIG[$uFN]))
{
$form_array[] = array($CONFIG[$uFN], $uI, 0, 255, 1);
}
}
I've tried it and I get a blank screen when upload.php tries to run.
The code is not the same but it is similar, there has to be someway to code it, but I'm like code stupid.
Any help is greatly appreciated.
Thanks,
Bryan
-
Zip up and attach your upload.php.
-
The only way I could get it to work was to continue the code on like it was originally.
if(!empty($CONFIG['user_field6_name'])) {
$form_array[] = array($CONFIG['user_field6_name'], 'user6', 0, 255, 1);
}
etc........
Thanks,
Bryan
-
You need to post the code that doesn't work so we can tell you why it doesn't work.
-
Sorry, I must not have explained it properly.
I'm suppossed to be looking in my upload.php code for code that looks like thisarray($CONFIG['user_field1_name'], 'user1', 0, 255, 1),
array($CONFIG['user_field2_name'], 'user2', 0, 255, 1),
array($CONFIG['user_field3_name'], 'user3', 0, 255, 1),
array($CONFIG['user_field4_name'], 'user4', 0, 255, 1),
);
Unfortunately I can't find the code I'm supposed to look for, the only thing that comes close to looking like what I'm supposed to replace is thisif(!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);
}
I Have no idea how to replace this section of code as it is similar yet not the same, and I know that some how, it's doing the same thing, so I just added all the extra fields as opposed to letting the loop do it.
Hope that helps, as I stated I'm no coder, wish I was.
Thanks
Bryan
-
I am having a related issue.
When an image is uploaded none of the user defined information is saved to the database.
Everything else is fine.
If I go into the image information after the upload and add information to the user defined fields and update, it saves fine.
any ideas?
-
the debug dump like looks like this
[19] => INSERT INTO cpg1410_pictures (pid, aid, filepath, filename, filesize, total_filesize, pwidth, pheight, ctime, owner_id, owner_name, title, caption, keywords, approved, user1, user2, user3, user4, user5, pic_raw_ip, pic_hdr_ip, position) VALUES ('', '77', 'userpics/10001/', 'bigpiechart.JPG', '58979', '135721', '876', '624', '1224266517', '1', 'Admin','test1', 'test2', 'test3', 'YES', '', '', '', '', '', '10.222.202.159', '10.222.202.159', '0') (0.003s)
POST :
------------------
Array
(
[album] => 77
[title] => test1
[caption] => test2
[keywords] => test3
[control] => phase_2
[unique_ID] => ff749777
[user1] => test4
[user2] => test5
[user3] => test6
[user4] => test7
[user5] => test8
[debugtext] => USER:
------------------
-
Replace $HTTP_POST_VARS with $_POST throughout the mod or enable long arrays in your php configuration (if you can).
-
ah excellent, i changed it to the $_POST and it works fine now.
thanks a lot.