Flatform doesn't work

somatics - May 25, 2006 - 06:18

I know people have posted this before, but I can't solve this problem based on the posts I've seen:

I have installed flatforum on my Drupal 4.7 Installation, using the Sharepoint-like Theme, which supposedly uses PHPTemplate. I've put the styles from flatforum at the end of the styles.css file in the Sharepoint-like Theme folder, added the node-forum.tpl.php to the Sharepoint-like Theme folder, and added the contents of template.php from flatforum to the template.php file in the Sharepoint-like Theme folder, and enabled the flatforum module on the modules admin page.

However, the Forum doesn't change it's look, and the source for the forum page doesn't seem to contain any of the css ids or classes added to the style.css file from the flatforum stylesheet.

What do I do?

Here are the contents of the template.php file now:

<?php
function sharepoint_like_regions() {
  return array(
      
'left' => t('left sidebar'),
      
'content' => t('content'),
      
'header' => t('header'),
      
'footer' => t('footer')
  );
}
function
phptemplate_menu_tree($pid = 1) {
  if (
$tree = menu_tree($pid)) {
   
$output .= "\n<ul>\n";
    if (
function_exists('base_path')) {
     
$base_path = base_path();
    }
   
$url = $base_path;   
    if (
$pid == 1) {
     
$output .= "<li><a href=\"" . $url . "\">home</a></li>";
    };
   
$output .= $tree;
   
$output .= "\n</ul>\n";
    return
$output;
  }
}
function
phptemplate_menu_item($mid, $children = '', $leaf = TRUE) {
 
//return '<li class="'. ($leaf ? 'leaf' : ($children ? 'expanded' : 'collapsed')) .'">'. menu_item_link($mid) . $children ."</li>\n";
 
return '<li>'. menu_item_link($mid) . $children ."</li>\n";
}
?>

<?php
// $Id: template.php,v 1.7 2006/05/11 18:17:29 ayman Exp $

function _phptemplate_variables($hook, $vars) {
static $is_forum;
$variables = array();
if (!isset($is_forum)) {
if (arg(0) == 'node' && is_numeric(arg(1)) && arg(2) == '') {
$nid = arg(1);
}
if (arg(0) == 'comment' && arg(1) == 'reply' && is_numeric(arg(2))) {
$nid = arg(2);
}
if ($nid) {
$node = node_load(array('nid' => $nid));
}
$is_forum = ($node && $node->type == 'forum');
_is_forum($is_forum);
}
if ($is_forum) {
switch ($hook) {
case 'comment' :
$variables['template_file'] = 'node-forum';
$variables['row_class'] = _row_class();
$variables['name'] = $vars['author'];
$variables['userid'] = $vars['comment']->uid;
$joined = module_invoke('flatforum', 'get_created', $vars['comment']->uid);
$variables['joined'] = $joined ? format_date($joined, 'custom', 'Y-m-d') : '';
$posts = module_invoke('flatforum', 'get', $vars['comment']->uid);
$variables['posts'] = $posts ? $posts : 0;
$variables['submitted'] = format_date($vars['comment']->timestamp);
$subject = $vars['comment']->subject;
$variables['title'] = empty($subject) ? '&nbsp' : $subject;
$variables['content'] = $vars['comment']->comment;
$variables['links'] = empty($vars['links']) ? '&nbsp' : $vars['links'];
break;
case 'node' :
$variables['row_class'] = _row_class();
$variables['userid']=$vars['node']->uid;
$joined = module_invoke('flatforum', 'get_created', $vars['node']->uid);
$variables['joined'] = $joined ? format_date($joined, 'custom', 'Y-m-d') : '';
$posts = module_invoke('flatforum', 'get', $vars['node']->uid);
$variables['posts'] = $posts ? $posts : 0;
$variables['title'] = empty($vars['title']) ? '&nbsp' : $vars['title'];
$variables['content'] = $vars['node']->body;
$variables['links'] = empty($vars['links']) ? '&nbsp' : $vars['links'];
break;
}
}
return $variables;
}
function _row_class() {
static $forum_row = TRUE;
$forum_row = !$forum_row;
return $forum_row ? 'odd' : 'even';
}
function _is_forum($arg = NULL) {
static $is_forum = FALSE;
if ($arg) {
$is_forum = $arg;
}
return $is_forum;
}

 
 

Drupal is a registered trademark of Dries Buytaert.