Month day year, etc statistic
#1

PHP код:
IRCCMD:topplayers(botidchannel[], user[], host[], params[])
{
    new 
_query[180], fetchedName[MAX_PLAYER_NAME], lastseen[40], activityCache:results;
    
results mysql_query(handle"SELECT `Username`, `Activity`, `LastLoggedIn` FROM `accounts` ORDER BY `Activity` DESC LIMIT 10");
    
IRC_GroupSay(gGroupIDchannel"00,12-----[Top 10 monthly active players]-----");
    for(new 
Qrrows cache_num_rows(); Qr<rowsQr++)
    {
        
cache_get_value_name(Qr"Username"fetchedName);
        
cache_get_value_name_int(Qr"Activity"activity);
        
cache_get_value_name(Qr"LastLoggedIn"lastseen);
        
format(_querysizeof(_query), "\x020,12 #%d\x02 - Username: \x1D%s\x1D     Last seen at: \x1D%s\x1D     Activity: \x1D%d\x1D minute(s)"Qr+1fetchedNamelastseenactivity 60);
        
IRC_GroupSay(gGroupIDchannel_query);
    }
    
IRC_GroupSay(gGroupIDchannel"00,12-----------------------------------------");
    
cache_delete(results);
    return 
1;

It currently shows as "minutes" like it divides the time fetched from the database "Activity" which is in seconds, and divide it into 60. What I want is for it to show like: 1 Month, 1 week, 6 days, 1 hour, 13 seconds. Just like that. I'm having problems how to do it, I suppose it needs to use a unix timestamp or idk. Can anyone tell me how?
Reply


Messages In This Thread
Month day year, etc statistic - by DarkMythHunter - 25.12.2018, 08:26
Re: Month day year, etc statistic - by iorp - 25.12.2018, 08:41

Forum Jump:


Users browsing this thread: 1 Guest(s)