Print Page | Close Window

Additions to user registration

Printed From: Web Wiz Forums
Category: Web Wiz Web App Support Forums
Forum Name: Web Wiz Forums Modifications
Forum Description: Mod's and Add-on's for Web Wiz Forums.
URL: https://forums.webwiz.net/forum_posts.asp?TID=21006
Printed Date: 29 March 2026 at 4:41am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Additions to user registration
Posted By: ramone_johnny
Subject: Additions to user registration
Date Posted: 12 August 2006 at 3:02pm
Hey guys,
Im wanting to add the following code so that additional tables are populated upon user registration. I had this working on a previous version of WWF but not on 8.
 
In the previous version I had the following bit of code below added around line 1133 near this bit of code...
 
'Update the database with the new user's details (needed for MS Access which can be slow updating)
                        .Update
                        'Re-run the query to read in the updated recordset from the database
                        .Requery
 
 
      
      'ADD THEIR USERID TO THE VIEW_COUNT TABLE
       'THIS CONTROLS HOW MANY TIMES THEIR PROFILE HAS BEEN VIEWED
       Set objRS  = Server.CreateObject("ADODB.Recordset")
       strSQL = "SELECT * From view_count;"
       objRS.MaxRecords = 1
       objRS.CursorType = 2
       objRS.LockType = 3
       objRS.Open strSQL, adoCon
       objRS.AddNew
       objRS.Fields("userID") = user_id
       objRS.Update
       objRS.Close
       Set objRS = Nothing
       
       Set objRS  = Server.CreateObject("ADODB.Recordset")
       strSQL = "SELECT * From people;"
       objRS.MaxRecords = 1
       objRS.CursorType = 2
       objRS.LockType = 3
       objRS.Open strSQL, adoCon
       objRS.AddNew
       objRS.Fields("userID") = user_id
       objRS.Fields("firstname") = Replace(strFirstname,"'","''")
       objRS.Fields("lastname") = Replace(strLastname,"'","''")
       objRS.Update
       objRS.Close
       Set objRS = Nothing
       
       
       'CREATE USERS PHOTO ALBUM FOLDER
       set objFSO = Server.CreateObject("Scripting.FileSystemObject")
       If Not objFSO.FolderExists(Server.MapPath(strPath) & "/" & user_id) then
       objFSO.CreateFolder Server.MapPath(strPath) & "/" & user_id
       end if
       Set objFSO = nothing
 
Now this no longer works? Whats changed? Where does it need to go? Could someone point me in the right direction here please?
 
Thanks
 
RJ



Replies:
Posted By: ramone_johnny
Date Posted: 13 August 2006 at 1:33am
Anyone at all?
 
At the very least could someone tell me where the very final peice of code does its bit when a new user registers so I can add additional code to it?
 
Thanks,
 
RJ


Posted By: ramone_johnny
Date Posted: 13 August 2006 at 3:45am
Ok more progress...
 
Ive got it basically working. Have customised register.asp to my liking, however I need to catch the actual Author_ID of the user that has just joined.
 
Previously I had this, which worked a treat. *At around line 915 I believe.
 
.Fields("Author_email") = strEmail
       .Fields("firstname") = strFirstname
       .Fields("lastname") = strLastname
       
       'GET THE USERS AUTHOR_ID NUMBER
       user_id = rsCommon("Author_ID")
 
However this doesnt appear to be working also?
 
Any suggestions guys?
 
RJ


Posted By: ramone_johnny
Date Posted: 13 August 2006 at 4:11am
What I find really confusing is that this peice of code of which you would think would be the unique id of the last registered user is infact the previous ID?
 
'Read back in the user ID for the activation email
lngUserProfileID = CLng(.Fields("Author_ID"))
 
Can someone please clarify this????
 
RJ


Posted By: ramone_johnny
Date Posted: 13 August 2006 at 4:50am
GOT IT! :)
 
For anyone who is wanting to populate additional tables within register.asp heres where you add the code.
 
 
Around line 1000 (ish)
 'If new registration we need to get the new users ID from the database
                 If strMode = "new" Then
                         'SQL to get the new Author_ID from the database
    strSQL = "SELECT " & strDBTop1 & " " & strDbTable & "Author.Author_ID " & _
    "FROM " & strDbTable & "Author" & strDBNoLock & " " & _
    "ORDER BY " & strDbTable & "Author.Author_ID DESC" & strDBLimit1 & ";"
    'Query database
    rsCommon.Open strSQL, adoCon
             'Read back in the user ID for the activation email
             lngUserProfileID = CLng(rsCommon("Author_ID"))
 
The important part is lngUserProfileID = CLng(rsCommon("Author_ID"))
 
This will allow you to capture the unique ID of the LAST REGISTERED USER. With this value you can then populate other tables with a relational value.
 
Enjoy!
 
RJ



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net