Location: PHPKode > projects > DantoBB > DantoBB_1-0/sources/panel_home.php
<?php

/*
	Copyright (C) 2009 DantoBB Team
	http://www.dantobb.com
*/

/**
 * Panel index
 *
 * Shows the Panel index with general information.
 *
 * @author	DantoBB Team
 * @link	http://www.dantobb.com
 * @license	GPL-2
 * @version	$Revision: 1.0 $
 * @copyright	Copyright (C) 2009 DantoBB Team
 * @package	DantoBB
 * @subpackage	Panel
 */

//
// Die when called directly in browser
//
if ( !defined('INCLUDED') )
	exit();

if ( count($_COOKIE) >= 1 && isset($_GET['al']) && valid_int($_GET['al']) ) {
	
	if ( $_GET['al'] ) {
		
		//
		// Set the AL cookie
		//
		$functions->set_al($session->sess_info['user_id'], $session->sess_info['user_info']['passwd']);
		$msgbox_content = $lang['AutoLoginSet'];
		
	} elseif ( !$_GET['al'] ) {
		
		//
		// Unset the AL cookie
		//
		$functions->unset_al();
		$msgbox_content = $lang['AutoLoginUnset'];
		
	}
	
	$template->parse('msgbox', 'global', array(
		'box_title' => $lang['Note'],
		'content' => $msgbox_content
	));
	
} elseif ( !empty($_GET['do']) && $_GET['do'] == 'markallasread' ) {
	
	$_SESSION['previous_visit'] = time();
	
	$template->parse('msgbox', 'global', array(
		'box_title' => $lang['Note'],
		'content' => $lang['MarkAllAsReadDone']
	));
	
} else {
	
	//
	// Some various session information
	//
	if ( count($_COOKIE) < 1 ) {
		
		$al_status = $lang['Disabled'];
		$al_change = $lang['FeatureDisabledBecauseCookiesDisabled'];
		
	} elseif ( $functions->isset_al() ) {
		
		$al_status = $lang['Enabled'];
		$al_change = '<a href="'.$functions->make_url('panel.php', array('al' => 0)).'">'.$lang['Disable'].'</a>';
		
	} else {
		
		$al_status = $lang['Disabled'];
		$al_change = '<a href="'.$functions->make_url('panel.php', array('al' => 1)).'">'.$lang['Enable'].'</a>';
		
	}
	
	$total_time = $functions->time_past($session->sess_info['started'], $session->sess_info['updated']);
	
	$template->parse('sess_info', 'panel', array(
		'sess_id_v' => $session->sess_info['sess_id'],
		'ip_addr_v' => $session->sess_info['ip_addr'],
		'started_v' => $functions->make_date($session->sess_info['started']),
		'updated_v' => $functions->make_date($session->sess_info['updated']),
		'total_time_v' => $total_time[1],
		'pages_v' => $session->sess_info['pages'],
		'al_status' => $al_status,
		'al_change' => $al_change,
		'mark_all_as_read' => '<a href="'.$functions->make_url('panel.php', array('do' => 'markallasread')).'">'.$lang['MarkAllAsRead'].'</a>'
	));
	
}

?>
Return current item: DantoBB