<?php

/**
 * This file is part of
 * pragmaMx - Web Content Management System.
 * Copyright by pragmaMx Developer Team - http://www.pragmamx.org
 *
 * pragmaMx is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published 
 * by the Free Software Foundation, either version 3 of the License, 
 * or (at your option) any later version.
 ******************************************************************
 * Block Encycolpedia-last-5-from-item-ticker 1.0 for pragmaMx 
 * written by (c) 2009 Michael Weiß, http://www.mw-websevice,de
 ******************************************************************
**/
 

// Modulname 
$module_name = 'Encyclopedia'; 
 
//
// ---------------Einstellungen fuer den Block---------------
// 

// Blockcache ermoeglichen
$mxblockcache = true;

// Anzahl der angezeigten Links, 0 um alle Links anzuzeigen
$limit = 5;

// Laufschrift Geschwindigkeit
$z_mount =4; // Betrag
$z_delay =0; // Verzoegerung

// Laufschrift Richtung
$z_direction ='left'; // Links = left , Rechts = right

// Laufschrift Trennzeichen //
$z_separator ='&#9679 &#9679 &#9679'; // Beispiel: + , - , * , <> , ~ , &#9679 ,

//
// -----------Ende der Einstellungen fuer den Block-----------
//

defined('mxMainFileLoaded') or die('access denied');

global $prefix;
$limit = ($limit) ? ' LIMIT ' . intval($limit) : '';
$content = ''; 

//
//-------Wahlmöglichkeit für alle Enzyklopädien die letzten Einträge-----------
//-------Einstellung für alle Enzyklopädie --- die Anzahl festlegen------------
//-------immer nur eine der beiden Möglichkeiten aktivieren--------------------
//
$result = sql_query("SELECT tid, eid, title FROM " . $prefix . "_encyclopedia_text order by tid DESC limit 0,5"); 

//
//-------Wahlmöglichkeit für eine bestimmte Enzyklopädie - die Zahl anpassen für die gewünschte Enzyklopädie---------
//-------Einstellung für alle Enzyklopädie --- die Anzahl festlegen--------------------------------------------------
//
//$result = sql_query("SELECT tid, eid, title FROM " . $prefix . "_encyclopedia_text where eid=1 order by tid DESC limit 0,5");

$list = '';
$list[] = '<marquee scrolldelay="'.$z_delay.'" scrollamount="'.$z_mount.'" direction="'.$z_direction.'" onmouseover="this.stop()" onmouseout="this.start()">';
while (list($tid, $eid, $title) = sql_fetch_row($result)) {
    $content['title']  = '<a href="modules.php?name=' . $module_name  . '&amp;op=content&amp;tid=' . $tid . '">' . $title . '</a>';

    $list[] = ''.$z_separator.'&nbsp;<strong>' . $content['title'] . '</strong>&nbsp;'.$z_separator.'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
}
$list[] = '</marquee>';
if ($list) {
    $content = implode("\n", $list);
}

?>