Miss T
11-15-2012, 04:38 AM
I have this calendar widget - i love it... BUT i need a little adjustment and i am no programmer
i cannot wright code and dont know what to change so it works the way i want it
right now the code shows all the events after the current day.. i want it to show the events that happens TODAY also - i dont want it to delete an event from overview at 00.01 on the day it occurs...
i dont want it to disappear before 23.59 on the day it has happened - it must show all day
and second: if i have a ranged event it shows wrong :( - this output makes no sense whn you see it in the overwiew
$format = sprintf("Fra d. %s til d. %s",date('d-m-Y',$event['dateline_from']),date('d-m-Y',$event['dateline_to']
I would very much like the ranged event to show like:
"From 14:00 to 20.00 on the 22.03.2013" if you understand... so that i show the events timeframe and date....
or:
"From 14:00 on the 22.04.2013 to 15.04.2013 on the 23.04.2013" it it is a 2 day event.... if that is to complex never mind... the solution above is fine - i hardly ever have 2 day events anyway...
Right now it shows the date twice and just looks wrong...
please help
heres the intire code... - i know the really cool coders in here will have no problem looking at this and point exactly to what i need changed... god i wish i had a flair for this
ob_start();
// %d
$show_count = 7;
$query = sprintf("SELECT * FROM ".TABLE_PREFIX."event WHERE visible = 1 AND (dateline_from >= '%d' || ( dateline_from > '%d' AND dateline_to < '%d' )) ORDER BY dateline_from ASC LIMIT %d",TIMENOW,TIMENOW,TIMENOW,$show_count);
$event_get = vB::$db->query_read($query);
$output_bits = '';
while($event = vB::$db->fetch_array($event_get)) {
if($event['dateline_to'] == 0 )
{
$format = sprintf("d. %s",date('d-m-Y',$event['dateline_from']));
} else {
$format = sprintf("Fra d. %s til d. %s",date('d-m-Y',$event['dateline_from']),date('d-m-Y',$event['dateline_to']));
}
$output_bits .= sprintf('
<div style="height:20px;" class = "cms_widget_post_bit"><h4 class="cms_widget_post_header"><a href="calendar.php?do=getinfo&e=%d">%s</a>
(%s)</h4>
</div>
',$event['eventid'],$event['title'],$format);
}
if ($output_bits == "")
{
$output = "Ingen fremtidige events";
}
else
{
$output = $output_bits;
}
ob_end_clean();
please help a girl in distress :)
Thansk
Miss T
i cannot wright code and dont know what to change so it works the way i want it
right now the code shows all the events after the current day.. i want it to show the events that happens TODAY also - i dont want it to delete an event from overview at 00.01 on the day it occurs...
i dont want it to disappear before 23.59 on the day it has happened - it must show all day
and second: if i have a ranged event it shows wrong :( - this output makes no sense whn you see it in the overwiew
$format = sprintf("Fra d. %s til d. %s",date('d-m-Y',$event['dateline_from']),date('d-m-Y',$event['dateline_to']
I would very much like the ranged event to show like:
"From 14:00 to 20.00 on the 22.03.2013" if you understand... so that i show the events timeframe and date....
or:
"From 14:00 on the 22.04.2013 to 15.04.2013 on the 23.04.2013" it it is a 2 day event.... if that is to complex never mind... the solution above is fine - i hardly ever have 2 day events anyway...
Right now it shows the date twice and just looks wrong...
please help
heres the intire code... - i know the really cool coders in here will have no problem looking at this and point exactly to what i need changed... god i wish i had a flair for this
ob_start();
// %d
$show_count = 7;
$query = sprintf("SELECT * FROM ".TABLE_PREFIX."event WHERE visible = 1 AND (dateline_from >= '%d' || ( dateline_from > '%d' AND dateline_to < '%d' )) ORDER BY dateline_from ASC LIMIT %d",TIMENOW,TIMENOW,TIMENOW,$show_count);
$event_get = vB::$db->query_read($query);
$output_bits = '';
while($event = vB::$db->fetch_array($event_get)) {
if($event['dateline_to'] == 0 )
{
$format = sprintf("d. %s",date('d-m-Y',$event['dateline_from']));
} else {
$format = sprintf("Fra d. %s til d. %s",date('d-m-Y',$event['dateline_from']),date('d-m-Y',$event['dateline_to']));
}
$output_bits .= sprintf('
<div style="height:20px;" class = "cms_widget_post_bit"><h4 class="cms_widget_post_header"><a href="calendar.php?do=getinfo&e=%d">%s</a>
(%s)</h4>
</div>
',$event['eventid'],$event['title'],$format);
}
if ($output_bits == "")
{
$output = "Ingen fremtidige events";
}
else
{
$output = $output_bits;
}
ob_end_clean();
please help a girl in distress :)
Thansk
Miss T