alekinna
Junior Member | Редактировать | Профиль | Сообщение | Цитировать | Сообщить модератору rosimk 1. В файле index.php замени всё начиная со строк //----------------------------------------------------- //--- Show New Images --------------------------------- //----------------------------------------------------- и до unset($new_images); включительно на код: Код: //----------------------------------------------------- //--- Show New Images --------------------------------- //----------------------------------------------------- $num_new_images = 6; $imgtable_width = ceil(intval($config['image_table_width']) / $num_new_images); if ((substr($config['image_table_width'], -1)) == "%") { $imgtable_width .= "%"; } $site_template->register_vars(array( "has_rss" => true, "rss_title" => "RSS Feed: ".format_text($config['site_name'], 2)." (".str_replace(':', '', $lang['new_images']).")", "rss_url" => $script_url."/rss.php?action=images" )); $additional_sql = ""; if (!empty($additional_image_fields)) { foreach ($additional_image_fields as $key => $val) { $additional_sql .= ", i.".$key; } } $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"; $result = $site_db->query($sql); $num_rows = $site_db->get_numrows($result); if (!$num_rows) { $new_images = "<table width=\"".$config['image_table_width']."\" border=\"0\" cellpadding=\"".$config['image_table_cellpadding']."\" cellspacing=\"".$config['image_table_cellspacing']."\"><tr class=\"imagerow1\"><td>"; $new_images .= $lang['no_new_images']; $new_images .= "</td></tr></table>"; } else { $new_images = "<table width=\"".$config['image_table_width']."\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">"; $count = 0; $bgcounter = 0; while ($image_row = $site_db->fetch_array($result)){ if ($count == 0) { $row_bg_number = ($bgcounter++ % 2 == 0) ? 1 : 2; $new_images .= "<tr class=\"imagerow".$row_bg_number."\">\n"; } $new_images .= "<td width=\"".$imgtable_width."\" valign=\"top\">\n"; show_image($image_row); $new_images .= $site_template->parse_template("thumbnail_new"); $new_images .= "\n</td>\n"; $count++; if ($count == $num_new_images) { $new_images .= "</tr>\n"; $count = 0; } } // end while if ($count > 0) { $leftover = ($num_new_images - $count); if ($leftover >= 1) { for ($f = 0; $f < $leftover; $f++) { $new_images .= "<td width=\"".$imgtable_width."\">\n \n</td>\n"; } $new_images .= "</tr>\n"; } } $new_images .= "</table>\n"; } // end else $site_template->register_vars("new_images", $new_images); unset($new_images); | обрати внимание на переменную $num_new_images = 6; 2. В файле functions.php найди: Код: "thumbnail" => get_thumbnail_code($image_row['image_media_file'], $image_row['image_thumb_file'], $image_row['image_id'], $image_row['cat_id'], $image_row['image_name'], $mode, $show_link), | после неё добавь: Код: "thumb_new" => get_thumbnail_new_code($image_row['image_media_file'], $image_row['image_thumb_file'], $image_row['image_id'], $image_row['cat_id'], $image_row['image_name'], $mode, $show_link), | 2.1 найди Код: после добавь: Код: function get_thumbnail_new_code($media_file_name, $thumb_file_name = "", $image_id, $cat_id, $image_name = "", $mode = "", $show_link = 1, $open_window = 0) { global $site_sess, $config, $user_info, $setting; if (!check_media_type($media_file_name)) { $thumb = "<img src=\"".ICON_PATH."/404.gif\" border=\"0\" title=\"\" alt\"no thumbnail\">"; } else { if (!get_file_path($thumb_file_name, "thumb", $cat_id, 0, 0)) { $thumb_file = ICON_PATH."/".get_file_extension($media_file_name).".gif"; $thumb_info = @getimagesize($thumb_file); $width_height = (!empty($thumb_info[3])) ? " ".$thumb_info[3] : ""; $thumb = "<img src=\"".$thumb_file."\" border=\"0\"".$width_height." title=\"".$image_name."\" alt=\"\">"; } else { $thumb_file = get_file_path($thumb_file_name, "thumb", $cat_id, 0, 1); $view_image = true; $thumb = "<img src=\"".$thumb_file."\" border=\"0\" width=\"70\" height=\"80\" title=\"".$image_name."\" alt=\"\">"; } } if ($show_link) { if ($open_window) { $thumb = "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$image_id.((!empty($mode)) ? "&mode=".$mode : ""))."\" onclick=\"opendetailwindow()\" target=\"detailwindow\">".$thumb."</a>"; } else { $thumb = "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$image_id.((!empty($mode)) ? "&mode=".$mode : ""))."\">".$thumb."</a>"; } } return $thumb; } | обрати внимание на значения width=\"70\" height=\"80\" меняй под свой дизайн 3. Создай файл thumbnail_new.html и положи его в папку templates/your template примерно такой: Код: {thumb_new}<br /> <b>{image_name}</b> {if image_is_new}<sup class="new">{lang_new}</sup>{endif image_is_new} ({user_name_link}) <br /> <a href="{cat_url}">{cat_name}</a><br /> {if allow_comments}{lang_comments} {image_comments}{endif allow_comments}<br /> {lightbox_button} | и отредактируй его, я например убрала всё, кроме самой картинки. всё! |