Author Topic: Benötige Hilfe bei Konfiguration der "Neue Bilder" Tabelle auf der Startseite  (Read 5156 times)

0 Members and 1 Guest are viewing this topic.

Offline SaschaM

  • Newbie
  • *
  • Posts: 11
    • View Profile
Hallo Leute,
ich habe ein Problem, nämlich die Tabelle "Neue Bilder" auf der Startseite sieht akutell so aus:
http://img.em-upload.de/image/dI9
Das sieht meiner Meinung nach jedoch sehr unschön aus, wegen den großen Abständen zwischen Thumbnail, Bildtitel, Username und Kategorie.

Wie bekommt man diesen kleiner, so dass es eher so aussieht:
http://img.em-upload.de/image/dI4

Für eure Hilfe wäre ich sehr dankbar ;)

Offline nobby

  • 4images Guru
  • *******
  • Posts: 2.855
    • View Profile
Hallo,

deine Links funktionieren nicht  :|

So ist Hilfe nicht Möglich.

nobby

Offline SaschaM

  • Newbie
  • *
  • Posts: 11
    • View Profile
Hi nobby,
da hatte ich was falsch eingestellt, die Bilder sind jetzt abrufbar.

Offline nobby

  • 4images Guru
  • *******
  • Posts: 2.855
    • View Profile
Schau Dir das mal an, dürfte Dich weiter bringen  :arrow: http://www.4homepages.de/forum/index.php?topic=30731.0

Offline SaschaM

  • Newbie
  • *
  • Posts: 11
    • View Profile
Also das was Rembrandt geschrieben hat habe ich umgesetzt, jedoch hat das nicht geholfen, es sieht immernoch gleich aus.

categories.php:
Code: [Select]
<?php
/**************************************************************************
 *                                                                        *
 *    4images - A Web Based Image Gallery Management System               *
 *    ----------------------------------------------------------------    *
 *                                                                        *
 *             File: categories.php                                       *
 *        Copyright: (C) 2002-2016 4homepages.de                          *
 *            Email: 4images@4homepages.de                                * 
 *              Web: http://www.4homepages.de                             * 
 *    Scriptversion: 1.8                                                  *
 *                                                                        *
 **************************************************************************
 *                                                                        *
 *    Dieses Script ist KEINE Freeware. Bitte lesen Sie die Lizenz-       *
 *    bedingungen (Lizenz.txt) für weitere Informationen.                 *
 *    ---------------------------------------------------------------     *
 *    This script is NOT freeware! Please read the Copyright Notice       *
 *    (Licence.txt) for further information.                              *
 *                                                                        *
 *************************************************************************/

$templates_used 'categories,category_bit,thumbnail_bit';
$main_template 'categories';

define('GET_CACHES'1);
define('ROOT_PATH''./');
define('MAIN_SCRIPT'__FILE__);
include(
ROOT_PATH.'global.php');
require(
ROOT_PATH.'includes/sessions.php');
$user_access get_permission();
include(
ROOT_PATH.'includes/page_header.php');

if (!
$cat_id || !isset($cat_cache[$cat_id]) || !check_permission("auth_viewcat"$cat_id)) {
  
redirect("index.php");
}

$cache_id create_cache_id(
  
'page.categories',
  array(
    
$user_info[$user_table_fields['user_id']],
    
$cat_id,
    
$page,
    
$perpage,
    isset(
$user_info['lightbox_image_ids']) ? substr(md5($user_info['lightbox_image_ids']), 08) : 0,
    
$config['template_dir'],
    
$config['language_dir']
  )
);

if (!
$cache_page_categories || !$content get_cache_file($cache_id)) {
// Always append session id if cache is enabled
if ($cache_page_categories) {
  
$old_session_mode $site_sess->mode;
  
$site_sess->mode 'get';
}

ob_start();

//-----------------------------------------------------
//--- SEO variables -----------------------------------
//-----------------------------------------------------

$site_template->register_vars(array('prepend_head_title' => $cat_cache[$cat_id]['cat_name'] . " - "));

//-----------------------------------------------------
//--- Show Categories ---------------------------------
//-----------------------------------------------------
if (!check_permission("auth_upload"$cat_id)) {
  
$upload_url "";
  
$upload_button "<img src=\"".get_gallery_image("upload_off.gif")."\" border=\"0\" alt=\"\" />";
}
else {
  
$upload_url $site_sess->url(ROOT_PATH."member.php?action=uploadform&amp;".URL_CAT_ID."=".$cat_id);
  
$upload_button "<a href=\"".$upload_url."\"><img src=\"".get_gallery_image("upload.gif")."\" border=\"0\" alt=\"\" /></a>";
}

$random_cat_image = (defined("SHOW_RANDOM_IMAGE") && SHOW_RANDOM_IMAGE == 0) ? "" get_random_image($cat_id);
$site_template->register_vars(array(
  
"categories" => get_categories($cat_id),
  
"cat_name" => format_text($cat_cache[$cat_id]['cat_name'], 2),
  
"cat_description" => format_text($cat_cache[$cat_id]['cat_description'], 101),
  
"cat_hits" => $cat_cache[$cat_id]['cat_hits'],
  
"upload_url" => $upload_url,
  
"upload_button" => $upload_button,
  
"random_cat_image" => $random_cat_image
));

unset(
$random_cat_image);

//-----------------------------------------------------
//--- Show Images -------------------------------------
//-----------------------------------------------------
$site_template->register_vars(array(
  
"has_rss"   => true,
  
"rss_title" => "RSS Feed: ".format_text($cat_cache[$cat_id]['cat_name'], 2)." (".str_replace(':'''$lang['new_images']).")",
  
"rss_url"   => $script_url."/rss.php?action=images&amp;".URL_CAT_ID."=".$cat_id
));

$num_rows_all = (isset($cat_cache[$cat_id]['num_images'])) ? $cat_cache[$cat_id]['num_images'] : 0;
$link_arg $site_sess->url(ROOT_PATH."categories.php?".URL_CAT_ID."=".$cat_id);

//5######################################## Start MOD: More Pictures on Detail Page #################################################
  
$sql "SELECT COUNT('image_group') AS sum
             FROM "
.IMAGES_TABLE."
             WHERE cat_id = '
$cat_id' AND image_group_image <= 'image_group' AND image_group != 0";
 
$row $site_db->query_firstrow($sql);
 
$num_rows_all $num_rows_all $row['sum']; 
//######################################## End MOD: More Pictures on Detail Page #################################################

include(ROOT_PATH.'includes/paging.php');
$getpaging = new Paging($page$perpage$num_rows_all$link_arg);
$offset $getpaging->get_offset();

$site_template->register_vars(array(
  
"paging" => $getpaging->get_paging(),
  
"paging_stats" => $getpaging->get_paging_stats()
));

$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;
  }
}

$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_group,i.image_group_image".$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 NOT i.image_group <> i.image_group_image 
        ORDER BY "
.$config['image_order']." ".$config['image_sort'].", i.image_id ".$config['image_sort']."
        LIMIT 
$offset$perpage ";
$result $site_db->query($sql);
$num_rows $site_db->get_numrows($result);

if (!
$num_rows)  {
  
$thumbnails "";
  
$msg $lang['no_images'];
}
else {
  
$thumbnails "<table width=\"".$config['image_table_width']."\" border=\"0\" cellpadding=\"".$config['image_table_cellpadding']."\" cellspacing=\"".$config['image_table_cellspacing']."\">\n";
  
$count 0;
  
$bgcounter 0;
  while (
$image_row $site_db->fetch_array($result)){
    if (
$count == 0) {
      
$row_bg_number = ($bgcounter++ % == 0) ? 2;
      
$thumbnails .= "<tr class=\"imagerow".$row_bg_number."\">\n";
    }
    
$thumbnails .= "<td width=\"".$imgtable_width."\" valign=\"middle\">\n";

    
show_image($image_row);
    
$thumbnails .= $site_template->parse_template("thumbnail_bit");
    
$thumbnails .= "\n</td>\n";

    
$count++;
    if (
$count == $config['image_cells']) {
      
$thumbnails .= "</tr>\n";
      
$count 0;
    }
  } 
// end while

  
if ($count 0)  {
    
$leftover = ($config['image_cells'] - $count);
    if (
$leftover 0) {
      for (
$i 0$i $leftover$i++){
        
$thumbnails .= "<td width=\"".$imgtable_width."\">\n&nbsp;\n</td>\n";
      }
      
$thumbnails .= "</tr>\n";
    }
  }
  
$thumbnails .= "</table>\n";
//end else
$site_template->register_vars("thumbnails"$thumbnails);
unset(
$thumbnails);

//-----------------------------------------------------
//--- Clickstream -------------------------------------
//-----------------------------------------------------
$clickstream "<span class=\"clickstream\"><a href=\"".$site_sess->url(ROOT_PATH."index.php")."\" class=\"clickstream\">".$lang['home']."</a>".$config['category_separator'].get_category_path($cat_id)."</span>";

//-----------------------------------------------------
//--- Print Out ---------------------------------------
//-----------------------------------------------------
$site_template->register_vars(array(
  
"msg" => $msg,
  
"clickstream" => $clickstream
));

$site_template->print_template($site_template->parse_template($main_template));

$content ob_get_contents();
ob_end_clean();

if (
$cache_page_categories) {
  
// Reset session mode
  
$site_sess->mode $old_session_mode;

  
save_cache_file($cache_id$content);
}

// end if get_cache_file()

echo $content;

//Update Category Hits
if ($user_info['user_level'] != ADMIN && $page == 1) {
  
$sql "UPDATE ".CATEGORIES_TABLE."
          SET cat_hits = cat_hits + 1
          WHERE cat_id = 
$cat_id";
  
$site_db->query($sql);
}

include(
ROOT_PATH.'includes/page_footer.php');
?>


index.php:
Code: [Select]
<?php
/**************************************************************************
 *                                                                        *
 *    4images - A Web Based Image Gallery Management System               *
 *    ----------------------------------------------------------------    *
 *                                                                        *
 *             File: index.php                                            *
 *        Copyright: (C) 2002-2016 4homepages.de                          *
 *            Email: 4images@4homepages.de                                * 
 *              Web: http://www.4homepages.de                             * 
 *    Scriptversion: 1.8                                                  *
 *                                                                        *
 **************************************************************************
 *                                                                        *
 *    Dieses Script ist KEINE Freeware. Bitte lesen Sie die Lizenz-       *
 *    bedingungen (Lizenz.txt) für weitere Informationen.                 *
 *    ---------------------------------------------------------------     *
 *    This script is NOT freeware! Please read the Copyright Notice       *
 *    (Licence.txt) for further information.                              *
 *                                                                        *
 *************************************************************************/

$templates_used 'home,category_bit,whos_online,thumbnail_bit';
$main_template 'home';

define('GET_CACHES'1);
define('ROOT_PATH''./');
define('MAIN_SCRIPT'__FILE__);
define('GET_USER_ONLINE'1);
include(
ROOT_PATH.'global.php');
require(
ROOT_PATH.'includes/sessions.php');
$user_access get_permission();

if (isset(
$HTTP_GET_VARS['template']) || isset($HTTP_POST_VARS['template'])) {
  
$template = (isset($HTTP_GET_VARS['template'])) ? get_basefile(stripslashes($HTTP_GET_VARS['template'])) : get_basefile(stripslashes($HTTP_POST_VARS['template']));
  if (!
file_exists(TEMPLATE_PATH."/".$template.".".$site_template->template_extension)) {
    
$template "";
  }
  else {
    
$main_template $template;
  }
}
else {
  
$template "";
}
include(
ROOT_PATH.'includes/page_header.php');

if (!empty(
$template)) {
  
$clickstream "<a href=\"".$site_sess->url(ROOT_PATH."index.php")."\">".$lang['home']."</a>".$config['category_separator'].str_replace("_"" "ucfirst($template));
  
$site_template->register_vars("clickstream"$clickstream);
  
$site_template->print_template($site_template->parse_template($main_template));
  include(
ROOT_PATH.'includes/page_footer.php');
}

$cache_id create_cache_id(
  
'page.index',
  array(
    
$user_info[$user_table_fields['user_id']],
    isset(
$user_info['lightbox_image_ids']) ? substr(md5($user_info['lightbox_image_ids']), 08) : 0,
    
$config['template_dir'],
    
$config['language_dir']
  )
);

if (!
$cache_page_index || !$content get_cache_file($cache_id)) {
// Always append session id if cache is enabled
if ($cache_page_index) {
  
$old_session_mode $site_sess->mode;
  
$site_sess->mode 'get';
}

ob_start();

//-----------------------------------------------------
//--- Show Categories ---------------------------------
//-----------------------------------------------------
$categories get_categories(0);
if (!
$categories)  {
  
$categories $lang['no_categories'];
}
$site_template->register_vars("categories"$categories);
unset(
$categories);

//-----------------------------------------------------
//--- Show New Images ---------------------------------
//-----------------------------------------------------
$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"
));

$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_new_images 16;
$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=\"".$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++ % == 0) ? 2;
      
$new_images .= "<tr class=\"imagerow".$row_bg_number."\">\n";
    }
    
$new_images .= "<td width=\"".$imgtable_width."\" valign=\"middle\">\n";

    
show_image($image_row);
    
$new_images .= $site_template->parse_template("thumbnail_bit");
    
$new_images .= "\n</td>\n";
    
$count++;
    if (
$count == $config['image_cells']) {
      
$new_images .= "</tr>\n";
      
$count 0;
    }
  } 
// end while

  
if ($count 0)  {
    
$leftover = ($config['image_cells'] - $count);
    if (
$leftover >= 1) {
      for (
$f 0$f $leftover$f++) {
        
$new_images .= "<td width=\"".$imgtable_width."\">\n&nbsp;\n</td>\n";
      }
      
$new_images .= "</tr>\n";
    }
  }
  
$new_images .= "</table>\n";
// end else

$site_template->register_vars("new_images"$new_images);
unset(
$new_images);

//-----------------------------------------------------
//--- Print Out ---------------------------------------
//-----------------------------------------------------
$site_template->register_vars(array(
  
"msg" => $msg,
  
"clickstream" => $clickstream
));
$site_template->print_template($site_template->parse_template($main_template));

$content ob_get_contents();
ob_end_clean();

if (
$cache_page_index) {
  
// Reset session mode
  
$site_sess->mode $old_session_mode;

  
save_cache_file($cache_id$content);
}

// end if get_cache_file()

echo $content;

include(
ROOT_PATH.'includes/page_footer.php');
?>


Offline nobby

  • 4images Guru
  • *******
  • Posts: 2.855
    • View Profile
Hast Du das auch gemacht?

in deiner /templates/<dein_template>/thumbnail_bit.html ist folgendes zu verwenden
Code: [Select]
<center>{thumbnail}</center>

Offline SaschaM

  • Newbie
  • *
  • Posts: 11
    • View Profile
Ja habe ich:
Code: [Select]
<!-- you wish detail page in a small javascript open window, use {thumbnail_openwindow} -->
<center>{thumbnail}</center><br />
<center><b>{image_name}</b> {if image_is_new}<sup class="new">{lang_new}</sup>{endif image_is_new}</center><br />
<center>({user_name_link})</center><br />
<center><a href="{cat_url}">{cat_name}</a></center><br />

Offline nobby

  • 4images Guru
  • *******
  • Posts: 2.855
    • View Profile

Offline SaschaM

  • Newbie
  • *
  • Posts: 11
    • View Profile
Also in der:
- index.php ist dieese Zeile nicht vorhanden;
- categories.php geändert zu "top";
- lightbox.php bereits "top" vorhanden;
- search.php auch bereits "top" vorhanden

Jedoch immernoch ohne Veränderung auf der Seite.

Achso was vielleicht noch wichtig wäre: Diese Lücken zwischen den einzelnen Elementen sind auch in den einzelnen Unterkategorien vorhanden, da sollten die natürlich auch weg (Beispiel: http://www.einsatzfahrzeuge-deutschland.de/categories.php?cat_id=109).

Offline nobby

  • 4images Guru
  • *******
  • Posts: 2.855
    • View Profile
Also in der:
- index.php ist dieese Zeile nicht vorhanden;
- categories.php geändert zu "top";
- lightbox.php bereits "top" vorhanden;
- search.php auch bereits "top" vorhanden

Wieso TOP (Top ist immer oben) das muß doch MIDDLE sein (für Mitte).

Hast Du da vielleicht irgendwelche MODs eingebaut?

Offline SaschaM

  • Newbie
  • *
  • Posts: 11
    • View Profile
In der Anleitung stand ja das man bottom zu top ändern sollte, in den 4 besagten .php Dateien... In der index.php war der Eintrag zum abändern nicht drin, in der categories.php hab ich den geändert und in den anderen beiden war im Eintrag bereits top eingetragen.

Mods habe ich nur einen drin, nämlich den dass man mehrere Fotos im Datensatz verknüpfen kann, wie hier zum Beispiel: http://www.einsatzfahrzeuge-deutschland.de/details.php?image_id=531

Offline nobby

  • 4images Guru
  • *******
  • Posts: 2.855
    • View Profile
Ich hatte damals ja auch das Problem.

Bei mir hatte das geholfen.

Ich weis im Moment nicht warum Du da schwierigkeiten mit hast.



Update: Ich habe Dir mal eine PN geschickt.
« Last Edit: June 04, 2017, 07:44:16 PM by nobby »

Offline SaschaM

  • Newbie
  • *
  • Posts: 11
    • View Profile
Tja komischerweise geht jetzt alles wie soll... Hatte jetzt die thumbnail_bit.html nochmal neu gemacht und dann alles mit einem center-Befehl gemacht:
Code: [Select]
<!-- you wish detail page in a small javascript open window, use {thumbnail_openwindow} -->
<div align="center">
{thumbnail}<br />
<b>{image_name}</b> {if image_is_new}<sup class="new">{lang_new}</sup>{endif image_is_new}
<br />
({user_name_link})<br />
<a href="{cat_url}">{cat_name}</a><br />
</div>

Danke für deine Hilfe ;)

Offline nobby

  • 4images Guru
  • *******
  • Posts: 2.855
    • View Profile
 :thumbup:  :wink:

OK! Dann kannst Du die Private Nachricht löschen.
« Last Edit: June 04, 2017, 08:44:24 PM by nobby »

Offline SaschaM

  • Newbie
  • *
  • Posts: 11
    • View Profile
Ja danke für das Angebot, läuft ja jetzt zum Glück :D

 

Post your comments here