1
Discussion & Troubleshooting / Re: Thumbnail only showing in subcategories and not categories on homepage.
« on: July 29, 2008, 04:17:44 PM »
I think it might be because of the rustynet template?
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
$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
FROM (".IMAGES_TABLE." i, ".CATEGORIES_TABLE." c)
WHERE i.image_active = 1 AND ((c.cat_parent_id = $cat_id AND c.cat_id = i.cat_id) OR (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";
$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";
@tucano
... da du den zweiten Punkt offensichtlich erfolgreich abgearbeitet hast, wäre es nett, wenn du in dem Tutorial-Thread noch mal ein Statement dazu abgibst ... mit 4images-Version und ggf. Hinweisen zur Ausführung ... denn offensichtlich tun sich viele andere 4images-User mit der Problematik "One Image - Three sizes" sehr schwer und so wäre es dann eine Motivation dieses Tutorial auch umzusetzen ...
Danke ... mawenzi
@tucano
... zu 3. ...
... so wie du ein additional_image_field für den Fotografen eingefügt hast, so kannst du auch ein additional_image_field für die Betrachtungsrechte einführen ... ein Tutorial wäre hier http://www.4homepages.de/forum/index.php?topic=20748.0 ... für dieses Feld wäre ein Ratio-Button auszuwählen ... Alle User bzw. Reg. User ... dann kann man unabhängig von der Kategorieeinstellung die Ansichtsrechte für jedes Bild einzeln vergeben ... um die Ansichtsrechte umzusetzen gibt es m.E. zwei Möglichkeiten ...
1. in der includes/functions.php die Rechte für die "Thumbs" neu zu regeln ...
2. in der includes/functions.php z.B $detail_view_all und $detail_view_user registrieren ...
und in der /templates/<dein_template>/tumbnail_bit.html die Rechte mit {if ...}-Tags regeln ...
wobei mir das jetzt etwas umständlicher zu sein scheint ...
... eine ähnliche Problematik haben wir hier im Forum mal diskutiert und umgesetzt ...
... Download Ja / Nein (unabhängig von der Kategorieeinstellung) ... hier ... http://www.4homepages.de/forum/index.php?topic=11539.0 ...
... dann gibt es auch noch ein Tutorial "Bild-Uploadoption: Rating Ja / Nein" (unabhängig von der Kategorieeinstellung) ... auch ähnlich ...
$additional_rights_fields['image_rights'] = array($lang['image_rights'], "radio", 1);
$lang['image_rights'] = "Bild-Rechte:";
<p style="line-height:100%; margin-top:0; margin-bottom:0;"><sup class="new">{lang_image_rights}</sup><br>
<input type="radio" name="image_rights" value="1"/>Ja <input type="radio" name="image_rights" value="0" checked="checked"> Nein </p>
<tr>
<td valign="top" class="row2"><b>Rechte:</b></td>
<td valign="top" class="row2"><p align="justify">{image_rights}</td>
</tr>
show_additional_fields("rights", $image_row, IMAGES_TABLE);
bei if ($action == "saveimages") if (!empty($additional_rights_fields)) {
foreach ($additional_rights_fields as $key => $val) {
if (isset($HTTP_POST_VARS[$key.'_'.$i]) && intval($val[2]) == 1 && trim($HTTP_POST_VARS[$key.'_'.$i]) == "") {
$error[$key.'_'.$i] = 1;
}
}
}
bei if ($action == "addimages") show_additional_fields("rights", array(), IMAGES_TABLE, $i);
if (!empty($additional_rights_fields)) {
$additional_field_array = array();
foreach ($additional_rights_fields as $key => $val) {
$additional_field_array[$key] = (!empty($image_row[$key])) ? format_text($image_row[$key], 1) : REPLACE_EMPTY;
$additional_field_array['lang_'.$key] = $val[0];
}
if (!empty($additional_field_array)) {
$site_template->register_vars($additional_field_array);
}
}
if (!empty($additional_rights_fields)) {
foreach ($additional_rights_fields as $key => $val) {
if (isset($HTTP_POST_VARS[$key]) && intval($val[2]) == 1 && trim($HTTP_POST_VARS[$key]) == "") {
$error[$key] = 1;
}
}
}
und im sql-update dort auchimage_rights = '$image_rights'
if (empty($error)) {
$additional_sql = "";
if (!empty($additional_image_fields)) {
$table_fields = $site_db->get_table_fields(IMAGES_TABLE);
foreach ($additional_image_fields as $key => $val) {
if (isset($HTTP_POST_VARS[$key]) && isset($table_fields[$key])) {
$additional_sql .= ", $key = '".un_htmlspecialchars(trim($HTTP_POST_VARS[$key]))."'";
}
}
}
$additional_sql_rights = "";
if (!empty($additional_rights_fields)) {
$table_fields = $site_db->get_table_fields(IMAGES_TABLE);
foreach ($additional_rights_fields as $key => $val) {
if (isset($HTTP_POST_VARS[$key]) && isset($table_fields[$key])) {
$additional_sql_rights .= ", $key = ".un_htmlspecialchars(trim($HTTP_POST_VARS[$key]))."";
}
}
}
$sql = "UPDATE ".IMAGES_TABLE."
SET cat_id = $cat_id, user_id = $user_id, image_name = '$image_name', image_photographer = '$image_photographer', image_rights = '$image_rights', 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."".$additional_sql_rights."
WHERE image_id = $image_id";
$result = $site_db->query($sql);
$additional_field_sql_rights = "";
$additional_value_sql_rights = "";
if (!empty($additional_rights_fields)) {
$table_fields = $site_db->get_table_fields(IMAGES_TABLE);
foreach ($additional_rights_fields as $key => $val) {
if (isset($HTTP_POST_VARS[$key.'_'.$i]) && isset($table_fields[$key])) {
$additional_field_sql_rights .= ", $key";
$additional_value_sql_rights .= ", '".un_htmlspecialchars(trim($HTTP_POST_VARS[$key.'_'.$i]))."'";
}
}
}
$current_time = time();
$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.",".$additional_field_sql_rights.")
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.",".$additional_value_sql_rights.")";