Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 04-18-2016, 06:08 AM
flowers's Avatar
flowers flowers is offline
 
Join Date: Aug 2007
Location: Polska/Warszawa
Posts: 10
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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?
Reply With Quote
  #2  
Old 04-18-2016, 11:55 AM
MarkFL's Avatar
MarkFL MarkFL is offline
 
Join Date: Feb 2014
Location: St. Augustine, FL
Posts: 3,853
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #3  
Old 04-18-2016, 12:58 PM
flowers's Avatar
flowers flowers is offline
 
Join Date: Aug 2007
Location: Polska/Warszawa
Posts: 10
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thank you
Reply With Quote
  #4  
Old 04-19-2016, 02:49 AM
MarkFL's Avatar
MarkFL MarkFL is offline
 
Join Date: Feb 2014
Location: St. Augustine, FL
Posts: 3,853
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.

Attached Images
File Type: png markfl_apb_acp.png (36.8 KB, 0 views)
Attached Files
File Type: xml product-markflalternatepostbacks.xml (6.3 KB, 11 views)
Reply With Quote
2 благодарности(ей) от:
Stratis, z3r0
  #5  
Old 04-19-2016, 03:28 AM
flowers's Avatar
flowers flowers is offline
 
Join Date: Aug 2007
Location: Polska/Warszawa
Posts: 10
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thank you very much.
Reply With Quote
2 благодарности(ей) от:
MarkFL, Stratis
  #6  
Old 04-19-2016, 07:38 AM
Stratis's Avatar
Stratis Stratis is offline
 
Join Date: Jan 2010
Posts: 738
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Stolen

* 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
Reply With Quote
  #7  
Old 04-19-2016, 06:13 PM
MarkFL's Avatar
MarkFL MarkFL is offline
 
Join Date: Feb 2014
Location: St. Augustine, FL
Posts: 3,853
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Okay, I have added a setting for active forums and a setting for active threads.
Attached Files
File Type: xml product-markflalternatepostbacks.xml (9.1 KB, 9 views)
Reply With Quote
  #8  
Old 04-19-2016, 06:42 PM
Stratis's Avatar
Stratis Stratis is offline
 
Join Date: Jan 2010
Posts: 738
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Very kind of you Mark, thanks.
Reply With Quote
Благодарность от:
MarkFL
  #9  
Old 04-20-2016, 12:36 AM
MarkFL's Avatar
MarkFL MarkFL is offline
 
Join Date: Feb 2014
Location: St. Augustine, FL
Posts: 3,853
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Attached Files
File Type: xml product-markflalternatepostbacks.xml (10.3 KB, 13 views)
Reply With Quote
  #10  
Old 04-20-2016, 03:26 AM
flowers's Avatar
flowers flowers is offline
 
Join Date: Aug 2007
Location: Polska/Warszawa
Posts: 10
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Very kind of you Mark, thanks.
Reply With Quote
Благодарность от:
MarkFL
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 08:41 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.04298 seconds
  • Memory Usage 2,286KB
  • Queries Executed 12 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (2)bbcode_html
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (10)post_thanks_box
  • (6)post_thanks_box_bit
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (4)post_thanks_postbit
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (4)postbit_attachment
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • postbit_attachment
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete