[MOD-DB] EZ Registration

A place for MOD Authors to post and receive feedback on MODs still in development. No MODs within this forum should be used within a live environment! No new topics are allowed in this forum.
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: MOD Development Forum rules

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.
User avatar
drathbun
Former Team Member
Posts: 12204
Joined: Thu Jun 06, 2002 3:51 pm
Location: TOPICS_TABLE
Contact:

Post by drathbun »

samureye wrote: Ah, I love it.

Great!
And I take it all the other information, users can go to profile afterwards and edit?

Yes. Essentially all this very simple MOD does is add a few switches to the profile_add_body template to hide all of the "other" profile fields until the user is editing (as opposed to registering).
And the invitation thing, say I am testing my board and want only a few people to get in, is this what you used? And can I just disable it without uninstalling it when i am ready for any and everyone to join?
http://www.phpbb.com/phpBB/viewtopic.php?t=378134

No, that is not what I use. I only very rarely use code written by someone else. :-) The invitation code is written for that specific site and is not in use anywhere else, nor is it written up as a MOD, nor do I intend to write it up as a MOD at this time. I have never looked at the MOD you linked to, so I cannot comment on anything they've done.
I blog about phpBB: phpBBDoctor blog
Still using phpbb2? So am I! Click below for details
Image
User avatar
drathbun
Former Team Member
Posts: 12204
Joined: Thu Jun 06, 2002 3:51 pm
Location: TOPICS_TABLE
Contact:

Post by drathbun »

MOD has been submitted for approval.
I blog about phpBB: phpBBDoctor blog
Still using phpbb2? So am I! Click below for details
Image
samureye
Registered User
Posts: 48
Joined: Sun Sep 10, 2006 6:27 pm

Post by samureye »

drathbun wrote: The invitation code is written for that specific site and is not in use anywhere else, nor is it written up as a MOD, nor do I intend to write it up as a MOD at this time. I have never looked at the MOD you linked to, so I cannot comment on anything they've done.


Meanie! :lol:
User avatar
drathbun
Former Team Member
Posts: 12204
Joined: Thu Jun 06, 2002 3:51 pm
Location: TOPICS_TABLE
Contact:

Post by drathbun »

samureye wrote:
drathbun wrote:The invitation code is written for that specific site and is not in use anywhere else, nor is it written up as a MOD, nor do I intend to write it up as a MOD at this time. I have never looked at the MOD you linked to, so I cannot comment on anything they've done.


Meanie! :lol:

;-)

I only write up code that I'm willing to support. That code isn't finished yet, it was written for that specific site and therefore takes some shortcuts that you cannot do when writing MODs for public release.

Anyway, thanks for the chuckle this morning. But I'm still not releasing the code. :-P As you found, there are other options out there so I don't see the need to put "yet another invitation / referral MOD" into the queue. Especially when the more complex MODs require more time to support, and that means less time for writing code. 8)
I blog about phpBB: phpBBDoctor blog
Still using phpbb2? So am I! Click below for details
Image
samureye
Registered User
Posts: 48
Joined: Sun Sep 10, 2006 6:27 pm

Post by samureye »

Heh, I can more than repect that.
KE5EHI
Registered User
Posts: 68
Joined: Mon Aug 28, 2006 5:55 pm
Location: Tulsa, OK

Post by KE5EHI »

drathbun wrote: You could also concatenate all of them together and check the result, that way if any single field had a value then the registration is denied. Assume that fields are called a - e and they're "post" variables it could look like:

Code: Select all

!empty($HTTP_POST_VARS['a'] . $HTTP_POST_VARS['b'] . $HTTP_POST_VARS['c'] . $HTTP_POST_VARS['d'] . $HTTP_POST_VARS['e'])
The "dot" . operator does a concatenation, so the result of a . b . c . d . e is checked for emptiness. If any of a - e had a value, I assume then that the entire result would be empty. But you might want to test it. :-)


Just tested it. Using the concatenate didn't work, spit back a parse error on the "." Of course now that I think about it I didn't add parentheses around the strings. Anywho...

It seems to work if you use the "or" statement. Tested it and it worked.

Code: Select all

if (( $mode == 'register' ) && ( !empty($HTTP_POST_VARS['occupation']) || !empty($HTTP_POST_VARS['icq']) || !empty($HTTP_POST_VARS['aim']) || !empty($HTTP_POST_VARS['msn']) || !empty($HTTP_POST_VARS['yim']) ))
Shadow503
Registered User
Posts: 107
Joined: Mon Feb 13, 2006 11:43 pm
Contact:

Post by Shadow503 »

This mod would be perfect if you combined it with some of the anti-bot mods.

Add a captcha and if the registration script recieves postdata for one of the fields removed by this mod automatically ban their IP and cancel the registration.

Edit:Wow, I just realised you already added this. I feel really stupid now. :oops:
User avatar
drathbun
Former Team Member
Posts: 12204
Joined: Thu Jun 06, 2002 3:51 pm
Location: TOPICS_TABLE
Contact:

Post by drathbun »

Shadow503 wrote: Edit:Wow, I just realised you already added this. I feel really stupid now. :oops:

The preliminary code is there, but I leave it up to the admin to decide which, if any, fields they want to check. :-)

I'm trying to remember now if I have submitted this to the MOD-DB, I think I have...

[Edit] Just checked, and it's in the queue 8) [/Edit]
I blog about phpBB: phpBBDoctor blog
Still using phpbb2? So am I! Click below for details
Image
pranavashok
Registered User
Posts: 20
Joined: Tue Aug 22, 2006 11:51 am
Location: India
Contact:

Post by pranavashok »

nice mod....
User avatar
drathbun
Former Team Member
Posts: 12204
Joined: Thu Jun 06, 2002 3:51 pm
Location: TOPICS_TABLE
Contact:

Post by drathbun »

Thanks, still in the queue...
I blog about phpBB: phpBBDoctor blog
Still using phpbb2? So am I! Click below for details
Image
User avatar
drathbun
Former Team Member
Posts: 12204
Joined: Thu Jun 06, 2002 3:51 pm
Location: TOPICS_TABLE
Contact:

Post by drathbun »

Found (and fixed) a bug. Version 1.0.1 of the base code is available for download, the add-on module has not changed.

If you have installed version 1.0.0 then you need to move one line of code. The original MOD install had you Find this:

Code: Select all

<!-- BEGIN switch_avatar_local_upload -->
And then add a line before that. The line needs to be - instead - before this line

Code: Select all

<!-- BEGIN switch_avatar_block -->
Here is the complete MOD install for 1.0.1

Code: Select all

#
#-----[ OPEN ]-------------------------------------
#
templates/subSilver/profile_add_body.tpl

#
#-----[ FIND ]-------------------------------------
# On or about line 67 to 67, may not represent a complete row
#
<!-- END switch_confirm -->

#
#-----[ AFTER, ADD ]-------------------------------------
#
	<!-- BEGIN switch_edit_profile -->


#
#-----[ FIND ]-------------------------------------
# On or about line 244 to 244, may not represent a complete row
#
<!-- BEGIN switch_avatar_block -->

#
#-----[ BEFORE, ADD ]-------------------------------------
#
	<!-- END switch_edit_profile -->
I blog about phpBB: phpBBDoctor blog
Still using phpbb2? So am I! Click below for details
Image
User avatar
rzbb
Registered User
Posts: 26
Joined: Sat Aug 26, 2006 5:45 pm

problem

Post by rzbb »

It works when viewing the registration page, but when viewing the profile editprofile page the "Profile Information" section doesnt show up because of the birthday and xdata switches I have installed.

I'm not sure why the birthday/xdata switches dont like being within the switch_edit_profile switch :( I also tried placing begin/end switch_edit_profile within the birthday/xdata switches to see if that helped, no luck.
User avatar
drathbun
Former Team Member
Posts: 12204
Joined: Thu Jun 06, 2002 3:51 pm
Location: TOPICS_TABLE
Contact:

Post by drathbun »

You can't nest switches within each other without more coding work. This MOD is designed to create a simple registration form, nothing more. If you have other switches nested in your code, it's not going to work. As you have found out. :-)
I blog about phpBB: phpBBDoctor blog
Still using phpbb2? So am I! Click below for details
Image
User avatar
rzbb
Registered User
Posts: 26
Joined: Sat Aug 26, 2006 5:45 pm

resolved

Post by rzbb »

I'm always the lucky one who finds things out the hard way I suppose.. :roll:

But, I did manage to fix the problem :D

I added profile_add_body_register.tpl and profile_add_body_editprofile.tpl, then edited usercp_register.php to use them. Thanks for your help though, it saved me alot of time now knowing that I cant nest switches! :P
User avatar
drathbun
Former Team Member
Posts: 12204
Joined: Thu Jun 06, 2002 3:51 pm
Location: TOPICS_TABLE
Contact:

Post by drathbun »

Well, in fact you can nest switches, you just have to do more work. Your solution sounds fine though. :-)

Look at index_body.tpl for an example of nested switches, or rather block labels. The category row includes the forum row, the forum row is nested within the category row. So you get code like this:

Code: Select all

          </span> <span class="genmed">{catrow.forumrow.FORUM_DESC}<br />
          </span><span class="gensmall">{catrow.forumrow.L_MODERATOR} {catrow.forumrow.MODERATORS}</span></td>
See the dot notation, catrow.forumrow.FIELD_NAME ? That works. To make the fix in the registration process would be a lot more work, so your solution is much easier, I would think.
I blog about phpBB: phpBBDoctor blog
Still using phpbb2? So am I! Click below for details
Image
Locked

Return to “[2.0.x] MODs in Development”