2 cm Abstand?K. hat geschrieben:Bislang stehen immer so etwa zwei Zentimeter Abstand in der Vertikale.
http://halchter.com/cms/front_content.php
2 cm Abstand?K. hat geschrieben:Bislang stehen immer so etwa zwei Zentimeter Abstand in der Vertikale.
Du hast schon mein erstes Posting gelesen, oder?Matz82 hat geschrieben:Wo bitte trage ich die Termine ein?
Halchteranerin hat geschrieben:Es ist eine Ergaenzung zum Terminuebersicht-Modul von agon (http://www.contenido.org/forum/viewtopic.php?t=2155), und es dient dazu, auf der Startseite die naechsten x Termine aufzulisten.
Code: Alles auswählen
// selected category 
$selected = "CMS_VALUE[0]"; 
echo "<table cellspacing=\"0\" cellpadding=\"10\" border=\"0\"> 
        <tr> 
          <td>Überschrift</td> 
          <td><input type=\"text\" name=\"CMS_VAR[1]\" value=\"CMS_VALUE[1]\"></td> 
        </tr> 
        <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> 
      </table>"; 
 Code: Alles auswählen
<?php 
$navmod_id = ((int)"CMS_VALUE[0]" == 0) ? $idcat : (int)"CMS_VALUE[0]"; 
$gefunden = 0; // um zu überprüfen, ob überhaupt Termine vorliegen 
$date = date("Y-m-d"); 
echo "<div>CMS_VALUE[1]<br><br></div>"; //Überschrift der Termin-Übersicht 
// Alle Artikel der Kategorie einlesen, die nicht Startartikel (= Terminübersicht) sind * nur contenido 4.4.x 
$sql = "SELECT 
         ARTLANG.idart, 
         CONTENT.value, 
         CONTENT.typeid 
       FROM 
          ".$cfg["tab"]["cat_art"]." AS CATART, 
          ".$cfg["tab"]["art_lang"]." AS ARTLANG, 
          ".$cfg["tab"]["cat"]." AS CAT, 
          ".$cfg["tab"]["content"]." AS CONTENT 
       WHERE 
          ARTLANG.idart = CATART.idart AND 
          CATART.idcat = CAT.idcat AND 
          ARTLANG.idartlang = CONTENT.idartlang AND 
          ARTLANG.idlang = '".$lang."' AND 
          CAT.idcat = '".$navmod_id."' AND 
          CAT.idclient = '".$client."' AND 
          ARTLANG.online = '1' AND 
          CATART.is_start='0' 
       ORDER BY 
          ARTLANG.idart, 
          CONTENT.typeid ASC"; 
$db->query($sql); 
$j = 0; 
$anz = 0; 
if ($db->num_rows() != 0) { 
   $termin = array (array ()); // Array erzeugen, in dem die Termine abgelegt werden; 
   while ($j < $db->num_rows()) // alle Datensätze durchlaufen 
      { 
$db->next_record(); 
if (isStartArticle($db->f("idartlang"),$idcat,$lang)==FALSE) 
{ 
if ($db->f("idart") > $termin["idart"][$anz]) 
{ 
$anz++; 
} 
switch ($db->f("typeid")) { 
case 0: // Anfangstermin 
$termin["datum1"][$anz] = $db->f("value"); 
$termin["jahr1"][$anz] = substr($db->f("value"),0,4); 
$termin["monat1"][$anz] = substr($db->f("value"),5,2); 
$termin["tag1"][$anz] = substr($db->f("value"),8,2); 
$termin["idart"][$anz] = $db->f("idart"); 
break; 
case 1: // Anfangsuhrzeit 
$termin["zeit1"][$anz] = $db->f("value"); 
$termin["datum1"][$anz] = $termin["datum1"][$anz]." ".$termin["zeit1"][$anz]; 
break; 
case 2: // Endtermin 
$termin["datum2"][$anz] = $db->f("value"); 
$termin["jahr2"][$anz] = substr($db->f("value"),0,0); 
$termin["monat2"][$anz] = substr($db->f("value"),0,0); 
$termin["tag2"][$anz] = substr($db->f("value"),8,2); 
break; 
case 3: // Enduhrzeit 
$termin["zeit2"][$anz] = $db->f("value"); 
$termin["datum2"][$anz] = $termin["datum2"][$anz]." ".$termin["zeit2"][$anz]; 
break; 
case 4: // Ort 
$termin["ort"][$anz] = $db->f("value"); 
break; 
case 6: // Titel 
$termin["titel"][$anz] = $db->f("value"); 
break; 
} 
} 
$j++; 
} 
   $array_multisort = array($termin["datum1"], SORT_ASC, SORT_STRING, 
                   $termin["datum2"], SORT_ASC, SORT_STRING, 
                   $termin["ort"], 
                   $termin["ortdetail"], 
                   $termin["zeit1"], 
                   $termin["zeit2"], 
                   $termin["idart"], 
                   $termin["titel"]); // nach Datum sortieren 
   for ($i = 0; $i <= $anz; $i ++) { 
      if ($termin["datum1"][$i] >= $date || $termin["datum2"][$i] >= $date) // nur Termine, die noch aktuell sind, aufnehmen 
         { 
         $gefunden ++; 
         echo '<div style="border-top:1px dotted #669900;" class="frontdate">'.substr($termin["datum1"][$i], 8, 2).'.'.substr($termin["datum1"][$i], 5, 2).'.'; 
   if ( strlen($termin["zeit1"][$i]) >1 ) 
   { 
      echo ', '.$termin["zeit1"][$i].' Uhr'; 
   } 
         $navmod_link = "front_content.php?client=".$client."?=".$lang."&idcat=".$navmod_id."&idart=".$termin["idart"][$i].""; 
    echo '<br></div>'; 
         echo '<div style="border-top:1px dotted #669900; width:120px;" class="frontevent"><a href="'.$sess->url("$navmod_link").'" class="frontevent">'.urldecode($termin["titel"][$i]).'</a></div>'; 
      } 
      /*Untenstehend ist die gewünschte Anzahl der anzuzeigenden Termine ggf. anzupassen. 
         In diesem Fall werden 5 Termine aufgelistet. */ 
      if ($gefunden == 5) 
         break; 
   } 
} 
if ($gefunden == 0) // falls kein aktueller Termin vorliegt 
   { 
   echo '<b>Es liegen aktuell keine Termine vor!</b>'; 
} 
?>