Die Events sollen horizontal im Header scrollen.
Dazu habe ich folgende Zeilen aus der portal.php in die page_header.php übernommen.
Code: Alles auswählen
$cal_config = array();
$sql = "SELECT * FROM ".$table_prefix."cal_config";
if(!$result = $db->sql_query($sql))
{
message_die(GENERAL_ERROR, "Couldn't query calendar config table", "", __LINE__, __FILE__, $sql);
}
else
{
while( $row = $db->sql_fetchrow($result) )
{
$cal_config[$row['config_name']] = $row['config_value'];
}
}
Code: Alles auswählen
//
// Events
//
if ($cal_config['number_events'] <> 0)
{
$day = create_date("j", time(), $userdata['user_timezone']);
$month = create_date("m", time(), $userdata['user_timezone']);
$year = create_date("Y", time(), $userdata['user_timezone']);
if ($cal_config['day_number'] == 0)
{
$sql_limit = ' LIMIT 0, ' . $cal_config['number_events'];
$event_span_date = '';
$sql_span = '';
}
else
{
$cal_days = $cal_config['number_events'];
$sql_limit = '';
$event_span_date = strtotime("$year-$month-$day 23:59:59 + $cal_days days");
$event_span_date = create_date("Y", $event_span_date, $userdata['user_timezone']).'-'.create_date("m", $event_span_date, $userdata['user_timezone']).'-'.create_date("j", $event_span_date, $userdata['user_timezone']).' 23:59:59';
$sql_span = " AND stamp <= '$event_span_date'";
}
$sql = "SELECT * FROM ".$table_prefix."calendar WHERE valid = 'yes'
AND stamp >= '$year-$month-$day 00:00:00'
$sql_span
ORDER BY stamp" . $sql_limit;
$check = 0;
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not select Event data', '', __LINE__, __FILE__, $sql);
}
else
{
while ($row = $db->sql_fetchrow($result))
{
$check++;
$subject = stripslashes($row['subject']);
if ( strlen($subject) > $cal_config['subject_length']) {
if ((substr($subject,-3,1) == '(') && (substr($subject,-1,1) == ')')) {
// store the number of permits and tack them on the end of the shortened subject
$subjectnum = substr($subject,-2,1);
$subject = substr($subject, 0, -3);
}
$subject = substr($subject, 0, $cal_config['subject_length']);
$subject .= '..';
}
$start_date = substr($row['stamp'],8,2).".".substr($row['stamp'],5,2).".".substr($row['stamp'],0,4);
$end_date = substr($row['eventspan'],8,2).".".substr($row['eventspan'],5,2).".".substr($row['eventspan'],0,4);
if ( $start_date == $end_date )
{
$span = $start_date;
}
else
{
$span = $start_date . " - " . $end_date;
}
$subject = ( $userdata['session_logged_in'] ) ? '<a href="'. $phpbb_root_path .'calendar.'.$phpEx.'?id='. $row['id'] .'&mode=display&day='. substr($row['stamp'],8,2). '&month='.substr($row['stamp'],5,2).'&year='.substr($row['stamp'],0,4).'">'. $subject .'</a>' : $subject;
$author = ( $userdata['session_logged_in'] ) ? '<a href="'. $phpbb_root_path .'profile.'.$phpEx.'?mode=viewprofile&'. POST_USERS_URL .'='. $row['user_id'] .'">('. stripslashes($row['username']) .')</a>' : '('. stripslashes($row['username']) .')';
$template->assign_block_vars('event', array(
'SUBJECT' => $subject,
'SPAN' => $span,
'AUTHOR' => $author));
}
if ( $check == 0 )
{
$template->assign_block_vars('event', array(
'SUBJECT' => $lang["No_events"]));
}
}
}
Jetzt erhalte ich nach Login diese Fehlermeldung:
Klich ich F5, dann bin ich onboard und es scheint alles zu laufenCritical Error!
message_die() was called multiple times.
Error #1
Du hast Dich erfolgreich eingeloggt.
Klick hier um zum Index zurückzukehren
Error #2
Couldn't query calendar config table
Line : 86
File : C:\Programme\xampp\htdocs\foren\aktuell-asia\orion\includes\page_header.php
SQL : SELECT * FROM cal_config
Um Line 86 herum schaut es so aus ..
Code: Alles auswählen
$cal_config = array();
$sql = "SELECT * FROM ".$table_prefix."cal_config";
if(!$result = $db->sql_query($sql))
{
message_die(GENERAL_ERROR, "Couldn't query calendar config table", "", __LINE__, __FILE__, $sql);
}Zusätzlich habe ich die MOD Mini_Cal verbaut.
Mit dem Include aus der Portal.php will es auch nicht laufen.
Aus der Portal.php ...
Code: Alles auswählen
// MOD MINI CAL BEGIN
include($phpbb_root_path . 'mods/netclectic/mini_cal/mini_cal.'.$phpEx);
// MOD MINI CAL END
Ich nutze das ORION.