[2.0.20] registration disable website signature

All new MODs released in our MOD Database will be announced in here. All support for released MODs needs to take place in here. No new MODs will be accepted into the MOD Database for phpBB2
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.

Rating:

Excellent!
32
65%
Very Good
6
12%
Good
4
8%
Fair
3
6%
Poor
4
8%
 
Total votes: 49

User avatar
EXreaction
Former Team Member
Posts: 5666
Joined: Sun Aug 21, 2005 9:31 pm
Location: Wisconsin, U.S.
Name: Nathan

Re: [2.0.20] registration disable website signature

Post by EXreaction » Fri Jul 13, 2007 1:16 am

You do the exact same edits to the exact same files in the other template folders.

danlazenby
Registered User
Posts: 9
Joined: Fri Aug 11, 2006 5:22 am

Re: [2.0.20] registration disable website signature

Post by danlazenby » Fri Jul 13, 2007 11:34 am

well i didn't edit any files i just installed it with easymod. i guess it only installs into subSilver.

User avatar
EXreaction
Former Team Member
Posts: 5666
Joined: Sun Aug 21, 2005 9:31 pm
Location: Wisconsin, U.S.
Name: Nathan

Re: [2.0.20] registration disable website signature

Post by EXreaction » Fri Jul 13, 2007 4:03 pm

It should have installed them to every style you had installed.

Just install it manually to the other templates, as long as you don't have too awful many it is pretty easy.

danlazenby
Registered User
Posts: 9
Joined: Fri Aug 11, 2006 5:22 am

Re: [2.0.20] registration disable website signature

Post by danlazenby » Fri Jul 13, 2007 9:01 pm

okay i've figured it out.
i had to upload the subSilver file profile_add_body.tpl over the other templates.
maybe this will help others in the same boat.
basically the website field would be visible so anyone could register and innocently type their website, then get unjustly banned.

aylagirl
Registered User
Posts: 3
Joined: Sat Oct 20, 2007 11:07 pm

Re: [2.0.20] registration disable website signature

Post by aylagirl » Thu Dec 06, 2007 3:34 am

This may be a dumb question, but when I download this MOD I end up with three separate files and I can't tell which one is most current. The files are:

1) Upgrade from 1.0.1.mod
2) Upgrade from 1.0.3.mod
3) Website Signature Remove 1.1.11.mod

Which one should I follow in order to install the most current version?

Sharon B.

User avatar
Brf
Support Team Member
Support Team Member
Posts: 51726
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Re: [2.0.20] registration disable website signature

Post by Brf » Thu Dec 06, 2007 12:23 pm

If you are not upgrading, then you should not be using an upgrade installer.

Welshcat
Registered User
Posts: 81
Joined: Sat Sep 02, 2006 5:26 pm
Contact:

Re: [2.0.20] registration disable website signature

Post by Welshcat » Wed Feb 06, 2008 5:46 am

I have a birthday mod installed on my forum. I have also removed that field in addition to the website and signature fields as I'm fed up of bots inputting a date of birth and then having birthdays appearing at the bottom of the forum. However, despite removing the birthday field, some bots still manage to fill that in anyway.

Can this registration disable website/signature mod be adapted so that if a bot tries to fill in the non-visible birthday field (as provided by the birthday mod), then the registration also fails?

I can post the codes for the birthday mod if necessary.

Any help appreciated. Thanks.

User avatar
EXreaction
Former Team Member
Posts: 5666
Joined: Sun Aug 21, 2005 9:31 pm
Location: Wisconsin, U.S.
Name: Nathan

Re: [2.0.20] registration disable website signature

Post by EXreaction » Wed Feb 06, 2008 5:49 am

You do not need to adapt the mod to include it, just run a quick check on the field and make sure it is blank, like this mod does. ;)

Welshcat
Registered User
Posts: 81
Joined: Sat Sep 02, 2006 5:26 pm
Contact:

Re: [2.0.20] registration disable website signature

Post by Welshcat » Wed Feb 06, 2008 3:40 pm

EXreaction wrote:You do not need to adapt the mod to include it, just run a quick check on the field and make sure it is blank, like this mod does. ;)
I'm not too sure what you mean by making sure the field is blank. Do you mean making sure it is invisible to registrants when they are signing up? Would this be done by adding the <!-- BEGIN switch_user_logged_in --> and <!-- END switch_user_logged_in --> before and after the field to hide in the profile_add_body.tpl?

But what about this code here in the usercp_register.php file?
// Start Website Signature removal mod
if ( ($mode == 'register') && (($signature != '')||($website != '')) )
{
if ($ban_ip == true)
{
$sql = "INSERT INTO ".BANLIST_TABLE." (`ban_ip`) VALUES ('".$userdata['session_ip']."')";
if ( !$db->sql_query($sql))
{
message_die(GENERAL_ERROR, "Couldn't insert ban_ip info into database", "", __LINE__, __FILE__, $sql);
}
}
session_end($userdata['session_id'], $userdata['user_id']);
message_die(GENERAL_ERROR, 'Die robot!');
}
// End Website Signature removal mod
Doesn't that need to be modified to include the birthday field - particularly the bit highlighted in bold? If so, how would that be done?

Thanks

User avatar
EXreaction
Former Team Member
Posts: 5666
Joined: Sun Aug 21, 2005 9:31 pm
Location: Wisconsin, U.S.
Name: Nathan

Re: [2.0.20] registration disable website signature

Post by EXreaction » Wed Feb 06, 2008 5:10 pm

Yes, you can do that as well. :)

Just add something like ||($birthday != '') in there after ||($website != '').

I do not know what the birthday variable will be, so I doubt that will work. You need to figure out what the variable is for the birthday fields.

Welshcat
Registered User
Posts: 81
Joined: Sat Sep 02, 2006 5:26 pm
Contact:

Re: [2.0.20] registration disable website signature

Post by Welshcat » Wed Feb 06, 2008 5:44 pm

EXreaction wrote:Yes, you can do that as well. :)

Just add something like ||($birthday != '') in there after ||($website != '').

I do not know what the birthday variable will be, so I doubt that will work. You need to figure out what the variable is for the birthday fields.
Ok thanks. Well I thought it might be something like that but I'm not sure exactly what the variable should be.

I don't suppose you would be able to figure out what the variable is if I post the relevant part of the instructions for the birthday mod here? (just relating to the usercp_register.php file):
#-----[ OPEN ]------------------------------------------------
#
includes/usercp_register.php

#
#-----[ FIND ]------------------------------------------------
#
$signature_bbcode_uid = '';

#
#-----[ AFTER, ADD ]------------------------------------------
#

// Start add - Birthday MOD
if (isset($HTTP_POST_VARS['birthday']) )
{
$birthday = intval ($HTTP_POST_VARS['birthday']);
if ($birthday!=999999)
{
$b_day = realdate('j',$birthday);
$b_md = realdate('n',$birthday);
$b_year = realdate('Y',$birthday);
}
} else
{
$b_day = ( isset($HTTP_POST_VARS['b_day']) ) ? intval ($HTTP_POST_VARS['b_day']) : 0;
$b_md = ( isset($HTTP_POST_VARS['b_md']) ) ? intval ($HTTP_POST_VARS['b_md']) : 0;
$b_year = ( isset($HTTP_POST_VARS['b_year']) ) ? intval ($HTTP_POST_VARS['b_year']) : 0;
if ($b_day && $b_md && $b_year)
{
$birthday = mkrealdate($b_day,$b_md,$b_year);
} else
{
$birthday = 999999;
}
}
// End add - Birthday MOD

#
#-----[ FIND ]------------------------------------------------
#
$avatar_sql = user_avatar_gallery($mode
}

#
#-----[ AFTER, ADD ]------------------------------------------
#

// Start add - Birthday MOD
// find the birthday values, reflected by the $lang['Submit_date_format']
if ($b_day || $b_md || $b_year) //if a birthday is submited, then validate it
{
$user_age=(date('md')>=$b_md.(($b_day <= 9) ? '0':'').$b_day) ? date('Y') - $b_year : date('Y') - $b_year - 1 ;
// Check date, maximum / minimum user age
if (!checkdate($b_md,$b_day,$b_year))
{
$error = TRUE;
if( isset($error_msg) )$error_msg .= "<br />";
$error_msg .= $lang['Wrong_birthday_format'];
} else
if ($user_age>$board_config['max_user_age'])
{
$error = TRUE;
if( isset($error_msg) )$error_msg .= "<br />";
$error_msg .= sprintf($lang['Birthday_to_high'],$board_config['max_user_age']);
} else
if ($user_age<$board_config['min_user_age'])
{
$error = TRUE;
if( isset($error_msg) )$error_msg .= "<br />";
$error_msg .= sprintf($lang['Birthday_to_low'],$board_config['min_user_age']);
} else
{
$birthday = ($error) ? $birthday : mkrealdate($b_day,$b_md,$b_year);
$next_birthday_greeting = (date('md')<$b_md.(($b_day <= 9) ? '0':'').$b_day) ? date('Y'):date('Y')+1 ;
}
} else
{
if ($board_config['birthday_required'])
{
$error = TRUE;
if( isset($error_msg) )$error_msg .= "<br />";
$error_msg .= sprintf($lang['Birthday_require']);
}
$birthday = 999999;
}
// End add - Birthday MOD

#
#-----[ FIND ]------------------------------------------------
#
$sql = "UPDATE " . USERS_TABLE . "
SET

#
#-----[ IN-LINE FIND ]----------------------------------------
#
str_replace("\'", "''", $interests) . "'

#
#-----[ IN-LINE AFTER, ADD ]----------------------------------
#
, user_birthday = '$birthday', user_next_birthday_greeting = '$next_birthday_greeting'

#
#-----[ FIND ]------------------------------------------------
#
# NOTICE - IMPORTENT SECURITY RISK
#
# If you some how do not preform the following VERY carefully you have the
# potential to compromise your forum SECURITY, your users may easyly get ADMIN access if you make mistake
# meny users do make mistake in the step, so please be very exact, if this fail, then do not run your code on live forum
#
$sql = "INSERT INTO " . USERS_TABLE . "

#
#-----[ IN-LINE FIND ]----------------------------------------
#
, user_active, user_actkey)

#
#-----[ IN-LINE BEFORE, ADD ]---------------------------------
#
, user_birthday, user_next_birthday_greeting

#
#-----[ FIND ]------------------------------------------------
#
VALUES ($user_id,

#
#-----[ IN-LINE FIND ]----------------------------------------
#
, ";

#
#-----[ IN-LINE BEFORE, ADD ]---------------------------------
#
, '$birthday', '$next_birthday_greeting'

#
#-----[ FIND ]------------------------------------------------
#
$interests = $userdata['user_interests'];

#
#-----[ AFTER, ADD ]------------------------------------------
#

// Start add - Birthday MOD
$birthday = $userdata['user_birthday'];
// End add - Birthday MOD

#
#-----[ FIND ]------------------------------------------------
#
display_avatar_gallery($mode

#
#-----[ IN-LINE FIND ]----------------------------------------
#
);

#
#-----[ IN-LINE BEFORE, ADD ]---------------------------------
#
, $birthday

#
#-----[ FIND ]------------------------------------------------
#
if ( $error )
{
$template->set_filenames(array(

#
#-----[ BEFORE, ADD ]-----------------------------------------
#

// Start add - Birthday MOD
if ( $birthday!=999999 )
{
$b_day = realdate('j', $birthday);
$b_md = realdate('n', $birthday);
$b_year = realdate('Y', $birthday);
$birthday = realdate($lang['Submit_date_format'], $birthday);
} else
{
$b_day = '';
$b_md = '';
$b_year = '';
$birthday = '';
}
// End add - Birthday MOD

#
#-----[ FIND ]------------------------------------------------
#
//
// Let's do an overall check for settings/versions which would prevent

#
#-----[ BEFORE, ADD ]-----------------------------------------
#

// Start add - Birthday MOD
$s_b_day = '<span class="genmed">' . $lang['Day'] . '&nbsp;</span><select name="b_day" size="1" class="gensmall">
<option value="0">&nbsp;-&nbsp;</option>
<option value="1">&nbsp;1&nbsp;</option>
<option value="2">&nbsp;2&nbsp;</option>
<option value="3">&nbsp;3&nbsp;</option>
<option value="4">&nbsp;4&nbsp;</option>
<option value="5">&nbsp;5&nbsp;</option>
<option value="6">&nbsp;6&nbsp;</option>
<option value="7">&nbsp;7&nbsp;</option>
<option value="8">&nbsp;8&nbsp;</option>
<option value="9">&nbsp;9&nbsp;</option>
<option value="10">&nbsp;10&nbsp;</option>
<option value="11">&nbsp;11&nbsp;</option>
<option value="12">&nbsp;12&nbsp;</option>
<option value="13">&nbsp;13&nbsp;</option>
<option value="14">&nbsp;14&nbsp;</option>
<option value="15">&nbsp;15&nbsp;</option>
<option value="16">&nbsp;16&nbsp;</option>
<option value="17">&nbsp;17&nbsp;</option>
<option value="18">&nbsp;18&nbsp;</option>
<option value="19">&nbsp;19&nbsp;</option>
<option value="20">&nbsp;20&nbsp;</option>
<option value="21">&nbsp;21&nbsp;</option>
<option value="22">&nbsp;22&nbsp;</option>
<option value="23">&nbsp;23&nbsp;</option>
<option value="24">&nbsp;24&nbsp;</option>
<option value="25">&nbsp;25&nbsp;</option>
<option value="26">&nbsp;26&nbsp;</option>
<option value="27">&nbsp;27&nbsp;</option>
<option value="28">&nbsp;28&nbsp;</option>
<option value="29">&nbsp;29&nbsp;</option>
<option value="30">&nbsp;30&nbsp;</option>
<option value="31">&nbsp;31&nbsp;</option>
</select>&nbsp;&nbsp;';
$s_b_md = '<span class="genmed">' . $lang['Month'] . '&nbsp;</span><select name="b_md" size="1" class="gensmall">
<option value="0">&nbsp;-&nbsp;</option>
<option value="1">&nbsp;'.$lang['datetime']['January'].'&nbsp;</option>
<option value="2">&nbsp;'.$lang['datetime']['February'].'&nbsp;</option>
<option value="3">&nbsp;'.$lang['datetime']['March'].'&nbsp;</option>
<option value="4">&nbsp;'.$lang['datetime']['April'].'&nbsp;</option>
<option value="5">&nbsp;'.$lang['datetime']['May'].'&nbsp;</option>
<option value="6">&nbsp;'.$lang['datetime']['June'].'&nbsp;</option>
<option value="7">&nbsp;'.$lang['datetime']['July'].'&nbsp;</option>
<option value="8">&nbsp;'.$lang['datetime']['August'].'&nbsp;</option>
<option value="9">&nbsp;'.$lang['datetime']['September'].'&nbsp;</option>
<option value="10">&nbsp;'.$lang['datetime']['October'].'&nbsp;</option>
<option value="11">&nbsp;'.$lang['datetime']['November'].'&nbsp;</option>
<option value="12">&nbsp;'.$lang['datetime']['December'].'&nbsp;</option>
</select>&nbsp;&nbsp;';
$s_b_day= str_replace("value=\"".$b_day."\">", "value=\"".$b_day."\" SELECTED>" ,$s_b_day);
$s_b_md = str_replace("value=\"".$b_md."\">", "value=\"".$b_md."\" SELECTED>" ,$s_b_md);
$s_b_year = '<span class="genmed">' . $lang['Year'] . '&nbsp;</span><input type="text" class="post" style="width: 50px" name="b_year" size="4" maxlength="4" value="' . $b_year . '" />&nbsp;&nbsp;';
$i = 0;
$s_birthday = '';
for ($i=0; $i<=strlen($lang['Submit_date_format']); $i++)
{
switch ($lang['Submit_date_format'][$i])
{
case d: $s_birthday .= $s_b_day;break;
case m: $s_birthday .= $s_b_md;break;
case Y: $s_birthday .= $s_b_year;break;
}
}
// End add - Birthday MOD

#
#-----[ FIND ]------------------------------------------------
#
'OCCUPATION' =>
'INTERESTS' =>

#
#-----[ AFTER, ADD ]------------------------------------------
#

// Start add - Birthday MOD
'S_BIRTHDAY' => $s_birthday,
'BIRTHDAY_REQUIRED' => ($board_config['birthday_required']) ? '*' : '',
// End add - Birthday MOD

#
#-----[ FIND ]------------------------------------------------
#
'L_INTERESTS' =>

#
#-----[ AFTER, ADD ]------------------------------------------
#

// Start add - Birthday MOD
'L_BIRTHDAY' => $lang['Birthday'],
// End add - Birthday MOD
I've tried: if ($birthday!=999999) but that just produces an error if someone then tries to register at all.

Any help appreciated. Thanks.

User avatar
RMcGirr83
Recognised Extension Developer
Posts: 21034
Joined: Wed Jun 22, 2005 4:33 pm
Location: Your display
Name: Rich McGirr
Contact:

Re: [2.0.20] registration disable website signature

Post by RMcGirr83 » Wed Feb 06, 2008 6:26 pm

Code: Select all

if ( ($mode == 'register') && (($signature != '')||($website != '')||($birthday<>'999999')) )

make sure that the edits required for this mod fall after this in your usercp_register.php file

Code: Select all

// End add - Birthday MOD
In times of change, learners inherit the earth, while the learned find themselves beautifully equipped to deal with a world that no longer exists - Eric Hoffer
Former Modifications/Extensions Team Member | My extensions
Appreciate the extensions/mods/support then buy me a beer
All requests for support via PM will be ignored

Welshcat
Registered User
Posts: 81
Joined: Sat Sep 02, 2006 5:26 pm
Contact:

Re: [2.0.20] registration disable website signature

Post by Welshcat » Wed Feb 06, 2008 11:09 pm

RMcGirr83 wrote:

Code: Select all

if ( ($mode == 'register') && (($signature != '')||($website != '')||($birthday<>'999999')) )

make sure that the edits required for this mod fall after this in your usercp_register.php file

Code: Select all

// End add - Birthday MOD
Well I tried this suggestion and then tried to register under a test user, but got the following error message at the end of the registration procedure:
Could not insert data into users table

DEBUG MODE

SQL Error : 1136 Column count doesn't match value count at row 1

INSERT INTO phpbb_users (user_reg_ip, user_reg_host, user_id, user_registerip, username, user_regdate, user_password, user_email, user_icq, user_website, user_occ, user_from, user_interests, user_name_first, user_name_last, user_sig, user_sig_bbcode_uid, user_avatar, user_avatar_type, user_viewemail, user_aim, user_yim, user_msnm, user_attachsig, user_allowsmile, user_allowhtml, user_allowbbcode, user_allow_viewonline, user_notify, user_notify_pm, user_popup_pm, user_timezone, user_dateformat, user_lang, user_style, user_gender, user_level, user_allow_pm, user_long, user_lat, user_birthday, user_next_birthday_greeting, user_country,user_active, user_actkey) VALUES ('90.194.26.174', '5ac21aae.bb.sky.com',5703, 'testuser', 1202339135, '098f6bcd4621d373cade4e832627b4f6', 'testuser@hotmail.com', '', '', '', '', '', 'testuser', '', '', '', '', 0, 0, '', '', '', 1, 1, 1, 1, 1, 0, 1, 1, 0, 'D M d, Y g:i a', 'english', 369, '0', 0, 1, '', '', '999999', '', 'nospec',0, 'd6dc698d119607')

Line : 970
File : usercp_register.php
Why is it doing this? Is there something wrong with the code ($birthday<>'999999')) ?

I don't want legitimate users to find that they can't register.

You also said:
make sure that the edits required for this mod fall after this in your usercp_register.php file

Code: Select all

// End add - Birthday MOD
Which
// End add - Birthday MOD
section do you mean in my above post, since there are several parts of the instruction that end in this?

Thanks

User avatar
RMcGirr83
Recognised Extension Developer
Posts: 21034
Joined: Wed Jun 22, 2005 4:33 pm
Location: Your display
Name: Rich McGirr
Contact:

Re: [2.0.20] registration disable website signature

Post by RMcGirr83 » Thu Feb 07, 2008 2:06 am

What is this?

Code: Select all

user_registerip
Because it doesn't line up with the value being

Code: Select all

'testuser'
BTW, the edits go after the first find of // End

You obviously need to check edits done to your includes/usercp_register.php file.
In times of change, learners inherit the earth, while the learned find themselves beautifully equipped to deal with a world that no longer exists - Eric Hoffer
Former Modifications/Extensions Team Member | My extensions
Appreciate the extensions/mods/support then buy me a beer
All requests for support via PM will be ignored

Welshcat
Registered User
Posts: 81
Joined: Sat Sep 02, 2006 5:26 pm
Contact:

Re: [2.0.20] registration disable website signature

Post by Welshcat » Thu Feb 07, 2008 4:11 am

RMcGirr83 wrote:What is this?

Code: Select all

user_registerip
Because it doesn't line up with the value being

Code: Select all

'testuser'
BTW, the edits go after the first find of // End

You obviously need to check edits done to your includes/usercp_register.php file.
Ok thanks.

The user_registerip was part of a code for a mod that logged the ip when a user registered. I've removed that coding now and put the other coding you suggested in your previous post. It seems to be error free now. All that remains now is to see whether any spammers will be able to still register and enter their birthday. Hopefully they won't.

Post Reply

Return to “[2.0.x] MOD Database Releases”