Modul "Artikelliste"

Gesperrt
vicky-pag
Beiträge: 56
Registriert: Mo 25. Jul 2005, 19:33
Wohnort: Montabaur
Kontaktdaten:

Modul "Artikelliste"

Beitrag von vicky-pag » Di 20. Feb 2007, 13:58

Hallo,

ich habe ein Problem mit dem Aussehen der "Artikelliste". Die Überschriften der Artikel, die in der entsprechenden Kategorie abgelegt wurden, werden in der Artikelliste wie gewünscht angezeigt. Funktioniert alles einwandfrei.

Allerdings weiß ich nicht, wie ich Schriftgröße und -farbe an meine Wünsche anpassen kann. Ich habe es schon über die CSS-Angaben in der Datei "format.css" versucht, das hat mich aber leider nicht weiter gebracht. Vielleicht habt ihr ja einen Tipp und könnt mir weiterhelfen.

Unter diesem Link könnt ihr euch mein Problem ansehen. Der Link "Schreibwettbewerb 2007" ist einfach viel zu groß...
http://www.pag-anini.de

Außerdem kann ich euch noch den Code des Moduls und die CSS-Datei geben.


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="165" border="0" cellspacing="0" cellpadding="0">
<tr><td height="30" colspan="2" ></td></tr>
<tr><td height="21" width="22" style="border: 0px; background-color: #C1C9FF"><img src="images/pfeil.jpg" width="22" height="21" border="0"></td>
<td width="143" style="background-color: #C1C9FF; padding-left:10px" class="punkte">CMS_VALUE[2]</td></tr>
';

if (is_array($articleID)) {

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

          // select all CMS variables of the article
          $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 colspan="2" class="text" height="22" style="border: 1px; border-top:0px; border-color: #000080; border-style: dashed; background-color: #C1C9FF; padding-left:10px"><a href="'.$link.'">'.urldecode($db->f("value")).'</a></td></tr>';

    } // end while



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

echo '</table><br>';


?>


CSS-Datei

Code: Alles auswählen

body             {font-family: helvetica, arial, geneva, sans-serif; font-size: x-small; color: #000000;}
.punkte   	 {font-family: helvetica, arial, geneva, sans-serif; font-size:13; color:#000080; font-weight: bold}
.headline   	 {font-family: helvetica, arial, geneva, sans-serif; font-size:15; color:#000000; font-weight: bold}
.subheadline   	 {font-family: helvetica, arial, geneva, sans-serif; font-size:13; color:#AE6B00}
.text		 {font-family: helvetica, arial, geneva, sans-serif; font-size:12; color:#000080}
.navigation {font-family: helvetica, arial, geneva, sans-serif; font-size:10; bgcolor:#C1C9FF;}



A:link           {font-family: helvetica, arial, geneva, sans-serif; font-size:13; text-decoration: none; color: #000080}
A:visited        {font-family: helvetica, arial, geneva, sans-serif; font-size:13; text-decoration: none; color: #000080}
A:hover          {font-family: helvetica, arial, geneva, sans-serif; font-size:13; text-decoration: none; color: #000080}
A:active         {font-family: helvetica, arial, geneva, sans-serif; font-size:13; text-decoration: none; color: #000080}


A.klein:link	{font-family: helvetica, arial, geneva, sans-serif; font-size:11; text-decoration: none; color: #000080}
A.klein:visited {font-family: helvetica, arial, geneva, sans-serif; font-size:11; text-decoration: none; color: #000080}
A.klein:hover	{font-family: helvetica, arial, geneva, sans-serif; font-size:11; font-weight:bold; text-decoration: none; color: #000080}
A.klein:active	{font-family: helvetica, arial, geneva, sans-serif; font-size:11; text-decoration: none; color: #000080}
Vielen Dank schon mal für eure Mühe und vielleicht findet sich ja etwas, was mir aus meinem Problem hilft.

Viele Grüße
Vicky :D

silicone
Beiträge: 299
Registriert: Di 15. Mär 2005, 10:33
Kontaktdaten:

Beitrag von silicone » Di 20. Feb 2007, 14:43

Du hast in dem Link zum Artikel ein

Code: Alles auswählen

<font size="4">
drin. Dadurch ist die Überschrift zu groß.
Wie mir scheint, holt sich die Artikelliste den Tag aus dem Artikel.

vicky-pag
Beiträge: 56
Registriert: Mo 25. Jul 2005, 19:33
Wohnort: Montabaur
Kontaktdaten:

Beitrag von vicky-pag » Di 20. Feb 2007, 16:05

Ok, dass heißt also in der Praxis, dass das Artikelliste-Modul die Formatierung der ersten Überschrift des jeweiligen Artikels auch auf die Auflistung im Modul anwendet, richtig?

Wen dem so ist, schließt sich für mich natürlich die Frage an, ob man das irgendwie umgehen kann. Ich möchte gerne die Überschrift des Artikels unabhängig vom Link im Modul formatieren können. Gibt es dazu eine Lösung?

Vielen Dank aber schon mal für deine Hilfe, das hat mich schon ein ganzes Stück weiter gebracht. :D

silicone
Beiträge: 299
Registriert: Di 15. Mär 2005, 10:33
Kontaktdaten:

Beitrag von silicone » Di 20. Feb 2007, 16:58

Du musst dem Output die Formatierung klauen. Das machst du mit

Code: Alles auswählen

strip_tags() 
.

Ich bin auch nicht der PHP-Könner...
Versuch mal nach

Code: Alles auswählen

$head = $db->f("value");
folgendes einzusetzen:

Code: Alles auswählen

$head = strip_tags($head);

vicky-pag
Beiträge: 56
Registriert: Mo 25. Jul 2005, 19:33
Wohnort: Montabaur
Kontaktdaten:

Beitrag von vicky-pag » Di 20. Feb 2007, 17:19

Gut, das habe ich soweit gemacht. Allerdings übernimmt der Link in der Artikelliste immer noch die Formatierung der Artikelüberschrift. Muss ich die Formatierung für den Link dann noch an einer anderen Stelle festschreiben? Und falls ja, würde mich interessieren wo und wie.

Vielen Dank!

Dodger77
Beiträge: 3626
Registriert: Di 12. Okt 2004, 20:00
Wohnort: Voerde (Niederrhein)
Kontaktdaten:

Beitrag von Dodger77 » Di 20. Feb 2007, 17:28

Ändere mal:

Code: Alles auswählen

echo '<tr><td colspan="2" class="text" height="22" style="border: 1px; border-top:0px; border-color: #000080; border-style: dashed; background-color: #C1C9FF; padding-left:10px"><a href="'.$link.'">'.urldecode($db->f("value")).'</a></td></tr>'; 
zu

Code: Alles auswählen

echo '<tr><td colspan="2" class="text" height="22" style="border: 1px; border-top:0px; border-color: #000080; border-style: dashed; background-color: #C1C9FF; padding-left:10px"><a href="'.$link.'">'.$head.'</a></td></tr>'; 
Und aus dem:

Code: Alles auswählen

$head = strip_tags($head);
mach mal:

Code: Alles auswählen

$head = strip_tags(urldecode($head));

vicky-pag
Beiträge: 56
Registriert: Mo 25. Jul 2005, 19:33
Wohnort: Montabaur
Kontaktdaten:

Beitrag von vicky-pag » Mi 21. Feb 2007, 16:03

Hallo!!

Vielen vielen Dank für eure Hilfe - es funktioniert einwandfrei. Wirklich klasse.

Danke noch einmal und viele Grüße
Vicky :D :D :D

Gesperrt