vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=251)
-   -   Pre-checked custom profile field (https://vborg.vbsupport.ru/showthread.php?t=286523)

licensinglinks 08-11-2012 03:38 AM

Pre-checked custom profile field
 
I want to set up a checkbox custom profile field "Receive weekly digest" (like the default "Receive Email from Administrators" field). I want this to display at registration and to be pre-checked.

Is this possible?

Lynne 08-11-2012 01:53 PM

Is it possible? Of course - anything is possible if you code it. If you are wondering if it already exists as a modification, then I would ask if you have tried a search yet? I do not know of a mod for this offhand.

licensinglinks 08-16-2012 07:11 PM

Yes I have tried a search.

Anyone got any ideas how I can do it?

Lynne 08-16-2012 07:16 PM

Create a User Profile Field, set it up to show at registration, and set the default for it to be checked. https://www.vbulletin.com/docs/html/profile

(Sorry, at first I thought you were asking about something else.)

licensinglinks 08-16-2012 07:29 PM

Quote:

Originally Posted by Lynne (Post 2357496)
Create a User Profile Field, set it up to show at registration, and set the default for it to be checked. https://www.vbulletin.com/docs/html/profile

You can't do that with checkboxes!

Lynne 08-16-2012 07:59 PM

Why not use a single-selection radio button with Yes/No as the answer and preset it to Yes? Your other option is for you to custom code it.

licensinglinks 08-18-2012 07:11 PM

Quote:

Originally Posted by Lynne (Post 2357525)
Why not use a single-selection radio button with Yes/No as the answer and preset it to Yes? Your other option is for you to custom code it.

Yes I could do this, but I want to know if I can do it with a pre-checked checkbox instead. That solution would be much neater.

Lynne 08-18-2012 10:47 PM

You cannot do it using the user profile fields. You would need to custom code it if you want it prechecked.

Another option is do do the opposite - instead of "Check if you wish to receive a weekly site newsletter", go with "Check if you do NOT wish to receive the weekly site newsletter".

licensinglinks 08-19-2012 06:54 AM

Quote:

Originally Posted by Lynne (Post 2358037)
You would need to custom code it if you want it prechecked.

That's what I want to know. Can anyone explain how to do it? I'm not looking for alternative ideas - I'm aware of the other options.

Black Snow 08-19-2012 10:06 AM

The code for making the box would be something like:
Code:

<input type="checkbox" name="digest" value="Yes" checked="checked" />
As for implementing it into vB, that's another story.


All times are GMT. The time now is 07:06 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.01600 seconds
  • Memory Usage 1,727KB
  • 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
  • (1)bbcode_code_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete