diff --git a/modules/forum/comment--forum.tpl.php b/modules/forum/comment--forum.tpl.php new file mode 100644 index 0000000..ddc114b --- /dev/null +++ b/modules/forum/comment--forum.tpl.php @@ -0,0 +1,89 @@ +created variable. + * - $changed: Formatted date and time for when the comment was last changed. + * Preprocess functions can reformat it by calling format_date() with the + * desired parameters on the $comment->changed variable. + * - $new: New comment marker. + * - $permalink: Comment permalink. + * - $submitted: Submission information created from $author and $created during + * template_preprocess_comment(). + * - $picture: Authors picture. + * - $signature: Authors signature. + * - $status: Comment status. Possible values are: + * comment-unpublished, comment-published or comment-preview. + * - $title: Linked title. + * - $classes: String of classes that can be used to style contextually through + * CSS. It can be manipulated through the variable $classes_array from + * preprocess functions. The default values can be one or more of the following: + * - comment: The current template type, i.e., "theming hook". + * - comment-by-anonymous: Comment by an unregistered user. + * - comment-by-node-author: Comment by the author of the parent node. + * - comment-preview: When previewing a new or edited comment. + * The following applies only to viewers who are registered users: + * - comment-unpublished: An unpublished comment visible only to administrators. + * - comment-by-viewer: Comment by the user currently viewing the page. + * - comment-new: New comment since last the visit. + * - $title_prefix (array): An array containing additional output populated by + * modules, intended to be displayed in front of the main title tag that + * appears in the template. + * - $title_suffix (array): An array containing additional output populated by + * modules, intended to be displayed after the main title tag that appears in + * the template. + * + * These two variables are provided for context: + * - $comment: Full comment object. + * - $node: Node object the comments are attached to. + * + * Other variables: + * - $classes_array: Array of html class attribute values. It is flattened + * into a string within the variable $classes. + * + * @see template_preprocess() + * @see template_preprocess_comment() + * @see template_process() + * @see theme_comment() + */ +?> +
> + +
+ + + + + +
+ +
+ + +
+ +
> + + +
+ +
+ +
+ + +
diff --git a/modules/forum/forum.css b/modules/forum/forum.css index 4a67c8b..b5e59df 100644 --- a/modules/forum/forum.css +++ b/modules/forum/forum.css @@ -48,3 +48,14 @@ #forum .icon .topic-status-closed { background-position: -120px 0; } + +/* ---------- Nodes and comments ----------- */ + +.node-type-forum .author-info { + float: left; + padding-right: 10px; +} +.node-type-forum .node .content { + overflow: hidden; +} + diff --git a/modules/forum/forum.module b/modules/forum/forum.module index dd6c6de..4980037 100644 --- a/modules/forum/forum.module +++ b/modules/forum/forum.module @@ -80,6 +80,14 @@ function forum_theme() { 'render element' => 'form', 'file' => 'forum.admin.inc', ), + 'node__forum' => array( + 'template' => 'node--forum', + 'variables' => array(), + ), + 'comment__forum' => array( + 'template' => 'comment--forum', + 'variables' => array(), + ), ); } @@ -1186,6 +1194,20 @@ function template_preprocess_forum_icon(&$variables) { } /** + * Process variables to format forum topic nodes. + */ +function forum_preprocess_node(&$variables) { + $variables['theme_hook_suggestions'][] = 'node__' . $variables['node']->type; +} + +/** + * Process variables to format comments. + */ +function forum_preprocess_comment(&$variables) { + $variables['theme_hook_suggestions'][] = 'comment__' . $variables['node']->type; +} + +/** * Process variables to format submission info for display in the forum list and topic list. * * $variables will contain: $topic diff --git a/modules/forum/node--forum.tpl.php b/modules/forum/node--forum.tpl.php new file mode 100644 index 0000000..a151421 --- /dev/null +++ b/modules/forum/node--forum.tpl.php @@ -0,0 +1,116 @@ +body becomes $body. When needing to access + * a field's raw values, developers/themers are strongly encouraged to use these + * variables. Otherwise they will have to explicitly specify the desired field + * language, e.g. $node->body['en'], thus overriding any language negotiation + * rule that was previously applied. + * + * @see template_preprocess() + * @see template_preprocess_node() + * @see template_process() + */ +?> +
> + + + + > + + + +
+ + + + +
+ + +
+ +
> + +
+ + +
+ + + +