TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
  • Total Members: 3,963
  • Latest: BiZaJe
Stats
  • Total Posts: 195,917
  • Total Topics: 21,308
  • Online today: 884
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 1
  • Guests: 210
  • Total: 211
  • @rjen

[Block] Most recent visitors to site

Started by whitesox, May 14, 2009, 10:45:27 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

whitesox

yes absolute great work from JPDeni  :up:

Ianedres

Much $foo from this JPDeni, yes. :coolsmiley:

Jessikard

 :up: great job
only one question - is it possible to adjust the font size ?

we need it smaller than now  ???

JPDeni

You can use the already-defined css "smalltext" size:


echo '<table class="smalltext">';


Or you can alter the font size just like you would on a regular html page, with inline css.

ElectricSquid

#24
This is great, but if the users time goes back past 24 hours, the block shows no indicator of that.

example:

ElectricSquid        00:16
Cultural Infidel      22:46
DUFF                   22:02
Project84             21:01
HBMT                  18:25
phoenix               18:24
mopar65pa           17:58
Bogie                   01:07
dodgeman            22:44 <-----<< here's the flip into yesterday
intenseimages       08:52
Night Hawk           12:09
Raminator             01:18
BigDaddy_HD        21:05 <-----<< two days ago
+3$+                   20:58
dexetr30               11:49
D-100                   17:46
3jvj                      00:28
okiedrew               23:02 <-----<< three days ago
Mike_Mandaville     20:42


I think this mod would be GREAT if it showed the date as well

example:

ElectricSquid        00:16 6/10
Cultural Infidel      22:46 6/9
DUFF                   22:02 6/9
Project84             21:01 6/9
HBMT                  18:25 6/9
phoenix               18:24 6/9
mopar65pa           17:58 6/9
Bogie                   01:07 6/9
dodgeman            22:44 6/8
intenseimages       08:52 6/8
Night Hawk           12:09 6/8
Raminator             01:18 6/8
BigDaddy_HD        21:05 6/7
+3$+                   20:58 6/7
dexetr30               11:49 6/7
D-100                   17:46 6/7
3jvj                      00:28 6/7
okiedrew               23:02 6/6
Mike_Mandaville     20:42 6/6

JPDeni

Just change the date format in this part:


date('H:i',$time)


If you don't know how to adjust the date format, see this page.

ElectricSquid

Thankyou.

Teach a man to fish, he eats for a lifetime, LOL


ElectricSquid

#28
Quote from: IchBinâ„¢ on June 10, 2009, 06:09:25 AM
* IchBin Points at sig

:)

Yup, I've come a long way from what you taught me a few years ago.
Quote from: JPDeni on June 10, 2009, 05:41:31 AM
Just change the date format in this part:


date('H:i',$time)


If you don't know how to adjust the date format, see this page.

COOL, I have it looking good for my admin uses.
Using the "smalltext" class on the table, I have...



<tr>
<td align="left"><a href="' . $scripturl . '?action=profile;u=' . $row['ID_MEMBER'] . '">' . $row['realName'] . '</a></td>
<td align="center" style="padding-right: 0px;">' . date('n/j',$time) . '</td>
<td align="right">' . date('g:i a',$time) . '</td>
</tr>



This gives the date and the time with am/pm and it all lines up nicely down the rows
( 6/10 1:39 am)



One last question, how do I go about making the admin invisible to users on this list?
I know it's something like...

            if (empty($context['admin']))
    - or -
            if (empty($context['user']['is_admin']))

...or something like that, but I don't know where to take it from there.


ElectricSquid

YEA!!
I think I figured out the answer to my question.

I used this bit of code as the if/else statement (for lack of a better term)


echo '<table width="100%" class="smalltext">';
while ($row = mysql_fetch_assoc($result)){
$time = $row['lastLogin'] + ($time_adjust * 3600);
echo '
<tr>
';

if ($row['ID_MEMBER'] == 1 )
echo '';

else

echo '
<td align="left"><a href="' . $scripturl . '?action=profile;u=' . $row['ID_MEMBER'] . '">' . $row['realName'] . '</a></td>
<td align="center" style="padding-right: 0px;">' . date('n/j',$time) . '</td>
<td align="right">' . date('g:i a',$time) . '</td>
</tr>';
}
echo '</table>';
mysql_free_result($result);



... and my Admin username disappeared from the list without producing any errors in the error log or parse errors (the dreaded white screen of shame and doom).

Could one of you take a quick look over that if/else and tell me if it's truly correct?
Thanks!!

This website is proudly hosted on Crocweb Cloud Website Hosting.