online image and offline image showing when logged in and logged out

This is a discussion on "online image and offline image showing when logged in and logged out" within the PHP Forum section. This forum, and the thread "online image and offline image showing when logged in and logged out are both part of the Program Your Website category.



Go Back   Webforumz.com > Main Forums > Program Your Website > PHP Forum

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Apr 1st, 2007, 21:44
Reputable Member
Join Date: Jul 2006
Location: Baldock
Age: 20
Posts: 447
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Aaron1988 Send a message via Yahoo to Aaron1988
online image and offline image showing when logged in and logged out

Hi i have a flashchat i brought it of www.tufat.com was just wondering i have 2 images called supportonline.gif and supportoffline.gif and i wanted to know how i can link in a new file so when i am not logged in the image supportoffline shows and when i am logged in it shows the supportonline image please can anyone assist me

Thanks
Aaron
Reply With Quote

  #2 (permalink)  
Old Apr 4th, 2007, 02:26
Ryan Fait's Avatar
SuperMember

SuperMember
Join Date: May 2006
Location: Las Vegas
Posts: 3,786
Thanks: 0
Thanked 0 Times in 0 Posts
Re: online image and offline image showing when logged in and logged out

You could do a database thing when when you login in, it changes a row to online and vice versa.
Reply With Quote
  #3 (permalink)  
Old Apr 5th, 2007, 10:08
Reputable Member
Join Date: Jul 2006
Location: Baldock
Age: 20
Posts: 447
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Aaron1988 Send a message via Yahoo to Aaron1988
Re: online image and offline image showing when logged in and logged out

That is a possibility if i actually knew how to do that lol i no good at databases
Reply With Quote
  #4 (permalink)  
Old Apr 5th, 2007, 17:15
Reputable Member
Join Date: May 2006
Location: Northampton, UK
Posts: 399
Thanks: 0
Thanked 0 Times in 0 Posts
Re: online image and offline image showing when logged in and logged out

cant you set a session when u log in... and then test whether the session is live?

That would work for a display to yourself... if you want to display to other users you'd need to query a database from everypage, and have a field that changed depending on your logged in or out status.... if you need help with this let me know and ill see if i can talk you through the logic.
Reply With Quote
  #5 (permalink)  
Old Apr 5th, 2007, 17:24
Reputable Member
Join Date: Jul 2006
Location: Baldock
Age: 20
Posts: 447
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Aaron1988 Send a message via Yahoo to Aaron1988
Re: online image and offline image showing when logged in and logged out

hey i have done it lol there was a readme on it but can you do it without being in an iframe? i show you the code i am using

Code: Select all
 
<iframe src="chat/supportyn.php" width="100%" height="500"></iframe>
Also this is the "supportyn.php" code

Code: Select all
<body bgcolor="#000000">
<center>
<?php
// supportyn.php - Written by, Gene Wells
 require_once('inc/common.php');
 $id = 'flashchat';
 $params = array();
 $open = false;
 if($GLOBALS['fc_config']['liveSupportMode']) {
  $stmt = new Statement("SELECT * FROM {$GLOBALS['fc_config']['db']['pref']}connections WHERE userid IS NOT NULL");
  if($rs = $stmt->process()) {
   while($rec = $rs->next()) {
    if(ChatServer::userInRole($rec['userid'], ROLE_ADMIN) || ChatServer::userInRole($rec['userid'], ROLE_MODERATOR)) {
     $open = true;
    }
   }
  }
 }
 if ($open)
    {?>
        <img src="supportonline.gif" width="120" height="60" />
   <?php }else{ ?>
        <img src="supportoffline.gif" width="140" height="80" />
  <?php  }
?>
</center>
Was wondering if it can be done without being viewed in an IFRAME please

Thanks
Aaron

Last edited by Aaron1988; Apr 5th, 2007 at 17:27. Reason: added Content (code)
Reply With Quote
Reply

Tags
images, logged in, logged out, offline, online, showing

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
[SOLVED] Dispaly User Data Once Logged In longstand PHP Forum 2 Nov 21st, 2007 20:16
users logged in script csun PHP Forum 4 May 8th, 2007 12:05
When logged in options Aaron1988 Webforumz Cafe 36 Nov 27th, 2006 15:45
background image not showing up in Firefox but showing in other browsers! eskymo Web Page Design 21 Jan 19th, 2006 23:10
Display logged in Username? Monie Classic ASP 5 Jan 14th, 2005 13:38


All times are GMT. The time now is 11:21.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43