Location: PHPKode > projects > Content*Builder > modules/headline/headlineBox.php
<?php
// Oft genutzte Funktionen bei Texten
include_once($rel."libraries/BTPL_functions.inc.php");

// Medien Klasse einbinden, keine Ahnung warum aber ich machs mal.
// Später: jetzt weiß ich's: Replacements
require_once($path['cb'].$cbDirLib.'CB_media.class.php');
$myMedia  = new MediaManagement();
$myMedia->setOptionObject($cbOption);
$myMedia->setBranchID($cbOption->getSingleOption("rpBranch"));
$rpBranch = $myMedia->getBranchDirectory();

// Limit setzen ( Default: 5 )
if($archive != 1) { 
	$headlineAmount = 5;
} else { 
	$headlineAmount = 10000;
}

$limit = "LIMIT 0,$headlineAmount";

$hlQuery = mysql_query("SELECT * FROM ".TABLE."_headlines ORDER BY datum DESC $limit");
if($hlQuery) {
	while($hlRow = mysql_fetch_object($hlQuery)) {
		$title = $hlRow->headline;
		$text  = $hlRow->msg;
		
		$title = stripslashes($title);
		$text  = stripslashes($text);
		
		$datetime = $hlRow->timestamp;
		$d1 = substr($datetime,0,4);
		$d2 = substr($datetime,4,2);
		$d3 = substr($datetime,6,2);
		$t1 = substr($datetime,8,2);
		$t2 = substr($datetime,10,2);
		$t3 = substr($datetime,12,2);
		$date = $d3.".".$d2.".".$d1;
		$time = $t1.":".$t2.":".$t3;
		
		/********* REPLACEMENT START **********/
		$text	= str_replace('[REPLACEDIR]', $path["cb"].'uploads/files/'.$rpBranch.'/', $text);
		/********** REPLACEMENT END ***********/
		
		// CB Article Link ... Internal Link Hack
		$text = preg_replace("/\[CBLINK module=([0-9a-zA-Z-]*) id=([0-9a-f-]*)\]([ 0-9a-zA-Z]*)\[\/CBLINK]/i", "<a href=\"".$PHP_SELF."?load=$1&sub=full&id=$2\">$3</a>", $text);
		
		$headlineTitle[]    = $title;
		$headlineText[]     = $text;
		$headlineID[]       = $hlRow->headlineid;
		$headlineDate[]     = $date;
		$headlineTime[]     = $time;
	}
	$tpl->assign("headlineSet", 1);
	$tpl->assign("headlineData",
		array ( "title" => $headlineTitle,
				"text"  => $headlineText,
				"id"    => $headlineID,
				"date"  => $headlineDate,
				"time"  => $headlineTime
		)
	);
}

$tpl->display("headlineOverview.template");
?>
Return current item: Content*Builder