Initial commit
This commit is contained in:
79
hauptframe.php
Normal file
79
hauptframe.php
Normal file
@ -0,0 +1,79 @@
|
||||
<?php
|
||||
session_start();
|
||||
# Fuer debugging
|
||||
error_reporting(E_ALL);
|
||||
ini_set('display_errors', 1);
|
||||
#echo __LINE__."<br>";
|
||||
|
||||
|
||||
|
||||
include_once 'classes/lg-on_Smarty.class.php';
|
||||
$smarty = new lgon_Smarty();
|
||||
require_once("config.inc.php");
|
||||
require_once("func_rollenrechte.php");
|
||||
$templatename = substr(basename($_SERVER['PHP_SELF']),0,-3)."html";
|
||||
require_once "language/german.inc.php";
|
||||
|
||||
|
||||
$sid = session_id();
|
||||
$datum=date("Y-m-d H:i:s");
|
||||
$result = $db->query( "INSERT INTO historie (vaid, datum, session_id, art, art_id) VALUES ('$user_vaid;', '$datum', '$sid', 'S', '')" );
|
||||
|
||||
|
||||
|
||||
if(rore($user_admin,'Administrator','RO')){
|
||||
$admin = 'Administrator';
|
||||
$smarty->assign('admin', 'Administrator');
|
||||
}else{
|
||||
$admin = '';
|
||||
$smarty->assign('admin', '');
|
||||
}
|
||||
|
||||
|
||||
$result3 = $db->query( "SELECT datum
|
||||
FROM userlog
|
||||
WHERE uid='$user_admin'
|
||||
ORDER by datum desc
|
||||
LIMIT 1,1" );
|
||||
$row3 = $result3->fetch_array();
|
||||
|
||||
|
||||
if($admin == ''){ //Administratoren dürfen alle NEWS sehen
|
||||
$query = "SELECT id, date_format(datum, '%d.%m.%Y, %H:%i') datum,date_format(datum, '%d.%m.%Y') datum_kurz, ueberschrift, aenderung, art, freigabe, link, datum datum_db
|
||||
FROM changelog
|
||||
WHERE freigabe='2'
|
||||
ORDER BY id DESC
|
||||
LIMIT 10";
|
||||
}else{
|
||||
$query = "SELECT id, date_format(datum, '%d.%m.%Y, %H:%i') datum,date_format(datum, '%d.%m.%Y') datum_kurz, ueberschrift, aenderung, art, freigabe, link, datum datum_db
|
||||
FROM changelog
|
||||
ORDER BY id DESC
|
||||
LIMIT 10";
|
||||
}
|
||||
|
||||
$result = $db->query( $query);
|
||||
|
||||
|
||||
|
||||
// For each result that we got from the Database
|
||||
while ($row = $result->fetch_array())
|
||||
{
|
||||
if($row3['datum'] <= $row['datum_db']){
|
||||
$icon = "1";
|
||||
}else{
|
||||
$icon = "0";
|
||||
}
|
||||
$row['icon'] = $icon;
|
||||
$row['titel'] = htmlspecialchars($row['ueberschrift']);
|
||||
$row['text'] = $db->real_escape_string(str_replace(chr(13),'',$row['aenderung']));
|
||||
$value[] = $row;
|
||||
}
|
||||
|
||||
// Assign this array to smarty...
|
||||
$smarty->assign('news', $value);
|
||||
|
||||
|
||||
$smarty->display("$template/$templatename");
|
||||
|
||||
|
||||
?>
|
Reference in New Issue
Block a user