PDA

View Full Version : Alternating Post Background Color


flowers
04-18-2016, 06:08 AM
One person posts, then the background color of the post of the first person to reply is slightly darker or lighter, then it switches back to the original shade on the next reply, and so on and so on. VB 4.2.2

How do I implement this feature?

MarkFL
04-18-2016, 11:55 AM
A quick and dirty method would be to go to your postbit template (whichever you are using), and locate the line:

<div class="postbody">

And change it to:

<div class="postbody" style="background: <vb:if condition="$post['postcount'] & 1">#FFDDDD<vb:else />#DDFFDD</vb:if>">

Change "#FFDDDD" to the background color you want for odd numbered posts and change "#DDFFDD" to the background color you want for even numbered posts.

flowers
04-18-2016, 12:58 PM
Thank you

MarkFL
04-19-2016, 02:49 AM
I hate hacking templates, so I have developed a simple mod that will allow you to turn the feature on/off, use HTML color pickers for the background colors, and select which styles the product is active in. Undo the edits you may have done to your postbit templates before installing. :)

To Install:


Download the attached .xml file.
Follow AdminCP -> Plugins & Products -> Manage Products -> Add/Import Product.
Click on "Choose File" and browse to the product .xml file that you downloaded.
Click "Import."
You MUST enable the product in the settings before it will function.
Configure the remaining settings to your liking. Each setting has a detailed explanation of its use.


https://vborg.vbsupport.ru/attachment.php?attachmentid=154716&stc=1&d=1461041109

flowers
04-19-2016, 03:28 AM
Thank you very much.:)

Stratis
04-19-2016, 07:38 AM
Stolen :D

* Can this have a feature to select in which forums we like to take effect ?
* Options to import with the "Background Color" and a background image to.
in the two exist options of colors if we want ?

Very nice :)

MarkFL
04-19-2016, 06:13 PM
Okay, I have added a setting for active forums and a setting for active threads. :)

Stratis
04-19-2016, 06:42 PM
Very kind of you Mark, thanks.

MarkFL
04-20-2016, 12:36 AM
I have added settings to include background images. For example, if you wish to tile the background of odd-numbered posts with an image, you would enter something like:

url(images/misc/checkerboard.png) repeat

Into the setting field titled "Background Image for Odd Numbered Posts". Note that the url of the image is not enclosed with quotes.

flowers
04-20-2016, 03:26 AM
Very kind of you Mark, thanks. :)