UBB.Dev
Posted By: JoshPet Beta-[6.4] Registration Mod 6.4 - 01/13/2004 9:42 AM
Mod Name / Version: Registration Mod 6.4

Description: This adds several profile fields to the newuser registration page, so that upon registration, you have a more complete profile. It adds: Homepage, Occupation, Hobbies, Geographic Location, Bio, ICQ Number, Custom1, Custom2, Custom3, Custom4, and let's them give a URL to their picture, upload a picture, or (if enabled) choose a stock avatar.

It requires the Occupation, Hobbies, Location and the 4 extra fields to be complete in order to register, as well as either an uploaded photo, URL or stock avatar.

Working Under: UBB.Threads 6.4

Mod Status: Beta

Any pre-requisites: UBB.Threads 6.4 or 6.4.1

Author(s): JoshPet

Date: 01/12/04

Credits: Commissioned by DonJulio from www.laondalatina.com

Files Altered: newuser.php, newuser_signup.tmpl, adduser.php

New Files: none

Database Altered: none

Info/Instructions: Note: Since the 4 extra fields are required, you must activate them in your config file or nobody will be able to register.

Disclaimer: Please backup every file that you intend to modify.
If the modification modifies the database, it's a good idea to backup your database before doing so.

Note: If you modify your UBB.Threads code, you may be giving up your right for "official" support from Infopop.If you need official support, you'll need to restore unmodified files.


Attached File
104955-registrationmod6.4.txt  (123 downloads)
Posted By: donJulio Re: Beta-[6.4] Registration Mod 6.4 - 01/13/2004 7:28 PM
Thank You ! This should be the last one because I recall something like the being planned for 6.5
Posted By: deltajo Re: Beta-[6.4] Registration Mod 6.4 - 01/14/2004 8:48 PM
Hi Josh:

I get this error when I go to the new user page:

Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING' in /home/site/public_html/ubbthreads/newuser.php on line 215


My line 214 and 215 is this:
// Send the page to them
$html -> send_header($ubbt_lang['NEW_USER'],$Cat,0,0,0,0);


Any ideas?
Posted By: JoshPet Re: Beta-[6.4] Registration Mod 6.4 - 01/14/2004 9:47 PM
You must have missed a line above there somewhere. Usually a } or { will throw the whole thing off.

I've checked the instructions, copy & paste with 6.4.1, so I think they are fine. Just make sure you didn't leave something out.
Posted By: deltajo Re: Beta-[6.4] Registration Mod 6.4 - 01/15/2004 1:21 AM
I found the problem (-- mine mostly!):

Your instructions tell us to open newuser.php, and...

[:"red"]
Find this:

// ---------------------
// Grab the tablewrapper
list($tbopen,$tbclose) = $html -> table_wrapper();
[/]

Unfortunately, that exact coding exists in TWO PLACES in that file (line 127 and line 207). My search naturally found the first such occurrence of it, but your mod requires the SECOND occurrence of it to be changed.

I normally check that when I hit a snag, but I neglected to this time. Anyway, I'm sure everyone will hit this same one unless you cahnge the instructions a tad.

Thanks Josh -- I like this mod.
Posted By: donJulio Stock avatar part missing? - 01/15/2004 8:26 PM
[] Description: This adds several profile fields to the newuser registration page, so that upon registration, you have a more complete profile. It adds: Homepage, Occupation, Hobbies, Geographic Location, Bio, ICQ Number, Custom1, Custom2, Custom3, Custom4, and let's them give a URL to their picture, upload a picture, or (if enabled) choose a stock avatar. [/]

Where's the part about the choosing a stock avatar? Look at mine right here:
http://www.laondalatina.com/foros/newuser.php
The part about being able to choose a stock avatar is the part that's missing (not to mention being the coolest part). Is it in the script but just missing from the template? It says in the above quote that it can be done if enabled, but I don't see how to enable it. I checked the instructions, and there is no mention of this feature in the mod:
[] Description: This adds several profile fields to the newuser registration
page, so that upon registration, you have a more complete profile.
It adds: Homepage, Occupation, Hobbies, Geographic Location, Bio,
ICQ Number, Custom 1, Custom2, Custom3, Custom4, and let's them give a URL
to their picture, or upload a picture (if you have the picture upload option on).

It requires the Occupation, Hobbies, Location and the 4 extra fields to be
complete, as well as they must either upload a picture, or supply a URL. [/]

Please help Josh!
Posted By: JoshPet Re: Stock avatar part missing? - 01/15/2004 9:07 PM
It's enabled from the threads config file.

Have you turned on the ability for people to use stock avatars in your config file?

I think it's off by default in 6.4.
Posted By: donJulio Re: Stock avatar part missing? - 01/15/2004 9:11 PM
OK. I'll look into it
EDIT:
I turned this on:
Allow users to choose from a predefined set of avatars for their picture?

And it still looks the same. Am I missing something else?
http://www.laondalatina.com/foros/newuser.php
BTW: On the last one you did for me, 6.3, there were some changes to a language file, but I didn't see any of that for this version. I don't think that is the problem though...
Posted By: deltajo Re: Stock avatar part missing? - 01/15/2004 9:22 PM
Same prob here.
Posted By: JoshPet Re: Stock avatar part missing? - 01/15/2004 9:32 PM
OK - sorry , my mistake.

Indeed in the template:

Below this:

$tictureviw


You need to add this:

$stockavatar

I'll fix the directions.
Posted By: donJulio Re: Stock avatar part missing? - 01/16/2004 4:19 AM
Thanks for the fix Josh. This is sooooo sweet!
Posted By: MattUK Re: Stock avatar part missing? - 01/17/2004 5:12 PM
This is fantastic.. however..

I think there are a few too many compulsory fields, not everyone has a homepage etc.. so how do we go about only making some of those fields compulsory ?
Posted By: donJulio Re: Stock avatar part missing? - 01/17/2004 6:52 PM
Homepage isn't compulsory in this mod. However take a look at this snippet of the instructions for the adduser.php:
[] // ------------------------------------------------------------
// If all required info is not filled in, then we can't proceed
if(((!$Loginname)||(!$Displayname)||(!$Email)||($agree != "yes")||(!$Occupation)||(!$Hobbies)||(!$Location)||(!$Extra2)||(!$Extra3)||(!$Extra4)||(!$Extra5)) || ((!$Picture) && (!isset($HTTP_POST_FILES['userfile']['name'])) && (!$avurl))){
$html -> not_right($ubbt_lang['ALL_FIELDS'],$Cat);
} [/]

I no next to little about PHP, but I'm pretty sure that's where you can change which fields are required OK, I admit it, I read Josh's comment
Posted By: JoshPet Re: Beta-[6.4] Registration Mod 6.4 - 01/27/2004 9:21 AM
[]deltajo said:
I found the problem (-- mine mostly!):

Your instructions tell us to open newuser.php, and...

[:"red"]
Find this:

// ---------------------
// Grab the tablewrapper
list($tbopen,$tbclose) = $html -> table_wrapper();
[/]

Unfortunately, that exact coding exists in TWO PLACES in that file (line 127 and line 207). My search naturally found the first such occurrence of it, but your mod requires the SECOND occurrence of it to be changed.

I normally check that when I hit a snag, but I neglected to this time. Anyway, I'm sure everyone will hit this same one unless you cahnge the instructions a tad.

Thanks Josh -- I like this mod. [/]


Thank you - corrected the instructions.
Posted By: smoknz28 Re: Stock avatar part missing? - 01/31/2004 8:28 AM
[]MattUK said:
This is fantastic.. however..

I think there are a few too many compulsory fields, not everyone has a homepage etc.. so how do we go about only making some of those fields compulsory ? [/]

I'd changed this portion of my adduser.php code from this hack:

// ------------------------------------------------------------
// If all required info is not filled in, then we can't proceed
if(((!$Loginname)||(!$Displayname)||(!$Email)||($agree != "yes")||(!$Occupation)||(!$Hobbies)||(!$Location)||(!$Extra2)||(!$Extra3)||(!$Extra4)||(!$Extra5)) || ((!$Picture) && (!isset($HTTP_POST_FILES['userfile']['name'])) && (!$avurl))){
$html -> not_right($ubbt_lang['ALL_FIELDS'],$Cat);
}


To:

// ------------------------------------------------------------
// EDITED VERSION OF THE HACK - If all required info is not filled in, then we can't proceed
if(((!$Loginname)||(!$Displayname)||(!$Email)||($agree != "yes")) || ((!$Picture) && (!isset($HTTP_POST_FILES['userfile']['name'])) && (!$avurl))){
$html -> not_right($ubbt_lang['ALL_FIELDS'],$Cat);
}


I don't want to require my members to have to fill out all the fields...but atleast I want them to have the option up front to fill them in.

Hope this may help you...
Posted By: JoshPet Re: Stock avatar part missing? - 01/31/2004 8:32 AM
Yeah, the field requirements are what I was commissioned to write. But you've got it nailed, you simply take them out of the check if you don't want that many fields required.
Posted By: smoknz28 Re: Stock avatar part missing? - 01/31/2004 9:27 AM
[]JoshPet said:
Yeah, the field requirements are what I was commissioned to write. But you've got it nailed, you simply take them out of the check if you don't want that many fields required. [/]



Thanks again for a well written hack Josh!
Posted By: Pilgrim Re: Beta-[6.4] Registration Mod 6.4 - 03/04/2004 6:46 PM
Josh,

This is a great hack and it works well 99% of the time. But just today, someone registered on my Board and somehow by-passed many of the required fields. Since I installed this hack only one other person decided to avoid filling in the required fields with the information asked for by typing in "n/a", which although I didn't think someone would do, I can understand how that would permit the registration process to succeed. But this newest individual's profile shows nothing for most of the required fields; they are blank. My guess is that the fields were filled in initially, and then after logging in, this person deleted the information for those fields.

Is there anyway to prevent this from happening other than informing such individuals that unless they provide the information asked for they will not be permitted to have an account? []http://www.the-highway.com/Smileys/shrug.gif[/]

Jeff
Posted By: shortbus Re: Beta-[6.4] Registration Mod 6.4 - 03/04/2004 9:49 PM
does it count spaces as filling it in? Maybe the hit the space bar a few times?
Posted By: JoshPet Re: Beta-[6.4] Registration Mod 6.4 - 03/06/2004 2:41 PM
Yeah, it might be spaces - the standard check in threads is just that fields aren't empty.

But yeah - they could edit their profile and remove the info - unless you further modify changebasic.php to require this information when they edit their profile.

This mod doesn't alter the requirements for when a user edits their profile.
Posted By: donJulio Re: Beta-[6.4] Registration Mod 6.4 - 03/08/2004 8:06 AM
I'm pretty sure it will look at spaces and put that into the database and accept the field as being filled, allowing registration to continue. I've already seen it several times on my site, where people are really only interested in the photo galleries and want to be members as soon as possible, so they don't put any effort into actually filling relevant info into the fields.
© UBB.Developers