<?php

	/**
	 * Random Link module for phpWebSite
	 *
	 * @author rck <http://www.kiesler.at/>
	 */



	if(empty($GLOBALS['core'])) {
		header('Location: ../..');
		exit();
	}


	if(empty($_SESSION['recentlinks']) || empty($_SESSION['recentlinks']['cache'])) {

		$_SESSION['recentlinks']=array();
		$_SESSION['recentlinks']['cache']=array();

		$_SESSION['recentlinks']['cache']['age']=0;

	}


	if( $_SESSION['recentlinks']['cache']['age']<= 0) {

		$_SESSION['recentlinks']['cache']['age']=21;


		require_once(PHPWS_SOURCE_DIR . "mod/recentlink/class/recentlink.php");

		$recent=new PHPWS_recentlink;

		$_SESSION['recentlinks']['cache']['title']=
			$_SESSION['translate']->it('Recent Links');

		$_SESSION['recentlinks']['cache']['content']=
			$recent->showLinks();

	}


	$GLOBALS['CNT_recentlink_box']=array();

	$GLOBALS['CNT_recentlink_box']['title']  =$_SESSION['recentlinks']['cache']['title'];
	$GLOBALS['CNT_recentlink_box']['content']=$_SESSION['recentlinks']['cache']['content'];

?>
