Background color posts for admins

Discuss phpBB 3.0.x in general.
Forum rules
Please post any phpBB 3.1.x related topics in the phpBB 3.1.x discussion forum.
Post Reply
ert4
New member
New member
Posts: 7
Joined: 04 Aug 2015, 16:23

Background color posts for admins

Post by ert4 »

Hi,

How Can I change background color posts for only admins?
example: https://www.phpbb.com/customise/db/down ... ?mode=view (3 post)

Thanks.
User avatar
Sniper_E
MOD Team
MOD Team
Posts: 591
Joined: 13 Jun 2011, 16:53
Location: Shreveport, LA
Contact:

Re: Background color posts for admins

Post by Sniper_E »

There are a few ways. One simple way would be doing a template edit using the RANK_TITLE...

Open prosilver/template/viewtopic_body.html
Find Inline (around line 128)

Code: Select all

<!-- IF postrow.S_ROW_COUNT is odd -->bg1<!-- ELSE -->bg2<!-- ENDIF -->
After Inline Add

Code: Select all

<!-- IF postrow.RANK_TITLE == "Site Admin" --> admin<!-- ENDIF -->
Assuming your administrator RANK_TITLE is Site Admin.

Open prosilver/theme/colours.css
Find

Code: Select all

.copyright {
Before Add

Code: Select all

.admin {
	background-color: #EAEADB;
}
Replace with the color you want the post to be there. #EAEADB

Refresh templates and theme.
No is NEVER an Option and NEVER is the only Option when it comes to Giving Up!
ert4
New member
New member
Posts: 7
Joined: 04 Aug 2015, 16:23

Re: Background color posts for admins

Post by ert4 »

Ok, thanks.
I have style subSilver2?
Oyabun1
New member
New member
Posts: 34
Joined: 16 Sep 2009, 08:16

Re: Background color posts for admins

Post by Oyabun1 »

First result in a search points to a MOD.
background_colour.png
ert4
New member
New member
Posts: 7
Joined: 04 Aug 2015, 16:23

Re: Background color posts for admins

Post by ert4 »

I have code in styles art mobile green:

Code: Select all

<!-- BEGIN postrow -->
	<!-- IF postrow.S_FIRST_UNREAD --><a id="unread"></a><!-- ENDIF -->
	<div id="p{postrow.POST_ID}" class="block post<!-- IF postrow.S_UNREAD_POST --> unreadpost<!-- ENDIF --><!-- IF postrow.S_ONLINE and not postrow.S_IGNORE_POST --> online<!-- ENDIF -->">
        <div class="post-header">
            <!-- IF not S_IS_BOT -->
                <!-- IF postrow.U_EDIT or postrow.U_DELETE or postrow.U_REPORT or postrow.U_WARN or postrow.U_INFO or postrow.U_QUOTE -->
                    <div class="post-author gradient link settings">
                        <a href="javascript:void(0);"> </a>
                        <ul class="sub">
                            <!-- IF postrow.U_EDIT --><li><a href="{postrow.U_EDIT}">{L_EDIT_POST}</a></li><!-- ENDIF -->
                            <!-- IF postrow.U_DELETE --><li><a href="{postrow.U_DELETE}">{L_DELETE_POST}</a></li><!-- ENDIF -->
                            <!-- IF postrow.U_REPORT --><li><a href="{postrow.U_REPORT}">{L_REPORT_POST}</a></li><!-- ENDIF -->
                            <!-- IF postrow.U_WARN --><li><a href="{postrow.U_WARN}">{L_WARN_USER}</a></li><!-- ENDIF -->
                            <!-- IF postrow.U_INFO --><li><a href="{postrow.U_INFO}">{L_INFORMATION}</a></li><!-- ENDIF -->
                            <!-- IF postrow.U_QUOTE --><li><a href="{postrow.U_QUOTE}">{L_REPLY_WITH_QUOTE}</a></li><!-- ENDIF -->
                        </ul>
                    </div>
                <!-- ENDIF -->
            <!-- ENDIF -->
            <!-- IF postrow.U_POST_AUTHOR -->
                <div class="post-author gradient link">
                    <a href="{postrow.U_POST_AUTHOR}">{postrow.POST_AUTHOR}</a>
                    <ul class="sub">
                        <li><a href="{postrow.U_POST_AUTHOR}">{postrow.POST_AUTHOR}</a></li>
                		<!-- IF postrow.POSTER_POSTS != '' --><li><span>{L_POSTS}: {postrow.POSTER_POSTS}</span></li><!-- ENDIF -->
                		<!-- IF postrow.POSTER_JOINED --><li><span>{L_JOINED}: {postrow.POSTER_JOINED}</span></li><!-- ENDIF -->
                        <!-- IF postrow.POSTER_FROM --><li><span>{L_LOCATION}: {postrow.POSTER_FROM}</span></li><!-- ENDIF -->
                        <!-- IF postrow.S_PROFILE_FIELD1 -->
                            <li><span>{postrow.PROFILE_FIELD1_NAME}: {postrow.PROFILE_FIELD1_VALUE}</span></li>
                        <!-- ENDIF -->
                        <!-- BEGIN custom_fields -->
                            <li><span>{postrow.custom_fields.PROFILE_FIELD_NAME}: {postrow.custom_fields.PROFILE_FIELD_VALUE}</span></li>
                        <!-- END custom_fields -->
                		<!-- IF not S_IS_BOT -->
        					<!-- IF postrow.U_PM --><li><a href="{postrow.U_PM}">{L_PRIVATE_MESSAGE}</a></li><!-- ENDIF -->
        					<!-- IF postrow.U_EMAIL --><li><a href="{postrow.U_EMAIL}">{L_SEND_EMAIL_USER} {postrow.POST_AUTHOR}</a></li><!-- ENDIF -->
        					<!-- IF postrow.U_WWW --><li><a href="{postrow.U_WWW}">{L_WEBSITE}</a></li><!-- ENDIF -->
                		<!-- ENDIF -->

                    </ul>
                </div>
            <!-- ENDIF -->
            <h2>{postrow.POST_SUBJECT}</h2>
        </div>
        <p class="post-time">{postrow.POST_DATE}</p>

		<div class="postbody">
			<!-- IF postrow.S_IGNORE_POST -->
				<div class="block rules">{postrow.L_IGNORE_POST}</div>
			<!-- ELSE -->

			<!-- IF postrow.S_POST_UNAPPROVED or postrow.S_POST_REPORTED -->
				<p class="block rules">
					<!-- IF postrow.S_POST_UNAPPROVED --><a href="{postrow.U_MCP_APPROVE}">{L_POST_UNAPPROVED}</a><br /><!-- ENDIF -->
					<!-- IF postrow.S_POST_REPORTED --><a href="{postrow.U_MCP_REPORT}">{L_POST_REPORTED}</a><!-- ENDIF -->
				</p>
			<!-- ENDIF -->

			{postrow.MESSAGE}

			<!-- IF postrow.S_HAS_ATTACHMENTS -->
				<dl class="attachbox">
					<dt>{L_ATTACHMENTS}</dt>
					<!-- BEGIN attachment -->
						<dd>{postrow.attachment.DISPLAY_ATTACHMENT}</dd>
					<!-- END attachment -->
				</dl>
			<!-- ENDIF -->

			<!-- IF postrow.S_DISPLAY_NOTICE --><div class="block rules">{L_DOWNLOAD_NOTICE}</div><!-- ENDIF -->
			<!-- IF postrow.EDITED_MESSAGE or postrow.EDIT_REASON -->
				<div class="notice">{postrow.EDITED_MESSAGE}
					<!-- IF postrow.EDIT_REASON --><br /><strong>{L_REASON}:</strong> <em>{postrow.EDIT_REASON}</em><!-- ENDIF -->
				</div>
			<!-- ENDIF -->

			<!-- IF postrow.BUMPED_MESSAGE --><div class="notice"><br /><br />{postrow.BUMPED_MESSAGE}</div><!-- ENDIF -->
		<!-- ENDIF -->

		</div>
	</div>
<!-- END postrow -->
Where Can I add:

Code: Select all

<!-- IF postrow.RANK_TITLE == "Site Admin" --> admin<!-- ENDIF -->
Thanks.
User avatar
Sniper_E
MOD Team
MOD Team
Posts: 591
Joined: 13 Jun 2011, 16:53
Location: Shreveport, LA
Contact:

Re: Background color posts for admins

Post by Sniper_E »

You would add it on that third line.

Code: Select all

       <div id="p{postrow.POST_ID}" class="block post<!-- IF postrow.S_UNREAD_POST --> unreadpost<!-- ENDIF --><!-- IF postrow.S_ONLINE and not postrow.S_IGNORE_POST --> online<!-- ENDIF --><!-- IF postrow.RANK_TITLE == "Site Admin" --> admin<!-- ENDIF -->">
Without installing that style art mobile green I don't know what it will turn out like.
I see some custom codes in what you posted. But you can try it and see.

But if you are running a 3.0.* site I would recommend taking Oyabun1's advice.
MODs are the way to go.
Installing that MOD he pointed you to would be your best bet rather than editing the core files.
No is NEVER an Option and NEVER is the only Option when it comes to Giving Up!
Diocletianus
New member
New member
Posts: 1
Joined: 19 Sep 2016, 08:10

Re: Background color posts for admins

Post by Diocletianus »

I googled it but couldn't find the mod for changing background colors for admins. Where is it exactly?
User avatar
Sniper_E
MOD Team
MOD Team
Posts: 591
Joined: 13 Jun 2011, 16:53
Location: Shreveport, LA
Contact:

Re: Background color posts for admins

Post by Sniper_E »

What you guys need is an extension for this. Which could be easily made.

I searched and did not see any extensions, but I did find this: Color in posts for administrators

Feel free to search .com for what you want.
That image posted looked like an old mod or a customized site by the admin of that site.
No is NEVER an Option and NEVER is the only Option when it comes to Giving Up!
Post Reply