Advertisement:

Users Online Today

Aloittaja BaneError, syyskuu 17, 2013, 09:10:15 IP

« edellinen - seuraava »

BaneError

Hello,

I just installed this Users Online Today.



I want to modify the above picture's text. So it will say: Users logged in last 24 hours but it will count user that have logged in last week.

It sounds easy but I am afraid to mess with this without a guidance.

Thanks

mashby

I guess I am rather unclear of what you want. The mod you installed does what it says...users online today. Today doesn't really mean this.
LainaaUsers logged in last 24 hours but it will count user that have logged in last week
Might you be able to further explain what you want?
Always be a little kinder than necessary.
- James M. Barrie

BaneError

I want to change this message from "Users logged in last 24 hours" to "Users logged in".
In other words I don't want the users to know when those members logged in, I just want them to show that a lot of members have logged in.

mashby

Hmm. OK. Seems odd to me but still OK. Have a look in Themes/default/languages
It's likely going to be UsersOnlineToday.english.php or whatever language you are running on your site.
All of the verbiage for that area seems to be in the first few lines:
$txt['uot_users_online_current_day']='Users Logged In Today';
$txt['uot_users_online_last_24_hours']='Users Logged In Last 24 Hours';
$txt['uot_users_online_last_7_days']='Users Logged In Last 7 Days';
Always be a little kinder than necessary.
- James M. Barrie

BaneError

I am using a custom theme, will I have any problem?
Also what if i want to change its function from 24 hours to 1 month?

mashby

Custom theme won't matter. One month? That would be a matter of editing Sources/Subs-UsersOnlineToday.php and adding that as an option. Although I have to say I don't quite get what your goal is. Seems that you want to make your site seem like it's "active" even if it's not?
Always be a little kinder than necessary.
- James M. Barrie

BaneError

Yeah something like that.
Can you tell me what I need to add in subs-usersonlinetoday.php in order to make an option for 1 month?

Thanks for your help

mashby

Add to this fun:
array('select', 'uot_setting_period', array('current_day' => $txt['uot_setting_current_day'], 'last_24_hours' => $txt['uot_setting_last_24_hours'], 'last_7_days' => $txt['uot_setting_last_7_days']), 'preinput' => $txt['uot_setting_period_pre_txt'], 'postinput' => $txt['uot_setting_period_post_txt']),

// There are three periods to choose from.
$allowed_period_options = array(
'current_day',
'last_24_hours',
'last_7_days',
);

// Load the users online during last period.
if ($modSettings['uot_setting_period'] == 'current_day')
{
$date = @getdate(forum_time(false));
$midnight = mktime(0, 0, 0, $date['mon'], $date['mday'], $date['year']) - ($modSettings['time_offset'] * 3600);
}
else
{
if ($modSettings['uot_setting_period'] == 'last_24_hours') $midnight = time() - 86400;
elseif ($modSettings['uot_setting_period'] == 'last_7_days') $midnight = time() - 604800;
}
604800 for 30 days is 2592000. There might be more things, but if that's what you're after, you might be better off changing this:
User online time threshold
Admin > Configuration > Features and Options
To the number of minutes in 30 days.

Personally I wouldn't even try this because it's subjective. Not sure of the performance implications of extending it out like that either.
Always be a little kinder than necessary.
- James M. Barrie

BaneError

I will not touch the last one.
Thanks for your help!

Advertisement: