Print Page | Close Window

trying to add a "welcome back" message

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=20200
Printed Date: 29 March 2026 at 2:47am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: trying to add a "welcome back" message
Posted By: De-zypher
Subject: trying to add a "welcome back" message
Date 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....



Replies:
Posted By: jckruger
Date 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: mailto:blah@blah.com - 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


Posted By: buun
Date 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...????


Posted By: De-zypher
Date 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...
 
 


Posted By: jckruger
Date 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


Posted By: jckruger
Date 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


Posted By: buun
Date Posted: 08 June 2006 at 7:27am
thnx http://forums.webwiz.net/member_profile.asp?PF=23591&FID=19 - jckruger  . good mod...



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