Comments re-enabled
I knew something was missing after the upgrade (besides the users since it's summer), but I couldn't quite tell what it was. This was it: the "add a comment" links were not there because comments were disabled on new posts. Looking back, they were disabled on a lot of old posts, too. I have enabled comments by default for new blog entries so this should not be a problem now.
Settings set in comment settings of admin/content/node-type/ for all the node types
- Default comment setting to Read/Write instead of Read Only.
- Comment Controls display above the blog instead of "do not display"
- Comment submission form display below post or comments instead of separate page
- Display order: oldest first.
I also discovered the comments queue in admin/content/comment and approved a few comments that had been waiting for several months.
Another change: In content/taxonomy, changed vocabulary name from "Forums" to "Tags" so it displays as "Tags" when it asks for terms, turned it on for all content types, and turned on Tags and Multiple Select. This might give us something akin to a tagging system. You can get a list of tags in use here, but you theoretically should be able to add new terms just by listing them when you start a new post:
http://segfault.cs.sonoma.edu/admin/content/taxonomy/1
I also enabled user signatures in admin/user/settings. You can probably configure them under "my account".
Edit: Events are fuuuuucked. Notes follow, will clear them up and work on it some more when I get home.
event module busted. Date entry form
• warning: checkdate() expects parameter 3 to be long, string given in /Volumes/UpperController/faculty/csclub/public_html/modules/event/event.module on line 1699.
• The specified date is invalid.
Preview shows:
Start: 2008-08-26 12:0
End: 2008-08-26 1:0
And this might be a problem:
print("DEBUG: Imploded start date is " . event_implode_date($node->event['start_exploded']);
DEBUG: Imploded start date is 2008-08-26 12:0:00
This is in event_explode_date and should solve problems on the
explode side:
$return['hour'] = str_pad($date['hour'], 2, '0', STR_PAD_LEFT);
$return['minute'] = str_pad($date['minute'], 2, '0', STR_PAD_LEFT);
$return['second'] = str_pad($date['second'], 2, '0', STR_PAD_LEFT);
However, that branch is not reached because the date_parse() function
does not exist.
After adding to second branch:
list($hr, $min, $sec) =explode(':', $time);
$hr = str_pad($hr, 2, '0', STR_PAD_LEFT);
$min = str_pad($min, 2, '0', STR_PAD_LEFT);
$sec = str_pad($sec, 2, '0', STR_PAD_LEFT);
$time ="$hr:$min:$sec";
Preview now shows:
Start: 2008-08-26 12:00
End: 2008-08-26 01:00
This is still incorrect. There is no AM or PM!
My own personal version of event_explode_date:
function event_explode_date($date) {
$return = array();
if (function_exists('date_parse')) {
$return = date_parse($date);
}
else {
list($date, $time) = explode(' ', $date);
// make it work for "time only" and "date only" values as well
if (!isset($time)) {
if (strpos($date, '-') ) {
$time = '00:00:00';
}
else {
$time = $date;
$date = '--';
}
}
print "
DEBUG: Date is $date, time is $time
";
list($year, $month, $day) = explode('-', $date);
$return['year'] = $year;
$return['month'] = $month;
$return['day'] = $day;
list($hour, $minute, $second) = explode(':', $time);
$return['hour']=$hour;
$return['minute']=$minute;
$return['second']=$second;
}
$return['month'] = str_pad($return['month'], 2, '0', STR_PAD_LEFT);
$return['day'] = str_pad($return['day'], 2, '0', STR_PAD_LEFT);
$return['hour'] = str_pad($return['hour'], 2, '0', STR_PAD_LEFT);
$return['minute'] = str_pad($return['minute'], 2, '0', STR_PAD_LEFT);
$return['second'] = str_pad($return['second'], 2, '0', STR_PAD_LEFT);
var_dump($return);
return $return;
}
That doesn't fix anything. Upon saving, it still farts out incorrect data
DEBUG: query is: INSERT INTO {event} (nid, event_start, event_end, timezone, start_in_dst, end_in_dst, has_time, has_end_date)
VALUES (175, '2008-08-26 24:0:00', '2008-08-26 24:0:00', 484, 0, 0, 1, 1)
It has absurdly wrong data for start_exploded and end_exploded.
Added these lines to case 'presave': to fix another bug (noon is PM).
if (variable_get('event_ampm', '0') == 1) {
if ($node->event['start_exploded']['ampm'] == 'pm') {
+ if($node->event['start_exploded']['hour'] != 12){
$node->event['start_exploded']['hour'] += 12;
+ }
}
if ($node->event['end_exploded']['ampm'] == 'pm') {
+ if($node->event['end_exploded']['hour'] != 12){
$node->event['end_exploded']['hour'] += 12;
+ }
}
}
Fixed event_implode_date to return padded values. This was probably breaking MySQL.
function event_implode_date($date) {
if (!isset($date['second'])) {
$date['second'] = '00';
}
return $date['year'] .'-' . str_pad($date['month'], 2, '0', STR_PAD_LEFT) .'-'
. str_pad($date['day'], 2, '0', STR_PAD_LEFT) .' '
. str_pad($date['hour'], 2, '0', STR_PAD_LEFT) .':'
. str_pad($date['minute'], 2, '0', STR_PAD_LEFT) .':'
. str_pad($date['second'], 2, '0', STR_PAD_LEFT) ;
}
DEBUG: Query is: INSERT INTO {event} (nid, event_start, event_end, timezone, start_in_dst, end_in_dst, has_time, has_end_date) VALUES (175, '2008-08-26 12:00:00', '2008-08-26 12:00:00', 484, 0, 0, 1, 1)
event_is_later is probably resetting the 1:00 pm to 12:00 pm because the am/pm was lost somewhere beforehand. Need to look into that. AM/PM still not appearing in preview.
Additional notes, I'll edit them down later:
Odd: ['start_exploded']['ampm'] disappears by the time
event_is_later() is called.
Maybe caused by variable_get('event_ampm', '0') == 1
being later in presave. Moved it earlier and trying again.
The query finally ran correctly and the time displays,
but the times in preview were still messed up.


Post new comment