4images Forum & Community

4images Issues / Ausgaben => Installation, Update & Configuration => Topic started by: honda2000 on May 22, 2008, 06:03:00 PM

Title: Template für Categories
Post by: honda2000 on May 22, 2008, 06:03:00 PM
Hallo, ja, ich weis, die Kategorien werden in category_bit.html angezeigt und erzeugt.
Wo aber werden die Subkategorien erzeugt,

und
 wenn ich eine Hauptkategorie anlegen, erscheint diese über:
category_bit.html mit:

Quote
<table border="0" cellspacing="0" cellpadding="0" class="row1">
  <tr>
    <td valign="top">
     <img src="{template_url}/images/folder.gif" width="18" height="9" alt="" />
      <!-- {if random_cat_image_file}<a href="{cat_url}"><img src="{random_cat_image_file}" border="1"></a>{endif random_cat_image_file}  -->
    </td>
    <td>
     <a href="{cat_url}" class="row1">{cat_name}</a>&nbsp;({num_images})
      {if cat_is_new}<sup class="new">{lang_new}</sup>{endif cat_is_new}
   </td>
  </tr>
</table>

aufgerufen

allerdings baut sich laut Quelltext noch eine:

Quote
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td valign="top" width="100%" class="catbgcolor">
<table border="0" cellpadding="3" cellspacing="1">
<tr>
<td valign="top">
<table border="0" cellspacing="0" cellpadding="0" class="row1">
  <tr>
    <td valign="top">
     <img src="./templates/default/images/folder.gif" width="18" height="9" alt="" />
      <!--   -->
    </td>
    <td>
     <a href="./categories.php?cat_id=xyz" class="row1">123</a>&nbsp;(1)
      <sup class="new">neu</sup>   </td>
  </tr>
</table>
</td>
</tr>
<tr>
<td valign="top">
<table border="0" cellspacing="0" cellpadding="0" class="row1">
  <tr>
    <td valign="top">
     <img src="./templates/default/images/folder.gif" width="18" height="9" alt="" />
      <!--   -->
    </td>
    <td>
     <a href="./categories.php?cat_id=XYZ" class="row1">123</a>&nbsp;(0)
         </td>
  </tr>
</table>
<br><a href="./categories.php?cat_id=xxx" class="subcat">XYZ</a>, <a href="./categories.php?cat_id=x" class="subcat">123</a>, <a href="./categories.php?cat_id=x" class="subcat">ABC</a>, <a href="./categories.php?cat_id=x" class="subcat">123</a>, <a href="./categories.php?cat_id=x" class="subcat">XYZ</a>, <a href="./categories.php?cat_id=x" class="subcat">123</a><br></td>
</tr>
</table>
</td>
</tr>
</table>
u.s.w.

drum herum, die muss ja irgendwo erzeugt werden.

ich möchte dort die Hintergrundfarbe ändern, und ich möchte, das vor jeder Subkategorie ein folder2.gif erscheint und alle Subkategorien untereinander und nicht wie Platz ist, nebeneinander!

@mawenzi, ich hab wieder gesucht, ohne Erfolg  :wink: :lol:

hat jemand einen Tipp/Rat oder gar gleich die Lösung bei der Hand???

EDIT:
mir ist noch was eingefallen:
ich nutze nicht die Anzeige der Kategorien/Subkategorien in der home.html
sondern ich habe die Anzeige ausgelagert mit:

Quote
$site_template->register_vars(array(
  "categories_all" => get_categories(0)
 ));

in page_header.php vor:
Quote
?>

und lasse die Kategorien in allen Haupttemplates in der linke Spalte mit:
Quote
{categories_all}
anzeigen

hier die Testseite: www.cre-arts.net/testgalerie/ (http://www.cre-arts.net/testgalerie/)

es geht also um die Kategorien/Subkategorien links

Title: Re: Template für Categories
Post by: Nicky on May 22, 2008, 06:32:01 PM
Hi honda,

hoffe das ist was du suchst...
includes/functions.php

Code: [Select]
function get_subcategories($parent_id) {
  global $cat_parent_cache, $cat_cache, $site_sess, $config;

  if (!isset($cat_parent_cache[$parent_id]) || $config['num_subcats'] < 1) {
    return "";
  }

  $visible_cat_cache = array();
  foreach ($cat_parent_cache[$parent_id] as $key => $val) {
    if (check_permission("auth_viewcat", $val)) {
      $visible_cat_cache[$key] = $val;
    }
  }

  $num_subs = sizeof($visible_cat_cache);
  $sub_cat_list = "";
  $i = 1;
  foreach ($visible_cat_cache as $subcat_id) {
    if ($i <= $num_subs && $i <= $config['num_subcats']) {
      $sub_url = $site_sess->url(ROOT_PATH."categories.php?".URL_CAT_ID."=".$subcat_id);
      $sub_cat_list .= "<a href=\"".$sub_url."\" class=\"subcat\">".format_text($cat_cache[$subcat_id]['cat_name'], 2)."</a>";
      if ($i != $config['num_subcats'] && $i < $config['num_subcats'] && $i < $num_subs) {
        $sub_cat_list .= ", ";
      }
      if ($i == $config['num_subcats'] && $i < $num_subs) {
        $sub_cat_list .= " ...\n";
      }
    }
    $i++;
  }
  return $sub_cat_list;
}
Title: Re: Template für Categories
Post by: honda2000 on May 22, 2008, 06:52:23 PM
hm, bin mir nicht sicher, ja, dort werden die Sub-kats aufgebaut, aber was fehlt, ist die Tabelle außen herum

Quote
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td valign="top" width="100%" class="catbgcolor">
<table border="0" cellpadding="3" cellspacing="1">
<tr>
<td valign="top">
<table border="0" cellspacing="0" cellpadding="0" class="row1">
  <tr>
    <td valign="top">
...
...
...


</td>
  </tr>
</table>
<br><a href="./categories.php?cat_id=xxx" class="subcat">XYZ</a>, <a href="./categories.php?cat_id=x" class="subcat">123</a>, <a href="./categories.php?cat_id=x" class="subcat">ABC</a>, <a href="./categories.php?cat_id=x" class="subcat">123</a>, <a href="./categories.php?cat_id=x" class="subcat">XYZ</a>, <a href="./categories.php?cat_id=x" class="subcat">123</a><br></td>
</tr>
</table>
</td>
</tr>
</table>

weil wie gesagt: ich möchte die Hintergrundfarbe ändern, und vor jeder Sup-Kat einen folder2.gif, und alle Sup-kats untereinander



das:

Quote
><a href="./categories.php?cat_id=xxx" class="subcat">XYZ</a>, <a href="./categories.php?cat_id=x" class="subcat">123</a>, <a href="./categories.php?cat_id=x" class="subcat">ABC</a>, <a href="./categories.php?cat_id=x" class="subcat">123</a>, <a href="./categories.php?cat_id=x" class="subcat">XYZ</a>, <a href="./categories.php?cat_id=x" class="subcat">123</a><br>

scheint ja aus der includes/functions.php zu stammen:

Quote
$sub_url = $site_sess->url(ROOT_PATH."categories.php?".URL_CAT_ID."=".$subcat_id);
      $sub_cat_list .= "<a href=\"".$sub_url."\" class=\"subcat\">".format_text($cat_cache[$subcat_id]['cat_name'], 2)."</a>";
      if ($i != $config['num_subcats'] && $i < $config['num_subcats'] && $i < $num_subs) {
        $sub_cat_list .= ", ";
      }
      if ($i == $config['num_subcats'] && $i < $num_subs) {
        $sub_cat_list .= " ...\n";
      }

da muss es noch mehr geben  :wink: :roll:

Title: Re: Template für Categories
Post by: honda2000 on May 22, 2008, 08:32:26 PM
@Nicky, kann es sein, das es mit dem ControlPanel

Allgemein > Einstellungen > Kategorie Einstellungen
Wieviele Zellen soll die Tabelle der Kategorien haben
 
Wie breit soll die Tabelle der Kategorien sein
Prozentangaben erlaubt
 
Cellspacing der Kategorie Tabelle
 
Cellpadding der Kategorie Tabelle
 
Wieviele Subkategorien sollen unter der Hauptkategorie dargestellt werden

Kann es sein, das es damit zusammenhängt, das von da aus noch eine Tabelle um die Kategorien und deren Supkategorien erzeugt wird??

sieht so aus, nur wie ändere ich dort den Hintergrund (Farbe) ??
 
Title: Re: Template für Categories
Post by: † manurom on May 22, 2008, 09:40:54 PM
Hello, honda 2000 nd Nicky;
I'd really like to discuss with you. But I am French. Posting in english is yet heavy for me. I was really a bad pupil at school, and do not remeber anything in german language. Fault is mine. Google translation, or anyother bot does not help me much.
If you can post here in english, most members could help you.

Hey, I don't blame you in any way. I just hope that anyone here could help you.

Best regards.

manurom
Title: Re: Template für Categories
Post by: honda2000 on May 22, 2008, 09:56:16 PM
sorry for bad english
look at: http://www.cre-arts.net/testgalerie/
left side, categorys

categorys are  not in home.html, in all templates width:
Quote
$site_template->register_vars(array(
  "categories_all" => get_categories(0)
 ));

in page_header.php :
?>

and show with
{categories_all}

but: how can i create a background-color???

the table are created in ControlPanel
settings ???

i dont no??!!