<?xml version="1.0" encoding="ISO-8859-1"?>
<module><name>vpNewsticker</name>
<description>Bei dem vpNewsticker handelt es sich um einen einfachen JavaScript-Newsticker. Es wird dabei wie in einer Artikelliste eine Kategorie nach allen Artikeln durchsucht und dann nach und nach dargestellt. Sollte ein Besucher Ihrer Internetseite JavaScript deaktiviert haben, funktioniert der Ticker natürlich nicht. Durch Nutzung von &lt;NOSCRIPT&gt;-Tags wird aber zumindest ein Link auf die Newskategorie gesetzt, so dass der Startartikel dieser Kategorie eine entsprechende Artikelliste bereithalten sollte.

Author: Ingo van Peeren (ingo@van-peeren.de)
Version: 1.0</description>
<type/>
<input/>
<output>&lt;?php
/***********************************************
* CONTENIDO MODUL - OUTPUT
*
* Modulname : vpNewsticker v1.2
* Author : Ingo van Peeren (ingo@van-peeren.de)
* Copyright : Ingo van Peeren (ingo@van-peeren.de)
* Created : 15-01-2005
* Modified : 07-04-2005
************************************************/

// in welcher Kategorie befinden sich die News
$cat = 41;
$startartikel = false; // möglich sind:
                       // true  (Startartikel wird mit angezeigt)
                       // false (Startartikel wird nicht mit angezeigt)

// welche Sprache und welcher Mandant sollen genutzt werden
$sprache = $lang;    // hier kann auch eine bestimmte Sprache als Zahl angegeben werden
$mandant = $client;  // hier kann auch ein bestimmter Mandant als Zahl angegeben werden

// nach wie vielen Millisekunden soll eine neue Nachricht erscheinen
$delay = 4000;

// Titel, Sortierung usw.
$titel = &quot;headline&quot;; // möglich sind:
                     // headline (entspricht HTMLHEAD1)
                     // title    (entspricht Artikeltitel)
$sortby = &quot;created&quot;; // möglich sind:
                     // titel        (entspricht dem zuvor ausgewählten Titelfeld)
                     // created      (entspricht Erstellungsdatum)
                     // lastmodified (entspricht Datum der letzten Änderung)
$sortorder = &quot;desc&quot;; // möglich sind:
                     // asc     (aufsteigend)
                     // desc    (absteigend)

// Texte
$newstitle = &quot;News&quot;;
$noscripttext1 = &quot;klicken Sie bitte&quot;;
$noscripttext2 = &quot;hier&quot;;
$noscripttext3 = &quot;!&quot;;

/* ab hier nichts mehr mofizieren */

// Funktionen
function ticker_feld () {
global $cat, $startartikel, $sprache, $mandant, $titel, $sortby, $sortorder;

  if (($sortby == &quot;created&quot;) || ($sortby == &quot;lastmodified&quot;)) {
    // Artikellisten Optionen einstellen
    $articleListOptions = array(&quot;idcat&quot; =&gt; $cat,            // Idcat (Muss angegeben werden)
                                &quot;lang&quot;  =&gt; $sprache,        // Sprach id (optional), standard ist die aktive Sprache
                                &quot;client&quot;=&gt; $mandant,        // Mandant id (optional), standard ist der aktive Mandant
                                &quot;start&quot; =&gt; $startartikel,   // Startartikel
                                &quot;order&quot; =&gt; $sortby,         // Feldname nach dem sortier wird, siehe tabelle 'con_art_lang'
                                &quot;direction&quot; =&gt; $sortorder); // Ab- oder Aufsteigende sortierung ('asc', oder 'desc')
    // Artikellisten Objekt erzeugen
    $articleList = new ArticleCollection($articleListOptions);
    $i = 0;
    while ($article = $articleList-&gt;nextArticle()) {
        if ($titel == &quot;headline&quot;) $tickerfeld[]['titel'] = $article-&gt;getContent('htmlhead', 1);
        else  $tickerfeld[$i]['titel'] = $article-&gt;get(&quot;title&quot;);
        $tickerfeld[$i]['idart'] = $article-&gt;get(&quot;idart&quot;);
        $i++;
    }
  }
  else {
    // Artikellisten Optionen einstellen
    $articleListOptions = array(&quot;idcat&quot; =&gt; $cat,            // Idcat (Muss angegeben werden)
                                &quot;lang&quot;  =&gt; $sprache,        // Sprach id (optional), standard ist die aktive Sprache
                                &quot;client&quot;=&gt; $mandant,        // Mandant id (optional), standard ist der aktive Mandant
                                &quot;start&quot; =&gt; $startartikel,   // Startartikel
                                &quot;order&quot; =&gt; &quot;idartlang&quot;,     // Feldname nach dem sortier wird, siehe tabelle 'con_art_lang'
                                &quot;direction&quot; =&gt; &quot;asc&quot;);      // Ab- oder Aufsteigende sortierung ('asc', oder 'desc')
    // Artikellisten Objekt erzeugen
    $articleList = new ArticleCollection($articleListOptions);
    $i = 0;
    while ($article = $articleList-&gt;nextArticle()) {
        if ($titel == &quot;headline&quot;) $htitel = $article-&gt;getContent('htmlhead', 1);
        else $htitel = $article-&gt;get(&quot;title&quot;);
        $tickerfeld[$i]['titel'] = $htitel;
        $tickerfeld[$i]['idart'] = $article-&gt;get(&quot;idart&quot;);
        $sort_value = trim(strip_tags(html_entity_decode(urldecode($htitel))));
        $sortiert[$i] = strtr($sort_value, &quot;ÄÖÜäöüß&quot;, &quot;AOUaous&quot;);
        $i++;
    }
    if ($sortorder == &quot;asc&quot;) array_multisort($sortiert, SORT_ASC, $tickerfeld);
    else array_multisort($sortiert, SORT_DESC, $tickerfeld);
  }
  return $tickerfeld;
}
// Funktionen Ende


?&gt;
&lt;div style=&quot;display: inline;&quot; class=&quot;ticker&quot;&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
&lt;!--
document.write('&lt;a href=&quot;front_content.php?idcat=&lt;?php echo $cat; ?&gt;&quot;&gt;&lt;?php echo $newstitle; ?&gt;&lt;\/a&gt;: ')
//--&gt;
&lt;/script&gt;
  &lt;noscript&gt;
    &lt;div style=&quot;display: inline;&quot; class=&quot;ticker&quot;&gt;
      &lt;?php echo $newstitle; ?&gt;: &lt;?php echo $noscripttext1; ?&gt;
      &lt;a class=&quot;newsticker&quot; href=&quot;front_content.php?idcat=&lt;?php echo $cat; ?&gt;&quot;&gt;&lt;?php echo $noscripttext2; ?&gt;&lt;/a&gt;
      &lt;?php echo $noscripttext3; ?&gt;
    &lt;/div&gt;
  &lt;/noscript&gt;
&lt;/div&gt;
&lt;div style=&quot;display: inline;&quot; class=&quot;ticker&quot;&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
&lt;!--
  var tickercontents=new Array()
  &lt;?php
    $tickerfeld = ticker_feld();
    $i = 0;
    foreach ($tickerfeld as $ticker) {
        $link = &quot;front_content.php?idcat=$cat&amp;amp;idart=&quot; . $ticker['idart'] ;
        $titel = trim(strip_tags($ticker['titel']));
        echo &quot;tickercontents[$i]='&lt;a class=\&quot;newsticker\&quot; href=\&quot;$link\&quot;&gt;&quot;.urldecode($titel).&quot;&lt;\/a&gt;'\n&quot;;
        $i++;
    }
  ?&gt;
  var tickdelay=&lt;?php echo $delay; ?&gt;

  ////Do not edit pass this line////////////////

  var currentmessage=0

  function changetickercontent(){
    if (document.layers){
      document.tickernsmain.document.tickernssub.document.write(tickercontents[currentmessage])
      document.tickernsmain.document.tickernssub.document.close()
    }
    else
      crosstick.innerHTML=tickercontents[currentmessage]

    if (currentmessage==tickercontents.length-1) currentmessage=0
      else currentmessage++
      setTimeout(&quot;changetickercontent()&quot;,tickdelay)
  }

  function start_ticking(){
    if (document.layers)
      document.tickernsmain.visibility=&quot;show&quot;
    else
      crosstick=document.getElementById? document.getElementById(&quot;tickerie&quot;) : document.all.tickerie
    changetickercontent()
  }

  if (document.all||document.getElementById)
    document.write('&lt;div id=&quot;tickerie&quot; style=&quot;display: inline;&quot;&gt;&lt;\/div&gt;')
  window.onload=start_ticking
//--&gt;
&lt;/script&gt;
&lt;/div&gt;</output>
</module>
