Author |
Topic  |
|
Bob Dobbs
Starting Member
USA
29 Posts |
Posted - 05 January 2003 : 02:35:04
|
I have an interesting scenario and I imagine there's a thrifty solution, but for the life of me, i'm stumped.
I've setup an IRC applet, outside of the forum. There is a simple Input form on that page to put in a username, click Enter and the chat window pops open and takes you into chat. That's fina and dandy, but i'd like to take it a step further.
If the person on that page is a member of the forum, and still has the cookie (not logged out or has logged in within 30 days), i'd like to extract their username and show it as text next to the enter button and if they DON'T, then i'll display the input box as usual.
I saw an archived topic, similar in nature at: http://forum.snitz.com/forum/topic.asp?ARCHIVE=true&TOPIC_ID=32878 , but i'm not going to pass the <%=username%> into the applet parameters. It also appears this topic was for an older version of Snitz as I no longer have inc_functions.asp (i'm using 3.4.02).
Here's what I currently have:
<!--#INCLUDE virtual="/forum/config.asp" --> <!--#INCLUDE VIRTUAL="/forum/inc_sha256.asp"--> <!--#INCLUDE virtual="/forum/inc_func_common.asp" --> <!--#INCLUDE virtual="/forum/inc_header_short.asp" -->
<% username = strDBNTUsername if username = "" Then username = "<input TYPE=TEXT NAME=NICKNAME value=Change_Me! SIZE=12>" %>
That's at the top of default.asp in the /chat/ directory. That will, in a nutshell, force non-forum members to fill in the Input Box with a username before spawning the applet popup.
A little down that same page I have: <FORM NAME="UserInfo"> <TABLE BORDER=0 bordercolor="maroon" CELLSPACING=0 bgcolor="black" width=300> <TR > <TD align=center><font color="white">nick name: <font color="red"><%=username%></font></font></TD> <TD align=center> <INPUT TYPE="BUTTON" VALUE="ENTER" onClick="send()"></TD> </tr> </TABLE> </FORM>
In theory, shouldn't that work as I had described? I'm sort of new to the whole ASP world, but i toiled over it for quite awhile before coming here for help. I did a search, and saw a few items somewhat similar, but nothing that could really help me get it working.
I set the cookie the admin for Website, thinking that might make the difference, but alas, nope.
Any help would be totally appreciated. Thanks!
-Dobbson |
Edited by - Bob Dobbs on 05 January 2003 02:36:29 |
|
laser
Advanced Member
    
Australia
3859 Posts |
Posted - 05 January 2003 : 02:39:38
|
I wanted a similar thing recently, but had to use :
<%=Request.Cookies(strUniqueID & "User")("Name")%>
Maybe overkill, but it worked for me  |
 |
|
Bob Dobbs
Starting Member
USA
29 Posts |
Posted - 05 January 2003 : 02:44:24
|
I think my big problem is that it's not reading the cookie. Logged into the forum or not logged into the forum, i'm presented the "Change_Me!" Input box each time. |
 |
|
ruirib
Snitz Forums Admin
    
Portugal
26364 Posts |
|
laser
Advanced Member
    
Australia
3859 Posts |
Posted - 05 January 2003 : 08:01:41
|
ruirib, he states that he's already done that
Bob, I'd start doing stupid things like "Response.Write strDBNYUserName" and the like. Obviously username is not being populated properly, but I don't know why not.
|
 |
|
ruirib
Snitz Forums Admin
    
Portugal
26364 Posts |
Posted - 05 January 2003 : 09:58:49
|
laser, yeah, that should have been obvious...
Bob, I suggest that your Response.Write the cookie values as well, to try to find out if they are being properly read. Quite likely, they are not... |
Snitz 3.4 Readme | Like the support? Support Snitz too |
 |
|
Bob Dobbs
Starting Member
USA
29 Posts |
Posted - 05 January 2003 : 10:31:23
|
I could not get it to pass the username using the <%Response.Write username%> call, BUT when I put the page into the /forum directory, it did work in that it displayed the username, but in doing that, it screws up the rest of the functions.
Any ideas why it may not be pulling the username outside of the forum directory? |
 |
|
ruirib
Snitz Forums Admin
    
Portugal
26364 Posts |
|
|
Topic  |
|