Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - trying to add a "welcome back" message
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

trying to add a "welcome back" message

 Post Reply Post Reply
Author
De-zypher View Drop Down
Newbie
Newbie


Joined: 22 May 2006
Status: Offline
Points: 7
Post Options Post Options   Thanks (0) Thanks(0)   Quote De-zypher Quote  Post ReplyReply Direct Link To This Post Topic: trying to add a "welcome back" message
    Posted: 07 June 2006 at 4:33am
Hello all im trying to add a "welcome back" %member% to the forums default page...this should appear right below the "you were last logged in at" line.  Any ideas?  Also I will be adding a DKP line and database entry that will need to be querried.  so the entire line would read (again right below the "you were last logon at" line) Welcome back %username% you have %dkp% DKP!
 
now i can either put another table in sql (im running sql 2005) or a new colum in where the members names are...but I would need to reff that colum/table to retrieve the DKP amount for that specific user...
 
Any ideas?
 
thanks in advanced....
Back to Top
jckruger View Drop Down
Groupie
Groupie
Avatar

Joined: 18 April 2006
Location: Australia
Status: Offline
Points: 135
Post Options Post Options   Thanks (0) Thanks(0)   Quote jckruger Quote  Post ReplyReply Direct Link To This Post Posted: 07 June 2006 at 5:42am
You mean like:
 
The time now is 2:33pm

Your IP Address: xxx.xxx.xxx.xxx
Welcome: test
Email Address: blah@blah.com
 
You last visited Today at 11:49am
 
This is what I have in my default.asp (I actually have more but for your purpose I have removed my other bits)
 
About line 349
 
-------------------------------------------------%>-------------------------------------
<link href="<% = strCSSfile %>default_style.css" rel="stylesheet" type="text/css" />
<!-- #include file="includes/header.asp" -->
<!-- #include file="includes/navigation_buttons_inc.asp" -->
<table class="basicTable" cellspacing="1" cellpadding="3" align="center">
 <tr>
  <td class="smText"><% = strTxtTheTimeNowIs & " " & TimeFormat(now()) %><br /><%
    Response.Write("<br>Your IP Address: " & Request.ServerVariables("REMOTE_ADDR") & vbCrLf & "<br>")
    Response.Write("Welcome: " & strLoggedInUsername & "<br>")
    Response.Write(vbCrLf & "Email Address:" & " " & strLoggedInEmail & "<br><br>")
 'If this is not the first time the user has visted the site display the last visit time and date
If IsDate(Request.Cookies(strCookieName)("LV")) Then
 If dtmLastVisitDate < CDate(Request.Cookies(strCookieName)("LV")) Then
     Response.Write(strTxtYouLastVisitedOn & " " & DateFormat(dtmLastVisitDate) & " " & strTxtAt & " " & TimeFormat(dtmLastVisitDate))
 End If
End If
-------------------------------------------------%>-------------------------------------
 
You could then use your query to substitute the values as you please.
 
If it's not correct it may point you in the right direction.
 
I'm not sure how to format the query for the other info you need.
 
Cheers
 
Justin


Edited by jckruger - 07 June 2006 at 5:45am
Back to Top
buun View Drop Down
Newbie
Newbie


Joined: 22 May 2006
Location: Turkey
Status: Offline
Points: 28
Post Options Post Options   Thanks (0) Thanks(0)   Quote buun Quote  Post ReplyReply Direct Link To This Post Posted: 07 June 2006 at 12:15pm
Response.Write(vbCrLf & "Email Address:" & " " & strLoggedInEmail & "<br><br>")
this parameter dont work. there have problem.
 
strLoggedInEmail  undefination variable.
 
i do. same
 
Dim strLoggedInEmail
 
but now dont show insade default.asp email address. only user name and ip adddress ican see.
 
where is the problem...????
Back to Top
De-zypher View Drop Down
Newbie
Newbie


Joined: 22 May 2006
Status: Offline
Points: 7
Post Options Post Options   Thanks (0) Thanks(0)   Quote De-zypher Quote  Post ReplyReply Direct Link To This Post Posted: 07 June 2006 at 4:18pm
Thank you for your replays...and the varialbe strLoggedInUsername works well...didnt see that one defined in the code.  But now I have another question I was hoping that you could help me with.  I want a user to beable to see their logon name...thus is the "welcome: user name" but also need them to be able to see their "dkp" points.  This is not a field that is in this forum...and its actually just a damage point system used in most online games.  But I am having some trouble setting up a query so that I get the "strLoggedInUsername" variable and then based on that variable to requery a field from the same table that i have added called DKP.  how could I query the DKP field based off the user name...just a rough point in the right direction could be a huge help...
Thanks again...
 
 
Back to Top
jckruger View Drop Down
Groupie
Groupie
Avatar

Joined: 18 April 2006
Location: Australia
Status: Offline
Points: 135
Post Options Post Options   Thanks (0) Thanks(0)   Quote jckruger Quote  Post ReplyReply Direct Link To This Post Posted: 07 June 2006 at 11:29pm
buun,
 
Sorry I forgot to mention that I had also to add this to common.asp at about line 198. Only add what is in RED.
 
--------------------------------------------------------%>----------------------------------
 'Redirect to the forum closed page
 Response.Redirect("forum_closed.asp" & strQsSID1)
End If
%>
<%
 '-------------------------------------------------------------------------------
 'Getting Current Users Email address (By Justin Kruger)
 '-------------------------------------------------------------------------------
 
Dim strLoggedInEmail 'Holds The current users Email Address
Dim CurrentEmail
'Initalise the strSQL variable with an SQL statement to query the database
strSQL = "SELECT tblAuthor.Author_email as CurrentEmail FROM tblAuthor WHERE tblAuthor.Username='" & strLoggedInUsername & "';"
'Set error trapping
On Error Resume Next
   'Query the database
   rsCommon.Open strSQL, adoCon
   'Set error trapping
On Error Resume Next
  
   'If there is a record returned from the database then the email address is already used
strLoggedInEmail = rsCommon("CurrentEmail")
   'Close recordset
   rsCommon.Close
'-------------------------------------------------------------------------------
 'End of Getting Current Users Email address (By Justin Kruger)
 '-------------------------------------------------------------------------------
%>
--------------------------------------------------------%>----------------------------------
 
This should be at the end of the file unless you have added other bits.
 
Let me know if that works.
 
Cheers
 
Justin


Edited by jckruger - 07 June 2006 at 11:34pm
Back to Top
jckruger View Drop Down
Groupie
Groupie
Avatar

Joined: 18 April 2006
Location: Australia
Status: Offline
Points: 135
Post Options Post Options   Thanks (0) Thanks(0)   Quote jckruger Quote  Post ReplyReply Direct Link To This Post Posted: 07 June 2006 at 11:34pm
De-zypher,
 
Maybe the above query style could be used. I'm not sure exactly of the specifics of your tables but I'm sure you could work with this.
 
Cheers
 
Justin
Back to Top
buun View Drop Down
Newbie
Newbie


Joined: 22 May 2006
Location: Turkey
Status: Offline
Points: 28
Post Options Post Options   Thanks (0) Thanks(0)   Quote buun Quote  Post ReplyReply Direct Link To This Post Posted: 08 June 2006 at 7:27am
thnx jckruger . good mod...
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.