Icy Phoenix

     
 

Can't Switch Some Code I've Got And Need Help

Can't Switch Some Code I've Got And Need Help

Article
Reply with quote    Download Post  
Post Can't Switch Some Code I've Got And Need Help 
 
I can't get this to switch  

It prints On-Line correctly and if I echo the no_users_on-line separately  - that works too ?

ANY help offered? will be appreciated....  

Thanks.

Code: [Download] [Hide] [Select]
<?php

/**
* @package (c) 2008 - 2015 Gnu Arcade Script
* @version $Id: user_online.php Version.1.0
* @license http://www.fsf.org/ GNU lesser General Public Licence
*/

if (!defined('IN_ARCADE')) {die('Please use the front door');}

    include "includes/db-global.php";
    include "includes/config.php";

echo '

'.IMG_TSL.''.$lang['users_online'].''.IMG_TSR.''.SCRST.'
<table class="width100" cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="content-a center">

<div style="vertical-align: top; text-align: left;">';

        $stmt = $database->query("SELECT status, username FROM " . USERS_TABLE . " WHERE status!=0 ORDER BY username ASC");
            $stmt->execute();
                $results = $stmt->fetchAll(PDO::FETCH_ASSOC);

                foreach($results as $row)
                {
                    $status_ol = intval($row['status']);
                    $status = htmlEsc($row['username']);

                if($status_ol >= time()-15*60){

                echo '<div style="display: inline; vertical-align: top; font-weight: bold; font-size: 11px;"> '.$status.', </div>';
        }
}
 
        if($status_ol == 0){echo '<div style="font-weight: bold; font-size: 11px; text-align: center;">'.$lang['no_users_online'].' </div>';}

echo '
</div>
</td>
</tr>
</table>
'.SCRSB.''.IMG_TSB.'';

?>




 
mort - View user's profile Send private message  
mort [ Tue 11 Feb, 2020 08:00 ]
Icy Phoenix is an open source project, you can show your appreciation and support future development by donating to the project.

Support us


Can't Switch Some Code I've Got And Need Help

Comments
Reply with quote    Download Post  
Post Re: Can't Switch Some Code I've Got And Need Help 
 
Hi mort,

Try to remplace this:
Code: [Download] [Hide]
  1. if($status_ol == 0) 

With this:
Code: [Download] [Hide]
  1. if (count($results) == 0) 




 
Informpro - View user's profile Send private message  
Informpro [ Tue 11 Feb, 2020 10:29 ]
Reply with quote    Download Post  
Post Re: Can't Switch Some Code I've Got And Need Help 
 
  

I had the VAR set in "status"  to  "timestamp" WHY? I don't know  

I set it to tinyint (4) -  no-go  -> 127

tinyint  NULL - no-go logged-in  -> 127

tinyint "signed" - no-go  -> 127

VARCHAR (1) - returns 1 or 0 correctly  

BUT! I still can't get the switch to work?  

I'll have a look around and see if it has something to do with PDO, although all the  other TINYINT's I use don't cause any problems?



 
mort - View user's profile Send private message  
mort [ Thu 13 Feb, 2020 02:12 ]
Reply with quote    Download Post  
Post Re: Can't Switch Some Code I've Got And Need Help 
 
DOH!

I knew this thing worked on my ASUS Win 7 PC, C - D (XAMPP) where I backed up XAMPP and put it on my new PC (ASUS 115 Gb solid-state) on D: drive (Portable Drive with D (XAMPP) - E - F- G.

Damn MS reported faulty partition on D: so I backed up XAMPP to E:, and ran "Fix It"  

And that's where it all went wrong - it had corrupted XAMPP? and a whole lot of other files on D:went missing!  

So I got a copy of the arcade-DB from Win 7 and compared it with WinMerge on Win 10 XAMPP "arcade.sql" and Yeah!

NEVER had so many problems to fix!  

Anyway, it's fixed - and thanks for your suggested fix - But it made no difference at the time.  

AND tomorrow I'll network the two PC's and use the old one for backup - - -  



 
mort - View user's profile Send private message  
mort [ Thu 20 Feb, 2020 12:15 ]
Reply with quote    Download Post  
Post Re: Can't Switch Some Code I've Got And Need Help 
 
Grats on fixing it -- I'm just surprised it took that much!  



 
Informpro - View user's profile Send private message  
Informpro [ Thu 20 Feb, 2020 12:24 ]
Display posts from previous:    

HideWas this topic useful?

Post new topic  Reply to topic  Page 1 of 1