Menu
Forums
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Trending
What's new
New posts
New profile posts
Latest activity
Members
Current visitors
New profile posts
Search profile posts
Upgrades
Log in
Register
What's new
Search
Search
Search titles only
By:
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
Server Development
Habbo Retros
Habbo Q&A
Online Stats
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="Evilsmoothie" data-source="post: 335564" data-attributes="member: 28136"><p>Since I'm a real retard sometimes I did this to my profiles..</p><p>First I got my good old stats from the database</p><p>[PHP] $stats = mysql_query("SELECT * FROM users_stats WHERE id='$id'");</p><p> $get1 = mysql_fetch_assoc($stats);[/PHP]</p><p>Then I decided to be a little dirty and I did this</p><p>[PHP]$ontime = $get1['online_seconds'];[/PHP]</p><p>Then I found the spot on the site I wanted the stuff to show and did this</p><p>[PHP] <?php</p><p> function secondsToWords($seconds)</p><p> {</p><p> $ret = "";</p><p> $days = intval(intval($seconds) / (3600*24));</p><p> if($days> 0)</p><p> {</p><p> $ret .= "$days Days ";</p><p> }</p><p> $hours = (intval($seconds) / 3600) % 24;</p><p> if($hours > 0)</p><p> {</p><p> $ret .= "$hours Hours ";</p><p> }</p><p> $minutes = (intval($seconds) / 60) % 60;</p><p> if($minutes > 0)</p><p> {</p><p> $ret .= "$minutes Min ";</p><p> }</p><p> return $ret;</p><p> }</p><p> print secondsToWords($ontime); ?>[/PHP]</p><p></p><p>Should you do it this way? <s>Probably</s> Definitely not, but it fucking worked so I didn't give a shit. (It's not what you asked for, but it sure is alot closer than nothing.)</p></blockquote><p></p>
[QUOTE="Evilsmoothie, post: 335564, member: 28136"] Since I'm a real retard sometimes I did this to my profiles.. First I got my good old stats from the database [PHP] $stats = mysql_query("SELECT * FROM users_stats WHERE id='$id'"); $get1 = mysql_fetch_assoc($stats);[/PHP] Then I decided to be a little dirty and I did this [PHP]$ontime = $get1['online_seconds'];[/PHP] Then I found the spot on the site I wanted the stuff to show and did this [PHP] <?php function secondsToWords($seconds) { $ret = ""; $days = intval(intval($seconds) / (3600*24)); if($days> 0) { $ret .= "$days Days "; } $hours = (intval($seconds) / 3600) % 24; if($hours > 0) { $ret .= "$hours Hours "; } $minutes = (intval($seconds) / 60) % 60; if($minutes > 0) { $ret .= "$minutes Min "; } return $ret; } print secondsToWords($ontime); ?>[/PHP] Should you do it this way? [s]Probably[/s] Definitely not, but it fucking worked so I didn't give a shit. (It's not what you asked for, but it sure is alot closer than nothing.) [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Server Development
Habbo Retros
Habbo Q&A
Online Stats
Top