Location: PHPKode > projects > Content*Builder > modules/archive/overview.inc.php
<?php
	require_once($rel."libraries/BTPL_functions.inc.php");
	require_once($path["cb"].$cbDirLib."pageSplit.class.php");
	$link1 = $PHP_SELF.'?load='.$load;
	
	/* 
	* Alle Rubriken abfragen und in Array speichern
	*/
	$archiveFolderArr = array();
	$folderQuery  = mysql_query("SELECT fname, fid FROM ".TABLE."_columns");
	while($folderRow = mysql_fetch_object($folderQuery)) {
		$archiveFolderArr[$folderRow->fid] = $folderRow->fname;
	}
	
	/*
	* Alle Authoren abfragen und Werte in Array's speichern
	*/
	$authorQuery  = mysql_query("SELECT name, fullname, userid, initial, email FROM ".TABLE."_user");
	while($authorRow = mysql_fetch_object($authorQuery)) {
		$archiveAuthorFNameArr[$authorRow->userid] = $authorRow->fullname;
		$archiveAuthorInitialArr[$authorRow->userid] = $authorRow->initial;
		$archiveAuthorEmailArr[$authorRow->userid] = $authorRow->email;
	}
	
	if (!$offset) $offset=0;
	$archiveLimit = 20;
	$archiveLimitString = $offset.", ".$archiveLimit;
	
	/*
	* Alle Artikel abfragen
	*/
	$archiveArticles     = mysql_query("SELECT * FROM ".TABLE."_article WHERE stage = '3' ORDER BY datum DESC LIMIT $archiveLimitString");
	
	$result       = mysql_query("SELECT COUNT(*) FROM ".TABLE."_article WHERE stage = '3'");
	list($numrec) = mysql_fetch_row($result);
	$numpage      = intval($numrec/$archiveLimit);

	// Es wird aufgerundete wenn Teilrest ├╝brig bleibt.

	if ($numrec%$archiveLimit) {
		++$numpage;
	}
	
	while($artRow = mysql_fetch_object($archiveArticles)) {
		$thisTitle = substr($artRow->title, 0, 24);
		if(strlen($artRow->title) > 24) {
			$thisTitle .= "...";
		}
		
		$thisIDE = $artRow->ide;
		
		$thisFolder = $archiveFolderArr[$artRow->folder];
		$thisFolderText = substr( $thisFolder, 0, 10);
		if(strlen($thisFolder) > 10) {
			$thisFolderText .= "...";
		}
		
		$thisAuthor = $archiveAuthorFNameArr[$artRow->userid];
		$thisAuthorText = substr( $thisAuthor, 0, 18);
		if(strlen( $thisAuthor ) > 18) {
			$thisAuthorText .= "...";
		}
		
		$archiveArticle_initial[] = $archiveAuthorInitialArr[$artRow->userid];
		$archiveArtTitle[]        = $thisTitle;
		$archiveArtFolder[]       = $thisFolderText;
		$archiveArtIde[]          = $thisIDE;
		$archiveArtAuthorFull[]   = $thisAuthorText;
		$archiveArtDate[]         = getGermanDate($artRow->datum);
		$archiveArtTime[]         = "";
		$archiveArtEmail[]        = $thisAuthorEmailArr[$artRow->userid];
		$archiveArtFolderId[]     = $artRow->folder;
	}
	
	$archiveNavigation = new PageSplit($archiveLimit, $offset, $numpage);
	$pn = array();
		
	$urlVars = $link1.$fsub;
	$pn['back']  = $archiveNavigation->getBackLink($urlVars, "<< Back");
	$pn['fwd']   = $archiveNavigation->getNextLink($urlVars, "Next >>");
	$pn['pages'] = $archiveNavigation->getPageLinks($urlVars);	
	
	$overviewData = array(  
		"FOLDER_NAME"  => $archiveArtFolder,
		"TITLE"        => $archiveArtTitle,
		"IDE"          => $archiveArtIde,
		"AUTHOR_FULL"  => $archiveArtAuthorFull,
		"DATE"         => $archiveArtDate,
		"EMAIL"        => $archiveArtEmail,
		"OPENFOLDER"   => $archiveArtFolderId
	);
	$tpl->assign("archiveOviewData", $overviewData);
	
	$overviewGeneral = array(
		"PNBACK"  => $pn['back'],
		"PNPAGES" => $pn['pages'],
		"PNFWD"   => $pn['fwd']
	);
	$tpl->assign("archiveOviewGeneral", $overviewGeneral);
				
	$tpl->display("archive_overview.template");
?>
Return current item: Content*Builder