vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=251)
-   -   Alternating Post Background Color (https://vborg.vbsupport.ru/showthread.php?t=322400)

flowers 04-18-2016 06:08 AM

Alternating Post Background Color
 
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:

HTML Code:

<div class="postbody">
And change it to:

HTML Code:

<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

1 Attachment(s)
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/attachmen...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

1 Attachment(s)
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

1 Attachment(s)
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. :)


All times are GMT. The time now is 06:59 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.00969 seconds
  • Memory Usage 1,726KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_html_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete