Seite 1 von 1

artikelliste frage [gelöst]

Verfasst: Fr 9. Dez 2005, 11:23
von rene04
hallo,

ich habe die fertige artikelliste aus der version 4.4.5 genommen und etwas modifiziert. nun gibt sie mir die headline und die subheadline aus:
Eingabe:

Code: Alles auswählen

/**
* Artikelliste mit I1,H1,T1
*
* Erstellt eine Liste mit allen Artikel bis
* auf den Startartikel.
*
* INPUT
*
* Author Jan Lengowski
* Copyright four for business AG
*/

// selected category
$selected = "CMS_VALUE[0]";

echo "<table cellspacing=\"0\" cellpadding=\"10\" border=\"0\">
        <tr valign=\"top\">
          <td class=\"text_medium\">Kategorie w?hlen:</td>
          <td>
            <select name=\"CMS_VAR[0]\">";
            if($selected!="0" && $selected!=""){
             echo"<option value=\"0\">--- kein ---</option>";

            }else{
            echo"<option selected=\"selected\" value=\"0\">--- kein ---</option>";
            }

            // fetch all categorys
            $query = "SELECT A.idcat, A.level, C.name FROM ".$cfg["tab"]["cat_tree"]." AS A, ".
                     $cfg["tab"]["cat"]." AS B,  ".$cfg["tab"]["cat_lang"]." AS C WHERE A.idcat=B.idcat ".
                     "AND B.idcat=C.idcat AND C.idlang='$lang' AND B.idclient='$client' ".
                     "AND C.visible=1 ORDER BY A.idtree";
            // execute query
            $db->query($query);

            // loop result and build the options
            while ($db->next_record()) {

              // indent spacer
              $spaces = "|";

              // how many levels
              $levels = $db->f("level");

              for ($i = 0; $i < $levels; $i ++) {
                // add 2 spaces for every level
                $spaces = $spaces . "--";

              } // end for
              
              $spaces .= ">";


              if ($selected == $db->f("idcat")) {
                // selected category
                echo "<option selected=\"selected\" value=\"". $db->f("idcat") ."\">". $spaces . $db->f("name") ."</option>";

              } else {
                // category
                echo "<option value=\"". $db->f("idcat") ."\">". $spaces . $db->f("name") ."</option>";

              } // end if

            } // end while

echo "      </select>";

echo "    </td>
        </tr>
        <tr>
          <td class=\"text_medium\">?berschrift</td>
          <td><input type=\"text\" name=\"CMS_VAR[2]\" value=\"CMS_VALUE[2]\"></td>
        </tr>
        <tr>
          <td class=\"text_medium\">Angezeigte L?nge in Zeichen</td>
          <td><input type=\"text\" name=\"CMS_VAR[3]\" value=\"CMS_VALUE[3]\"></td>
        </tr>

      </table>";
Ausgabe:

Code: Alles auswählen

<?php
/***********************************************
* CONTENIDO MODUL - OUTPUT
*
* REFERENZ MODUL / ARTIKELLISTE
*
* Artikelliste mit Img 1, Head 1, Head 2
*
* Erstellt eine Liste mit allen Artikel bis
* auf den Startartikel.
*
* Author      :     Jan Lengowski
* Copyright   :     four for business AG
* Created     :     15-08-2002
* Modified    :     16-08-2002
************************************************/

// second db class instance
$db2 = new DB_Contenido;

// selected category
$selcat = "CMS_VALUE[0]";

 if($selcat!="0" && $selcat!=""){

// select all articles in category widthout start article
$query = "SELECT ARTLANG.idart, ARTLANG.idartlang FROM ".$cfg["tab"]["cat_art"]." AS CATART, ".
          $cfg["tab"]["art_lang"]." AS ARTLANG ".
         "WHERE CATART.idcat = '$selcat' AND ARTLANG.idart = CATART.idart AND ARTLANG.idlang = '$lang' AND ".
         "ARTLANG.online = '1' ORDER BY CATART.idart DESC";

// execute query
$db->query($query);

unset($articleID);
unset($linkID);

// get id's of sub articles
while ($db->next_record()) {
  $articleID[] = $db->f("idartlang");
  $linkID[] = $db->f("idart");
} // end while

// loop through subarticles

echo '
<table width="154" border="0" cellspacing="0" cellpadding="0" style="background-image:url(images/boxen/hg_kachel_box.gif); background-repeat:repeat-y">
<tr><td colspan="3"><img src="images/boxen/titel_news_events.gif" width="154" height="18"></td></tr>
';

if (is_array($articleID)) {

    foreach ($articleID as $key => $value) {

          // select all CMS variables of the article
          //siedamod start
          $sql = "SELECT * FROM ".$cfg["tab"]["content"]." WHERE idartlang = '$value' AND idtype = '1' AND typeid = '2'";
          $db->query($sql);
          $db->next_record();
          $headline = $db->f("value");
          //siedamod end
          
          $sql = "SELECT * FROM ".$cfg["tab"]["content"]." WHERE idartlang = '$value' AND idtype = '1' AND typeid = '1'";
          $db->query($sql);
          $db->next_record();
          $head = $db->f("value");
          
          if ( strlen($head) > "CMS_VALUE[3]") {
            $head = substr($head, 0, "CMS_VALUE[3]");
            $head .= '..';
          }

          // link
          $link = $sess->url("front_content.php?client=$client&lang=$lang&idcat=$selcat&idart=$linkID[$key]&m=$m&s=$s");

          echo '
          <tr> 
          <td width="6"><img src="images/abstandshalter.gif" width="6" height="1"></td>
          <td width="142"><img src="images/abstandshalter.gif" width="1" height="10"></td>
          <td width="6"><img src="images/abstandshalter.gif" width="6" height="1"></td>
          </tr>
          <tr><td><span class="box"><a href="'.$link.'">'.urldecode($db->f("value")).'</a><br>'.urldecode($headline).'</span></td></tr>';

    } // end while

          unset($headline);
        unset($text);
        
    } // end foreach
    
} // end if (is_array)

echo '
        <tr><td>&nbsp;</td></tr>        
        <tr bgcolor="#7F7F7F"> 
          <td colspan="3"><img src="images/abstandshalter.gif" width="1" height="1"></td>
        </tr>
      </table><br>';

?>
nun zu meiner frage:

die schriftgröße der headline welche in meiner artikelliste angezeigt wird ist die gleiche wie im artikel selbst :( kann ich die irgentwie verkleinern?

gruesse rene

Verfasst: Fr 9. Dez 2005, 11:28
von rezeptionist
span class="box"


verändermal in deiner klasse box die font-size


greets

Verfasst: Fr 9. Dez 2005, 11:31
von rene04
dann verändert sich die ausgabegröße der subheadline.

gruesse rene

Verfasst: Fr 9. Dez 2005, 11:34
von i-fekt
Ersetze

Code: Alles auswählen

<span class="box"><a href="'.$link.'">'.urldecode($db->f("value")).'</a>
durch

Code: Alles auswählen

<span class="box"><h1><a href="'.$link.'">'.urldecode($db->f("value")).'</a></h1>

Nun noch eine Klasse

Code: Alles auswählen

span.box h1 {
 font-size: 18px;
}
Fertig. ;)

Verfasst: Fr 9. Dez 2005, 11:36
von rezeptionist
ist aber auch ein heilloses durcheinander

Code: Alles auswählen

<a href="'.$link.'">'.urldecode($db->f("value")).'</a>
gegen

Code: Alles auswählen

<a href="'.$link.'" style="font-size:10px;">'.urldecode($db->f("value")).'</a>
sollte klappen

greets

Verfasst: Fr 9. Dez 2005, 11:59
von rene04
hallo,

also es ging noch einfacher...im artikel war in der html ansicht ein span class box gesetzt. das hab ich rausgenommen. nu gehts.

danke

gruesse rene

Verfasst: Fr 9. Dez 2005, 12:44
von HerrB
Es sei erwähnt, dass dieses Modul mit V4.6.x kompatibel ist - weil dieser Satz (Ausgabe) nicht korrekt ist:

Code: Alles auswählen

// select all articles in category widthout start article 
Die folgende Abfrage ermittelt immer alle Artikel, unabhängig davon, ob sie Startartikel sind oder nicht. Nur, falls da jemand mal dran rumschrauben möchte, um die Startartikel eben nicht zu erhalten...

Gruß
HerrB