Join Reason

Started by live627, December 20, 2009, 10:49:47 AM

Previous topic - Next topic

Arantor

So 0 is a logical join reason?
Holder of controversial views, all of which my own.


SoLoGHoST

Well, it could be....  I just want to be politically correct here.  No offense bro.

Gargoyle

Well since it is join reason 0 really isn't a reason so that's going to be okay with me... ;D

Thanks for the insight though.. ;D

Arantor

*shrug* I'm all for keeping it simple in code, and I didn't figure that '0' would be a logical join reason hence using empty(), but end of the day it's whatever works.
Holder of controversial views, all of which my own.


SoLoGHoST

It's definitely better to use empty when you aren't dealing with string values, atleast this is my opinion.  Since, when you use string values, the value can be anything at all.  So I am actually training myself to use isset for this.  But, to each their own.  If 0 is not a possible join reason, than using empty should be fine.  I just like error-proofing my code so it works for every possible scenario.

Cheers :)

Arantor

True enough.

Though I'd argue that you're after a reason for joining which would typically be text rather than just simply 0. isset and empty both have their place, my humble opinion is that empty is preferable here given context, but there are plenty of other places empty is not appropriate.
Holder of controversial views, all of which my own.


SoLoGHoST

Well, let's take for instance a forum wants to know the join reason based on a number.  This could be based on anything, a score you had in an online game, or anything really.  So if the Admin wants a join reason based on a number, and the number is zero, the user won't be able to join the forum.

Ofcouse, this is taken out of context, but still something to consider when coding.  Please don't get me wrong, I understand that empty is perfectly fine for this, but there is still that case of 0 being a possible string value, or even a bunch of zero's.  For example:  000000000 also = empty.

Well, it's all good, and please don't take this the wrong way ofcourse.

Cheers :)

Arantor

In which case you'd probably also modify the description to make it clear that that's the case. Mod out of the box seems to want a general textbox for why someone joined up, implying a reason.

Yes, of course there are going to be oddities, but the general use case would imply that 0 on its own would be unsuitable. Oh, and 000000000 is not considered empty, I think you'll find.
Holder of controversial views, all of which my own.


SoLoGHoST

Ohh, ok, have tested this a while back and was empty, musta been a mistake on my part.  Sorry bout that and thanks for clearing that up.  Will have to give it another go than.

live627

Quote from: Arantor on January 02, 2010, 01:23:42 PM
*shrug* I'm all for keeping it simple in code

Hence the name SIMPLE Machines :D

I think empty() is the perfect choice ;)

Gargoyle

Just reporting back on the code Arantor gave me... No more errors in my logs!

Thanks again!

lovearat

Quote from: live627 on December 20, 2009, 10:49:47 AM
This mod adds a field on the registration page asking the visitor how he found the site. In addition, if all registrants must be approved by the site administrator, a section is added to the list of members awaiting approval with their join reason.

All registrants are required to be approved before joining my forum. To me asking the visitor how they found the forum amd asking for a join reason are two different questions. And , while it would be nice to know how they found the forum, i.e. searched for, word of mouth, etc. All I really want to know is why they wish to join my forum. Is there a way to make it ask  for a join reason in both areas? Thanks  :)
<span style="font-size: 12px; color: red;">Do Not Pm Me For Support. Please use the appropriate board</span>

dimdom

Sorry but I maybe miss something with this mod...

From where can the admin read the reasons for joining?

Or they only appear if they members need approval?


live627


TheListener

Quote from: live627 on January 15, 2010, 04:21:23 PM
Quote from: dimdom on January 14, 2010, 06:51:38 PM
they only appear if they members need approval

As members do not require approval to register on my forum I have decided to let this mod go.

Would of made for interesting stats otherwise.

lovearat

Quote from: lovearat on January 14, 2010, 08:39:09 AM
Quote from: live627 on December 20, 2009, 10:49:47 AM
This mod adds a field on the registration page asking the visitor how he found the site. In addition, if all registrants must be approved by the site administrator, a section is added to the list of members awaiting approval with their join reason.

All registrants are required to be approved before joining my forum. To me asking the visitor how they found the forum amd asking for a join reason are two different questions. And , while it would be nice to know how they found the forum, i.e. searched for, word of mouth, etc. All I really want to know is why they wish to join my forum. Is there a way to make it ask  for a join reason in both areas? Thanks  :)

Could someone please help me out with this? Thanks  :)
<span style="font-size: 12px; color: red;">Do Not Pm Me For Support. Please use the appropriate board</span>

live627

Quote from: Brack1 on January 18, 2010, 11:37:02 PM
Quote from: live627 on January 15, 2010, 04:21:23 PM
Quote from: dimdom on January 14, 2010, 06:51:38 PM
they only appear if they members need approval

As members do not require approval to register on my forum I have decided to let this mod go.

Would of made for interesting stats otherwise.

If you have SMF 2, you can create a custom profile field

TheListener

Quote from: live627 on January 19, 2010, 11:44:09 PM
Quote from: Brack1 on January 18, 2010, 11:37:02 PM
Quote from: live627 on January 15, 2010, 04:21:23 PM
Quote from: dimdom on January 14, 2010, 06:51:38 PM
they only appear if they members need approval

As members do not require approval to register on my forum I have decided to let this mod go.

Would of made for interesting stats otherwise.

If you have SMF 2, you can create a custom profile field

Point noted with thanks.

Gargoyle

Quote from: lovearat on January 19, 2010, 01:54:48 PM
Quote from: lovearat on January 14, 2010, 08:39:09 AM
Quote from: live627 on December 20, 2009, 10:49:47 AM
This mod adds a field on the registration page asking the visitor how he found the site. In addition, if all registrants must be approved by the site administrator, a section is added to the list of members awaiting approval with their join reason.

All registrants are required to be approved before joining my forum. To me asking the visitor how they found the forum amd asking for a join reason are two different questions. And , while it would be nice to know how they found the forum, i.e. searched for, word of mouth, etc. All I really want to know is why they wish to join my forum. Is there a way to make it ask  for a join reason in both areas? Thanks  :)

Could someone please help me out with this? Thanks  :)

What "both" areas?? This is for registration.. Where else do you register?

live627

*cough* Custom Profiles

Advertisement: