Go Back   vb.org Archive > Community Discussions > Modification Requests/Questions (Unpaid)
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 08-03-2012, 07:53 PM
Brew's Avatar
Brew Brew is offline
 
Join Date: Sep 2002
Posts: 359
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default PostBit Switcher

I would like a small mod/template change that would allow the member to switch between Vertical and Horizontal PostBits.

I've found one here that is supposed to be for vB4 but it requires you to copy the entire vertical code over to the horizontal code.....Not very elegant I think plus I think it will break some mods, like the Thumbs Up/Down mod.

Thanks to anyone who may consider this.
Reply With Quote
  #2  
Old 08-04-2012, 09:25 AM
BirdOPrey5's Avatar
BirdOPrey5 BirdOPrey5 is offline
Senior Member
 
Join Date: Jun 2008
Location: New York
Posts: 10,610
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Fairly easy to do.

1) Create a User Profile Field: "Use Horizontal Postbit?"
Answers: Yes / No
Note the field # it is given after you save it. (Field # may be different then display order)

2) Go to Plugin Manager -> Add New Plugin
Product: vBulletin
Title: Custom Postbit
Hook: global_bootstrap_init_start
Exec. Order: 5
PHP Code:
PHP Code:
global $vbulletin;
if (
$vbulletin->userinfo['field5'] == "Yes")
  
$vbulletin->options['legacypostbit'] = 0;
else
  
$vbulletin->options['legacypostbit'] = 1
*Change 'field5' to whatever actual field# it is assigned- 'field6' , 'field7' ...

Then anyone who chooses "Yes" will see the horizontal postbit, and anyone who chooses "No" (or doesn't choose at all) will see the legacy (vertical) postbit.
Reply With Quote
Благодарность от:
New Joe
  #3  
Old 08-04-2012, 09:54 AM
New Joe's Avatar
New Joe New Joe is offline
 
Join Date: May 2009
Posts: 1,128
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks BOP5, i might give that a go

--------------- Added [DATE]1344078270[/DATE] at [TIME]1344078270[/TIME] ---------------

Didn't work.
Reply With Quote
  #4  
Old 08-04-2012, 02:03 PM
Scanu's Avatar
Scanu Scanu is offline
 
Join Date: Nov 2010
Posts: 829
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It could be because BOP5 decided to not put { and } but the code works (thanks btw)
Try this instead
PHP Code:
global $vbulletin;
if (
$vbulletin->userinfo['field5'] == "Yes")
{
  
$vbulletin->options['legacypostbit'] = 0;
}
else
{
  
$vbulletin->options['legacypostbit'] = 1;

Reply With Quote
  #5  
Old 08-04-2012, 02:08 PM
New Joe's Avatar
New Joe New Joe is offline
 
Join Date: May 2009
Posts: 1,128
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'll give that new code a try, thanks


This part though;
Quote:
1) Create a User Profile Field: "Use Horizontal Postbit?"
Answers: Yes / No
There's many ways to make a 'Profile Field' is it the first one it shows?
Reply With Quote
  #6  
Old 08-04-2012, 02:17 PM
Scanu's Avatar
Scanu Scanu is offline
 
Join Date: Nov 2010
Posts: 829
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

No it isn't select single selection radio Button
Reply With Quote
  #7  
Old 08-04-2012, 03:43 PM
Brew's Avatar
Brew Brew is offline
 
Join Date: Sep 2002
Posts: 359
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Scanu View Post
No it isn't select single selection radio Button
I've tried the various types...which one it correct?

Single-Line Text Box?
Multiple_line Text Box?
Single-Selection Radio Buttons?
Single-Selection Menu?
Multiple-Selection Menu?
Multiple-selection Checkbox?

Single-Selection Radio Buttons seems like the way to go but Scanu says it's not.

Thanks!
Reply With Quote
  #8  
Old 08-04-2012, 03:59 PM
Scanu's Avatar
Scanu Scanu is offline
 
Join Date: Nov 2010
Posts: 829
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yeah it's single selection radio buttons, i said "the first one isn't correct, select single selection radio buttons"
Reply With Quote
  #9  
Old 08-04-2012, 04:35 PM
Brew's Avatar
Brew Brew is offline
 
Join Date: Sep 2002
Posts: 359
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Works excellent guys!

Can I have permission to add this to the DB at VB.org?
Reply With Quote
  #10  
Old 08-04-2012, 08:24 PM
BirdOPrey5's Avatar
BirdOPrey5 BirdOPrey5 is offline
Senior Member
 
Join Date: Jun 2008
Location: New York
Posts: 10,610
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Brew View Post
Works excellent guys!

Can I have permission to add this to the DB at VB.org?
This isn't a mod so it can't be put in the Mods section. At best it would be an article if you wanted to write it up as one but honestly I think it is fine where it is.
Reply With Quote
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 01:43 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.03839 seconds
  • Memory Usage 2,261KB
  • Queries Executed 11 (?)
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_php
  • (3)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (10)post_thanks_box
  • (1)post_thanks_box_bit
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (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
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete