Permalink
Browse files

fix forum post author name issue and add icon to moderator posts

  • Loading branch information...
1 parent e6392b1 commit 2870c5ff90f4d49ba2910181c578e9331abc542e @benjamin-dk benjamin-dk committed Mar 11, 2012
View
17 sites/all/themes/tuba/template.php
@@ -9,12 +9,25 @@ function tuba_advanced_forum_simple_author_pane(&$variables) {
$context = $variables['context'];
// Sending the context rather than the account makes it work for anon comments.
$name = theme('username', array('account' => $context));
+ $usertype = "anonymous";
+
+ //add "moderator"-label if the user is not anonymous
+ if ($context->uid > 0) {
+ $name = "Moderator: ".$name;
+ $usertype = "moderator";
+ }
+ else if (isset($variables['context']->field_name['und']['0']['safe_value'])) {
+ $name = $variables['context']->field_name['und']['0']['safe_value'];
+ }
+ else {
+ $name = "Anonym";
+ }
- $account = user_load($context->uid);
+ //$account = user_load($context->uid);
//$picture = theme('user_picture', array('account' => $account));
//return '<div class="author-pane">' . $name . $picture . '</div>';
- return '<div class="author-pane">' . $name . '</div>';
+ return '<div class="author-pane '.$usertype.'">' . $name . '</div>';
}
/* TUBA modification: Theming the breadcrumb*/
View
4 sites/all/themes/tuba/tuba_adv_forum/advanced-forum.tuba_adv_forum.structure.css
@@ -158,6 +158,10 @@ table.forum-table-topics tr {
float: right;
}
+.author-pane.moderator {
+ background: url("../images/assets/tuba_star.png") no-repeat scroll 0 0 transparent;
+ padding-left: 25px;
+}
.forum-post-content {
background: none repeat scroll 0 0 #F3F3F3;
padding: 15px 20px 30px;

0 comments on commit 2870c5f

Please sign in to comment.