Mit dieser Modifikation ist es als Admin oder Member möglich, die Befugnisse einzelne Bilder Sichtbar für "Alle", "Registrierte User", "Privat", oder nur "Administratoren" zu setzen.
Big Thank you to
*V@no!
Achtung diese Modifikation ist sehr lange.
Neu:
je ein neues Datenbankfeld in "Images Table" und "Images Temp Table" dazu speichert euch die datei "install_privat_images.php" aus dem anhang, in euren root und führt sie aus.
Zu Modifzierende Dateien:
1.) admin/images.php
2.) admin/validateimages.php
3.) includes/auth.php
4.) includes/functions.php
5.) includes/session.php
6.) lang/deutsch(englisch)/main.php
7.) root/categories.php
8.) root/details.php
9.) root/global.php
10.) root/index.php
11.) root/member.php
12.) root/search.php
13.) root/top.php
14.) yourtemplates/member_editimage.html
15.) yourtemplates/member_upladform.html
1.) suche in admin/images.php:
if ($action == "") {
$action = "modifyimages";
}
füge darunter ein:
//#################################### Mod Privat Images ###################################################################
$access_array = array(
AUTH_ALL => $lang['all'],
AUTH_USER => $lang['userlevel_registered'],
AUTH_ACL => $lang['private'],
AUTH_ADMIN => $lang['userlevel_admin']
);
function show_access_select($title = "", $type, $status, $i) {
global $access_array, $HTTP_POST_VARS, $i;
if (isset($HTTP_POST_VARS[$type.'_'.$i])) {
$status = $HTTP_POST_VARS[$type.'_'.$i];
}
echo "<tr class=\"".get_row_bg()."\" valign=\"top\">\n<td><p class=\"rowtitle\">".$title."</p></td>\n";
if(isset($i)){
echo "<td>\n<select name=\"image_auth_viewimage_".$i."\">\n";
}
elseif(!isset($i)){
echo "<td>\n<select name=\"image_auth_viewimage\">\n";
}
foreach ($access_array as $key => $val) {
echo "<option value=\"".$key."\"";
if ($status == $key) {
echo " selected=\"selected\"";
}
echo ">".$val."</option>\n";
}
echo "</select>\n</td>\n</tr>\n";
}
//#################################### Mod Privat Images ###################################################################
1.1) suche:
$image_allow_comments = intval($HTTP_POST_VARS['image_allow_comments']);
füge darunter ein:
//#################################### Mod Privat Images ###################################################################
$image_auth_viewimage = $HTTP_POST_VARS['image_auth_viewimage'];
//#################################### Mod Privat Images ###################################################################
1.2) suche:
$sql = "UPDATE ".IMAGES_TABLE."
SET cat_id = $cat_id, user_id = $user_id, image_name = '$image_name', image_description = '$image_description', image_keywords = '$image_keywords', image_date = $image_date, image_active = $image_active, image_media_file = '$new_name', image_thumb_file = '$new_thumb_name', image_download_url = '$image_download_url', image_allow_comments = $image_allow_comments, image_downloads = $image_downloads, image_votes = $image_votes, image_rating = '$image_rating', image_hits = $image_hits".$additional_sql."
WHERE image_id = $image_id";
ersetze mit:
//#################################### Mod Privat Images ###################################################################
$sql = "UPDATE ".IMAGES_TABLE."
SET cat_id = $cat_id, user_id = $user_id, image_name = '$image_name', image_description = '$image_description', image_keywords = '$image_keywords', image_date = $image_date, image_active = $image_active, image_media_file = '$new_name', image_thumb_file = '$new_thumb_name', image_download_url = '$image_download_url', image_allow_comments = $image_allow_comments, image_downloads = $image_downloads, image_votes = $image_votes, image_rating = '$image_rating', image_hits = $image_hits, image_auth_viewimage = $image_auth_viewimage".$additional_sql."
WHERE image_id = $image_id";
//#################################### Mod Privat Images ###################################################################
1.3) suche:
show_cat_select_row($lang['field_category'], $image_row['cat_id'], 3);
füge darunter ein:
//#################################### Mod Privat Images ###################################################################
show_access_select($lang['auth_viewimage'], $key, $image_row['image_auth_viewimage'], $i);
//#################################### Mod Privat Images ###################################################################
1.4) suche:
$user_id = (intval($HTTP_POST_VARS['user_id_'.$i]) != 0) ? intval($HTTP_POST_VARS['user_id_'.$i]) : $user_info['user_id'];
füge darüber ein:
//#################################### Mod Privat Images ###################################################################
$image_auth_viewimage = $HTTP_POST_VARS['image_auth_viewimage_'.$i];
//#################################### Mod Privat Images ###################################################################
1.5) suche:
//Upload Image
füge darüber ein ein:
//#################################### Mod Privat Images ###################################################################
$image_auth_viewimage = $HTTP_POST_VARS['image_auth_viewimage_'.$i];
//#################################### Mod Privat Images ###################################################################
1.6)suche:
$image_allow_comments = trim($HTTP_POST_VARS['image_allow_comments_'.$i]);
füge darunter ein:
//#################################### Mod Privat Images ###################################################################
$image_auth_viewimage = $HTTP_POST_VARS['image_auth_viewimage_'.$i];
//#################################### Mod Privat Images ###################################################################
1.7) suche:
$sql = "INSERT INTO ".IMAGES_TABLE."
(cat_id, user_id, image_name, image_description, image_keywords, image_date, image_active, image_media_file, image_thumb_file, image_download_url, image_allow_comments".$additional_field_sql.")
VALUES
($cat_id, $user_id, '$image_name', '$image_description', '$image_keywords', $current_time, $image_active, '$new_name', '$new_thumb_name', '$image_download_url', $image_allow_comments".$additional_value_sql.")";
ersetze es mit:
//#################################### Mod Privat Images ###################################################################
$sql = "INSERT INTO ".IMAGES_TABLE."
(cat_id, user_id, image_name, image_description, image_keywords, image_date, image_active, image_media_file, image_thumb_file, image_download_url, image_allow_comments, image_auth_viewimage".$additional_field_sql.")
VALUES
($cat_id, $user_id, '$image_name', '$image_description', '$image_keywords', $current_time, $image_active, '$new_name', '$new_thumb_name', '$image_download_url', $image_allow_comments, $image_auth_viewimage".$additional_value_sql.")";
//#################################### Mod Privat Images ###################################################################
1.8 ) suche:
show_cat_select_row($lang['field_category'], 0, 3, $i);
füge darunter ein:
//#################################### Mod Privat Images ###################################################################
show_access_select($lang['auth_viewimage'], $key, $val, $i);
//#################################### Mod Privat Images ###################################################################
2.) suche in admin/validateimages.php:
show_admin_header();
füge darunter ein:
//#################################### Mod Privat Images ###################################################################
$access_array = array(
AUTH_ALL => $lang['all'],
AUTH_USER => $lang['userlevel_registered'],
AUTH_ACL => $lang['private'],
AUTH_ADMIN => $lang['userlevel_admin']
);
function show_access_select($title = "", $type, $status, $i) {
global $access_array, $HTTP_POST_VARS, $i;
if (isset($HTTP_POST_VARS[$type.'_'.$i])) {
$status = $HTTP_POST_VARS[$type.'_'.$i];
}
echo "<tr class=\"".get_row_bg()."\" valign=\"top\">\n<td><p class=\"rowtitle\">".$title."</p></td>\n";
if(isset($i)){
echo "<td>\n<select name=\"image_auth_viewimage_".$i."\">\n";
}
elseif(!isset($i)){
echo "<td>\n<select name=\"image_auth_viewimage\">\n";
}
foreach ($access_array as $key => $val) {
echo "<option value=\"".$key."\"";
if ($status == $key) {
echo " selected=\"selected\"";
}
echo ">".$val."</option>\n";
}
echo "</select>\n</td>\n</tr>\n";
}
//#################################### Mod Privat Images ###################################################################
2.1) suche:
$user_id = (intval($HTTP_POST_VARS['user_id']) != 0) ? intval($HTTP_POST_VARS['user_id']) : $user_info['user_id'];
füge darunter ein:
//#################################### Mod Privat Images ###################################################################
$image_auth_viewimage = ($HTTP_POST_VARS['image_auth_viewimage']);
//#################################### Mod Privat Images ###################################################################
2.2) suche:
$sql = "UPDATE ".IMAGES_TEMP_TABLE."
SET cat_id = $cat_id, user_id = $user_id, image_name = '$image_name', image_description = '$image_description', image_keywords = '$image_keywords', image_date = $image_date, image_media_file = '$new_name', image_thumb_file = '$new_thumb_name', image_download_url = '$image_download_url'".$additional_sql."
WHERE image_id = $image_id";
ersetze es mit:
//#################################### Mod Privat Images ###################################################################
$sql = "UPDATE ".IMAGES_TEMP_TABLE."
SET cat_id = $cat_id, user_id = $user_id, image_name = '$image_name', image_description = '$image_description', image_keywords = '$image_keywords', image_date = $image_date, image_media_file = '$new_name', image_thumb_file = '$new_thumb_name', image_download_url = '$image_download_url', image_auth_viewimage = '$image_auth_viewimage'".$additional_sql."
WHERE image_id = $image_id";
//#################################### Mod Privat Images ###################################################################
2.3)suche:
show_user_select_row($lang['user'], $image_row['user_id']);
füge darunter ein:
//#################################### Mod Privat Images ###################################################################
show_access_select($lang['auth_viewimage'], $key, $image_row['image_auth_viewimage'], $i);
//#################################### Mod Privat Images ###################################################################
2.4) suche:
$image_download_url = addslashes($image_cache[$key]['image_download_url']);
füge darunter ein:
//#################################### Mod Privat Images ###################################################################
$image_auth_viewimage = $image_cache[$key]['image_auth_viewimage'];
//#################################### Mod Privat Images ###################################################################
2.5)suche:
$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:
//#################################### Mod Privat Images ###################################################################
$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,image_auth_viewimage".$additional_field_sql.")
VALUES
($cat_id, $user_id, '$image_name', '$image_description', '$image_keywords', $current_time, '$new_name', '$new_thumb_name', '$image_download_url','$image_auth_viewimage'".$additional_value_sql.")";
//#################################### Mod Privat Images ###################################################################
3.) suche in includes/auth.php:
?>
füge darüber ein:
//#################################### Mod Privat Images ###################################################################
function get_image_permission(){
global $site_db, $user_info, $user_image_access;
if (isset($user_image_access) && !empty($user_image_access))
return $user_image_access;
$user_image_access = array();
// if ($user_info['user_id'] != 0 && $user_info['user_level'] != GUEST && $user_info['user_level'] != USER_AWAITING) {
$current_time = time();
$sql = "SELECT image_id, user_id,image_auth_viewimage
FROM ".IMAGES_TABLE."
WHERE user_id <> ".$user_info['user_id']." AND image_auth_viewimage <> 0
";
$result = $site_db->query($sql);
while ($row = $site_db->fetch_array($result)) {
$user_image_access[$row['image_id']] = $row;
}
return $user_image_access;
}
function check_image_permission($type,$image_id) {
global $site_db, $user_info, $user_image_access;
/* if (!isset($image_id[$type])) {
return false;
echo "return false";
} */
if ($user_image_access[$image_id][$type] == AUTH_ALL || $user_info['user_level'] == ADMIN) {
return true;
echo "return true";
}
elseif ($user_image_access[$image_id][$type] == AUTH_USER && ($user_info['user_level'] != GUEST && $user_info['user_level'] != USER_AWAITING)) {
return true;
echo "return true";
}
elseif ($user_image_access[$image_id][$type] == AUTH_ADMIN && $user_info['user_level'] != ADMIN) {
return false;
echo "return false";
}
elseif ($user_image_access[$image_id][$type] == AUTH_ACL && ($user_info['user_level'] != GUEST && $user_info['user_level'] != USER_AWAITING)) {
/* if (isset($user_image_access[$image_id])) {
for ($i = 0; $i < sizeof($user_image_access[$image_id]); $i++) {
if (isset($user_image_access[$image_id][$i][$type]) && $user_image_access[$image_id][$i][$type] == 1) {
*/ return false;
echo "return true";
//}
//}
//}
}
return false;
echo "return false";
}
function get_auth_image_sql($type, $mode = "IN") {
global $auth_image_sql, $user_image_access;
if (!empty($auth_image_sql[$type][$mode])) {
return $auth_image_sql[$type][$mode];
}
$auth_image_sql[$type]['IN'] = 0;
$auth_image_sql[$type]['NOTIN'] = 0;
foreach ($user_image_access as $key => $val) {
if (!check_image_permission($type, $key)) {
$auth_image_sql[$type]['NOTIN'] .= ", ".$key;
}
else {
$auth_image_sql[$type]['IN'] .= ", ".$key;
}
}
return $auth_image_sql[$type][$mode];
}
//#################################### Mod Privat Images ###################################################################
4.) suche in includes/functions.php:
$cat_id_sql = get_auth_cat_sql("auth_viewcat", "NOTIN");
füge darunter ein:
//#################################### Mod Privat Images ###################################################################
$image_id_sql = get_auth_image_sql("image_auth_viewimage", "NOTIN");
//#################################### Mod Privat Images ###########################################
4.1) suche:
$sql = "SELECT DISTINCT i.image_id, i.cat_id, i.user_id, i.image_name, i.image_description, i.image_keywords, i.image_date, i.image_active, i.image_media_file, i.image_thumb_file, i.image_download_url, i.image_allow_comments, i.image_comments, i.image_downloads, i.image_votes, i.image_rating, i.image_hits, c.cat_name".get_user_table_field(", u.", "user_name")."
FROM (".IMAGES_TABLE." i, ".CATEGORIES_TABLE." c)
LEFT JOIN ".USERS_TABLE." u ON (".get_user_table_field("u.", "user_id")." = i.user_id)
WHERE i.image_active = 1 AND i.cat_id NOT IN ($cat_id_sql) AND c.cat_id = i.cat_id
ORDER BY RAND()";
und ersetze es mit:
//#################################### Mod Privat Images ###################################################################
$sql = "SELECT DISTINCT i.image_id, i.cat_id, i.user_id, i.image_name, i.image_description, i.image_keywords, i.image_date, i.image_active, i.image_media_file, i.image_thumb_file, i.image_download_url, i.image_allow_comments, i.image_comments, i.image_downloads, i.image_votes, i.image_rating, i.image_hits, c.cat_name".get_user_table_field(", u.", "user_name")."
FROM (".IMAGES_TABLE." i, ".CATEGORIES_TABLE." c)
LEFT JOIN ".USERS_TABLE." u ON (".get_user_table_field("u.", "user_id")." = i.user_id)
WHERE i.image_active = 1 AND i.cat_id NOT IN ($cat_id_sql) AND c.cat_id = i.cat_id AND i.image_id NOT IN ($image_id_sql)
ORDER BY RAND()";
//#################################### Mod Privat Images ###################################################################
4.2) suche:
$sql = "SELECT COUNT(*) as total_images
FROM ".IMAGES_TABLE."
WHERE image_active = 1 AND cat_id NOT IN ($cat_id_sql)
";
und ersetze es mit:
//#################################### Mod Privat Images ###################################################################
$sql = "SELECT COUNT(*) as total_images
FROM ".IMAGES_TABLE."
WHERE image_active = 1 AND cat_id NOT IN ($cat_id_sql) AND image_id NOT IN ($image_id_sql)
";
//#################################### Mod Privat Images ###################################################################
4.3) suche:
$sql = "SELECT i.image_id, i.cat_id, i.user_id, i.image_name, i.image_description, i.image_keywords, i.image_date, i.image_active, i.image_media_file, i.image_thumb_file, i.image_download_url, i.image_allow_comments, i.image_comments, i.image_downloads, i.image_votes, i.image_rating, i.image_hits, c.cat_name".get_user_table_field(", u.", "user_name")."
FROM (".IMAGES_TABLE." i, ".CATEGORIES_TABLE." c)
LEFT JOIN ".USERS_TABLE." u ON (".get_user_table_field("u.", "user_id")." = i.user_id)
WHERE i.image_active = 1 AND i.cat_id NOT IN ($cat_id_sql) AND c.cat_id = i.cat_id
LIMIT $number, 1";
und ersetze es:
//#################################### Mod Privat Images ###################################################################
$sql = "SELECT i.image_id, i.cat_id, i.user_id, i.image_name, i.image_description, i.image_keywords, i.image_date, i.image_active, i.image_media_file, i.image_thumb_file, i.image_download_url, i.image_allow_comments, i.image_comments, i.image_downloads, i.image_votes, i.image_rating, i.image_hits, c.cat_name".get_user_table_field(", u.", "user_name")."
FROM (".IMAGES_TABLE." i, ".CATEGORIES_TABLE." c)
LEFT JOIN ".USERS_TABLE." u ON (".get_user_table_field("u.", "user_id")." = i.user_id)
WHERE i.image_active = 1 AND i.cat_id NOT IN ($cat_id_sql) AND c.cat_id = i.cat_id AND i.image_id NOT IN ($image_id_sql)
LIMIT $number, 1";
//#################################### Mod Privat Images ###################################################################
5.) suche in includes/session.php:
?>
füge darüber ein:
//#################################### Mod Privat Images ###########################################
$user_image_access = get_image_permission();
if (defined("GET_CACHES") && empty($cat_cache)) {
$config['cat_order'] = empty($config['cat_order']) ? 'cat_order, cat_name ASC' : $config['cat_order'];
$sql = "SELECT cat_id, cat_name, cat_description, cat_parent_id, cat_hits, cat_order, auth_viewcat, auth_viewimage, auth_download, auth_upload, auth_directupload, auth_vote, auth_sendpostcard, auth_readcomment, auth_postcomment
FROM ".CATEGORIES_TABLE."
ORDER BY ".$config['cat_order']." " .$config['cat_sort'];
$result = $site_db->query($sql);
while ($row = $site_db->fetch_array($result)) {
$cat_cache[$row['cat_id']] = $row;
$cat_parent_cache[$row['cat_parent_id']][] = $row['cat_id'];
}
$site_db->free_result();
// --------------------------------------
$new_cutoff = time() - (60 * 60 * 24 * $config['new_cutoff']);
$sql = "SELECT cat_id, COUNT(image_id) AS new_images
FROM ".IMAGES_TABLE."
WHERE image_active = 1 AND image_date >= $new_cutoff
GROUP BY cat_id";
$result = $site_db->query($sql);
while ($row = $site_db->fetch_array($result)) {
$new_image_cache[$row['cat_id']] = $row['new_images'];
}
$site_db->free_result();
$sql = "SELECT cat_id, COUNT(*) AS num_images
FROM ".IMAGES_TABLE."
WHERE image_active = 1 AND image_id NOT IN (".get_auth_image_sql("image_auth_viewimage", "NOTIN").")
GROUP BY cat_id";
$result = $site_db->query($sql);
while ($row = $site_db->fetch_array($result)) {
$cat_cache[$row['cat_id']]['num_images'] = $row['num_images'];
}
$site_db->free_result();
} //end if GET_CACHES
//#################################### Mod Privat Images ###########################################
6.) suche in lang/deutsch(englisch)/main.php:
$lang['userlevel_guest'] = "Gast";
füge darunter ein:
//#################################### Privat Images ###################################################################
$lang['userlevel_all'] = "Alle";
$lang['userlevel_registered'] = "Registrierte User";
$lang['userlevel_private']= "Privat";
$lang['userlevel_admins'] = "Administratoren";
$lang['auth_viewimage'] = "Bilddetails sehen:";
//#################################### Privat Images ###################################################################
Optional english/main.php
//#################################### Privat Images ###################################################################
$lang['userlevel_all'] = "All";
$lang['userlevel_registered'] = "Registered User";
$lang['userlevel_private']= "Privat";
$lang['userlevel_admins'] = "Administratoren";
$lang['auth_viewimage'] = "Show Image detail:";
//#################################### Privat Images ###################################################################
7.) suche in root/categories.php:
$sql = "SELECT i.image_id, i.cat_id, i.user_id, i.image_name, i.image_description, i.image_keywords, i.image_date, i.image_active, i.image_media_file, i.image_thumb_file, i.image_download_url, i.image_allow_comments, i.image_comments, i.image_downloads, i.image_votes, i.image_rating, i.image_hits".$additional_sql.", c.cat_name".get_user_table_field(", u.", "user_name")."
FROM (".IMAGES_TABLE." i, ".CATEGORIES_TABLE." c)
LEFT JOIN ".USERS_TABLE." u ON (".get_user_table_field("u.", "user_id")." = i.user_id)
WHERE i.image_active = 1 AND i.cat_id = $cat_id AND c.cat_id = i.cat_id
ORDER BY ".$config['image_order']." ".$config['image_sort'].", i.image_id ".$config['image_sort']."
LIMIT $offset, $perpage ";
ersetze es mit:
//#################################### Privat Images ###################################################################
$sql = "SELECT i.image_id, i.cat_id, i.user_id, i.image_name, i.image_description, i.image_keywords, i.image_date, i.image_active, i.image_media_file, i.image_thumb_file, i.image_download_url, i.image_allow_comments, i.image_comments, i.image_downloads, i.image_votes, i.image_rating, i.image_hits, i.image_auth_viewimage".$additional_sql.", c.cat_name".get_user_table_field(", u.", "user_name")."
FROM (".IMAGES_TABLE." i, ".CATEGORIES_TABLE." c)
LEFT JOIN ".USERS_TABLE." u ON (".get_user_table_field("u.", "user_id")." = i.user_id)
WHERE i.image_active = 1 AND i.cat_id = $cat_id AND c.cat_id = i.cat_id AND i.image_id NOT IN (".get_auth_image_sql("image_auth_viewimage", "NOTIN").")
ORDER BY ".$config['image_order']." ".$config['image_sort'].", i.image_id ".$config['image_sort']."
LIMIT $offset, $perpage ";
//#################################### Privat Images ###################################################################
8.) suche in root/details.php:
$sql = "SELECT i.image_id, i.cat_id, i.user_id, i.image_name, i.image_description, i.image_keywords, i.image_date, i.image_active, i.image_media_file, i.image_thumb_file, i.image_download_url, i.image_allow_comments, i.image_comments, i.image_downloads, i.image_votes, i.image_rating, i.image_hits".$additional_sql.", c.cat_name".get_user_table_field(", u.", "user_name").get_user_table_field(", u.", "user_email")."
FROM (".IMAGES_TABLE." i, ".CATEGORIES_TABLE." c)
LEFT JOIN ".USERS_TABLE." u ON (".get_user_table_field("u.", "user_id")." = i.user_id)
WHERE i.image_id = $image_id AND i.image_active = 1 AND c.cat_id = i.cat_id";
ersetze es mit:
//#################################### Mod Privat Images ###################################################################
$check_image_auth_viewimage = (check_image_permission("image_auth_viewimage", $image_id)) ? " " : "AND NOT i.image_id = '$image_id'";
$sql = "SELECT i.image_id, i.cat_id, i.user_id, i.image_name, i.image_description, i.image_keywords, i.image_date, i.image_active, i.image_media_file, i.image_thumb_file, i.image_download_url, i.image_allow_comments, i.image_comments, i.image_downloads, i.image_votes, i.image_rating, i.image_hits, i.image_auth_viewimage".$additional_sql.", c.cat_name".get_user_table_field(", u.", "user_name").get_user_table_field(", u.", "user_email")."
FROM (".IMAGES_TABLE." i, ".CATEGORIES_TABLE." c)
LEFT JOIN ".USERS_TABLE." u ON (".get_user_table_field("u.", "user_id")." = i.user_id)
WHERE i.image_id = $image_id AND i.image_active = 1 AND c.cat_id = i.cat_id $check_image_auth_viewimage";
//#################################### Mod Privat Images ###################################################################
9.) suche in root/global.php:
if (defined("GET_CACHES")) {
und ersetze es mit:
//#################################### Mod Privat Images ###################################################################
//if (defined("GET_CACHES")) {
if (defined("GET_CACHES") && (defined("IN_CP") || isset($global_get_caches))) {
//#################################### Mod Privat Images ###################################################################
10.) suche in root/index.php:
$num_new_images = $config['image_cells'];
$sql = "SELECT i.image_id, i.cat_id, i.user_id, i.image_name, i.image_description, i.image_keywords, i.image_date, i.image_active, i.image_media_file, i.image_thumb_file, i.image_download_url, i.image_allow_comments, i.image_comments, i.image_downloads, i.image_votes, i.image_rating, i.image_hits".$additional_sql.", c.cat_name".get_user_table_field(", u.", "user_name")."
FROM (".IMAGES_TABLE." i, ".CATEGORIES_TABLE." c)
LEFT JOIN ".USERS_TABLE." u ON (".get_user_table_field("u.", "user_id")." = i.user_id)
WHERE i.image_active = 1 AND c.cat_id = i.cat_id AND i.cat_id NOT IN (".get_auth_cat_sql("auth_viewcat", "NOTIN").")
ORDER BY i.image_date DESC
LIMIT $num_new_images";
ersetze es mit:
//#################################### Mod Privat Images ###################################################################
$num_new_images = $config['image_cells'];
$sql = "SELECT i.image_id, i.cat_id, i.user_id, i.image_name, i.image_description, i.image_keywords, i.image_date, i.image_active, i.image_media_file, i.image_thumb_file, i.image_download_url, i.image_allow_comments, i.image_comments, i.image_downloads, i.image_votes, i.image_rating, i.image_hits, i.image_auth_viewimage".$additional_sql.", c.cat_name".get_user_table_field(", u.", "user_name")."
FROM (".IMAGES_TABLE." i, ".CATEGORIES_TABLE." c)
LEFT JOIN ".USERS_TABLE." u ON (".get_user_table_field("u.", "user_id")." = i.user_id)
WHERE i.image_active = 1 AND c.cat_id = i.cat_id AND i.cat_id NOT IN (".get_auth_cat_sql("auth_viewcat", "NOTIN").") AND i.image_id NOT IN (".get_auth_image_sql("image_auth_viewimage", "NOTIN").")
ORDER BY i.image_date DESC
LIMIT $num_new_images";
//#################################### Mod Privat Images ###################################################################
11.)suche in root/member.php:suche im abschnitt: if ($action == "updateimage")
$image_keywords = ereg_replace("( ){2,}", " ", $image_keywords);
füge darunter ein:
//#################################### Mod Privat Image ###################################################################
$image_auth_viewimage = $HTTP_POST_VARS['image_auth_viewimage'];
//#################################### Mod Privat Images ###################################################################
11.1) suche im abschnitt: if ($action == "updateimage")
$sql = "UPDATE ".IMAGES_TABLE."
SET image_name = '$image_name', image_description = '$image_description', image_keywords = '$image_keywords'".$additional_sql."
WHERE image_id = $image_id";
ersetze es mit:
//#################################### Mod Privat Image ###################################################################
$sql = "UPDATE ".IMAGES_TABLE."
SET image_name = '$image_name', image_description = '$image_description', image_keywords = '$image_keywords', image_auth_viewimage = $image_auth_viewimage".$additional_sql."
WHERE image_id = $image_id";
//#################################### Mod Privat Image ###################################################################
11.2) suche im abschnitt if ($action == "editimage")
$sql = "SELECT image_id, cat_id, user_id, image_name, image_description, image_keywords, image_allow_comments".$additional_sql."
FROM ".IMAGES_TABLE."
WHERE image_id = $image_id";
ersetze es mit:
//#################################### Mod Privat Images ###################################################################
$sql = "SELECT image_id, cat_id, user_id, image_name, image_description, image_keywords, image_allow_comments, image_auth_viewimage".$additional_sql."
FROM ".IMAGES_TABLE."
WHERE image_id = $image_id";
//#################################### Mod Privat Images ###################################################################
11.3) suche im abschnitt if ($action == "editimage")
$image_allow_comments = (isset($HTTP_POST_VARS['image_allow_comments'])) ? intval($HTTP_POST_VARS['image_allow_comments']) : $image_row['image_allow_comments'];
füge darunter ein:
//#################################### Mod Privat Images ###################################################################
$access_array = array(
AUTH_ALL => $lang['userlevel_all'],
AUTH_USER => $lang['userlevel_registered'],
AUTH_ACL => $lang['userlevel_private'],
AUTH_ADMIN => $lang['userlevel_admins']
);
$status = (isset($HTTP_POST_VARS['image_auth_viewimage']))? $HTTP_POST_VARS['image_auth_viewimage'] : $image_row['image_auth_viewimage'];
$access_select = "<td class=\"row1\">\n<select class=\"input\" name=\"image_auth_viewimage\">\n";
foreach ($access_array as $key => $val) {
$access_select .= "<option value=\"".$key."\"";
if ($status == $key) {
$access_select .= " selected=\"selected\"";
}
$access_select .= ">".$val."</option>\n";
}
$access_select .= "</select>\n</td>\n</tr>\n";
//#################################### Mod Privat Images ###################################################################
11.4) suche im abschnitt if ($action == "editimage")
$site_template->register_vars(array(
füge darunter ein:
//#################################### Mod Privat Images ###################################################################
"access_select" => $access_select,
"auth_viewimage" => $lang['auth_viewimage'],
//#################################### Mod Privat Images ###################################################################
11.5) suche im abschnitt if ($action == "uploadimage")
$image_keywords = ereg_replace("( ){2,}", " ", $image_keywords);
füge darunter ein:
//#################################### Mod Privat Images ###################################################################
$image_auth_viewimage = $HTTP_POST_VARS['image_auth_viewimage'];
//#################################### Mod Privat Images ###################################################################
11.6) suche im abschnitt if ($action == "uploadimage")
$sql = "INSERT INTO ".IMAGES_TABLE."
(cat_id, user_id, image_name, image_description, image_keywords, image_date, image_active, image_media_file, image_thumb_file, image_download_url, image_allow_comments".$additional_field_sql.")
VALUES
($cat_id, ".$user_info['user_id'].", '$image_name', '$image_description', '$image_keywords', $current_time, $image_active, '$new_name', '$new_thumb_name', '$image_download_url', $image_allow_comments".$additional_value_sql.")";
ersetze es mit:
//#################################### Mod Privat Images ###################################################################
$sql = "INSERT INTO ".IMAGES_TABLE."
(cat_id, user_id, image_name, image_description, image_keywords, image_date, image_active, image_media_file, image_thumb_file, image_download_url, image_allow_comments, image_auth_viewimage".$additional_field_sql.")
VALUES
($cat_id, ".$user_info['user_id'].", '$image_name', '$image_description', '$image_keywords', $current_time, $image_active, '$new_name', '$new_thumb_name', '$image_download_url', $image_allow_comments,$image_auth_viewimage".$additional_value_sql.")";
//#################################### Mod Privat Images ###################################################################
11.7) suche im abschnitt if ($action == "uploadimage")
$sql = "INSERT INTO ".IMAGES_TEMP_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_info['user_id'].", '$image_name', '$image_description', '$image_keywords', $current_time, '$new_name', '$new_thumb_name', '$image_download_url'".$additional_value_sql.")";
ersetze es mit:
//#################################### Mod Privat Images ###################################################################
$sql = "INSERT INTO ".IMAGES_TEMP_TABLE."
(cat_id, user_id, image_name, image_description, image_keywords, image_date, image_media_file, image_thumb_file, image_download_url,image_auth_viewimage".$additional_field_sql.")
VALUES
($cat_id, ".$user_info['user_id'].", '$image_name', '$image_description', '$image_keywords', $current_time, '$new_name', '$new_thumb_name', '$image_download_url','$image_auth_viewimage'".$additional_value_sql.")";
//#################################### Mod Privat Images ###################################################################
11.8 ) suche im abschnitt if ($action == "uploadform")
$site_template->register_vars(array(
füge darüber ein:
//#################################### Mod Privat Images ###################################################################
$access_array = array(
AUTH_ALL => $lang['userlevel_all'],
AUTH_USER => $lang['userlevel_registered'],
AUTH_ACL => $lang['userlevel_private'],
AUTH_ADMIN => $lang['userlevel_admins']
);
$status = (isset($HTTP_POST_VARS['image_auth_viewimage']))? $HTTP_POST_VARS['image_auth_viewimage'] : $image_row['image_auth_viewimage'];
$access_select = "<td class=\"row1\">\n<select class=\"input\" name=\"image_auth_viewimage\">\n";
foreach ($access_array as $key => $val) {
$access_select .= "<option value=\"".$key."\"";
if ($status == $key) {
$access_select .= " selected=\"selected\"";
}
$access_select .= ">".$val."</option>\n";
}
$access_select .= "</select>\n</td>\n</tr>\n";
//#################################### Mod Privat Images ###################################################################
11.9.) suche im abschnitt if ($action == "uploadform")
$site_template->register_vars(array(
füge darunter ein:
//#################################### Mod Privat Images ###################################################################
"access_select" => $access_select,
"auth_viewimage" => $lang['auth_viewimage'],
//#################################### Mod Privat Images ###################################################################
12.) suche in root/search.php:
if (!empty($sql_where_query)) {
$sql = "SELECT COUNT(*) AS num_rows_all
FROM ".IMAGES_TABLE." i
WHERE i.image_active = 1 $sql_where_query
$cat_id_sql
";
ersetze es mit:
//#################################### Mod Privat Images ###################################################################
if (!empty($sql_where_query)) {
$sql = "SELECT COUNT(*) AS num_rows_all
FROM ".IMAGES_TABLE." i
WHERE i.image_active = 1 $sql_where_query
$cat_id_sql AND i.image_id NOT IN (".get_auth_image_sql("image_auth_viewimage", "NOTIN").")
";
//#################################### Mod Privat Images ###################################################################
12.1) suche:
$sql = "SELECT i.image_id, i.cat_id, i.user_id, i.image_name, i.image_description, i.image_keywords, i.image_date, i.image_active, i.image_media_file, i.image_thumb_file, i.image_download_url, i.image_allow_comments, i.image_comments, i.image_downloads, i.image_votes, i.image_rating, i.image_hits".$additional_sql.", c.cat_name".get_user_table_field(", u.", "user_name")."
FROM (".IMAGES_TABLE." i, ".CATEGORIES_TABLE." c)
LEFT JOIN ".USERS_TABLE." u ON (".get_user_table_field("u.", "user_id")." = i.user_id)
WHERE i.image_active = 1
$sql_where_query
AND c.cat_id = i.cat_id $cat_id_sql
ORDER BY ".$config['image_order']." ".$config['image_sort'].", image_id ".$config['image_sort']."
LIMIT $offset, $perpage";
ersetze es mit:
//#################################### Mod Privat Images ###################################################################
$sql = "SELECT i.image_id, i.cat_id, i.user_id, i.image_name, i.image_description, i.image_keywords, i.image_date, i.image_active, i.image_media_file, i.image_thumb_file, i.image_download_url, i.image_allow_comments, i.image_comments, i.image_downloads, i.image_votes, i.image_rating, i.image_hits".$additional_sql.", c.cat_name".get_user_table_field(", u.", "user_name")."
FROM (".IMAGES_TABLE." i, ".CATEGORIES_TABLE." c)
LEFT JOIN ".USERS_TABLE." u ON (".get_user_table_field("u.", "user_id")." = i.user_id)
WHERE i.image_active = 1 AND i.image_id NOT IN (".get_auth_image_sql("image_auth_viewimage", "NOTIN").")
$sql_where_query
AND c.cat_id = i.cat_id $cat_id_sql
ORDER BY ".$config['image_order']." ".$config['image_sort'].", image_id ".$config['image_sort']."
LIMIT $offset, $perpage";
//#################################### Mod Privat Images ###################################################################
13.) suche in root/top.php:
$cat_id_sql = get_auth_cat_sql("auth_viewcat", "NOTIN");
füge darunter ein:
//#################################### Mod Privat Images ###################################################################
$image_id_sql = get_auth_image_sql("image_auth_viewimage", "NOTIN");
//#################################### Mod Privat Images ###################################################################
13.1) suche 4x :
WHERE i.image_active = 1 AND i.cat_id NOT IN ($cat_id_sql) AND i.cat_id = c.cat_id
$cat_match_sql
ersetze es mit:
WHERE i.image_active = 1 AND i.cat_id NOT IN ($cat_id_sql) AND i.cat_id = c.cat_id
$cat_match_sql AND i.image_id NOT IN ($image_id_sql)
14.)suche in yourtemplates/member_editimage.html: <textarea name="image_keywords" cols="30" rows="10" wrap="virtual" class="textarea">{image_keywords}</textarea>
</td>
</tr>
füge darunter ein:
<tr>
<td class="row1" valign="top"><b>{auth_viewimage}</b></td>
{access_select}
</tr>
15.) suche in yourtemplates/member_upladform.html: <textarea cols="30" class="textarea" rows="10" name="image_keywords">{image_keywords}</textarea>
</td>
</tr>
füge darunter ein:
<tr>
<td class="row1" valign="top"><b>{auth_viewimage}</b></td>
{access_select}
</tr>
das war es
mfg Andi