Here’s another hack, this time for #1. In modules/weblog/mod.weblog_calendar.php we need to make changes in a couple locations. First find:
$data[$d][] = array(
$TYPE->parse_type($row['title'], array('text_format' => 'lite', 'html_format' => 'none', 'auto_links' => 'n', 'allow_img_url' => 'no')),
$row['url_title'],
$entry_date,
$permalink,
$title_permalink,
$author,
$profile_path,
$id_path,
$base_fields,
$comment_tb_total,
$day_path
);
We’re going to add an array called $row to the bottom, like so:
$data[$d][] = array(
...(blah blah blah)...
$day_path,
$row
);
Don’t forget the comma after $day_path!
Next move way down toward the bottom, to the var_replace function. Look for:
$str = str_replace(
array(LD.'title'.RD,
LD.'url_title'.RD,
LD.'author'.RD,
LD.'comment_tb_total'.RD,
LD.'day_path'.RD),
array($val['0'],
$val['1'],
$val['5'],
$val['9'],
$val['10']),
$str);
This is where the variable replacement happens, swapping out, for example, {url_title} with the actual URL title. We need to add our desired variable names to the first array, and the values those variables should be replaced by to the second array. Easy enough, right? So it might look something like this:
$str = str_replace(
array(LD.'title'.RD,
LD.'url_title'.RD,
LD.'author'.RD,
LD.'comment_tb_total'.RD,
LD.'day_path'.RD,
LD.'mr_wilsons_variable'.RD,
LD.'lindas_variable'.RD,
LD.'seamus_variable'.RD),
array($val['0'],
$val['1'],
$val['5'],
$val['9'],
$val['10'],
$val['11']['avatar_filename'],
$val['11']['field_id_22'],
$val['11']['field_id_94']),
$str);
So {mr_wilsons_variable} will be replaced by the avatar file name associated with the author of the entry; {lindas_variable} will be replaced by whatever is in field_id_22; and {seamus_variable} will be replaced by whatever is in field_id_94. Easy, right?
How do you tell which field ID relates to which custom weblog field? The easiest way is probably to look at the URL for the appropriate custom field in the custom weblog field edit page in the control panel.
Granted, this isn’t the most elegant hack in the world, but it should be easy to move to the next version of EE (unless, of course, the EE crew has already added this feature to EE 1.5). It can be made cleaner, but that would require more explanation.