Seite 1 von 1

Todays Events

Verfasst: 10.10.2004 12:04
von derDavid
Hallo Leute!

Ich bin ja bald ruhig :D , möchte euch aber vorher noch mit einer Frage nerven. Und zwar geht es um den "Todays Events" Hack, passend für den Calendar Lite. Das Problem ist, dass auch der mit der phpBB 2.0.10 nicht zu funktionieren scheint. Vielleicht hat ja jemand von euch den Hack schonmal passend umgeschrieben? Oder wäre bereit, mir da auf die Sprünge zu helfen?
Danke im Voraus! :grin:

David.

Verfasst: 10.10.2004 12:26
von derDavid
Ein bisschen weiter bin ich jetzt schon selber gekommen...

Der IFrame wird korrekt angezeigt, aber im IFrame steht eine irgendwie paradoxe Fehlermeldung:
Warning: date(): Windows does not support dates prior to midnight (00:00:00), January 1, 1970 in D:\Programme\xampp\htdocs\sentaforum\cal_lite.php on line 938

Warning: date(): Windows does not support dates prior to midnight (00:00:00), January 1, 1970 in D:\Programme\xampp\htdocs\sentaforum\cal_lite.php on line 939

Warning: date(): Windows does not support dates prior to midnight (00:00:00), January 1, 1970 in D:\Programme\xampp\htdocs\sentaforum\cal_lite.php on line 940
Und da drunter dann die normale Tabelle, wo dann die Events drinstehen.

Und beim Eintragen eines neuen Events erscheint - egal, was ich als Datum eingebe - "Mindestens ein Datum sind ungültig."

Meine cal_lite.php findet ihr unter http://sentaforum.davlam.de/files/cal_lite.txt .

Verfasst: 05.02.2005 17:02
von XtC
Hab da auch ein kleines Problem mit der Todays Events-MOD.
Folgendes:
Habe die 2 Dateien geuppt und wie in der Install beschrieben alles verändert, da ich aber die Termine im Portal angezeigt bekommen möchte hab ich halt dort den code der eigendlich für die index_body.tpl gedacht war dort eingefügt.
nur werden dort keine Termine angezeigt!??
Habe einen Testeintrag vorgenommen der wir im Kalender auch angezeigt aber leider nicht im Portal!
Jeder verstanden wie ich das meine??
Was muss ich da noch ändern?

MfG.: XtC

Verfasst: 05.02.2005 17:51
von XtC
Erledigt, habs gefunden!!

Code: Alles auswählen

Today's events 1.2 to Callite 1.4.4

Workin code changes.

#
#-----[ OPEN ]------------------------------------------
#

/includes/page_header.php

#
#-----[ FIND ]------------------------------------------
#

$l_online_users = sprintf($l_t_user_s, $total_online_users);
$l_online_users .= sprintf($l_r_user_s, $logged_visible_online);
$l_online_users .= sprintf($l_h_user_s, $logged_hidden_online);
$l_online_users .= sprintf($l_g_user_s, $guests_online);
}

#
#-----[ ADD, UNDERNEATH ]------------------------------------------
#

//
// Calculate What day it is, and set a link for the iframe
//
$d_var = date ("j");
$m_var = date ("m");
$y_var = date ("Y");
$day_events_link = "cal_lite.$phpEx?day=$d_var&month=$m_var&year=$y_var&mode=displaytoday";
$h_day_events_link = "cal_lite.$phpEx?day=$d_var&month=$m_var&year=$y_var&mode=display";


#
#-----[ FIND ]------------------------------------------
#
'T_SPAN_CLASS3' => $theme['span_class3'],

#
#-----[ ADD, UNDERNEATH ]------------------------------------------
#
'DAY_EVENTS_LINK' => $day_events_link,
'U_DAY_EVENTS_LINK' => $h_day_events_link,




#
#-----[ OPEN ]------------------------------------------
#
# repeat this step for each template you have installed on your board

inside templates/xxx/index_body.tpl:

#
#-----[ FIND ]------------------------------------------
#
# This is to have the "Today's Events" UNDER the "Who's Online?" box.

<table width="100%" cellpadding="1" cellspacing="1" border="0">
<td align="left" valign="top"><span class="gensmall">{L_ONLINE_EXPLAIN}</span></td>
</table>

#
#-----[ ADD, UNDERNEATH ]------------------------------------------
#
# Modify this code to fit your theme's overall style, if needed
# Also, if you would like to change how tall the box is, modify the height=175 part of the code.

<br />
<table width="100%" cellpadding="3" cellspacing="1" border="0" class="forumline">
<tr>
<td class="catHead" colspan="2" height="28"><span class="cattitle"><a href="{U_DAY_EVENTS_LINK}" class="cattitle">Today's Events</a></span></td>
</tr>
<tr>
<td>
<IFRAME name=dayevents src="{DAY_EVENTS_LINK}" width="100%" height=175 allowTransparency="true" style="background-color:transparent" frameborder=0></IFRAME>
</td>
</tr></table>




#
#-----[ OPEN ]------------------------------------------
#

cal_lite.php

#
#-----[ FIND ]------------------------------------------
#

elseif ($mode == 'display') { display(); }

#
#-----[ ADD, UNDERNEATH ]------------------------------------------
#

elseif ($mode == 'displaytoday') { displaytoday(); }

#
#-----[ FIND ]------------------------------------------
#
include ($phpbb_root_path . "includes/page_header.php");

#
#-----[ ADD, *ABOVE* ]------------------------------------------
#

if ($mode == 'displaytoday') {
$gen_simple_header = TRUE;
}

#
#-----[ FIND ]------------------------------------------
#

include_once($phpbb_root_path . 'includes/page_tail.php');

#
#-----[ REPLACE WITH ]------------------------------------------
#

if ($mode != 'displaytoday'){
include_once($phpbb_root_path . 'includes/page_tail.php');
}

#
#-----[ FIND ]------------------------------------------
#

'BUTTON_PREV' => $button_prev,
'BUTTON_NEXT' => $button_next,

'BUTTON_HOME' => $button_home,
'BUTTON_ADD' => $button_add,
'BUTTON_VAL' => $button_val)
);
$template->pparse('body');
return;
}

#
#-----[ ADD, UNDERNEATH ]------------------------------------------
#

function displaytoday()
{
global $thisscript, $phpbb_root_path, $phpEx, $action, $homeurl, $images, $phpbbheaders,
$id, $day, $month, $year, $userdata, $lang, $config_footer, $footer, $caluser,$cl_m,$cl_d,$cl_y,
$endday, $endmonth, $endyear, $board_config, $bbcode_uid, $template, $db, $cal_version;

$currentmonth = create_date("m", time(), $userdata['user_timezone']);

$template->set_filenames(array(
'body' => 'cal_day_events_lite_nh.tpl')
);

$lastseconds = mktime(0,0,0,$cl_m,$cl_d,$cl_y)-(24*60*60);
$lastday = date('j', $lastseconds);
$lastmonth = date('m', $lastseconds);
$lastyear = date('Y', $lastseconds);

$nextseconds = mktime(0,0,0,$cl_m,$cl_d,$cl_y)+(24*60*60);
$nextday = date('j', $nextseconds);
$nextmonth = date('m', $nextseconds);
$nextyear = date('Y', $nextseconds);
$sql = "SELECT * FROM ".CAL_TABLE." WHERE valid = 'yes' AND ";
if ($id) {
$sql .= "id = '$id'";
}
else {
$sql .= "eventspan >= '$cl_y-$cl_m-$cl_d 00:00:00' AND stamp <= '$cl_y-$cl_m-$cl_d 23:59:59' ORDER BY stamp";
}
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not select Event data', '', __LINE__, __FILE__, $sql);
}
$check=0;
while ($row = $db->sql_fetchrow($result))
{
$subject=stripslashes($row['subject']);
$zdesc=stripslashes($row['description']);
$bbcode_uid = $row['bbcode_uid'];
if( $board_config['allow_bbcode'] ) {
$zdesc = ( $board_config['allow_bbcode'] ) ? bbencode_second_pass($zdesc, $bbcode_uid) : preg_replace("/\:[0-9a-z\:]+\]/si", "]", $zdesc);
}
if ( $board_config['allow_smilies'] )
{
$zdesc = smilies_pass($zdesc);
}
// Delete icon
$today = strtotime(date("Y-m-d"));
$not_old_check = (strtotime($row['stamp']) < $today) ? 1 : 0;

if ((($caluser >=4) && ($userdata['user_id']==$row['user_id'])) || ($caluser >=5)) {
if (!$not_old_check) {
$edit_img = '<a href="'. $thisscript .'?action=Modify_marked&id='.$row['id'].'"><img src="' . $images['icon_edit'] . '" alt="' . $lang['Edit_delete_post'] . '" title="' . $lang['Edit_delete_post'] . '" border="0" /></a>';
}
$delpost_img = '<a href="' . $thisscript .'?action=Delete_marked&id='.$row['id'].'"><img src="' . $images['icon_delpost'] . '" alt="' . $lang['Delete_post'] . '" title="' . $lang['Delete_post'] . '" border="0" /></a>';
}
else {
$edit_img = '';
$delpost_img = '';
}

$zdesc = make_clickable($zdesc);
$start_date = mydateformat($row['stamp'], $userdata['user_dateformat']);
$end_date = mydateformat($row['eventspan'], $userdata['user_dateformat'], 1);

$template->assign_block_vars('event_row', array(
'SUBJECT' => $subject,
'DATE' => $start_date,
'END_DATE' => $end_date,
'AUTHOR' => stripslashes($row['username']),
'DESC' => $zdesc,
'BUTTON_DEL' => $delpost_img,
'BUTTON_MOD' => $edit_img)
);
$check++;
//echo $row['stamp']; exit;
}
if($check == 0)
{
$template->assign_block_vars('no_events', array(
'NO_EVENTS' => $lang["No events"])
);
}

$template->assign_vars(array(
'SUBJECT' => $lang['Subject'],
'DATE' => $lang['Date'],
'END_DATE' => $lang['End_day'],
'AUTHOR' => $lang['Author'])
);
$template->pparse('body');
return;
}


#
#-----[ SAVE ALL FILES, AND UPLOAD. ]------------------------------------------
#