![]() |
I know why, but can't figure out a workaround..
I know why this query returns 'Array', but I can't figure out how to get around it.
PHP Code:
I tried: PHP Code:
I looked at the code of Babstats, and eventually found the function which determines the rank from the rating (which I copied the syntax of, see above function getRank() ). PHP Code:
Thanks for any help. |
The array it returns is the database row for that rank. So....
return $rank['id']; unless you want it to return something other than id, just replace $rank['id'] with whatever field you want. |
OMG it worked! Thank you!
|
Possible to get a format like this: 1 day, 7 hours, 35 minutes from a total of seconds?
i.e., how do I change 15427 seconds into 'x days, x hours, x minutes' ? Thx in advance. |
$minutes = floor($x / 60) ;
$hours = floor($x / (60 * 60)); $seconds = $x - (hours * 60 * 60); math. ;) |
Ah, but I suck at math. :(
Thx very much. edit.- For some reason, this: PHP Code:
Code:
0d, 3h, 210m. |
Yeah, you have to remove the largest period from the time as you move from, say, days down to seconds, otherwise, you end up counting things more than once.
Try this function. It is a little verbose, but the upside is that it is easier to understand/maintain. (I have not tested this code.) Code:
function get_elapsed_time_string($interval_in_seconds) { |
Wonderful. You guys are amazing. :D Thanks!
|
All times are GMT. The time now is 12:53 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|