Ok so my PHPBB subsilver 2 has 2 post background colors. They change one after another. I would love that the first 2 post would have the same color and the color change would go only after second post. Can someone help me ? There is a $4 reward if someone can provide me the working code. P.S. dont ask me for any ACP accesses. You will have to provide me the code and i will insert myself. Thanks
This can be done with jquery. Here is a rough one-liner for the code you need: $('.post.bg2').first().addClass('bg1').removeClass('bg2'); Code (markup): You will most likely put that in your themes header file.
No, i just want the background color for the first 2 post to be the same and continue switching after the second one. It seems that everything i am trying to do at phpbb is almost impossible. There are so many thing i could do with a WordPress and almost nothing with phpbb. grrrrrrrrrrrrrrr So when it come to my request, is it impossible or just hard ?
That is exactly what the snippet I provided will do. Each post on a phpbb thread is wrapped in a <div> tag with a class attribute of either "bg1" or "bg2" and each post alternates which one (this is how the colors are set). The snippet I provided will take the first posts class (oddly bg2 instead of bg1) and replace it with bg1. This will effectively make the first two posts have the same background color and then the rest will continue to alternate.
Hmmm ok let me try it. I will copy and paste this but i need the exact location. Could you post a line after with once i need to insert it. Also, are u sure its in a header instead of viewtopic_body.html ?
technically, there are a number of places you could put it, but the <head> tag of the webpage is common practice. To place this properly, put the following in the header file above the </head> tag: <script type="text/javascript"> $(document).ready(function() { $('.post.bg2').first().addClass('bg1').removeClass('bg2'); }); </script> Code (markup): That should do the trick.
I have placed this code on overall_header.html just above the </head> but nothing happened. Is that maybe the wrong place to place ? Still need help guys !
find below code on viewtopic_body.html <!-- IF postrow.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF --> <td valign="top" class="profile"> Code (markup): replace with below code <!-- IF postrow.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF --> <!-- IF postrow.S_FIRST_ROW --><tr class="row2"><!-- ENDIF --> <td valign="top" class="profile"> Code (markup): that is, we are changing background of first post ; first post will have the same background of second post (all even numbered posts) alternating background colors will start from third post Edit : it is also possible to add a new background color for the first two posts. regular alternate colors start from the third post ..