Location: PHPKode > projects > Aratix > inc/functions.inc.php
<?php
/*
** Aratix
** Version 0.1.0beta8 (Anubis)
**
** Autor: Manuel Burghammer
** E-Mail: hide@address.com
** Homepage: http://www.xitara.net
**
** File: functions.inc.php - Version 0.1.0 build 120
** Position: /inc/
** Last Modified: 26.06.2006 - 12:26:46
*/

function get($var, $flag = ''){
	if(isset($_POST[$var]))
		return $_POST[$var];
	else if(isset($_GET[$var]))
		return $_GET[$var];
	else if(isset($_FILES[$var][$flag]))
		return $_FILES[$var][$flag];
	else
		return FALSE;
}

function get_language($config, $user_name = ""){
// 	if($user != "")
// 		$language = user('language');
// 	else if(($language = config('language')) == -1 && isset($_SERVER['HTTP_ACCEPT_LANGUAGE']))
// 		$language = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2);
//
// 	if($language == "")
// 		$language = DEFAULT_LANGUAGE;
//
// 	return $language;
	return "de";
}

function runtime(){
	$end_time = microtime(); // Endzeit des Scriptes speichern
	list($startmsec, $startsec) = explode(" ", $GLOBALS['starttime']);
	list($endmsec, $endsec) = explode(" ", $end_time);
	$runtime = ($endmsec + $endsec) - ($startmsec + $startsec); // Laufzeit des Scriptes erzeugen

	return $runtime;
}

function pathway($id = ''){
	global $pathway_array, $pathway_actpage, $config;
	$pathway = "";

	if($id == ""){
		if(!get('id'))
			$id = 1;
		else
			$id = get('id');

		$act_ = $GLOBALS['db']->read(TB_PAGES, "parent, menu_text, module_name", "id='" . $id . "'");
		$id = $act_['parent'];

		if(get('module') || $act_['module_name']){
			if(get('module'))
				$module_name = get('module');
			else
				$module_name = $act_['module_name'];

			$pathway_actpage = array('id' => $id, 'menu_text' => $config->i18n('module_' .$module_name));
		}
		else
			$pathway_actpage = array('id' => $id, 'menu_text' => $act_['menu_text']);
	}
	if($id != "-1" && !get('module')){
		$act = $GLOBALS['db']->read(TB_PAGES, "parent, menu_text, module_name", "id='" . $id . "'");

		if($act['module_name'] == "")
			$pathway_array[] = array('id' => $id, 'menu_text' => $act['menu_text']);
		else
			$pathway_array[] = array('id' => $id, 'menu_text' => $config->i18n('module_' . $act['module_name']));
	}
	if(isset($act) && $act['parent'] != "-1")
		pathway($act['parent']);
	else{
		if(get('session'))
			$pathway .= "<span class=\"pathway_name\">" . $GLOBALS['user']->get_username($GLOBALS['my']->id()) . "</span> " . $config->get('seperator1') . " ";

		if(is_array($pathway_array)){
			$pathway_array = array_reverse($pathway_array);

			foreach($pathway_array as $pathway_page){
				$pathway .= '<a href="index.php?' . $GLOBALS['session_string'] . 'id=' . $pathway_page['id'] . '" class="pathway_pages">' . $pathway_page['menu_text'] . '</a> ' . $config->get('seperator2') . "  ";
			}
		}
		$pathway .= '<span class="pathway_act_page">' . $pathway_actpage['menu_text'] . '</span>';
		$GLOBALS['content']->assign("pathway", $pathway);
	}
}

function arraycount($count_array){
	return count($count_array['a']);
}





?>
Return current item: Aratix