Author |
Topic |
cripto9t
Average Member
USA
881 Posts |
Posted - 28 November 2003 : 12:15:24
|
Very easy add-on to the avatar mod.
Replaces the log-out button or image with members' avatar.
Just one small change in inc_header.asp.
- Requires
- Tested
- Demo
- Download
- Log-in
- Name: snitzdude
- Password: snitz
Update 11/30/03 Changed this line
strSql = strSql & " Where " & strMemberTablePrefix & "MEMBERS.M_NAME = """ & strDBNTUserName & """" To this
strSql = strSql & " Where " & strMemberTablePrefix & "MEMBERS.M_NAME = '" & strDBNTUserName & "'" For sql server.
|
_-/Cripto9t\-_ |
Edited by - cripto9t on 02 December 2003 07:05:57 |
|
Shaggy
Support Moderator
Ireland
6780 Posts |
Posted - 28 November 2003 : 12:41:40
|
Cool! Might be able to use that on the site I'm working on at the mo'.
|
Search is your friend “I was having a mildly paranoid day, mostly due to the fact that the mad priest lady from over the river had taken to nailing weasels to my front door again.” |
|
|
richfed
Average Member
United States
999 Posts |
|
cripto9t
Average Member
USA
881 Posts |
Posted - 29 November 2003 : 07:55:50
|
quote: Originally posted by richfed
Tried this, but ended up with the following error [AFTER logging in]:
Microsoft OLE DB Provider for SQL Server error '80040e14'
Invalid column name 'richfed'.
/messageboard/inc_header.asp, line 548
No error message before I logged in.
Hi Richfed, I've only tested on mySql and access. I had that error when I was putting this together. The cause was not enough quotes around """ & strDBNTUserName & """"
|
_-/Cripto9t\-_ |
|
|
Faizan
Average Member
United Kingdom
592 Posts |
Posted - 29 November 2003 : 17:21:41
|
Well, I have a suggestion, put "Log Out" text in a very small text, just underneath the avatar so they know how to use it.
|
»Snitz Graphics
|
|
|
Faizan
Average Member
United Kingdom
592 Posts |
Posted - 29 November 2003 : 17:24:46
|
Ohh... you've already got it, just saw the demo again!
|
»Snitz Graphics
|
|
|
richfed
Average Member
United States
999 Posts |
Posted - 29 November 2003 : 17:53:43
|
quote: Originally posted by cripto9t
quote: Originally posted by richfed
Tried this, but ended up with the following error [AFTER logging in]:
Microsoft OLE DB Provider for SQL Server error '80040e14'
Invalid column name 'richfed'.
/messageboard/inc_header.asp, line 548
No error message before I logged in.
Hi Richfed, I've only tested on mySql and access. I had that error when I was putting this together. The cause was not enough quotes around """ & strDBNTUserName & """"
Well. I tried playing around with more quotation marks, but received different errors each time. If anyone figures out how to make this neat little mod work on SQL Server, please post it here. Thanks!
Also, what is the CSS file for? |
|
|
cripto9t
Average Member
USA
881 Posts |
Posted - 30 November 2003 : 10:57:18
|
I'm sorry its not working for you Richfed. I messed aroundd with it yesterday and like I said, was able to duplicate the error in mySql. I can't think of another way to call it. I'll post the code, maybe someone will have an answer as to why it don't or should work.
if strAuthType = "db" then
Response.Write "<b>" & ChkString(strDBNTUserName, "display") & "</b></font></td>" & vbNewLine & _
" <td align=""center"">"
strSqL = "SELECT " & strMemberTablePrefix & "MEMBERS.MEMBER_ID, " & strMemberTablePrefix & "MEMBERS.M_NAME, " & strMemberTablePrefix & "MEMBERS.M_AVATAR_URL"
strSql = strSql & " FROM " & strMemberTablePrefix & "MEMBERS"
strSql = strSql & " Where " & strMemberTablePrefix & "MEMBERS.M_NAME = """ & strDBNTUserName & """"
set rs = my_Conn.Execute (strSql)
if strGfxButtons = "1" and chkString(rs("M_AVATAR_URL"),"sqlString") <> "noavatar.gif" then
Response.Write "<input src=""" & chkString(rs("M_AVATAR_URL"),"display") & """ width=""" & intAvatarWidth & """ height=""" & intAvatarHeight & """ type=""image"" border=""0"" value=""Logout"" id=""submit1"" name=""Logout"" tabindex=""-1""><br />" & vbNewLine & _
"<font face=""" & strDefaultFontFace & """ color=""" & strForumFontColor & """ size=""" & strFooterFontSize & """>log-out</font><br />"
elseif strGfxButtons = "1" and chkString(rs("M_AVATAR_URL"),"sqlString") = "noavatar.gif" then
Response.Write "<input src=""" & strImageUrl & "button_logout.gif"" type=""image"" border=""0"" value=""Logout"" id=""submit1"" name=""Logout"" tabindex=""-1"">"
else
Response.Write "<input type=""submit"" value=""Logout"" id=""submit1"" name=""submit1"" tabindex=""-1"">"
end if
rs.close
set rs=nothing
end if
Is anyone else having problems that I can't help them with . |
_-/Cripto9t\-_ |
|
|
cripto9t
Average Member
USA
881 Posts |
Posted - 30 November 2003 : 11:33:24
|
Just a shot in the dark . Try this line
strSql = strSql & " Where " & strMemberTablePrefix & "MEMBERS.M_NAME = '" & strDBNTUserName & "'" |
_-/Cripto9t\-_ |
|
|
richfed
Average Member
United States
999 Posts |
|
Faizan
Average Member
United Kingdom
592 Posts |
Posted - 30 November 2003 : 13:17:09
|
quote: Originally posted by richfed Question - if someone does NOT have an avatar what shows? The regular "Log Out" button?
The LOGOUT button I think. Try the DEMO without using an avatar.
|
»Snitz Graphics
|
|
|
cripto9t
Average Member
USA
881 Posts |
Posted - 30 November 2003 : 14:56:32
|
Cool . I'll have to up-date the zip. Faizan is right. It is the same as the original code, only it checks for an avatar first. If you have images turned on in admin sec. you should see your log-out image, if not - the submit button. I suggest you check to make sure it works right on all 3 scenarios.
<edit>The css is for the readme, I'm gonna stick it in the readme head when I up-date the zip.</edit>
<edit2>Zip updated.</edit2> |
_-/Cripto9t\-_ |
Edited by - cripto9t on 30 November 2003 15:20:59 |
|
|
richfed
Average Member
United States
999 Posts |
|
cripto9t
Average Member
USA
881 Posts |
Posted - 02 December 2003 : 07:03:36
|
quote: Originally posted by richfed
Just to confirm ... MOD works as advertised on MS-SQL - log in/log out, with/without avatar. As one of my posters said, "Cool. Nice touch." I agree!
Thanks for the feedback Richfed. I'll add MS-SQL to original post . |
_-/Cripto9t\-_ |
|
|
RichLondoner
Starting Member
United Kingdom
43 Posts |
Posted - 15 December 2003 : 08:13:09
|
Cool, nice little touch, for my intranet forums also just added the logout button as well straight after the Avatar and removed the text as that text isn't linked and my users may not work out that the Avatar is now the logout button. Also fixed the height/width as all our avatars are square dimensions, works fine with MS SQL. |
Richard Mills http://www.mysector.co.uk |
|
|
cripto9t
Average Member
USA
881 Posts |
Posted - 15 December 2003 : 09:45:02
|
Thanks Richard |
_-/Cripto9t\-_ |
|
|
Topic |
|