adding more colors?

This forum is now closed. Please ask all styles-related questions in the phpBB 3.0 Styles Support & Discussion Forum.
Locked
User avatar
RMS
Registered User
Posts: 517
Joined: Sun Apr 21, 2002 1:53 am
Location: I'm not sure

adding more colors?

Post by RMS »

There is something I was trying to change within my viewtopic file but I can't seem to figure out how so I was hoping someone could help me.

I was trying to change it so that as there are alternating background colors for every other poster's stuff, if it would be possible to divide that into 4 different colors so that the left hand column (with the names, avatars etc) and the text column backgrounds are different? And if possible, how to set it so that I can change it in the ACP or something so it doesn't have to be hardcoded?
This is my signature.
User avatar
Arty
Former Team Member
Posts: 16654
Joined: Wed Mar 06, 2002 2:36 pm
Name: Vjacheslav Trushkin
Contact:

Post by Arty »

You can set only 2 colors, not 4.

Every post has {postrow.ROW_CLASS} which is ether row1 or row2.

Here is original code for that row (in viewtopic_body.tpl):

Code: Select all

		<td width="150" align="left" valign="top" class="{postrow.ROW_CLASS}"><span class="name"><a name="{postrow.U_POST_ID}"></a><b>{postrow.POSTER_NAME}</b></span><br /><span class="postdetails">{postrow.POSTER_RANK}<br />{postrow.RANK_IMAGE}{postrow.POSTER_AVATAR}<br /><br />{postrow.POSTER_JOINED}<br />{postrow.POSTER_POSTS}<br />{postrow.POSTER_FROM}</span><br /></td>
		<td class="{postrow.ROW_CLASS}" width="100%" height="28" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
			<tr>
				<td width="100%"><a href="{postrow.U_MINI_POST}"><img src="{postrow.MINI_POST_IMG}" width="12" height="9" alt="{postrow.L_MINI_POST_ALT}" title="{postrow.L_MINI_POST_ALT}" border="0" /></a><span class="postdetails">{L_POSTED}: {postrow.POST_DATE}<span class="gen">&</span>& &{L_POST_SUBJECT}: {postrow.POST_SUBJECT}</span></td>
				<td valign="top" nowrap="nowrap">{postrow.QUOTE_IMG} {postrow.EDIT_IMG} {postrow.DELETE_IMG} {postrow.IP_IMG}</td>
			</tr>
			<tr> 
				<td colspan="2"><hr /></td>
			</tr>
			<tr>
				<td colspan="2"><span class="postbody">{postrow.MESSAGE}{postrow.SIGNATURE}</span><span class="gensmall">{postrow.EDITED_MESSAGE}</span></td>
			</tr>
		</table></td>
To set different colors for posts/poster_info you can do this:

Code: Select all

		<td width="150" align="left" valign="top" class="poster_{postrow.ROW_CLASS}"><span class="name"><a name="{postrow.U_POST_ID}"></a><b>{postrow.POSTER_NAME}</b></span><br /><span class="postdetails">{postrow.POSTER_RANK}<br />{postrow.RANK_IMAGE}{postrow.POSTER_AVATAR}<br /><br />{postrow.POSTER_JOINED}<br />{postrow.POSTER_POSTS}<br />{postrow.POSTER_FROM}</span><br /></td>
		<td class="post_{postrow.ROW_CLASS}" width="100%" height="28" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
			<tr>
				<td width="100%"><a href="{postrow.U_MINI_POST}"><img src="{postrow.MINI_POST_IMG}" width="12" height="9" alt="{postrow.L_MINI_POST_ALT}" title="{postrow.L_MINI_POST_ALT}" border="0" /></a><span class="postdetails">{L_POSTED}: {postrow.POST_DATE}<span class="gen">&</span>& &{L_POST_SUBJECT}: {postrow.POST_SUBJECT}</span></td>
				<td valign="top" nowrap="nowrap">{postrow.QUOTE_IMG} {postrow.EDIT_IMG} {postrow.DELETE_IMG} {postrow.IP_IMG}</td>
			</tr>
			<tr> 
				<td colspan="2"><hr /></td>
			</tr>
			<tr>
				<td colspan="2"><span class="postbody">{postrow.MESSAGE}{postrow.SIGNATURE}</span><span class="gensmall">{postrow.EDITED_MESSAGE}</span></td>
			</tr>
		</table></td>
I changed class from class="{postrow.ROW_CLASS}" to class="poster_{postrow.ROW_CLASS}" and class="post_{postrow.ROW_CLASS}". That creates 4 new classes: "poster_row1", "poster_row2", "post_row1", "post_row2" and you can use it to set different background for different columns.

And you cannot do it from control panel - you need to edit tpl and css yourself.
Vjacheslav Trushkin / Arty.
Free phpBB 3.1 styles | New project: Iconify - modern SVG framework
User avatar
RMS
Registered User
Posts: 517
Joined: Sun Apr 21, 2002 1:53 am
Location: I'm not sure

Post by RMS »

...hmm, I see. Exactly which other file do I have to edit to set the colors?
This is my signature.
User avatar
Arty
Former Team Member
Posts: 16654
Joined: Wed Mar 06, 2002 2:36 pm
Name: Vjacheslav Trushkin
Contact:

Post by Arty »

that html code is in viewtopic_body.tpl and you shoud add classes to overall_header.tpl or stylename.css
Vjacheslav Trushkin / Arty.
Free phpBB 3.1 styles | New project: Iconify - modern SVG framework
User avatar
RMS
Registered User
Posts: 517
Joined: Sun Apr 21, 2002 1:53 am
Location: I'm not sure

Post by RMS »

Ah ok. Thanks :)
This is my signature.
Locked

Return to “[2.0.x] Styles Development & Discussion”