bad code format in template.php, please help

bstrange - March 25, 2008 - 01:43

I think I screwed something up when trying to mod template.php to utilize advanced forums. After modifying template.php, any submitted content or action requiring a user or admin to hit the submit button caused the entire site to 'go white' displaying a blank white page. Hitting refresh would load the previous page.

my template.php has only the mod to allow advanced forums, and the fix for event calendar for IE. I have taken it down until I figure out where i mucked up the code, but if someone could take a look I'd be very appreciative. The template.php is as follows:

<?php
 
if (module_exists('advanced_forum')) {
   
$vars = advanced_forum_addvars($hook, $vars);
  }
?>

<?php
// $Id: template.php,v 1.4.2.1 2007/04/18 03:38:59 drumm Exp $


// ***** This is a custom function to reduce the size of the month block in order to fit in IE   ****

function MyDrupal_Impact_event_calendar_month($op, $header, $rows, $attributes = array(), $caption = NULL) {
  if (
$op == 'block') {
    foreach(
$header as $key => $values) { $header[$key]['data'] = substr($values['data'],0,1); }
   
$output = theme("table", $header, $rows, $attributes, $caption);
    return
'<div class="event-calendar"><div class="month-view">'. $output ."</div></div>\n";
  }
  else
  {
 
$output = theme("table", $header, $rows, $attributes, $caption);
    return
'<div class="event-calendar"><div class="month-view">'. $output ."</div></div>\n";
  }
}

?>

Ok so anyone see where I screwed it up?

Thanks in advance :)

=-=

VeryMisunderstood - March 25, 2008 - 01:45

try this

<?php
// $Id: template.php,v 1.4.2.1 2007/04/18 03:38:59 drumm Exp $

  if (module_exists('advanced_forum')) {
    $vars = advanced_forum_addvars($hook, $vars);
  }

// ***** This is a custom function to reduce the size of the month block in order to fit in IE   ****

function MyDrupal_Impact_event_calendar_month($op, $header, $rows, $attributes = array(), $caption = NULL) {
  if ($op == 'block') {
    foreach($header as $key => $values) { $header[$key]['data'] = substr($values['data'],0,1); }
    $output = theme("table", $header, $rows, $attributes, $caption);
    return '<div class="event-calendar"><div class="month-view">'. $output ."</div></div>\n";
  }
  else
  {
  $output = theme("table", $header, $rows, $attributes, $caption);
    return '<div class="event-calendar"><div class="month-view">'. $output ."</div></div>\n";
  }
}

_____________________________________________________________________
My posts & comments are usually dripping with sarcasm.
If you ask nicely I'll give you a towel : )

That fixed it :) Thanks

bstrange - March 25, 2008 - 02:08

That fixed it :)

Thanks

 
 

Drupal is a registered trademark of Dries Buytaert.