Open / Öffne: index.php
Search / Suche:
$site_template->register_vars("new_images", $new_images);
unset($new_images);
Add after / Füge danach ein:
//-----------------------------------------------------
//--- Show New Images By Category ---------------------
//-----------------------------------------------------
$imgtable_width = ceil(intval($config['image_table_width']) / $config['image_cells']);
if ((substr($config['image_table_width'], -1)) == "%") {
$imgtable_width .= "%";
}
$additional_sql = "";
if (!empty($additional_image_fields)) {
foreach ($additional_image_fields as $key => $val) {
$additional_sql .= ", i.".$key;
}
}
$num_news_images_bycat = $config['image_cells'];
// Option Start
$bycat_in = array(72,132); // Change the Number in your category-id - ID ripping by commas
// Ändere die Nummer in deine Kategorie-ID - ID trennen durch Komma
// Option Ende
$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 IN (".get_auth_cat_sql("auth_viewcat").") AND i.cat_id IN (".implode(", ", $bycat_in).")
ORDER BY i.image_date DESC
LIMIT $num_news_images_bycat";
$result = $site_db->query($sql);
$num_rows = $site_db->get_numrows($result);
if (!$num_rows) {
$news_images_bycat = "<table width=\"".$config['image_table_width']."\" border=\"0\" cellpadding=\"".$config['image_table_cellpadding']."\" cellspacing=\"".$config['image_table_cellspacing']."\"><tr class=\"imagerow1\"><td>";
$news_images_bycat .= $lang['no_news_images_bycat'];
$news_images_bycat .= "</td></tr></table>";
}
else {
$news_images_bycat = "<table width=\"".$config['image_table_width']."\" border=\"0\" cellpadding=\"".$config['image_table_cellpadding']."\" cellspacing=\"".$config['image_table_cellspacing']."\">";
$count = 0;
$bgcounter = 0;
while ($image_row = $site_db->fetch_array($result)){
if ($count == 0) {
$row_bg_number = ($bgcounter++ % 2 == 0) ? 1 : 2;
$news_images_bycat .= "<tr class=\"imagerow".$row_bg_number."\">\n";
}
$news_images_bycat .= "<td width=\"".$imgtable_width."\" valign=\"top\">\n";
show_image($image_row);
$news_images_bycat .= $site_template->parse_template("thumbnail_bit");
$news_images_bycat .= "\n</td>\n";
$count++;
if ($count == $config['image_cells']) {
$news_images_bycat .= "</tr>\n";
$count = 0;
}
} // end while
if ($count > 0) {
$leftover = ($config['image_cells'] - $count);
if ($leftover >= 1) {
for ($f = 0; $f < $leftover; $f++) {
$news_images_bycat .= "<td width=\"".$imgtable_width."\">\n \n</td>\n";
}
$news_images_bycat .= "</tr>\n";
}
}
$news_images_bycat .= "</table>\n";
} // end else
$site_template->register_vars("news_images_bycat", $news_images_bycat);
unset($news_images_bycat);
Suche nach // Option Start. Dort müssen die ID´s der Kategorien eingetragen werden
Search / / Start option. Where the ID's of the categories listed
Add this code in your home.html
Füge diesen Code in deiner home.html ein
{news_images_bycat}
Finish
Fertig