Once again: Geeklog ROCKS!
Dirk, thanks to your suggestion, I was able to get the custom registration stuff done in about 10 minutes. Great stuff. One snag I did run into was the "batch user load". Appears to be some sort of filesystem permission problem, but I simply added all the users manually. After I did that, however, I could not log in as a user and save a custom profile. The regular user functions worked fine, but none of the custom stuff worked. In anycase, I tracked it down to the Update function in the libcommon.php file.
When I added a user manually, a custom record in the custom table was not created for that user. When a user went to save his updated profile, the code simply does an "update" on both the regular GeekLog user tables AND the custom table. If there is no record in the custom table, it makes it a little hard to update
.
In anycase, I fixed the problem with the following code. I have simply added my entire custom_usersave() function from the lib-common.php file.
function custom_usersave($uid) {
global $_CONF,$_TABLES,$HTTP_POST_VARS;
// Note you will need to ensure all data is prepared correctly before inserts - as quotes may need to be escaped with addslashes()
//JTS: 9/9/2003 Check if the custom table exists first
$result = DB_query("SELECT uid FROM {$_TABLES['custom_memberinfo']} WHERE {$_TABLES['custom_memberinfo']}.uid = $uid"
;
$A = DB_fetchArray($result);
if (strlen($A['uid'])==0)
{
DB_query("INSERT INTO {$_TABLES['custom_memberinfo']} (uid,address,firstname,lastname) VALUES ($uid,'{$HTTP_POST_VARS['address']}','{$HTTP_POST_VARS['firstname']}','{$HTTP_POST_VARS['lastname']}'
"
;
}
else
{
DB_query("UPDATE {$_TABLES['custom_memberinfo']} SET
address='{$HTTP_POST_VARS['address']}',
firstname='{$HTTP_POST_VARS['firstname']}',
lastname='{$HTTP_POST_VARS['lastname']}'
WHERE uid=$uid"
;
}
DB_query("UPDATE {$_TABLES['users']} SET
email='{$HTTP_POST_VARS['email']}',
homepage='{$HTTP_POST_VARS['homepage']}',
fullname='{$HTTP_POST_VARS['firstname']} {$HTTP_POST_VARS['lastname']}'
WHERE uid=$uid"
;
return true;
}
Because I and my users like to live dangerously, I have ignored the "data preparation" warning
. Hope this helps someone.