News:

Wondering if this will always be free?  See why free is better.

Main Menu

Users Online Today Mod

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

Previous topic - Next topic

Stuart

Quote from: ASi ve MAVi on December 28, 2005, 06:55:33 AM
my dear frıend,ı have opened a mod ın whıch you had.ıs ıt ok for you?

http://www.guzelforum.com/forum/index.php/board,70.0.html

sorry I don't english speak too

Thanks for offering your help, though I don't get any further by visiting your website  :( Nevertheless it's appreciated that you tried  ;D

If anyone can help me how I can actually get this MOD working on my forum that would be very kind !

Cheers,
Stuart

ASi ve MAVi

#141
1.1RC1 FOR MANUEL SETUP


SOURCE directory BoardIndex.php file chance


find


mysql_free_result($result_boards);

after to add

// Load the users online today.
$nowdate = @getdate(forum_time(false));
$midnight = mktime(0, 0, 0, $nowdate['mon'], $nowdate['mday'], $nowdate['year']) - ($modSettings['time_offset'] * 3600);

$s = strpos($user_info['time_format'], '%S') === false ? '' : ':%S';
if (strpos($user_info['time_format'], '%H') === false && strpos($user_info['time_format'], '%T') === false)
$time_fmt = '%I:%M' . $s . ' %p';
else
$time_fmt = '%H:%M' . $s;

$result = db_query("
SELECT
mem.ID_MEMBER, mem.lastLogin, mem.realName, mem.memberName, mem.showOnline,
mg.onlineColor, mg.ID_GROUP, mg.groupName
FROM {$db_prefix}members AS mem
LEFT JOIN {$db_prefix}membergroups AS mg ON (mg.ID_GROUP = IF(mem.ID_GROUP = 0, mem.ID_POST_GROUP, mem.ID_GROUP)) WHERE mem.lastLogin >= $midnight", __FILE__, __LINE__);

$context['users_online_today'] = array();
$context['list_users_online_today'] = array();

while ($row = mysql_fetch_assoc($result))
{
$userday = strftime('%d', forum_time(true));
$loginday = strftime('%d', forum_time(true, $row['lastLogin']));
$yesterday = $userday == $loginday ? '' : $txt['uot_yesterday'];

$lastLogin = $yesterday . strftime($time_fmt, forum_time(true, $row['lastLogin']));
$title = (allowedTo('moderate_forum') || !empty($row['showOnline'])) ? ' title="' . $lastLogin . '"' : '';

// Some basic color coding...
if (!empty($row['onlineColor']))
$link = '<a href="' . $scripturl . '?action=profile;u=' . $row['ID_MEMBER'] . '"' . $title . ' style="color: ' . $row['onlineColor'] . ';">' . $row['realName'] . '</a>';
else
$link = '<a href="' . $scripturl . '?action=profile;u=' . $row['ID_MEMBER'] . '"' . $title . '>' . $row['realName'] . '</a>';

$is_buddy = in_array($row['ID_MEMBER'], $user_info['buddies']);
if ($is_buddy)
{
$link = '<b>' . $link . '</b>';
}

$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;
}
mysql_free_result($result);

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

$context['num_users_online_today'] = count($context['users_online_today']);





SOURCE directory Stats.php file chance

find


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

after to add

// Total members online today
$frag = explode('-', strftime('%Y-%m-%d', time()));
$midnight = forum_time(false, mktime(0, 0, 0, (int) $frag[1], (int) $frag[2], (int) $frag[0]));
$result = db_query("
SELECT
COUNT(*)
FROM {$db_prefix}members
WHERE lastLogin >= $midnight", __FILE__, __LINE__);
list ($context['total_users_online_today']) = mysql_fetch_row($result);





yours theme BoardIndex.template.php file chance

find


<a href="' . $scripturl . '?action=stats">' . $txt['smf223'] . '</a>' : '', '
</div>
</td>
</tr>';


after to add


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

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

echo $context['num_users_online_today'], ' ', $context['num_users_online_today'] == 1 ? $txt['uot_user_online_today'] : $txt['uot_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']))
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>';





yours theme Stats.template.php file chance

find


<td nowrap="nowrap">', $txt['users_online_today'], ':</td>
<td align="right">', $context['online_today'], '</td>';


remove and add


<td nowrap="nowrap">', $txt['users_online_today'], ':</td>
<td align="right">', $context['online_today'], '</td>
</tr><tr>
<td nowrap="nowrap">', $txt['uot_total_users_online_today'], ':</td>
<td align="right">', $context['total_users_online_today'], '</td>';





DEFAULT Theme LANGUAGES directory Modifications.english.php file chance

?>

over to add

$txt['uot_users_online_today_title']='Users Online Today';
$txt['uot_user_online_today']='user online today';
$txt['uot_users_online_today']='users online today';
$txt['uot_total_users_online_today']='Total Online Today';
$txt['uot_yesterday']='Yesterday at ';


Stuart


ASi ve MAVi


beemer

Stuart ?

Did you install the 1.05 version?

What are the errors you are getting?
http://www.bmw7resource.co.uk
SMF 1.1 RC1
MKP 1.1 RC1
Helios Multi RC1
-------------------------------------------------------
http://www.thefishsheadnhorsesarse.co.uk
SMF 1.1 RC2
TinyPortal 0.8.6

Stuart

Quote from: beemer on December 28, 2005, 04:31:07 PM
Stuart ?

Did you install the 1.05 version?

What are the errors you are getting?

I may actually have used the wrong version of this MOD  ???

beemer

See if you can uninstall and try the versio in the link on my post 2 above?
http://www.bmw7resource.co.uk
SMF 1.1 RC1
MKP 1.1 RC1
Helios Multi RC1
-------------------------------------------------------
http://www.thefishsheadnhorsesarse.co.uk
SMF 1.1 RC2
TinyPortal 0.8.6

Stuart

Quote from: beemer on December 28, 2005, 04:46:34 PM
See if you can uninstall and try the versio in the link on my post 2 above?

I'm ever so sorry, but that seems to be the location MOD  ???
I already tried that but what has it got to do with the Online Today MOD  ???
Sorry for not understanding, I possibly look like a pretty dumb guy now  :(

beemer

Stuart sorry  (that was for someting else) doh

The latest version says for 1.1 rc1 I cant find an old copy maybe on my works pc?

What are the errors you get?
http://www.bmw7resource.co.uk
SMF 1.1 RC1
MKP 1.1 RC1
Helios Multi RC1
-------------------------------------------------------
http://www.thefishsheadnhorsesarse.co.uk
SMF 1.1 RC2
TinyPortal 0.8.6

Stuart

Quote from: beemer on December 28, 2005, 05:12:28 PM
Stuart sorry  (that was for someting else) doh

The latest version says for 1.1 rc1 I cant find an old copy maybe on my works pc?

What are the errors you get?

I should find myself the 1.0.5. version I guess  :P

1. Voer aanpassing uit ./Sources/BoardIndex.php Succes
2. Voer aanpassing uit ./Sources/Stats.php Failed
3. Voer aanpassing uit ./Themes/default/BoardIndex.template.php Failed
4. Voer aanpassing uit ./Themes/default/Stats.template.php Failed
5. Voer aanpassing uit ./Themes/default/languages/Modifications.english.php Failed
6. Voer aanpassing uit ./Themes/default/languages/Stats.english.php Failed

2: in_array(): Wrong datatype for second argument
Bestand: /data/members/paid/o/r/orisit.nl/htdocs/www/astmaforum/Sources/BoardIndex.php
Regel: 274

8: Undefined index: buddies
Bestand: /data/members/paid/o/r/orisit.nl/htdocs/www/astmaforum/Sources/BoardIndex.php
Regel: 274

Stuart

#150
Quote from: RoarinRow on December 10, 2005, 06:11:44 PM
I finally got this to work on my forum SMF 1.0.5.

1.  I downloaded the file from FaSan's website (Registration required to get to download section).  After your register, you should logout, then log back in again to see the contents of the download section.

     http://www.smitalia.net/community/index.php

2.  Download and install OnLineUserToday_13_10.zip via Package Manager

3.  Edit your 'BoardIndexTemplate' for your custom them. 

I had to change the highlighted code from 'titlebg' to 'catgb' to go with my Techhead theme.

// "Users online Today"
        if(isset($context['num_users_today']))
        echo '
        <tr>
                <td class="catbg" colspan="2">', $txt['158bis'], ' ( ', $context['num_users_today'], ' ', $context['num_users_today'] == 1 ? $txt['user'] : $txt['users'], ' )</td>
        </tr><tr>
                <td class="windowbg" width="20" valign="middle" align="center"><img src="', $settings['images_url'], '/icons/online.gif" alt="', $txt['158bis'], '" border="0" /></td>
                <td class="windowbg2" width="100%"><span class="smalltext">', $context['user_today'], '</span></td>
        </tr>';

That's it.  It put's the member's names in alphabetical order.

I tried all that but I'm getting these errors:

8: Undefined index: 158bis
Bestand: /data/members/paid/o/r/orisit.nl/htdocs/www/astmaforum/Themes/safblue105/BoardIndex.template.php (eval?)
Regel: 362


8: Undefined index: 158bis
Bestand: /data/members/paid/o/r/orisit.nl/htdocs/www/astmaforum/Themes/safblue105/BoardIndex.template.php (eval?)
Regel: 364


I have to put my account into English, otherwise it's not working and it looks like a mess when you view the stats page (if you're using the Dutch language)  :'(

8: Undefined index: smf_stats_14bis
Bestand: /data/members/paid/o/r/orisit.nl/htdocs/www/astmaforum/Themes/default/languages/Stats.dutch.php (eval?)
Regel: 181

Stuart

Quote from: RoarinRow on December 28, 2005, 06:24:02 PM
Quote from: Stuart on December 28, 2005, 06:13:47 PM
Quote from: RoarinRow on December 10, 2005, 06:11:44 PM
I finally got this to work on my forum SMF 1.0.5.

1.  I downloaded the file from FaSan's website (Registration required to get to download section).  After your register, you should logout, then log back in again to see the contents of the download section.

     http://www.smitalia.net/community/index.php

2.  Download and install OnLineUserToday_13_10.zip via Package Manager

3.  Edit your 'BoardIndexTemplate' for your custom them. 

I had to change the highlighted code from 'titlebg' to 'catgb' to go with my Techhead theme.

// "Users online Today"
        if(isset($context['num_users_today']))
        echo '
        <tr>
                <td class="catbg" colspan="2">', $txt['158bis'], ' ( ', $context['num_users_today'], ' ', $context['num_users_today'] == 1 ? $txt['user'] : $txt['users'], ' )</td>
        </tr><tr>
                <td class="windowbg" width="20" valign="middle" align="center"><img src="', $settings['images_url'], '/icons/online.gif" alt="', $txt['158bis'], '" border="0" /></td>
                <td class="windowbg2" width="100%"><span class="smalltext">', $context['user_today'], '</span></td>
        </tr>';

That's it.  It put's the member's names in alphabetical order.

I tried all that but I'm getting these errors:

8: Undefined index: 158bis
Bestand: /data/members/paid/o/r/orisit.nl/htdocs/www/astmaforum/Themes/safblue105/BoardIndex.template.php (eval?)
Regel: 362


8: Undefined index: 158bis
Bestand: /data/members/paid/o/r/orisit.nl/htdocs/www/astmaforum/Themes/safblue105/BoardIndex.template.php (eval?)
Regel: 364


I have to put my account into English, otherwise it's not working and it looks like a mess when you view the stats page (if you're using the Dutch language)  :'(

I have the file here - OnLineUserToday

I resolved those errors by going to my 'Modifications.english.php file' found at Themes/default/languages and adding this line:

//OnLine Users Today
$txt['158bis'] = 'Users Online Today';
$txt['smf_stats_14bis'] = 'Users Online Today';



It worked, thanks for your help  :D

RoarinRow

#152
Quote from: Stuart on December 28, 2005, 06:48:16 PM
Quote from: RoarinRow on December 28, 2005, 06:24:02 PM
Quote from: Stuart on December 28, 2005, 06:13:47 PM
Quote from: RoarinRow on December 10, 2005, 06:11:44 PM
I finally got this to work on my forum SMF 1.0.5.

1.  I downloaded the file from FaSan's website (Registration required to get to download section).  After your register, you should logout, then log back in again to see the contents of the download section.

     http://www.smitalia.net/community/index.php

2.  Download and install OnLineUserToday_13_10.zip via Package Manager

3.  Edit your 'BoardIndexTemplate' for your custom them. 

I had to change the highlighted code from 'titlebg' to 'catgb' to go with my Techhead theme.

// "Users online Today"
        if(isset($context['num_users_today']))
        echo '
        <tr>
                <td class="catbg" colspan="2">', $txt['158bis'], ' ( ', $context['num_users_today'], ' ', $context['num_users_today'] == 1 ? $txt['user'] : $txt['users'], ' )</td>
        </tr><tr>
                <td class="windowbg" width="20" valign="middle" align="center"><img src="', $settings['images_url'], '/icons/online.gif" alt="', $txt['158bis'], '" border="0" /></td>
                <td class="windowbg2" width="100%"><span class="smalltext">', $context['user_today'], '</span></td>
        </tr>';

That's it.  It put's the member's names in alphabetical order.

I tried all that but I'm getting these errors:

8: Undefined index: 158bis
Bestand: /data/members/paid/o/r/orisit.nl/htdocs/www/astmaforum/Themes/safblue105/BoardIndex.template.php (eval?)
Regel: 362


8: Undefined index: 158bis
Bestand: /data/members/paid/o/r/orisit.nl/htdocs/www/astmaforum/Themes/safblue105/BoardIndex.template.php (eval?)
Regel: 364


I have to put my account into English, otherwise it's not working and it looks like a mess when you view the stats page (if you're using the Dutch language)  :'(

I resolved those errors by going to my 'Modifications.english.php file' found at Themes/default/languages and adding this line:

//OnLine Users Today
$txt['158bis'] = 'Users Online Today';
$txt['smf_stats_14bis'] = 'Users Online Today';



It worked, thanks for your help  :D


Welcome!

SMF 2.0
TP 1.0 RC1.1
Wordpress 3.1.3

California Dreamin

I have installed this and it is not showing up on my board. How do you activate it?
I have logged out and back in. Still not showing up.

RoarinRow

Quote from: fresnolady on December 29, 2005, 02:28:02 AM
I have installed this and it is not showing up on my board. How do you activate it?
I have logged out and back in. Still not showing up.

I used the edit to my custom BoardIndexTemplate.php as described above for my SMF v.1.0.5 forum.  The mod should work for the Default theme, but anything else will require modification to your BoardIndexTemplate.php for your version of SMF.

SMF 2.0
TP 1.0 RC1.1
Wordpress 3.1.3

California Dreamin

Quote from: RoarinRow on December 29, 2005, 02:36:00 AM
Quote from: fresnolady on December 29, 2005, 02:28:02 AM
I have installed this and it is not showing up on my board. How do you activate it?
I have logged out and back in. Still not showing up.

I used the edit to my custom BoardIndexTemplate.php as described above for my SMF v.1.0.5 forum.  The mod should work for the Default theme, but anything else will require modification to your BoardIndexTemplate.php for your version of SMF.

I am using the Default theme  :(

RoarinRow

Quote from: fresnolady on December 30, 2005, 12:27:53 AM
Quote from: RoarinRow on December 29, 2005, 02:36:00 AM
Quote from: fresnolady on December 29, 2005, 02:28:02 AM
I have installed this and it is not showing up on my board. How do you activate it?
I have logged out and back in. Still not showing up.

I used the edit to my custom BoardIndexTemplate.php as described above for my SMF v.1.0.5 forum.  The mod should work for the Default theme, but anything else will require modification to your BoardIndexTemplate.php for your version of SMF.

I am using the Default theme  :(

Is this in your 'boardindextemplate.php' file:

// "Users online Today"
        if(isset($context['num_users_today']))
        echo '
        <tr>
                <td class="catbg" colspan="2">', $txt['158bis'], ' ( ', $context['num_users_today'], ' ', $context['num_users_today'] == 1 ? $txt['user'] : $txt['users'], ' )</td>
        </tr><tr>
                <td class="windowbg" width="20" valign="middle" align="center"><img src="', $settings['images_url'], '/icons/online.gif" alt="', $txt['158bis'], '" border="0" /></td>
                <td class="windowbg2" width="100%"><span class="smalltext">', $context['user_today'], '</span></td>
        </tr>';

SMF 2.0
TP 1.0 RC1.1
Wordpress 3.1.3

California Dreamin

Quote from: RoarinRow on December 30, 2005, 12:46:19 AM
Quote from: fresnolady on December 30, 2005, 12:27:53 AM
Quote from: RoarinRow on December 29, 2005, 02:36:00 AM
Quote from: fresnolady on December 29, 2005, 02:28:02 AM
I have installed this and it is not showing up on my board. How do you activate it?
I have logged out and back in. Still not showing up.

I used the edit to my custom BoardIndexTemplate.php as described above for my SMF v.1.0.5 forum.  The mod should work for the Default theme, but anything else will require modification to your BoardIndexTemplate.php for your version of SMF.

I am using the Default theme  :(

Is this in your 'boardindextemplate.php' file:

// "Users online Today"
        if(isset($context['num_users_today']))
        echo '
        <tr>
                <td class="catbg" colspan="2">', $txt['158bis'], ' ( ', $context['num_users_today'], ' ', $context['num_users_today'] == 1 ? $txt['user'] : $txt['users'], ' )</td>
        </tr><tr>
                <td class="windowbg" width="20" valign="middle" align="center"><img src="', $settings['images_url'], '/icons/online.gif" alt="', $txt['158bis'], '" border="0" /></td>
                <td class="windowbg2" width="100%"><span class="smalltext">', $context['user_today'], '</span></td>
        </tr>';


no, I don't see that......

HNHF

Hi There,

I am running  SMF RC2  and de Online Users Today mod won't work with this version.

Is there a update for it?

Greetings, Martin.
Groetjes Martin....


Http://www.hnhf.nl/

DemonicInfluence

I don't think so as the mod creator isn't a charter member, so they wouldn't be able to get rc2..

Advertisement: