Location: PHPKode > projects > Php simple acces data mysql > phpsimpledb_v2/includes/prepend.php
<?php	
	// lecture du fichier de configuration
	$sThisPath = dirname( __FILE__ ).DIRECTORY_SEPARATOR;
	define( 'PATH_BASE', substr( $sThisPath, 0, strlen( $sThisPath ) - strlen( 'includes'.DIRECTORY_SEPARATOR ) ) );
	include_once( PATH_BASE.'configuration.php' );
	
	// determine si une authentification est necessaire
	if( AUTHENT_USE ){
		if( !isset( $_SESSION ) ){ session_start(); }
		if( !isset( $_SESSION[ 'phpsimpledb_login' ] ) || $_SESSION[ 'phpsimpledb_login' ] != true ){
			header( 'Location: '.AUTO_URL_BASE.'login.php' );
			exit();
		}
	}

	global $oTemplate, $oFramework, $oLang;
	
	//instatiation du framework
	require 'framework'.DIRECTORY_SEPARATOR.'framework.php';
	$oFramework = new DBframework();
	
	//chargement du fichier de langue
	$o = array();
	include_once( PATH_BASE.'langues'.DIRECTORY_SEPARATOR.TAG_LANG.'.php' );
	$oLang = $o;
	
	//moteur de template
	require 'smarty'.DIRECTORY_SEPARATOR.'smart_site.php';
	$oTemplate = new smarty_site();
	$oTemplate->assign( 'css_http', AUTO_URL_BASE.'templates/'.TEMPLATE_NAME.'/' );
	$oTemplate->assign( 'css_http_base', AUTO_URL_BASE );
	$oTemplate->assign( 'oLang', $oLang );
	$oAllMenus = array();
	$oAllMenus[] = array( 'href'=>'manage/projets/index.php', 'text'=>ucfirst( $oLang[ 'mes_projets' ] ) );
	$oAllMenus[] = array( 'href'=>'manage/a_propos/index.php', 'text'=>ucfirst( $oLang[ 'a_propos' ] ) );
	if( AUTHENT_USE ){
		$oAllMenus[] = array( 'href'=>'unlogin.php', 'text'=>'[-'.ucfirst( $oLang[ 'deconnexion' ] ).'-]' );
	}
	$oTemplate->assign( 'oAllMenus', $oAllMenus );
		
	function vd( $o, $n = '' ){
		echo '<hr/><h1>'.$n.'</h1><pre>';
		echo var_dump( $o );
		echo '</pre></h1>';
	}
?>
Return current item: Php simple acces data mysql