Seite 1 von 1

Newsliste zeigt immer den Startartikel mit an...

Verfasst: Mi 30. Apr 2008, 10:43
von astalbold
Hallo,
unser Webentwickler hat uns verlassen und jetzt muss ich mich um unser Intranet kümmern, habe leider so gut wie keine Ahnung von php.

Habe nun in unserem Intranet das Problem das in dem Modul Artikelliste immer der Startartikel mit aufgelistet wird. Unser Webentwickler scheint irgendein Modul angepasst zu haben.
Die Artikel über das selbe Problem bei dem Standardartikellistenmodul (Beispielmandant) hab ich gelesen, in dem Beispielmandanten konnte ich das auch beseitigen.
Nur unsere Intranetseite basiert nicht auf dem Beispielmandanten. Für das Intranet scheint er ein anderes Modul dafür genutzt zu haben.

Input:

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>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>Überschrift</td>
          <td><input type=\"text\" name=\"CMS_VAR[2]\" value=\"CMS_VALUE[2]\"></td>
        </tr>
      </table>";
Output:

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 CATART.is_start='0' 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 $value;

echo '
<font class="normalTXT"><b>CMS_VALUE[2]</b></font><br>
<hr noshade size="1"> 
<table border="0" cellspacing="0" cellpadding="0">';

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");
          $modif = $db->f("lastmodified");
          $author = $db->f("author");

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

          echo '
<tr>
<td valign="middle"><img src="imgSTADTWAF/kasten_blau.gif" border="0">&nbsp;&nbsp;</td>
<td valign="middle"><a href="'.$link.'"><b>'.urldecode($db->f("value")).'</b></a></td>
</tr>
<tr>
<td>&nbsp;</td><td><font size="1" face="ARIAL">Erstellt am: '.$modif.' von '.$author.'</font></td></tr>
</tr>
<tr><td colspan="2">&nbsp;</td></tr>';

    } // end while



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

echo '</table><br>';


?>
Irgendwo da drin muss der Fehler sein, aber das übersteigt etwas meinen Programmierhorizont... ;-)

Danke

Verfasst: Fr 2. Mai 2008, 15:59
von emergence
das modul unterstützt noch die uralt methode wie ein startartikel definiert ist...

dieses modul hier unterstützt das was du haben willst
-> http://forum.contenido.org/viewtopic.php?t=10957

Verfasst: Mo 5. Mai 2008, 08:19
von astalbold
Danke für den Tipp, unser Intranet ist auch von 2002, haben immer fleißig das Update eingespielt. Ich hab das Modul jetzt ausprobiert, hab damit allerdings noch 2 Probleme...

Das erste Problem, wenn ich das Modul einbinde, sieht das bei mir etwas komisch aus, es scheint auch etwas an der Übersetztung nicht zu stimmen.
Bild

Das zweite Problem, wo und wie kann ich das editieren das es möglichst wieder so oder ähnlich aussieht?
Bild

ich vermute mal, dass ich die richtige Stelle dafür gefunden habe aber der dort stehende Code ist etwas zu hoch für mich.
ich muss diesen Code (alte Newsmodul):

Code: Alles auswählen

<tr>
<td valign="middle"><img src="imgSTADTWAF/kasten_blau.gif" border="0">&nbsp;&nbsp;</td>
<td valign="middle"><a href="front_content.php?client=1&lang=1&idcat=34&idart=133&m=&s="><b>Ausführliche Anleitungen für die Telefone</b></a></td>
</tr>
<tr>
<td>&nbsp;</td><td><font size="1" face="ARIAL">Erstellt am: 2008-04-30 09:07:59 von tim.sawukaytis </font></td></tr>
</tr>
an vermutlich diese Stelle bekommen (das neue empfohlene Newsmodul Article List Advanced V4.6.x V1.4):

Code: Alles auswählen

foreach ($aData as $aValue) {
         echo '<div>', chr(10);
         echo '   <div id="headline">'.$aValue["Category"].": ".$aValue["Headline"].'</div>', chr(10);

         if ($aSettings["Elements"] > 0) {
            for ($i = 0; $i < $aSettings["Elements"]; $i++) {
               switch (TRUE) {
                  case ($aSettings["k".$i]["ElementType"] == "Image" || $aSettings["k".$i]["ElementType"] == "ExtractedImage"):
                     $image = $aValue["i".$i]["WebPath"];
                     
                     $width  = $aValue["i".$i]["Width"];
                     $height = $aValue["i".$i]["Height"];

                     if ($aSettings["k".$i]["ElementWidth"] > 0 && $aSettings["k".$i]["ElementHeight"] > 0) {
                        # Check, if resize necessary
                        if ($aValue["i".$i]["ServerPath"] != "" && file_exists($aValue["i".$i]["ServerPath"]) && 
                            ($aValue["i".$i]["Width"] > $aSettings["k".$i]["ElementWidth"] || 
                             $aValue["i".$i]["Height"] > $aSettings["k".$i]["ElementHeight"])) {
                           # Scale image
                           $image = capiImgScale($aValue["i".$i]["ServerPath"], $aSettings["k".$i]["ElementWidth"], $aSettings["k".$i]["ElementHeight"], false, false, 10, false);
                           
                           #Get dimensions of the image
                           list ($width, $height, $type, $attr) = getimagesize($image);
                        } else {
                           $image = $aValue["i".$i]["WebPath"];
                           
                           $width  = $aValue["i".$i]["Width"];
                           $height = $aValue["i".$i]["Height"];
                        }
                     }
                     
                     if ($image != "") {
                        echo '   <div id="image"><img src="'.$image.'" width="'.$width.'" height="'.$height.'" /></div>', chr(10);
                     }
                     
                     break;
                  default: // Everything else is treated as "Text"
                     echo '   <div id="text">'.$aValue["i".$i]["Value"].'</div>', chr(10);
               }
            }
ich versteh nicht so ganz wie ich das umbauen soll...