Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ticket/12488] Add user warning indication to viewtopic posts #2400

Merged
merged 4 commits into from
May 7, 2014
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion phpBB/styles/prosilver/template/viewtopic_body.html
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ <h2 class="poll-title">{POLL_QUESTION}</h2>
<!-- BEGIN postrow -->
<!-- EVENT viewtopic_body_postrow_post_before -->
<!-- IF postrow.S_FIRST_UNREAD --><a id="unread"></a><!-- ENDIF -->
<div id="p{postrow.POST_ID}" class="post <!-- IF postrow.S_ROW_COUNT is odd -->bg1<!-- ELSE -->bg2<!-- ENDIF --><!-- IF postrow.S_UNREAD_POST --> unreadpost<!-- ENDIF --><!-- IF postrow.S_POST_REPORTED --> reported<!-- ENDIF --><!-- IF postrow.S_POST_DELETED --> deleted<!-- ENDIF --><!-- IF postrow.S_ONLINE and not postrow.S_POST_HIDDEN --> online<!-- ENDIF -->">
<div id="p{postrow.POST_ID}" class="post <!-- IF postrow.S_ROW_COUNT is odd -->bg1<!-- ELSE -->bg2<!-- ENDIF --><!-- IF postrow.S_UNREAD_POST --> unreadpost<!-- ENDIF --><!-- IF postrow.S_POST_REPORTED --> reported<!-- ENDIF --><!-- IF postrow.S_POST_DELETED --> deleted<!-- ENDIF --><!-- IF postrow.S_ONLINE and not postrow.S_POST_HIDDEN --> online<!-- ENDIF --><!-- IF postrow.POSTER_WARNINGS --> warned<!-- ENDIF -->">
<div class="inner">

<dl class="postprofile" id="profile{postrow.POST_ID}"<!-- IF postrow.S_POST_HIDDEN --> style="display: none;"<!-- ENDIF -->>
Expand All @@ -129,6 +129,7 @@ <h2 class="poll-title">{POLL_QUESTION}</h2>

<!-- IF postrow.POSTER_POSTS != '' --><dd class="profile-posts"><strong>{L_POSTS}{L_COLON}</strong> {postrow.POSTER_POSTS}</dd><!-- ENDIF -->
<!-- IF postrow.POSTER_JOINED --><dd class="profile-joined"><strong>{L_JOINED}{L_COLON}</strong> {postrow.POSTER_JOINED}</dd><!-- ENDIF -->
<!-- IF postrow.POSTER_WARNINGS --><dd class="profile-warnings"><strong>{L_WARNINGS}{L_COLON}</strong> <em>{postrow.POSTER_WARNINGS}</em></dd><!-- ENDIF -->
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the value should not be wrapped by <em>


<!-- IF postrow.S_PROFILE_FIELD1 -->
<!-- Use a construct like this to include admin defined profile fields. Replace FIELD1 with the name of your field. -->
Expand Down
4 changes: 4 additions & 0 deletions phpBB/styles/prosilver/theme/colours.css
Original file line number Diff line number Diff line change
Expand Up @@ -660,6 +660,10 @@ fieldset.polls dd div {
background-image: url("./en/icon_user_online.gif");
}

dd.profile-warnings em {
color: #BC2A4D;
}

/*
--------------------------------------------------------------
Colours and backgrounds for buttons.css
Expand Down
5 changes: 5 additions & 0 deletions phpBB/styles/prosilver/theme/content.css
Original file line number Diff line number Diff line change
Expand Up @@ -731,6 +731,11 @@ fieldset.polls dd div {
height: auto !important;
}

dd.profile-warnings em {
font-style: normal;
font-weight: bold;
}

dd.profile-contact {
overflow: visible;
}
Expand Down
1 change: 1 addition & 0 deletions phpBB/styles/subsilver2/template/viewtopic_body.html
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ <h2><!-- EVENT viewtopic_topic_title_prepend --><a class="titles" href="{U_VIEW_
<span class="postdetails">
<!-- IF postrow.POSTER_JOINED --><br /><b>{L_JOINED}{L_COLON}</b> {postrow.POSTER_JOINED}<!-- ENDIF -->
<!-- IF postrow.POSTER_POSTS != '' --><br /><b>{L_POSTS}{L_COLON}</b> {postrow.POSTER_POSTS}<!-- ENDIF -->
<!-- IF postrow.POSTER_WARNINGS != '' --><br /><b>{L_WARNINGS}{L_COLON}</b> {postrow.POSTER_WARNINGS}<!-- ENDIF -->

<!-- IF postrow.S_PROFILE_FIELD1 -->
<!-- Use a construct like this to include admin defined profile fields. Replace FIELD1 with the name of your field. -->
Expand Down
2 changes: 1 addition & 1 deletion phpBB/viewtopic.php
Original file line number Diff line number Diff line change
Expand Up @@ -1641,7 +1641,7 @@
'POSTER_JOINED' => $user_cache[$poster_id]['joined'],
'POSTER_POSTS' => $user_cache[$poster_id]['posts'],
'POSTER_AVATAR' => $user_cache[$poster_id]['avatar'],
'POSTER_WARNINGS' => $user_cache[$poster_id]['warnings'],
'POSTER_WARNINGS' => ($auth->acl_get('m_warn') && $poster_id != ANONYMOUS) ? $user_cache[$poster_id]['warnings'] : '',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we should have both available in the template.
one based on permissions and the value without permissions.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove $poster_id != ANONYMOUS, add warnings value to user cache for anonymous user.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't know anonymous could get warnings

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, they can't. I'm solely talking about code organisation. See #2405

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh yes, sorry, I misunderstood

'POSTER_AGE' => $user_cache[$poster_id]['age'],

'POST_DATE' => $user->format_date($row['post_time'], false, ($view == 'print') ? true : false),
Expand Down