Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Additions to user registration
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Additions to user registration

 Post Reply Post Reply
Author
ramone_johnny View Drop Down
Groupie
Groupie


Joined: 13 May 2005
Status: Offline
Points: 87
Post Options Post Options   Thanks (0) Thanks(0)   Quote ramone_johnny Quote  Post ReplyReply Direct Link To This Post Topic: Additions to user registration
    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
Back to Top
ramone_johnny View Drop Down
Groupie
Groupie


Joined: 13 May 2005
Status: Offline
Points: 87
Post Options Post Options   Thanks (0) Thanks(0)   Quote ramone_johnny Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
ramone_johnny View Drop Down
Groupie
Groupie


Joined: 13 May 2005
Status: Offline
Points: 87
Post Options Post Options   Thanks (0) Thanks(0)   Quote ramone_johnny Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
ramone_johnny View Drop Down
Groupie
Groupie


Joined: 13 May 2005
Status: Offline
Points: 87
Post Options Post Options   Thanks (0) Thanks(0)   Quote ramone_johnny Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
ramone_johnny View Drop Down
Groupie
Groupie


Joined: 13 May 2005
Status: Offline
Points: 87
Post Options Post Options   Thanks (0) Thanks(0)   Quote ramone_johnny Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.