Prevent Negative Age trolls

Started by GleamPlay.com, May 24, 2015, 09:56:30 AM

Previous topic - Next topic

GleamPlay.com

How to prevent negative age trolls in Profile?



Thanks!!!
Gleam - http://gleamplay.com
The SMF to have fun, meet new friends and play games!

Steve

Tell people to stop putting in a birth year greater than 2015 in their profile. I don't know if there's a coded way to do it otherwise.
DO NOT pm me for support!

Colin

That could be a good mod request idea.
"If everybody is thinking alike, then somebody is not thinking." - Gen. George S. Patton Jr.

Colin

margarett

Yes it is.

2 possibilities: disallow the user from entering a negative age OR show a text like "I'm too idiot to provide a valid birthday" if the age is negative ;D
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

GleamPlay.com

Quote from: margarett on May 24, 2015, 02:52:33 PM
2 possibilities: disallow the user from entering a negative age OR show a text like "I'm too idiot to provide a valid birthday" if the age is negative ;D
How to do this 2 methods? Thanks!!!
Gleam - http://gleamplay.com
The SMF to have fun, meet new friends and play games!

margarett

I really don't have the time to build a proper package these days, but it's really easy.

For the "idiot" message, open Sources/Profile-View.php. Find:
$context['member'] += array(
'age' => $birth_year <= 4 ? $txt['not_applicable'] : $datearray['year'] - $birth_year - (($datearray['mon'] > $birth_month || ($datearray['mon'] == $birth_month && $datearray['mday'] >= $birth_day)) ? 0 : 1),
'today_is_birthday' => $datearray['mon'] == $birth_month && $datearray['mday'] == $birth_day
);

Add after:
// Negative age? REALLY?!
if (is_numeric($context['member']['age']) && ($context['member']['age'] < 0))
$context['member']['age'] = 'I\'m too idiot to provide a valid birthdate!';


To disallow a valid birthday is more difficult because that page has no "error handling". Maybe I can give it a try one of these days...
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

Jade Elizabeth

Wow I'm kind of surprised that's even able to happen lol.
Once proud Documentation Writer and Help Squad Leader | Check out my new adult coloring career: Color With Jade/Patreon.

PokémonS

I have same problem too,
I don't mind it but...

Quote from: margarett on May 24, 2015, 09:06:36 PM
Add after:
// Negative age? REALLY?!
if (is_numeric($context['member']['age']) && ($context['member']['age'] < 0))
$context['member']['age'] = 'I\'m too idiot to provide a valid birthdate!';


To disallow a valid birthday is more difficult because that page has no "error handling". Maybe I can give it a try one of these days...

Wow, this is fun. Sometimes my user put 9999, so $context['member']['age'] >100 may work as well.

Out off topic:
Location also can be faked like "in your home".
Change to custom field with list of city/state dropdown may works.
きみと手をつなごう つらいときはもっと
ゼロからはじめよう ほら ほら 手をつなごう
みんな手をつなごう つらいときはもっと
力を合わせよう ほら ほら 手をつなごう

Steve

I actually like the location the way it is. It's funny to see what some of the members come up with e.g. 'The Twilight Zone' etc. I don't really care where they are actually from. ;D
DO NOT pm me for support!

Advertisement: