Users Online Today Mod

Started by Nibogo, November 06, 2005, 01:42:31 AM

Previous topic - Next topic

symon

That code tweak was for it to work in the babylon theme :(

alo

Quote from: symon on March 24, 2007, 07:21:50 PM
That code tweak was for it to work in the babylon theme :(
i'm not good at php, can u help me?

mgaidia

how can i install this on SAF MC theme?

symon

Quote from: alo on March 26, 2007, 08:04:30 PM
i'm not good at php, can u help me?

I'm afraid I can't. I only know the Babylon theme as like you I'm not too good with PHP. Hopefully one of the creators here will be able to help with your theme but they seem to have all gone :(

If you're using Babylon I'll try to help ;)

Bigguy

The instructions are in the install.xml file of the zip package of this mod.Unpack the mod and open the zip andyou will see it.  

symon

This is true but they are only for the default theme.

I've posted the change needed for the Babylon theme :D

I suspect other themes may need a little bit digging.

Bigguy...would you know how to complete the function and do the database bits so this mod showed accumulative guests also? I posted a few pages back that I had it ready to go and posted the code. I just need help with the DB and function. I think people want it to enhance this great mod :)

Bigguy

I am really no good with databases. maybe another team member will see this and step in. You should ask the author first however if it is ok to modify his modification package.

symon

I never modified it...I just posted how to get it to work in a theme other than default. Surely that's ok?

Hope so :)

Bigguy

Yes it is ok. I thought you wanted to do bd changes thats all, my mistake if I am wrong. :)

alo

Quote from: alo on March 26, 2007, 08:04:30 PM
Quote from: symon on March 24, 2007, 07:21:50 PM
That code tweak was for it to work in the babylon theme :(
i'm not good at php, can u help me?
i need that work on another theme but thank you!

steve51184

how do i install this on smf 1.1.2 with the default theme?

symon

Quote from: Bigguy on March 27, 2007, 08:10:05 PM
Yes it is ok. I thought you wanted to do bd changes thats all, my mistake if I am wrong. :)

Ah..sorry..yeh...the adding guests also?

Yeh...that would be altering it but is that not what a mod maker does to the original code?

Do we need certain permission to make mods? Or is the code open source but mods are not?

Cheers for any info...I know you're busy here :)

Bigguy

You can alter the code of SMF anyway you want really but you should always ask the mod authors permission if you are going to make changes to his mod and release what you do to the public. If it is only for personal then you can make changes to it.

symon

That makes sense :)

Love the avatar BTW. :D

Bigguy


Jessondair

I regret to say I didn't read all 43 pages of this thread, so if my question is already answered here, I apologize.  Here's what I'd like to see this mod do...

First, I'd like it visible ONLY to admin and moderators.

Then, I'd like it to show me the membernames of those who've logged in, and the IP addresses of guests who've just lurked on the forum.

Is this possible?  I'm afraid I don't have the skills to modify this on my own and make it happen.  :P

edi67

One simple question, i have this mod installed and all work perfectly with smf 1.1.1 but is possible show the list of users online today in Alphabetic Order?? i see the list in casual order and will be more clean have list in alphabetic order

thx  
CrazyZone - My SMF Forum


From the difficult the hardening of the man you can see

klra

#637
QuoteOne simple question, i have this mod installed and all work perfectly with smf 1.1.1 but is possible show the list of users online today in Alphabetic Order?? i see the list in casual order and will be more clean have list in alphabetic order

I too would like to know how to do this.

Great Mod BTW!

I tried this (SMF ver 1.1.2), still not alphabatizing the list.

link to thread discussion - http://www.simplemachines.org/community/index.php?topic=55513.msg616919#msg616919

Quote
           Re: Users Online Today Mod
« Reply #375 on: June 19, 2006, 10:11:46 AM »   Quote

thanks ceceri. I am still using 1.3.0 (afraid of betas..)...
Anyway, I found a way around the issue I mentioned above. All credits go to Ştefan Tălpălaru, actually.
To show Users online today in alphabetical order rather than login time, you have to do some minor modifications in the BoardIndex.php file (Sources folder), as follows:
Delete "$row['lastLogin'] . " from here

Code:
$context['users_online_today'][$row['lastLogin'] . $row['memberName']] = array(
         'id' => $row['ID_MEMBER'],
         'username' => $row['memberName'],
         'name' => $row['realName'],
         'group' => $row['ID_GROUP'],
         'href' => $scripturl . '?action=profile;u=' . $row['ID_MEMBER'],
         'link' => $link,
         'is_buddy' => $is_buddy,
         'hidden' => empty($row['showOnline']),
      );

      $context['list_users_online_today'][$row['lastLogin'] . $row['memberName']] = (empty($row['showOnline']) && allowedTo('moderate_forum')) ? '<i>' . $link . '</i>' : $link;

so it will look like

Code:
$context['users_online_today'][$row['memberName']] = array(
         'id' => $row['ID_MEMBER'],
         'username' => $row['memberName'],
         'name' => $row['realName'],
         'group' => $row['ID_GROUP'],
         'href' => $scripturl . '?action=profile;u=' . $row['ID_MEMBER'],
         'link' => $link,
         'is_buddy' => $is_buddy,
         'hidden' => empty($row['showOnline']),
      );

      $context['list_users_online_today'][$row['memberName']] = (empty($row['showOnline']) && allowedTo('moderate_forum')) ? '<i>' . $link . '</i>' : $link;

and change "krsort" with "ksort"
Code:
  mysql_free_result($result);

   krsort($context['users_online_today']);
   krsort($context['list_users_online_today']);

Remeber, in ASCII capital letters come before small letters (I didn't know..), so all usernames starting with a capital letter will come first.
This works great if  you want your users to be able to see who was online today (regardless hidden/unhidden), without figuring out who's online at the moment

ArkServer

Not sure if its asked before but is it possible to show the last _REAL_ 24 hour user online instead of resetting at 0.00AM?

Tucker2007

#639
Open BoardIndex.php

After:    
// Set the latest member.
$context['latest_member'] = &$context['common_stats']['latest_member'];


Add:
$date = strftime('%Y%m%d', forum_time(false));

// Members online so far today.
$result = db_query("
SELECT mostOn
FROM {$db_prefix}log_activity
WHERE date = $date
LIMIT 1", __FILE__, __LINE__);
list ($context['online_today']) = mysql_fetch_row($result);
mysql_free_result($result);

$context['online_today'] = (int) $context['online_today'];

// Total members online today
$date = @getdate(forum_time(false));
$midnight = mktime(0, 0, 0, $date['mon'], $date['mday'], $date['year']) - ($modSettings['time_offset'] * 3600);
$result = db_query("
SELECT
COUNT(*)
FROM {$db_prefix}members
WHERE lastLogin >= $midnight", __FILE__, __LINE__);
list ($context['total_users_online_today']) = mysql_fetch_row($result);


Open BoardIndex.template

Replace

  echo $txt['uot_total'], ': <b>', $context['num_users_online_today'], '</b>';
  if (!$context['user']['is_guest'])
  echo ' (', $txt['uot_visible'], ': ', ($context['num_users_online_today'] - $context['num_hidden_users_online_today']), ', ', $txt['uot_hidden'], ': ', $context['num_hidden_users_online_today'], ')';


With

  echo $txt['uot_total'], ': <b>', $context['online_today'], '</b>';
  if (!$context['user']['is_guest'])
  echo ' (Members: ', ($context['num_users_online_today'] - $context['num_hidden_users_online_today']), ', ', $txt['uot_hidden'], ': ', $context['num_hidden_users_online_today'], ' , Guests: ', ($context['online_today'] - $context['total_users_online_today']), ')';


This will I hope, I havnt 100% tested however it seems to be working so far. Anyways it will show the number of guests on the forum today, I beleive this is what people wanted, well its what I wanted Example:
Total: 3 (Members: 2, Hidden: 0 , Guests: 1)

Anyways I hope this will keep synmon quiet now hehe, He seems to have been wanting this alot. First post and i've posted something useful  :D (I hope)

Enjoy  ;D

(Sorry if im not very descriptive its 4:30am and I have been looking at code for 5 hours, it messes with your head lol, I feel like a vulcan will all this logic   ::))

Edit: Ok i dont think this works because it only records 1 guest... Bugger :( Well hopefully somone can find this usefull.


Edit2: Ok actually, It seems it is working however logs every 15 minutes which is set by board so I have lowered to refresh every 5 mins, Hey I think I have solved it :D

Advertisement: