<?php // $Id: block-Calendar_centerlist_scroll.php,v 20.15 2004/08/29 02:00:06 EllselAn Exp $
/************************************************************************/
/* KalenderMx v1.4.a                                                    */
/* ===================                                                  */
/*  Calendar Module for vkpMx 2.x / pragmaMx & phpNuke 5.5-7.2          */
/*  Copyright (c) 2004 by A.Ellsel (kalender@pragmamx.org)              */
/*  http://www.pragmamx.org & http://www.shiba-design.de                */
/* -------------------------------------------------------------------- */
/* KalenderMx is based on EventCalendar 2.0                             */
/*  Copyright (c) 2001 Originally by Rob Sutton                         */
/*  http://smart.xnettech.net (Nuke Site)                               */
/*  Development continued by Aleks A.-Lessmann                          */
/* Included some ideas and changes by:                                  */
/*  flobee, bulli-frank, kicks, kochloeffel, FrankySz, Jubilee          */
/* -------------------------------------------------------------------- */
/* This program 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 2 or a newer version.   */
/************************************************************************/
### !!!! don't change this 3 lines !!!! #########################################
$thisfile=basename(__file__);
if (eregi($thisfile, $_SERVER["PHP_SELF"])) die ("You can't access this file directly...");
global $prefix,$bgcolor1,$bgcolor2,$bgcolor3,$bgcolor4,$bgcolor5,$textcolor1,$textcolor2;
#################################################################################

if (eregi("block-Candynews.php",$_SERVER['PHP_SELF']))
{
	Header("Location: index.php");
	die();
}


$mxblockcache = FALSE;




// verschiedene Einstellungen
$richtung  = "left"; 		# Richtug/Direction up down left oder right  wenn/if $scrollen=1
$speed     = 8;   		# scrollgeschwindigkeit wenn / scrollig speed if $scrollen=1
$warte     = 10;   		# scrollverzögerung wenn / scroll delay if $scrollen=1
$limit     = 30;   		# Max. Anzahl der angezeigten Nachrichten....




$scrolling = 1; 			# Eintraege seitlich scrollen
$scrolltype = "scroll" ;		# Art des Scrollens: scroll / alternate
$scrolltopmargin = 0 ;		# Abstand des scrollenden Teils von oben: beliebiger integer Wert in px
######### Definition der Farben und Rahmen ###############################################################
$listbordercolor = $bgcolor2;	# Rahmenfarbe um Liste
$listtableborder = 0;		# html Rahmen um Liste
$listtablecellspacing = 1;	# abstand zwischen Events (auch Rahmenbreite)
$listtablecellpadding = 2;    	# this will make the Events lines larger or smaller depending on value
###### Ende der Einstellungen, ab hier nichts veraendern !! ###############################################


if (($richtung=="left") or ($richtung=="right"))
{
	$hoehe=18;
	$waagerecht= 1;
}
else
{
	$hoehe=200;
	$waagerecht= 0;
}

if (!calDetectGoodBrowser ()) {$scrolling=0;}
$content = "\n<!-- $thisfile output start -->\n";

if ($scrolling)
{
	srand((double)microtime()*1000000);
	$randmarq = 'm'.md5(uniqid(rand(),1));
	$content.="<table width=\"100%\" border=\"$listtableborder\" cellspacing=\"$listtablecellspacing\" cellpadding=\"$listtablecellpadding\" style=\"background-color: $listbordercolor; border: ${listtableborder}px solid $listbordercolor;\"><tr><td width=\"100%\">
         <div style=\"position: relative; top: $scrolltopmargin;\">
         <marquee id='".$randmarq."' behavior='$scrolltype' direction='$richtung' height='$hoehe' hspace='0' vspace='0' scrollamount='$speed' scrolldelay='$warte' loop='0' dir='ltr' onMouseOver='this.stop()' onMouseOut='this.start()'>
	";
}


$result = sql_query("SELECT * FROM ".$prefix."_candynews WHERE active='1' ORDER BY ID desc LIMIT ".$limit."");
if ($waagerecht==1)
{
	while ($row = sql_fetch_array($result))
	{
		$row['url']= stripslashes($row['url']);
		$row['titel']=stripslashes($row['titel']);
		if ($row['url'] == '')
		{
			$content .= "+++&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;".$row['titel']."&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
		}
		if (($row['url'] != '')&&($row['sets'] == '0'))
		{
			$content .= "+++&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"".$row['url']."\">".$row['titel']."</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
		}
		if (($row['url'] != '')&&($row['sets'] == '1'))
		{
			$content .= "+++&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"".$row['url']."\" target=\"_blank\">$row[titel]</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
		}
	}
	$content .= "+++";
}
if ($waagerecht==0)
{
	while ($row = sql_fetch_array($result))
	{
		$row['url']= stripslashes($row['url']);
		$row['titel']=stripslashes($row['titel']);
		$content .= "<br><br>------------------><br>";
		if ($row['url'] == '')
		{
			$content .= "".$row['titel']."";
		}
		if (($row['url'] != '')&&($row['sets'] == ''))
		{
			$content .= "<a href=\"".$row['url']."\">".$row['titel']."";
		}
		if (($row['url'] != '')&&($row['sets'] == '1'))
		{
			$content .= "<a href=\"".$row['url']."\" target=\"_blank\">$row[titel]</a>";
		}
		$content .= "<br><------------------<br><br>";
	}
}

if ($scrolling)
{
	/// Mozilla macht Probleme beim scrollen, deshalb hier explizit starten
	$content .= "</marquee></div></td></tr>\n</table>
	<script language='JavaScript1.2'>
	<!--
	if (document.getElementById) { document.getElementById('".$randmarq."').start(); }
	//-->
	</script>
	";
}
else
{
	$content.= "";
}
$content .= "\n<!-- $thisfile output end -->\n<!-- KalenderMx © by shiba-design.de -->\n";
$content=ereg_replace("\t","",$content);
?>