Events from Callite on EzPortal
Forumsregeln
Auch wenn hier der Support für phpBB 2 weiterhin aufrecht erhalten bleibt, weisen wir darauf hin, dass das phpBB 2 nicht mehr offiziell unterstützt und weiterentwickelt wird!
Auch wenn hier der Support für phpBB 2 weiterhin aufrecht erhalten bleibt, weisen wir darauf hin, dass das phpBB 2 nicht mehr offiziell unterstützt und weiterentwickelt wird!
Events from Callite on EzPortal
I apologize for asking this, as this may have been discussed already. But, I don't understand German and would appreciate any help you could give me.
Is there anyway to change the way the date is formated for this mod. My Callite has the correct format that I want (Sunday May 16, 2004 6:00 pm). However, the date shows up like this, 16.05.2004, with this mod.
Thank-you,
Michelle
Is there anyway to change the way the date is formated for this mod. My Callite has the correct format that I want (Sunday May 16, 2004 6:00 pm). However, the date shows up like this, 16.05.2004, with this mod.
Thank-you,
Michelle
- oxpus
- Administrator
- Beiträge: 28735
- Registriert: Mo 27.Jan, 2003 22:13
- Wohnort: Bad Wildungen
- Kontaktdaten:
Try this:
Code: Alles auswählen
#
#-----[ OPEN ]-----
#
portal.php
#
#-----[ FIND ]-----
#
$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);
#
#-----[ AFTER, ADD ]-----
#
$events_dateformat = ( !$userdata['user_dateformat'] ) ? $board_config['default_dateformat'] : $userdata['user_dateformat'];
$events_timezone = ( !$userdata['user_timezone'] ) ? $board_config['board_timezone'] : $userdata['user_timezone'];
$start_date = create_date($events_dateformat, $row['stamp'], events_timezone);
$end_date = create_date($events_dateformat, $row['eventspan'], events_timezone);
#
#-----[ SAVE/CLOSE ALL FILES ]-----
#
# EoMKarsten Ude
-={ Das Mädchen für alles }=-
Kein Support per Messenger, Email oder PN! Unaufgeforderte Nachrichten werden ignoriert!
No support per Messenger, Email or PM. Each unasked message will be ignored!
-={ Das Mädchen für alles }=-
Kein Support per Messenger, Email oder PN! Unaufgeforderte Nachrichten werden ignoriert!
No support per Messenger, Email or PM. Each unasked message will be ignored!
This is the code correct? I tried editing the part that I highlighted in red..However that did not do what I thought it would. Could you please advise as to which part of the code I should edit..I do know how to edit the code I just don't know which part..
Thank you,
Michelle
Thank you,
Michelle
//
// 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
{
$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"]));
}
}
}
- oxpus
- Administrator
- Beiträge: 28735
- Registriert: Mo 27.Jan, 2003 22:13
- Wohnort: Bad Wildungen
- Kontaktdaten:
Please use BBCode CODE or QUOTE to reduce the page length. Thanks.
And no, the variables you named will be used to query the database.
And no, the variables you named will be used to query the database.
Karsten Ude
-={ Das Mädchen für alles }=-
Kein Support per Messenger, Email oder PN! Unaufgeforderte Nachrichten werden ignoriert!
No support per Messenger, Email or PM. Each unasked message will be ignored!
-={ Das Mädchen für alles }=-
Kein Support per Messenger, Email oder PN! Unaufgeforderte Nachrichten werden ignoriert!
No support per Messenger, Email or PM. Each unasked message will be ignored!
- oxpus
- Administrator
- Beiträge: 28735
- Registriert: Mo 27.Jan, 2003 22:13
- Wohnort: Bad Wildungen
- Kontaktdaten:
I've change the code above. Try it again.
If this will not work for you, I'll test it today afternoon on my testboard...
If this will not work for you, I'll test it today afternoon on my testboard...
Karsten Ude
-={ Das Mädchen für alles }=-
Kein Support per Messenger, Email oder PN! Unaufgeforderte Nachrichten werden ignoriert!
No support per Messenger, Email or PM. Each unasked message will be ignored!
-={ Das Mädchen für alles }=-
Kein Support per Messenger, Email oder PN! Unaufgeforderte Nachrichten werden ignoriert!
No support per Messenger, Email or PM. Each unasked message will be ignored!
- oxpus
- Administrator
- Beiträge: 28735
- Registriert: Mo 27.Jan, 2003 22:13
- Wohnort: Bad Wildungen
- Kontaktdaten:
Last try, before I'll test it:
Find in portal.php
and replace this lines with
Find in portal.php
Code: Alles auswählen
$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);
$events_dateformat = ( !$userdata['user_dateformat'] ) ? $board_config['default_dateformat'] : $userdata['user_dateformat'];
$events_timezone = ( !$userdata['user_timezone'] ) ? $board_config['board_timezone'] : $userdata['user_timezone'];
$start_date = create_date($events_dateformat, $row['stamp'], events_timezone);
$end_date = create_date($events_dateformat, $row['eventspan'], events_timezone);Code: Alles auswählen
$start_date = mydateformat($row['stamp'], $userdata['user_dateformat']);
$end_date = mydateformat($row['eventspan'], $userdata['user_dateformat'], 1);Karsten Ude
-={ Das Mädchen für alles }=-
Kein Support per Messenger, Email oder PN! Unaufgeforderte Nachrichten werden ignoriert!
No support per Messenger, Email or PM. Each unasked message will be ignored!
-={ Das Mädchen für alles }=-
Kein Support per Messenger, Email oder PN! Unaufgeforderte Nachrichten werden ignoriert!
No support per Messenger, Email or PM. Each unasked message will be ignored!
- oxpus
- Administrator
- Beiträge: 28735
- Registriert: Mo 27.Jan, 2003 22:13
- Wohnort: Bad Wildungen
- Kontaktdaten:
Sorry, the function will be in calendar.php.
Delete the following code from calendar.php and insert this in includes/functions.php before "?>" (at the end):
Delete the following code from calendar.php and insert this in includes/functions.php before "?>" (at the end):
Code: Alles auswählen
function mydateformat($thisdate, $dateformat='d M Y G:i', $span=0)
{
global $cal_config;
if ($cal_config['cal_dateformat']) {
$dateformat = $cal_config['cal_dateformat'];
}
// date comes in as the following:
$myr = substr($thisdate, 0, 4);
$mym = substr($thisdate, 5, 2);
$myd = substr($thisdate, 8, 2);
$myh = substr($thisdate, 11, 2);
$myn = substr($thisdate, 14, 2);
$mys = substr($thisdate, 17, 2);
if ($span || ($myh=='00' && $myn=='00' && $mys=='00')) {
// Need to strip out any TIME references so...
$timerefs = array ('a','A','B','g','G','h','H','i','I','s');
while (list(,$val) = each ($timerefs))
{
$dateformat = ereg_replace($val, "", $dateformat);
}
// strip out any characters used for time
$dateformat = ereg_replace('[:]', " ", $dateformat);
}
$returndate = date($dateformat, mktime ($myh,$myn,$mys,$mym,$myd,$myr));
return $returndate;
}Karsten Ude
-={ Das Mädchen für alles }=-
Kein Support per Messenger, Email oder PN! Unaufgeforderte Nachrichten werden ignoriert!
No support per Messenger, Email or PM. Each unasked message will be ignored!
-={ Das Mädchen für alles }=-
Kein Support per Messenger, Email oder PN! Unaufgeforderte Nachrichten werden ignoriert!
No support per Messenger, Email or PM. Each unasked message will be ignored!