News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Users Online Today Mod

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

Previous topic - Next topic

SA™

in your theme directory languages find Modifications.english.php find ?>
near the bottom and cut and past it right at the bottom
http://samods.github.io/SAChatBar/

Xbox Live: smokerthecheese 360 or xbone
My Work
Piano Movers / Delivery service
QuoteMy allies are dead.
I'm 'bout to be too.
Zombies are chasing me.
F*** it, I'm screwed -___-

eleven0

How can I change 24 hours to something else?

dxyy

Quote from: Eleven0 on November 03, 2007, 10:29:43 PM
How can I change 24 hours to something else?
Yes, and is it possible to have it be the 'last 24 hours' instead of just from 12AM of the day. For example, if you go to the forum at 1AM, it will only show the users who were active between 12 and 1AM.

Personally I think it would be better if it could be the last 24 hour period, instead of 'today'

Does anyone know how to achieve this?

Thank you in advance! :)

SA™

there is a mod users online in the last tweny four hours its old tho i have it on my forum i had to mauly install it tho


http://custom.simplemachines.org/mods/index.php?mod=479
http://samods.github.io/SAChatBar/

Xbox Live: smokerthecheese 360 or xbone
My Work
Piano Movers / Delivery service
QuoteMy allies are dead.
I'm 'bout to be too.
Zombies are chasing me.
F*** it, I'm screwed -___-

VegaTheChosen

ive added this mod to my forum
and it worked with everything but  B l a c k - R a i n V.2 by C r i p ~ theme
can anyone point me in the direction of getting this to show on this particular theme?
thanks

VegaTheChosen

Quote from: VegaTheChosen on November 05, 2007, 10:08:13 PM
ive added this mod to my forum
and it worked with everything but  B l a c k - R a i n V.2 by C r i p ~ theme
can anyone point me in the direction of getting this to show on this particular theme?
thanks

any help?

Herman's Mixen

BoardIndex.template.php search for this

', $txt['most_online_ever'], ': ', $modSettings['mostOnline'], ' (' , timeformat($modSettings['mostDate']), ')
</span>
</td>
</tr>';


not every theme has that inside it don't know if you theme does

add after that code


// Users online today

echo '
<tr>
<td class="titlebg" colspan="2">', $txt['uot_users_online_today'], '</td>
</tr><tr>
<td class="windowbg" width="20" valign="middle" align="center">
<img src="', $settings['images_url'], '/icons/online.gif" alt="', $txt['uot_users_online_today'], '" border="0" />
</td>
<td class="windowbg2" width="100%">';

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

  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'], ')';

// Assuming there ARE users online... each user in users_online has an id, username, name, group, href, and link.
if (!empty($context['users_online_today']) && !$context['user']['is_guest'])
echo '<br />', implode(', ', $context['list_users_online_today']);

echo '
<br />', $context['show_stats'] && !$settings['show_sp1_info'] ? '
<a href="' . $scripturl . '?action=stats">' . $txt['smf223'] . '</a>' : '', '
</div>
</td>
</tr>';


success  ;D
Met vriendelijke groet, The Burglar!

 House Mixes | Mixcloud | Any Intelligent fool can make things bigger, more complex, and more violent.
It takes a touch of genius - and a lot of courage - to move in the opposite direction. - Albert Einstein

Former Godfather of our dutch community ;)

Jade Elizabeth

how do we hide the hidden users from being "counted"
Once proud Documentation Writer and Help Squad Leader | Check out my new adult coloring career: Color With Jade/Patreon.

VegaTheChosen

Quote from: The Burglar! on November 07, 2007, 04:53:20 PM
BoardIndex.template.php search for this

', $txt['most_online_ever'], ': ', $modSettings['mostOnline'], ' (' , timeformat($modSettings['mostDate']), ')
</span>
</td>
</tr>';


not every theme has that inside it don't know if you theme does

add after that code


// Users online today

echo '
<tr>
<td class="titlebg" colspan="2">', $txt['uot_users_online_today'], '</td>
</tr><tr>
<td class="windowbg" width="20" valign="middle" align="center">
<img src="', $settings['images_url'], '/icons/online.gif" alt="', $txt['uot_users_online_today'], '" border="0" />
</td>
<td class="windowbg2" width="100%">';

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

  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'], ')';

// Assuming there ARE users online... each user in users_online has an id, username, name, group, href, and link.
if (!empty($context['users_online_today']) && !$context['user']['is_guest'])
echo '<br />', implode(', ', $context['list_users_online_today']);

echo '
<br />', $context['show_stats'] && !$settings['show_sp1_info'] ? '
<a href="' . $scripturl . '?action=stats">' . $txt['smf223'] . '</a>' : '', '
</div>
</td>
</tr>';


success  ;D


the code you gave worked!
thank you!
I didnt have the script that you posted in the boardindex but i found the spot
thanks again

Herman's Mixen

Met vriendelijke groet, The Burglar!

 House Mixes | Mixcloud | Any Intelligent fool can make things bigger, more complex, and more violent.
It takes a touch of genius - and a lot of courage - to move in the opposite direction. - Albert Einstein

Former Godfather of our dutch community ;)

elliatt

I've installed this mod on 1.1.4 but it does not show up.

It installed with no problem or errors.

I'm using the default theme/skin and no other mods are installed.

Any suggestions?

Kimmie

Quote from: The Burglar! on November 07, 2007, 04:53:20 PM
BoardIndex.template.php search for this

', $txt['most_online_ever'], ': ', $modSettings['mostOnline'], ' (' , timeformat($modSettings['mostDate']), ')
</span>
</td>
</tr>';


not every theme has that inside it don't know if you theme does

add after that code


// Users online today

echo '
<tr>
<td class="titlebg" colspan="2">', $txt['uot_users_online_today'], '</td>
</tr><tr>
<td class="windowbg" width="20" valign="middle" align="center">
<img src="', $settings['images_url'], '/icons/online.gif" alt="', $txt['uot_users_online_today'], '" border="0" />
</td>
<td class="windowbg2" width="100%">';

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

  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'], ')';

// Assuming there ARE users online... each user in users_online has an id, username, name, group, href, and link.
if (!empty($context['users_online_today']) && !$context['user']['is_guest'])
echo '<br />', implode(', ', $context['list_users_online_today']);

echo '
<br />', $context['show_stats'] && !$settings['show_sp1_info'] ? '
<a href="' . $scripturl . '?action=stats">' . $txt['smf223'] . '</a>' : '', '
</div>
</td>
</tr>';


success  ;D


I added this to that template and for the most part it works great. Is there a code I can add so that it will also show the heading " Users Logged In Today" (like the mod does on the default theme)? Or just show that heading instead of the ":2 ( :2 :0)" part?



Thanks in advance. :)

Stargater59

Kimmie, in the default theme directory go to

languages/Modifications.english.php

and add:

$txt['uot_users_online_today']='Users Logged In Today';
$txt['uot_yesterday']='Yesterday at ';
$txt['uot_total']='Total';
$txt['uot_visible']='Visible';
$txt['uot_hidden']='Hidden';


And in stats.english.php add (unless it was added already):


$txt['users_online_today'] = 'Online Today';
$txt['num_hits'] = 'Total page views';
$txt['average_hits'] = 'Average page views per day';


That should work for any theme. Unless the theme uses it's own language files. 

Kimmie

In the languages/Modifications.english.php in the default theme, this is what was already there:

<?php
// Version: 1.1; Modifications
$txt['uot_users_online_today']='Users Logged In Today';
$txt['uot_yesterday']='Yesterday at ';
$txt['uot_total']='Total';
$txt['uot_visible']='Visible';
$txt['uot_hidden']='Hidden';

?>


(looks the same so I didnt change anything there).

In the stats.english.php file, I have this

<?php
// Version: 1.1; Stats

$txt[888] = 'Most Online';

$txt['smf_stats_1'] = 'Statistics Center';
$txt['smf_stats_2'] = 'General Statistics';
$txt['smf_stats_3'] = 'Top 10 Posters';
$txt['smf_stats_4'] = 'Top 10 Boards';
$txt['smf_stats_5'] = 'Forum History (using forum time offset)';
$txt['smf_stats_6'] = 'Date (yyyy/mm/dd)';
$txt['smf_stats_7'] = 'New Topics';
$txt['smf_stats_8'] = 'New Posts';
$txt['smf_stats_9'] = 'New Members';
$txt['smf_stats_10'] = 'Page views';
$txt['smf_stats_11'] = 'Top 10 Topics (by Replies)';
$txt['smf_stats_12'] = 'Top 10 Topics (by Views)';
$txt['smf_stats_13'] = 'Monthly Summary';
$txt['smf_stats_14'] = 'Most Online';
$txt['smf_stats_15'] = 'Top Topic Starters';
$txt['smf_stats_16'] = 'Most Time Online';
$txt['smf_stats_17'] = 'Best Karma';
$txt['smf_stats_18'] = 'Worst Karma';
$txt['stats_more_detailed'] = 'more detailed &raquo;';

$txt['average_members'] = 'Average registrations per day';
$txt['average_posts'] = 'Average posts per day';
$txt['average_topics'] = 'Average topics per day';
$txt['average_online'] = 'Average online per day';
$txt['users_online'] = 'Users Online';
$txt['gender_ratio'] = 'Male to Female Ratio';
$txt['users_online_today'] = 'Online Today';
$txt['num_hits'] = 'Total page views';
$txt['average_hits'] = 'Average page views per day';

$txt['smf_news_1'] = 'comment';
$txt['smf_news_2'] = 'comments';
$txt['smf_news_3'] = 'Write Comment';
$txt['smf_news_error2'] = 'You cannot specify a board that doesn\'t allow guests.  Please check the board ID before trying again.';
$txt['xml_rss_desc'] = 'Live information from ' $context['forum_name'];

?>




All those files seem to be there. Does anything look incorrect in those? I had originally added the user online mod while I still had the default theme up but when I changed the theme to a new one, that feature no longer worked so I added that code to the board template.

Stargater59

Well.. if the text strings are in Modifications.english.php, and you've made the appropriate edits to the theme you're using. The text should show up..

Kimmie

When I changed to the new theme, that info didnt appear - so I added this code, which allows it to work, It just has the #'s (:2 (:2 :0) instead of the "Users Logged In Today" text.


// Users online today

echo '
<tr>
<td class="titlebg" colspan="2">', $txt['uot_users_online_today'], '</td>
</tr><tr>
<td class="windowbg" width="20" valign="middle" align="center">
<img src="', $settings['images_url'], '/icons/online.gif" alt="', $txt['uot_users_online_today'], '" border="0" />
</td>
<td class="windowbg2" width="100%">';

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

  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'], ')';

// Assuming there ARE users online... each user in users_online has an id, username, name, group, href, and link.
if (!empty($context['users_online_today']) && !$context['user']['is_guest'])
echo '<br />', implode(', ', $context['list_users_online_today']);

echo '
<br />', $context['show_stats'] && !$settings['show_sp1_info'] ? '
<a href="' . $scripturl . '?action=stats">' . $txt['smf223'] . '</a>' : '', '
</div>
</td>
</tr>';


Is there a way to just adjust the above code to add the Users Logged In Today text as well? Or perhaps change the code to where it says that "instead" of the numbers?

TrueSatan

Quote from: wdm2005 on November 04, 2007, 04:56:36 AM
there is a mod users online in the last tweny four hours its old tho i have it on my forum i had to mauly install it tho


http://custom.simplemachines.org/mods/index.php?mod=479

If you look at the support topic for that mod you'll find I've updated it and added two derivative mods with different time periods.

Stargater59

Quote from: Kimmie on December 04, 2007, 05:08:09 PM
When I changed to the new theme, that info didnt appear - so I added this code, which allows it to work, It just has the #'s (:2 (:2 :0) instead of the "Users Logged In Today" text.


// Users online today

echo '
<tr>
<td class="titlebg" colspan="2">', $txt['uot_users_online_today'], '</td>
</tr><tr>
<td class="windowbg" width="20" valign="middle" align="center">
<img src="', $settings['images_url'], '/icons/online.gif" alt="', $txt['uot_users_online_today'], '" border="0" />
</td>
<td class="windowbg2" width="100%">';

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

  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'], ')';

// Assuming there ARE users online... each user in users_online has an id, username, name, group, href, and link.
if (!empty($context['users_online_today']) && !$context['user']['is_guest'])
echo '<br />', implode(', ', $context['list_users_online_today']);

echo '
<br />', $context['show_stats'] && !$settings['show_sp1_info'] ? '
<a href="' . $scripturl . '?action=stats">' . $txt['smf223'] . '</a>' : '', '
</div>
</td>
</tr>';


Is there a way to just adjust the above code to add the Users Logged In Today text as well? Or perhaps change the code to where it says that "instead" of the numbers?

You could. But I believe it's better to do it the other way. What theme are you using?

Kimmie

#798
Right now I am using this one:

http://custom.simplemachines.org/themes/index.php?lemma=411

EDIT- I changed themes to a different one and it works fine. Must be something wrong with the compatability of it with that other theme.

Stargater59

There's your problem.

That theme uses its own language files. Meaning, instead of having to edit the default theme's Modifications.english.php, you needed to add the text strings to blue_lt/languages/Modifications.english.php

Advertisement: