Goofy Forum UI

mrbucket - September 26, 2005 - 19:36
Project:Goofy
Version:6.x-2.x-dev
Component:User interface
Category:feature request
Priority:normal
Assigned:Unassigned
Status:closed
Description

I am involved with a podcast that is looking to deploy Drupal and we are all amazed with the goofy theme. The only thing lacking is the forum. We don't really like the non-traditional layout of the forum. It is a critical part of our podcast community and the only thing preventing us from using the goofy theme. Does anyone have a solution for this? Has anyone changed it to a more traditional layout (with the goofy look... to match the site). Any help or sugguestions would be greatly appreciated.

Jay

#1

Mad Maks - January 2, 2007 - 10:47
Version:4.5.x-1.x-dev» 4.7.x-1.x-dev

I have add these code to goofy.theme:

function goofy_forum_list($forums, $parents, $tid) {
  global $user;
  $img_path = base_path() . path_to_theme() .'/images/';
 
  if ($forums) {

    $header = array(t('Forum'), t('Topics'), t('Posts'), t('Last post'));

    foreach ($forums as $forum) {
      if ($forum->container) {
        $description  = '<div style="margin-left: '. ($forum->depth * 30) ."px;\">\n";
        $description .= ' <div class="name">'. l($forum->name, "forum/$forum->tid") ."</div>\n";

        if ($forum->description) {
          $description .= ' <div class="description">'. filter_xss_admin($forum->description) ."</div>\n";
        }
        $description .= "</div>\n";

        $rows[] = array(array('data' => $description, 'class' => 'container', 'colspan' => '4'));
      }
      else {
        $new_topics = _forum_topics_unread($forum->tid, $user->uid);
        $forum->old_topics = $forum->num_topics - $new_topics;
        if (!$user->uid) {
          $new_topics = 0;
        }

        $description  = '<div style="margin-left: '. ($forum->depth * 30) ."px;\">\n";
        $description .= ' <div class="name">'. l($forum->name, "forum/$forum->tid") ."</div>\n";

        if ($forum->description) {
          $description .= ' <div class="description">'. filter_xss_admin($forum->description) ."</div>\n";
        }
        $description .= "</div>\n";

        $rows[] = array(
          array('data' => $description, 'class' => 'forum'),
          array('data' => $forum->num_topics . ($new_topics ? '<br />'. l(format_plural($new_topics, '1 new', '%count new'), "forum/$forum->tid", NULL, NULL, 'new') : ''), 'class' => 'topics'),
          array('data' => $forum->num_posts, 'class' => 'posts'),
          array('data' => _forum_format($forum->last_post), 'class' => 'last-reply'));
      }
    }
   
    $body .= "<div\"> " . theme('table', $header, $rows) . " </div>";

    return '
<table border="0" cellspacing="0" cellpadding="0" style="width: 100%;" class="goofy_forum">
<tr>
  <td><img src="'. $img_path .'or-ul.png" alt="" style="display: block;" /></td>
  <td class="oru" style="width: 100%;"><img src="'. $img_path .'null.gif" alt="" /></td>
  <td><img src="'. $img_path .'or-ur.png" alt="" style="display: block;" /></td>
</tr>
<tr>
  <td class="orl"><img src="'. $img_path .'null.gif" alt="" /></td>
  <td class="orcnt" style="width: 100%; vertical-align: top;">'. Forums .'</td>
  <td class="orr"><img src="'. $img_path .'null.gif" alt="" /></td>
</tr>
<tr>
  <td class="orl"><img src="'. $img_path .'null.gif" alt="" /></td>
  <td class="orcnt" style="width: 100%;"><img src="'. $img_path .'null.gif" height="5" alt="" /></td>
  <td class="orr"><img src="'. $img_path .'null.gif" alt="" /></td>
</tr>
<tr>
  <td class="lgl"><img src="'. $img_path .'null.gif" alt="" /></td>
  <td class="lgcnt" style="width: 100%;"><img src="'. $img_path .'null.gif" height="4" alt="" /></td>
  <td class="lgr"><img src="'. $img_path .'null.gif" alt="" /></td>
</tr>
<tr>
  <td class="lgl"><img src="'. $img_path .'null.gif" alt="" /></td>
  <td class="lgcnt" style="width: 100%;">'. $body .'</td>
  <td class="lgr"><img src="'. $img_path .'null.gif" alt="" /></td>
</tr>
<tr>
  <td><img src="'. $img_path .'lg-dl.png" alt="" style="display: block;" /></td>
  <td class="lgd" style="width: 100%;"><img src="'. $img_path .'null.gif" width="150" height="1" alt="" /></td>
  <td><img src="'. $img_path .'lg-dr.png" alt="" style="display: block;" /></td>
</tr>
</table>
<br />
';

  }

}

function goofy_forum_topic_list($tid, $topics, $sortby, $forum_per_page) {
  global $forum_topic_list_header;
  $img_path = base_path() . path_to_theme() .'/images/';
  if ($topics) {

    foreach ($topics as $topic) {
      // folder is new if topic is new or there are new comments since last visit
      if ($topic->tid != $tid) {
        $rows[] = array(
          array('data' => theme('forum_icon', $topic->new, $topic->num_comments, $topic->comment_mode, $topic->sticky), 'class' => 'icon'),
          array('data' => check_plain($topic->title), 'class' => 'title'),
          array('data' => l(t('This topic has been moved'), "forum/$topic->tid"), 'colspan' => '3')
        );
      }
      else {
        $rows[] = array(
          array('data' => theme('forum_icon', $topic->new, $topic->num_comments, $topic->comment_mode, $topic->sticky), 'class' => 'icon'),
          array('data' => l($topic->title, "node/$topic->nid"), 'class' => 'topic'),
          array('data' => $topic->num_comments . ($topic->new_replies ? '<br />'. l(format_plural($topic->new_replies, '1 new', '%count new'), "node/$topic->nid", NULL, NULL, 'new') : ''), 'class' => 'replies'),
          array('data' => _forum_format($topic), 'class' => 'created'),
          array('data' => _forum_format($topic->last_reply), 'class' => 'last-reply')
        );
      }
    }
  }


  $body .= "<div\"> " . theme('table', $forum_topic_list_header, $rows) . " </div>";

  return '
<table border="0" cellspacing="0" cellpadding="0" style="width: 100%;" class="goofy_forum_topic">
<tr>
  <td><img src="'. $img_path .'or-ul.png" alt="" style="display: block;" /></td>
  <td class="oru" style="width: 100%;"><img src="'. $img_path .'null.gif" alt="" /></td>
  <td><img src="'. $img_path .'or-ur.png" alt="" style="display: block;" /></td>
</tr>
<tr>
  <td class="orl"><img src="'. $img_path .'null.gif" alt="" /></td>
  <td class="orcnt" style="width: 100%; vertical-align: top;">'. Topics .'</td>
  <td class="orr"><img src="'. $img_path .'null.gif" alt="" /></td>
</tr>
<tr>
  <td class="orl"><img src="'. $img_path .'null.gif" alt="" /></td>
  <td class="orcnt" style="width: 100%;"><img src="'. $img_path .'null.gif" height="5" alt="" /></td>
  <td class="orr"><img src="'. $img_path .'null.gif" alt="" /></td>
</tr>
<tr>
  <td class="lgl"><img src="'. $img_path .'null.gif" alt="" /></td>
  <td class="lgcnt" style="width: 100%;"><img src="'. $img_path .'null.gif" height="4" alt="" /></td>
  <td class="lgr"><img src="'. $img_path .'null.gif" alt="" /></td>
</tr>
<tr>
  <td class="lgl"><img src="'. $img_path .'null.gif" alt="" /></td>
  <td class="lgcnt" style="width: 100%;">'. $body .'</td>
  <td class="lgr"><img src="'. $img_path .'null.gif" alt="" /></td>
</tr>
<tr>
  <td><img src="'. $img_path .'lg-dl.png" alt="" style="display: block;" /></td>
  <td class="lgd" style="width: 100%;"><img src="'. $img_path .'null.gif" width="150" height="1" alt="" /></td>
  <td><img src="'. $img_path .'lg-dr.png" alt="" style="display: block;" /></td>
</tr>
</table>
<br />
';
}

#2

fgm - November 26, 2008 - 21:40
Version:4.7.x-1.x-dev» 6.x-2.x-dev
Priority:critical» normal
Status:active» needs review

A derivative of your patch has been incorporated in the 6.2 branch in today's version. Please review so we can know whether it can be kept in the upcoming production version.

#3

fgm - December 6, 2008 - 23:05
Status:needs review» fixed

No comment after over one week. No new error found. Assuming fixed.

#4

System Message - December 20, 2008 - 23:11
Status:fixed» closed

Automatically closed -- issue fixed for two weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.