Advertisement:
2by2host

Author Topic: (2.0 RC4) Custom Profile Fields - select box default  (Read 4511 times)

Offline hakcenter

  • Semi-Newbie
  • *
  • Posts: 11
(2.0 RC4) Custom Profile Fields - select box default
« on: January 31, 2011, 08:06:00 PM »
I noticed that the text style custom field, doesn't show up when you don't have any text in it. Which is great. I would consider that working as intended.

But is there a default for select box / radial that could be considered a opt out / no selection ? I have a tendancy to make a -- select box for no selected value, but it is showing up when people submit their other options for other profile fields.

Offline hakcenter

  • Semi-Newbie
  • *
  • Posts: 11
Re: (2.0 RC4) Custom Profile Fields - select box default
« Reply #1 on: February 04, 2011, 04:32:52 PM »
still looking for some help with this..

select boxes, that aren't a requirement, should have some kind of opt-out / no display like text boxes with no text.

Offline Arantor

  • SMF Legend
  • *
  • Posts: 51,013
    • wedgebook on Facebook
Re: (2.0 RC4) Custom Profile Fields - select box default
« Reply #2 on: February 04, 2011, 05:54:36 PM »
Well, I'm not sure this is a bug, exactly so I'm not sure it is going to be 'fixed'. But unfortunately I don't know how to alter it offhand either.

Offline hakcenter

  • Semi-Newbie
  • *
  • Posts: 11
Re: (2.0 RC4) Custom Profile Fields - select box default
« Reply #3 on: February 11, 2011, 06:30:29 PM »
If we could have a blank menubox item, as the first item...

then the rest.. you could opt out by selecting it.

Because as it stands now, we have a blank box, but when we select it... (after choosing something from before) it still keeps your old selection...
« Last Edit: February 14, 2011, 07:57:55 PM by hakcenter »

Offline hakcenter

  • Semi-Newbie
  • *
  • Posts: 11
Re: (2.0 RC4) Custom Profile Fields - select box default
« Reply #4 on: February 14, 2011, 08:11:56 PM »
I think the way the 'default value' works is sorta incorrect. Except for a required nature.

We need a bit more language, however.

Profile-Modify.php

Change
Code: [Select]
$value = $row['default_value'];
to
//$value = $row['default_value'];
$value = '';

Let's users select the blank box again. And it works, but it does make the profile look weird on refresh. If you then go somewhere else, come back to profile view, it shows everything as it should.

Is there an if required check ?
« Last Edit: February 15, 2011, 12:12:02 AM by hakcenter »

Offline hakcenter

  • Semi-Newbie
  • *
  • Posts: 11
Re: (2.0 RC4) Custom Profile Fields - select box default
« Reply #5 on: February 16, 2011, 12:26:55 PM »
Okay here's a basic fix for the selectbox, allowing users to select the blank box, and it will respect that, as long as the selectbox is not 'required'

Profile-Modify.php
Code: [Select]
Find
$value = $row['default_value'];
Replace
if ($row['show_reg'] > 1)
$value = $row['default_value'];
else
$value = '';

Offline Joshua Dickerson

  • Developer
  • SMF Super Hero
  • *
  • Posts: 12,636
  • Gender: Male
    • joshuaadickerson on LinkedIn
Re: (2.0 RC4) Custom Profile Fields - select box default
« Reply #6 on: April 30, 2012, 03:31:52 PM »
Is this relevant? I noticed it on the last page and wasn't tracked.
Need help? See the wiki. Want to help SMF? See the wiki!

Did you know you can help develop SMF? See us on Github.

How have you bettered the world today?

Offline hakcenter

  • Semi-Newbie
  • *
  • Posts: 11
Re: (2.0 RC4) Custom Profile Fields - select box default
« Reply #7 on: April 30, 2012, 04:17:51 PM »
I don't think so ? I think it made it up stream.. Would have to check against my forum but all seems fine

Offline Joshua Dickerson

  • Developer
  • SMF Super Hero
  • *
  • Posts: 12,636
  • Gender: Male
    • joshuaadickerson on LinkedIn
Re: (2.0 RC4) Custom Profile Fields - select box default
« Reply #8 on: May 01, 2012, 07:54:02 AM »
hakcenter, if you wouldn't mind checking, I would like to close this. Thanks :)
Need help? See the wiki. Want to help SMF? See the wiki!

Did you know you can help develop SMF? See us on Github.

How have you bettered the world today?

Offline hakcenter

  • Semi-Newbie
  • *
  • Posts: 11
Re: (2.0 RC4) Custom Profile Fields - select box default
« Reply #9 on: July 28, 2012, 01:02:40 AM »
Wow I never updated this, lame..

No it is not fixed 2.0.2