Thread: Miscellaneous Hacks - Military Branches in Postbit and Memberslist
View Single Post
  #20  
Old 08-21-2009, 06:33 PM
blind-eddie's Avatar
blind-eddie blind-eddie is offline
 
Join Date: Apr 2006
Location: Michigan
Posts: 2,310
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by HappyFeet View Post
I have a question about this Mod. If a member chooses a branch, they cannot uncheck it, only choose another branch. I had to add a text field they could change to, to remove the flag, then erase their text entry and re-save to go back to normal.

Is there a way to add a "None" choice without it displaying "None" in the post bit? Or a way to uncheck your choice?

Many thanks in advance... Great Mod, I like a lot lot lot.:up:
Quote:
Originally Posted by Redlinemotorsports View Post
Try making your field editable by user
Quote:
Originally Posted by HappyFeet View Post
I double checked that, not sure what to do here. I did it exactly as instructed, & double checked that too. Maybe a counter needs to be updated? Not sure... I'm no pro but I've attached a screen shot of the profile field set up and as seen in user cp. As you can see it is editable by user, but you can't un-check the radio button. Heck, I couldn't even change it in Admin CP.

I don't want to trouble you, just checking to see if its this way for others... Maybe its just me, I'll see if I can work this out.

Thanks so much.

You can also see the text field I added to get out of it as mentioned earlier.
What is happening here is, that after this is tested by the installer, you cannot uncheck your selection to leave it blank. A flag will always show in postbit/postbit_legacy.
I added the option "None", added a blank transparent image named, none.gif.
That still shows a white box in members postbit/postbit_legacy.
I also did as HappyFeet did, by adding a text field for member imput, but, that is kinda silly adding it when all options for military are there for members to pick from.

So, I changed the profile field type to Single-Line Text Box.
Title: Military Branch
Desciption:
Code:
<fieldset id="question" title="Question">
<table cellpadding="4" cellspacing="0" border="0" align="left">
<tr>
<td>What branch of the Military are you in now or previously in?</td>
</tr>
</table>
</fieldset>


<fieldset id="militarybranch" title="Military Branch">
<legend>Please Copy & Paste your selection and add it to the text area below.</legend>
<table cellpadding="4" cellspacing="0" border="0" align="left">
<tr>
<td class="smallfont" colspan="Military Branch">
<tr><td>Army</tr>
<tr><td>Navy</tr>
<tr><td>Air Force</tr>
<tr><td>Coast Guard</tr>
<tr><td>Marine Corps</tr>
<tr><td> Note: Using this option will show the flag for that military branch in every post you make.</tr>
</td>
</tr>
</table>
</fieldset>
Set Default: No
Field Required: No
Field Editable bu User: Yes
Private Field: No
Field Searchable on Members List: Yes
Show on Members List: Yes
Display Page: Edit Your Details

Adding the code to the Discription Box will result the following.



I am not trying to re-write your addon Redlinemotorsports, I am only making it easier on me & others that use your addon, if one of our members selects a branch, out of curiosity & can't remove it.
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01756 seconds
  • Memory Usage 1,786KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code
  • (3)bbcode_quote
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.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_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • showpost_complete