Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Snitz Forums 2000 MOD-Group
 MOD Add-On Forum (W/O Code)
 Changing the Thank you message
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

leesh695
Junior Member

101 Posts

Posted - 02 March 2008 :  18:40:57  Show Profile  Reply with Quote
I want the Thank you message in post_info.asp to add the users title and name at the end.

I know I can use "" & strDBNTUserName & "" to add the name but not sure of the title can anyone help me please?

<

muzishun
Senior Member

United States
1079 Posts

Posted - 02 March 2008 :  19:15:28  Show Profile  Visit muzishun's Homepage  Reply with Quote
There's really no "quick" way to do it, since the title is not stored in any forum variables. If you only want to use it in that one location, it would be as simple as running a quick SQL query to get the user's title from the database and use it on post_info.asp. However, if you think you'll want to use it in other places as well, you might consider adding the code to inc_header.asp and storing it in a variable for use throughout your site.<

Bill Parrott
Senior Web Programmer, University of Kansas
Co-Owner and Code Monkey, Eternal Second Designs (www.eternalsecond.com)
Personal Website (www.chimericdream.com)

Edited by - muzishun on 02 March 2008 19:15:50
Go to Top of Page

leesh695
Junior Member

101 Posts

Posted - 02 March 2008 :  19:31:25  Show Profile  Reply with Quote
Thanks for the info

Could you help me with the code for that please?
I really lack knowledge<

Edited by - leesh695 on 02 March 2008 19:32:03
Go to Top of Page

muzishun
Senior Member

United States
1079 Posts

Posted - 02 March 2008 :  19:49:24  Show Profile  Visit muzishun's Homepage  Reply with Quote
I am on my way out the door just at the moment, but if nobody has replied when I get home this evening, I'll take a look. It should only be a couple lines of code.<

Bill Parrott
Senior Web Programmer, University of Kansas
Co-Owner and Code Monkey, Eternal Second Designs (www.eternalsecond.com)
Personal Website (www.chimericdream.com)
Go to Top of Page

leesh695
Junior Member

101 Posts

Posted - 02 March 2008 :  19:51:33  Show Profile  Reply with Quote
Thanks alot <
Go to Top of Page

muzishun
Senior Member

United States
1079 Posts

Posted - 02 March 2008 :  23:44:14  Show Profile  Visit muzishun's Homepage  Reply with Quote
This is untested, but it should work for you. You can include it in post_info.asp or in inc_header.asp, which will give you a little more flexibility with using the title on other pages.

strSql = "SELECT M_TITLE FROM " & strMemberTablePrefix & "MEMBERS WHERE MEMBER_ID = " & MemberID

set rsMTitle = Server.CreateObject("ADODB.Recordset")
rsMTitle.open strSql, my_Conn

MemberTitle = rsMTitle("M_TITLE")

rsMTitle.close
set rsMTitle = nothing
<

Bill Parrott
Senior Web Programmer, University of Kansas
Co-Owner and Code Monkey, Eternal Second Designs (www.eternalsecond.com)
Personal Website (www.chimericdream.com)
Go to Top of Page

leesh695
Junior Member

101 Posts

Posted - 03 March 2008 :  08:46:39  Show Profile  Reply with Quote
Worked Great, I included it in Inc_header.

Thanks loads <
Go to Top of Page

leesh695
Junior Member

101 Posts

Posted - 03 March 2008 :  09:31:01  Show Profile  Reply with Quote
Oh, I noticed an error when i include it in Inc_header, when people are not logged in.

"ADODB.Field error '800a0bcd'

Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record.

/forum/forum/inc_header.asp, line 595"

Its not really important, It works fine just in post_info.asp.

Thanks alot for writing this for me :)<
Go to Top of Page

muzishun
Senior Member

United States
1079 Posts

Posted - 03 March 2008 :  10:55:52  Show Profile  Visit muzishun's Homepage  Reply with Quote
You're welcome. I forgot to include a check for users who aren't logged in. It's a fairly simple change. Make this line:
MemberTitle = rsMTitle("M_TITLE")

Look like this:

if not (rsMTitle.BOF or rsMTitle.EOF) then
	MemberTitle = rsMTitle("M_TITLE")
end if

That'll cover your rear for users who aren't logged in.<

Bill Parrott
Senior Web Programmer, University of Kansas
Co-Owner and Code Monkey, Eternal Second Designs (www.eternalsecond.com)
Personal Website (www.chimericdream.com)

Edited by - muzishun on 03 March 2008 10:56:21
Go to Top of Page

AnonJr
Moderator

United States
5768 Posts

Posted - 03 March 2008 :  12:02:35  Show Profile  Visit AnonJr's Homepage  Reply with Quote
Why not do this instead? This way you don't hit the database if they aren't logged in... it will save you a little overhead in the long-run.

If mLev > 0 Then
	strSql = "SELECT M_TITLE FROM " & strMemberTablePrefix & "MEMBERS WHERE MEMBER_ID = " & MemberID

	set rsMTitle = Server.CreateObject("ADODB.Recordset")
	rsMTitle.open strSql, my_Conn
	
	MemberTitle = rsMTitle("M_TITLE")
	
	rsMTitle.close
	set rsMTitle = nothing
End If


There's probably an even better way of doing it during the login process, but I'd have to go back and dig up a clean copy of the code...<

Edited by - AnonJr on 03 March 2008 12:03:27
Go to Top of Page

muzishun
Senior Member

United States
1079 Posts

Posted - 03 March 2008 :  14:38:46  Show Profile  Visit muzishun's Homepage  Reply with Quote
Good idea, Anon. I agree that it could probably be done more efficiently during the login process, but I was going for "quick and dirty" to save time.<

Bill Parrott
Senior Web Programmer, University of Kansas
Co-Owner and Code Monkey, Eternal Second Designs (www.eternalsecond.com)
Personal Website (www.chimericdream.com)
Go to Top of Page

leesh695
Junior Member

101 Posts

Posted - 03 March 2008 :  15:38:19  Show Profile  Reply with Quote
Well, I have added the fix that anon posted because you both seem to agree thats better:p

Thanks again for everything <
Go to Top of Page

muzishun
Senior Member

United States
1079 Posts

Posted - 03 March 2008 :  17:47:15  Show Profile  Visit muzishun's Homepage  Reply with Quote
You're quite welcome.<

Bill Parrott
Senior Web Programmer, University of Kansas
Co-Owner and Code Monkey, Eternal Second Designs (www.eternalsecond.com)
Personal Website (www.chimericdream.com)
Go to Top of Page

cgcarter1
Starting Member

14 Posts

Posted - 01 April 2008 :  12:00:53  Show Profile  Reply with Quote
I decide that having the user's number of posts was better.
For instance:
Thank you JohnQSmith for your 123456 posts!

This is how I changed your code...

If mLev > 0 Then
strSql = "SELECT M_POSTS FROM " & strMemberTablePrefix & "MEMBERS WHERE MEMBER_ID = " & MemberID

set rsMposts = Server.CreateObject("ADODB.Recordset")
rsMposts.open strSql, my_Conn

MemberPosts = rsMposts("M_POSTS")

rsMposts.close
set rsMposts = nothing
End If<
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.14 seconds. Powered By: Snitz Forums 2000 Version 3.4.07