iEntry 10th Anniversary Webforumz RegistrationAnnouncements Contact Webforumz StaffContact
Home Resources Blogs Meet the Team Contact Register
 

Go Back   WebForumz.com > The Code > Classic ASP

Reply
 
LinkBack Thread Tools
Old October 8th, 2007, 01:50 AM   #1
Most Reputable Member
 

Join Date: Feb 2004
Location: Borneo
Age: 28
Posts: 1,630
Blog Entries: 2
Thanks: 0
Thanked 4 Times in 3 Posts
Rep Altering Power: 0 Monie is a jewel in the rough Monie is a jewel in the rough Monie is a jewel in the rough Monie is a jewel in the rough
[SOLVED] Show "Image" Depends On User "Status"?

Hai guys,

Is it possible if I want to show 2 different kind of image (for example: online and offline gif) depends on the "status" of the user?

In my page, when the user login, it will set the user "status" (a field in my database) to be "Online" and when he logout, it will set the "status" to "Offline".

So when the user has logged in, I want to display the Online.gif just beside the user name. Just like a toggle function in javascript.

Code:
if "status" == Online {
display "online.gif"
}
else
display "offline.gif"
If this things can be done in any other way other that javascript, please tell me,

Thanks....
Monie is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old October 8th, 2007, 06:45 AM   #2
Highly Reputable Member
SuperMember
 
Rakuli's Avatar
 

Join Date: Sep 2007
Location: Australia
Age: 25
Posts: 956
Blog Entries: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 Rakuli is a splendid one to behold Rakuli is a splendid one to behold Rakuli is a splendid one to behold Rakuli is a splendid one to behold Rakuli is a splendid one to behold Rakuli is a splendid one to behold
Re: Show "Image" Depends On User "Status"?

Hi monie,

What type of server side scripting do you have available? You can't achieve this with javascript alone as javascript has no knowledge of what other user's are up to.

If you have PHP, I can help you. Let me know and I'll move this thread over there.

Cheers,
__________________
Luke Dingle . com
Rakuli is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old October 8th, 2007, 09:51 PM   #3
Most Reputable Member
 

Join Date: Feb 2004
Location: Borneo
Age: 28
Posts: 1,630
Blog Entries: 2
Thanks: 0
Thanked 4 Times in 3 Posts
Rep Altering Power: 0 Monie is a jewel in the rough Monie is a jewel in the rough Monie is a jewel in the rough Monie is a jewel in the rough
Re: Show "Image" Depends On User "Status"?

I am using ASP (..currently learning PHP-WAMP)

If you can teach me using PHP, go on. I'll learn by doing. If you know the ASP way, maybe it will be easier for me to understand...

Thanks by the way...
Monie is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old October 12th, 2007, 12:58 PM   #4
Most Reputable Member
 

Join Date: Feb 2004
Location: Borneo
Age: 28
Posts: 1,630
Blog Entries: 2
Thanks: 0
Thanked 4 Times in 3 Posts
Rep Altering Power: 0 Monie is a jewel in the rough Monie is a jewel in the rough Monie is a jewel in the rough Monie is a jewel in the rough
Re: Show "Image" Depends On User "Status"?

Any thing so far Rakuli?
Monie is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old October 12th, 2007, 06:15 PM   #5
Highly Reputable Member
SuperMember
 
Rakuli's Avatar
 

Join Date: Sep 2007
Location: Australia
Age: 25
Posts: 956
Blog Entries: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 Rakuli is a splendid one to behold Rakuli is a splendid one to behold Rakuli is a splendid one to behold Rakuli is a splendid one to behold Rakuli is a splendid one to behold Rakuli is a splendid one to behold
Re: Show "Image" Depends On User "Status"?

Hi Monie, sorry I missed this one. If you have a look at http://www.webforumz.com/php-forum/6...-beginners.htm it has some links to PHP starter tutorials but it may be easier for you to see the ASP way

Moving to the ASP forum
__________________
Luke Dingle . com
Rakuli is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old October 15th, 2007, 06:18 AM   #6
WebForumz Member
 

Join Date: Sep 2007
Location: Wales, UK
Age: 37
Posts: 91
Thanks: 1
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 robbied72 will become famous soon enough robbied72 will become famous soon enough
Re: Show "Image" Depends On User "Status"?

Hi Monie,

Is this for a forum kind of "User Online"? if so you will need to flag it in the database, if you just want an image to show to the user that is logged in then you can just use a session variable and us the following:-

Code:
<%If Session("svUserName") <> "" Then%>
Code for the online image goes here......
<%Else%>
Code for the offline image goes here......
<%End If%>
robbied72 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old October 15th, 2007, 10:22 PM   #7
Most Reputable Member
 

Join Date: Feb 2004
Location: Borneo
Age: 28
Posts: 1,630
Blog Entries: 2
Thanks: 0
Thanked 4 Times in 3 Posts
Rep Altering Power: 0 Monie is a jewel in the rough Monie is a jewel in the rough Monie is a jewel in the rough Monie is a jewel in the rough
Re: Show "Image" Depends On User "Status"?

Yes, I did it. Thanks robbied.

Code:
<%
    Session("userStatus") = rs("status")
    If Session("userStatus") = "Online" Then
        Response.Write ("<img src=img/online.gif>")
    Else
        Response.Write ("<img src=img/offline.gif>")
    End If
%>

Last edited by Monie; October 16th, 2007 at 02:09 AM..
Monie is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating a "tag" system to find relevant "related" pages MrQuestions PHP 3 March 20th, 2008 09:06 PM
? IS "meta name="robots" content="?" necessary in pages ? Love2Java Your Design and Layout 6 August 8th, 2007 10:48 AM
window.opener.document["nameForm"].getElementById("someid").value; doesnt work drpompeii JavaScript 0 February 17th, 2007 08:09 PM
<option value="yes" class="x"> problem in Firefox mameha1977 HTML, XHTML and CSS 1 June 21st, 2006 08:20 AM
Need to build a "Trip" or "Journey Planner" jswebdev PHP 4 December 5th, 2005 08:22 PM


Search Engine Optimization by vBSEO 3.2.0 RC8