Hi!
Make modifications allowing to enter comments to scanned photos. And faced with the problem of how to pass data from intput fields when adding / removing.
Added to the code
action == "validateimages" checkbox and the input line
while ($image_row = $site_db->fetch_array($result)) {
echo "<tr class=\"".get_row_bg()."\">";
$image_path = (is_remote($image_row['image_media_file'])) ? $image_row['image_media_file'] : MEDIA_TEMP_PATH."/".$image_row['image_media_file'];
$file_src = get_file_path($image_row['image_media_file'], "media", 0, 1);
echo "<td ROWSPAN=3><input type=\"radio\" name=\"image_list[".$image_row['image_id']."]\" value=\"1\" ></td>";
echo "<td ROWSPAN=3 ><input type=\"radio\" name=\"image_list[".$image_row['image_id']."]\" value=\"0\" ></td>";
echo "<td ROWSPAN=3><a href=\"".$image_path."\" target=\"_blank\"><img src=\"".$file_src."\" border=\"1\" height=\"50\"></a></td>";
echo "<td><b><a href=\"".$image_path."\" target=\"_blank\">".format_text($image_row['image_name'], 2)."</a></b> </td>\n";
echo "<td>".format_text($image_row['image_Mesto'], 2)."</td>";
echo "<td>".format_text($image_row['image_NOmarsh'], 2)."</td>";
echo "<td><a href=\"".$site_sess->url(ROOT_PATH."categories.php?".URL_CAT_ID."=".$image_row['cat_id'])."\" target=\"_blank\">".format_text($cat_cache[$image_row['cat_id']]['cat_name'], 2)."</a></td>\n";
$show_user_name = format_text($image_row[$user_table_fields['user_name']], 2);
if ($image_row['user_id'] != GUEST && empty($url_show_profile)) {
$show_user_name = "<a href=\"".$site_sess->url(ROOT_PATH."member.php?action=showprofile&".URL_USER_ID."=".$image_row['user_id'])."\" target=\"_blank\">$show_user_name</a>";
}
echo "<td>".$show_user_name."</td>\n";
echo "<td >".format_date($config['date_format']." ".$config['time_format'], $image_row['image_date'])."</td>\n";
echo "<td ROWSPAN=3><p>";
show_text_link($lang['edit'],"validateimages.php?action=editimage&image_id=".$image_row['image_id']);
echo "</p></td>\n";
echo "</tr>\n";
echo "<tr class=\"".get_row_bg()."\"> ";
echo "<td colspan=6> <table border=0 align=center >
<tr align=center>
<td width=80>Photo size </ td> <td width=60> not sharp </ td> <td width=60> Dark </ td> <td width=80> Relight </ td> <td width=110> Unsuccessful perspective </ td> <td width=130> Foreign objects </ td> <td width=130> little information </ td>
</ tr> <tr align=center>
<td> <input type=\"checkbox\" name=\"my_check[]\" value=\" size photo does not comply;\"> </ td>
<td> <input type=\"checkbox\" name=\"my_check[]\" value=\" sharp enough;\"> </ td>
<td> <input type=\"checkbox\" name=\"my_check[]\" value=\" Dark;\"> </ td>
<td> <input type=\"checkbox\" name=\"my_check[]\" value=\" Relight;\"> </ td>
<td> <input type=\"checkbox\" name=\"my_check[]\" value=\" Poor angle;\"> </ td>
<td> <input type=\"checkbox\" name=\"my_check[]\" value=\" Foreign objects in the frame;\"> </ td>
<td> <input type=\"checkbox\" name=\"my_check[]\" value=\" little information;\"> </ td>
</tr> </table>
</td>";
echo "</tr>\n";
echo "<tr class=\"".get_row_bg()."\">";
echo "<td colspan=6 align=\"center\"><input name=\"my_check[]\" type=\"text\" size=\"110\"></td>";
echo "</tr>\n";
}The problem is that I use
$my_check = $_POST['my_check'];
$note = implode(" ", $my_check);to enter into the database. But when checking several photos at the same time - notes are the same for all photos.
$action == "saveimages"while ($row = $site_db->fetch_array($result)) {
$image_cache[$row['image_id']] = $row;
}
foreach ($image_list as $key => $val) {
flush();
$image_name = addslashes($image_cache[$key]['image_name']);
$cat_id = $image_cache[$key]['cat_id'];
$user_id = $image_cache[$key]['user_id'];
$image_Mesto = addslashes($image_cache[$key]['image_Mesto']);
$image_NOmarsh = addslashes($image_cache[$key]['image_NOmarsh']);
$image_description = addslashes($image_cache[$key]['image_description']);
$image_keywords = addslashes($image_cache[$key]['image_keywords']);
$image_date = $image_cache[$key]['image_date'];
$image_media_file = addslashes($image_cache[$key]['image_media_file']);
$image_thumb_file = addslashes($image_cache[$key]['image_thumb_file']);
$image_download_url = addslashes($image_cache[$key]['image_download_url']);
$note = trim($HTTP_POST_VARS['note']);
$old_media_path = MEDIA_TEMP_PATH."/".$image_media_file;
$old_thumb_path = THUMB_TEMP_PATH."/".$image_thumb_file;
$current_time = time();
$my_check = $_POST['my_check'];
$note = implode(" ", $my_check);
if ($val == 1) {
$status=1;
$new_name = copy_media($image_media_file, "-1", $cat_id);
$new_thumb_name = copy_thumbnail($new_name, $image_thumb_file, "-1", $cat_id);
if ($new_name) {
$additional_field_sql = "";
$additional_value_sql = "";
if (!empty($additional_image_fields)) {
$table_fields = $site_db->get_table_fields(IMAGES_TABLE);
foreach ($additional_image_fields as $key2 => $val2) {
if (isset($image_cache[$key][$key2]) && isset($image_cache[$key][$key2])) {
$additional_field_sql .= ", $key2";
$additional_value_sql .= ", '".addslashes($image_cache[$key][$key2])."'";
}
}
}
$sql1 = "INSERT INTO ".IMAGES_TEMP1_TABLE."
(cat_id, user_id, image_name, image_Mesto, image_NOmarsh, image_description, image_date, note, status)
VALUES
($cat_id, $user_id, '$image_name', '$image_Mesto','$image_NOmarsh','$image_description', $current_time, '$note','$status')";
$result1 = $site_db->query($sql1);How to make
$note data were entered correctly for each of the entries photo?
PS sorry for my english