Hi!
Der Wunsch,Idee danach stammt von hier:
http://www.4homepages.de/forum/index.php?topic=31302.0Mit dieser Modifikation ist es möglich, in "ACP/Bilder verwalten/Bilder freischalten" neue Bilder Inaktiv zu schalten um sie zu einen späteren Zeitpunkt zu aktivieren.
Der User bekommt eine eMail Benachrichtigung über den Status seiner hochgeladenen Bilder "Freigeschaltet", "Gelöscht" oder "Inaktiv".
So lange das Bild "Inaktiv" ist, kann nur der jeweilige User sein Bild in der Galerie betrachten, für andere Mitglieder oder Gäste ist das Bild nicht sichtbar.
Inaktive Bilder können in ACP/Bilder verwalten/Bilder bearbeiten/Anzeige Optionen/Sortieren nach: Dropdown Auswahlfeld (ganz unten) "Inaktv" gefunden werden.
Erforderlich: diese Modifikation: Email image validation results to the user v21.) suche in admin/validateimages.php:
if ($val == 1){
ersetze es mit:
if ($val == 1 || $val == 4) {
1.1) suche:
$current_time = time();
$sql = "INSERT INTO ".IMAGES_TABLE."
(cat_id, user_id, image_name, image_description, image_keywords, image_date, image_media_file, image_thumb_file, image_download_url".$additional_field_sql.")
VALUES
($cat_id, $user_id, '$image_name', '$image_description', '$image_keywords', $current_time, '$new_name', '$new_thumb_name', '$image_download_url'".$additional_value_sql.")";
ersetze es mit:
$image_active = ($val == 4) ? 0: 1;
$current_time = time();
$sql = "INSERT INTO ".IMAGES_TABLE."
(cat_id, user_id, image_name, image_active, image_description, image_keywords, image_date, image_media_file, image_thumb_file, image_download_url".$additional_field_sql.")
VALUES
($cat_id, $user_id, '$image_name','$image_active', '$image_description', '$image_keywords', $current_time, '$new_name', '$new_thumb_name', '$image_download_url'".$additional_value_sql.")";
1.2) suche:
"status" => 1,
ersetze es mit:
"status" => ($val == 1)? $lang['validate_yes'] : $lang['inactive'],
1.3) suche:
"status" => ($info['status']) ? $lang['validate_yes'] : $lang['validate_no'],
ersetze es mit:
"status" => ($info['status']) ? $info['status'] : $lang['validate_no'],
1.4) suche:
echo "<td class=\"tableseparator\">".$lang['validate']."</td>\n<td class=\"tableseparator\">".$lang['delete']."</td>\n<td class=\"tableseparator\"> </td>\n<td class=\"tableseparator\">".$lang['field_image_name']."</td>\n<td class=\"tableseparator\">".$lang['field_category']."</td>\n<td class=\"tableseparator\">".$lang['field_username']."</td>\n<td class=\"tableseparator\">".$lang['field_date']."</td>\n<td class=\"tableseparator\">".$lang['options']."</td>\n</tr>\n";
ersetze es mit:
echo "<td class=\"tableseparator\">".$lang['validate_msg']."</td>\n
<td class=\"tableseparator\" onClick=\"if(send){send=false;CheckAllradio(2, false);CheckAllradio(3, true);}else{send=true;CheckAllradio(2, true); CheckAllradio(3, false);}\">Send</td>\n
<td class=\"tableseparator\" onClick=\"if(yes){yes=false;no=false}else{yes=true;no=false;}CheckAllradio(1, yes)\">".$lang['validate']."</td>\n
<td class=\"tableseparator\" onClick=\"if(yes){yes=false;no=false}else{yes=true;no=false;}CheckAllradio(4, yes)\">".$lang['inactive']."</td>\n
<td class=\"tableseparator\" onClick=\"if(no){no=false;yes=false}else{no=true;yes=false;}CheckAllradio(0, no)\">".$lang['delete']."</td>\n
<td class=\"tableseparator\"> </td>\n<td class=\"tableseparator\">".$lang['field_image_name']."</td>\n
<td class=\"tableseparator\">".$lang['field_category']."</td>\n<td class=\"tableseparator\">".$lang['field_username']."</td>\n
<td class=\"tableseparator\">".$lang['field_date']."</td>\n<td class=\"tableseparator\">".$lang['options']."</td>\n</tr>\n";
1.5) suche:
echo "<td><input type=\"radio\" name=\"image_list[".$image_row['image_id']."]\" value=\"1\" onDblclick=\"this.checked=false;\"></td>";
füge darunter ein:
echo "<td><input type=\"radio\" name=\"image_list[".$image_row['image_id']."]\" value=\"4\" onDblclick=\"this.checked=false;\"></td>";
2.) suche in admin/images.php:
<option value="i.image_hits"><?php echo $lang['field_hits'] ?></option>
füge darunter ein:
<option value="i.image_active"><?php echo $lang['field_inactive'] ?></option>
2.1) suche:
$limitstart = (isset($HTTP_POST_VARS['limitstart'])) ? trim($HTTP_POST_VARS['limitstart']) : "";
füge darüber ein:
if($orderby == "i.image_active") {
$orderby = "i.image_active";
$condition .= " AND image_active = 0";
}
2.2) suche:
$sql = "SELECT i.image_id, i.cat_id, i.user_id, i.image_name, i.image_media_file, i.image_date".get_user_table_field(", u.", "user_name")."
ersetze es mit:
$sql = "SELECT i.image_id, i.cat_id, i.user_id, i.image_name, i.image_media_file, i.image_thumb_file, i.image_date,i.image_active".get_user_table_field(", u.", "user_name")."
3.) suche lang/your lang/admin.php:
$lang['validate_status'] = "Status";
füge darunter ein:
$lang['field_inactive'] = "Inaktiv";
$lang['inactive'] = "Inaktiv";
4.) suche in lang/your lang/main.php "?>" und füge davor ein:
$lang['active'] = "Inaktiv<br /><span class=\"smalltext\">Dieses Bild ist zur Zeit Inaktiv, Gäste und andere Member können das Bild nicht sehen.</span>";
Optional Step 5.), 5.1), 5.2), 5.3) falls ihr Thumbnails der Inaktiven Bilder in der categories.html den jeweiligen User anzeigen lassen wollt.5.) suche in categories.php:
$site_template->register_vars(array(
"categories" => get_categories($cat_id),
ersetze es mit:
$site_template->register_vars(array(
"lang_active" => $lang['active'], //#### Mod Image Active/Inactive #####
"categories" => get_categories($cat_id),
5.1) suche:
i.image_active = 1
ersetze es mit:
i.image_active in (1,0)
5.2) suche:
$thumbnails .= "<td width=\"".$imgtable_width."\" valign=\"top\">\n";
show_image($image_row);
$thumbnails .= $site_template->parse_template("thumbnail_bit");
$thumbnails .= "\n</td>\n";
$count++;
ersetze es mit:
//####### Start Mod Image Active/Inactive #####
/*$thumbnails .= "<td width=\"".$imgtable_width."\" valign=\"top\">\n";
show_image($image_row);
$thumbnails .= $site_template->parse_template("thumbnail_bit");
$thumbnails .= "\n</td>\n";
$count++; */
$is_image_owner = ($image_row['user_id'] > USER_AWAITING && $user_info['user_id'] == $image_row['user_id']) ? 1 : 0;
if($is_image_owner && $image_row['image_active'] == 0){
$thumbnails .= "<td width=\"".$imgtable_width."\" valign=\"top\">\n";
show_image($image_row);
$thumbnails .= $site_template->parse_template("thumbnail_active_bit");
$thumbnails .= "\n</td>\n";
$count++;
}elseif($image_row['image_active'] == 1){
$thumbnails .= "<td width=\"".$imgtable_width."\" valign=\"top\">\n";
show_image($image_row);
$thumbnails .= $site_template->parse_template("thumbnail_bit");
$thumbnails .= "\n</td>\n";
$count++;
}
//###### End Mod Image Active/Inactive #####
5.3.) erstelle eine neue HTML Datei "thumbnail_active_bit.html" in euren template Ordner, mit folgen inhalt:
{thumbnail}<br />
<b>{image_name}</b>
<p class="title" style="margin-top:0;color:red">{lang_active}</p>
6.) suche in details.php
AND i.image_active = 1
ersetze es mit:
AND i.image_active in (1,0)
6.2) suche:
$image_allow_comments = (check_permission("auth_readcomment", $cat_id)) ? $image_row['image_allow_comments'] : 0;
füge darunter ein:
//########## Start Mod Image Active/Inactive ###############
$active = 1;
if($is_image_owner && $image_row['image_active'] == 0){
$image_allow_comments = 0;
$active = 0;
}
elseif(!$is_image_owner && $image_row['image_active'] == 0){
redirect($url);
}
$site_template->register_vars(array(
"lang_active" => $lang['active'],
"active" => $active
));
//########## End Mod Image Active/Inactive #################
6.3) suche:
if (!empty($sql_where_query)) {
$sql = "SELECT image_id, cat_id, image_name, image_media_file, image_thumb_file
FROM ".IMAGES_TABLE."
WHERE image_active = 1
$sql_where_query
$cat_id_sql
ORDER BY ".$config['image_order']." ".$config['image_sort'].", image_id ".$config['image_sort'];
$in_mode = 1;
}
}
if (!$in_mode || empty($sql)) {
$sql = "SELECT image_id, cat_id, image_name, image_media_file, image_thumb_file
FROM ".IMAGES_TABLE."
WHERE image_active = 1 AND cat_id = $cat_id
ORDER BY ".$config['image_order']." ".$config['image_sort'].", image_id ".$config['image_sort'];
}
ersetze es mit:
if (!empty($sql_where_query)) {
$sql = "SELECT image_id, cat_id, user_id, image_name, image_media_file, image_thumb_file,image_active
FROM ".IMAGES_TABLE."
WHERE image_active in (0,1)
$sql_where_query
$cat_id_sql
ORDER BY ".$config['image_order']." ".$config['image_sort'].", image_id ".$config['image_sort'];
$in_mode = 1;
}
}
if (!$in_mode || empty($sql)) {
$sql = "SELECT image_id, cat_id, user_id, image_name, image_media_file, image_thumb_file,image_active
FROM ".IMAGES_TABLE."
WHERE image_active in (0,1) AND cat_id = $cat_id
ORDER BY ".$config['image_order']." ".$config['image_sort'].", image_id ".$config['image_sort'];
}
6.4) suche:
$image_id_cache[] = $row['image_id'];
$next_prev_cache[$row['image_id']] = $row;
ersetze es mit:
//########## Start Mod Image Active/Inactive #################
$is_image_owner = ($row['user_id'] > USER_AWAITING && $user_info['user_id'] == $row['user_id']) ? 1 : 0;
if($is_image_owner && ($row['image_active'] == 1 || $row['image_active'] == 0)){
$image_id_cache[] = $row['image_id'];
$next_prev_cache[$row['image_id']] = $row;
if ($break) {
break;
}
}
if(!$is_image_owner && $row['image_active'] == 1){
$image_id_cache[] = $row['image_id'];
$next_prev_cache[$row['image_id']] = $row;
if ($break) {
break;
}
}
//########## End Mod Image Active/Inactive ################
7.) suche in der details.html:
{lightbox_button} {postcard_button} {download_button} {download_zip_button}
ersetze es mit:
{if active}
{lightbox_button} {postcard_button} {download_button} {download_zip_button}
{endif active}
{ifnot active}
<p class="title" style="margin-top:0;color:red">{lang_active}</p>
{endifnot active}
mfg Andi