News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Users Online Today Mod

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

Previous topic - Next topic

ludothegreat

Just installed this mod on SMF 1.1.1  using Dilbert MC theme. I am now getting a bunch of code at the top of my Forum. Even after uninstalling the mod it is still there. Here is the code.

$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';

I also tried to reinstall the mod thinking maybe something installed wrong and it added a second line with the same exact thing at the top. So now I have two lines of code. Here is the site if you want to check it out for yourself.

hxxp:ludothegreat.com/mallorngardens/forums/ [nonactive]

I just want to get rid of the code. Thanks in advance.

Sir_Trout

Just installed this mod on SMF 1.1.2  using Dilbert MC theme and it did not work, but it does work on the default theme.  so I did some reading and found the following...

Quote from: Bigguy on January 14, 2007, 02:05:41 PM
This should be the only edit you have to do. In your BoardIndex.template.php find:

</span>
</td>
</tr>';


Before that add:

// 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>';




:P But I get get this error when I try and install the above code.
The file you tried to save generated the following error:
Parse error: parse error, unexpected '>' in BoardIndex.template.php on line 223

Any ideas?


-ST

Bigguy

I am getting the same error and will try to figure this out tonight. When I do I will post something. (if I do)

Sir_Trout

#563
One more question, you said to look for this...
                      </span>
      </td>
   </tr>';

Do I look for the first instance of this?  because I see it more then once....  In the Dilbert MC theme any ways.

-ST

archiebald

Sorry, I didn't read all 38 pages of this thread.

This mod did not work when attempting to install with the 1.1.2 default theme.

Carceri

Quote from: archiebald on February 14, 2007, 01:52:32 AM
Sorry, I didn't read all 38 pages of this thread.

This mod did not work when attempting to install with the 1.1.2 default theme.

Okay, I will look into that. It works if you have the mod applied to 1..1.1 when upgrading to 1.1.2, so I guess the changes required to make it work with 1.1.2 are minimal.

Could you please tell me what files it fails to apply the mod to?

archiebald

Surely,

3.    Execute Modification    C:\Inetpub\wwwroot\forum/Themes/default/BoardIndex.template.php    Test failed

All other pre-installation tests are successful

Bigguy

Ok I have just installed this and it works. If you install the mod with the error on BoardIndex.template.php you have to put the edit in manually for that file but it's hard to find. Look for this in the BoardIndex.template.php file:

echo $newmembul123 , ' New This Month: ' , $row['month'] , ' ' , $newmembul123 , ' New This Week: ' , $row['week'] , ' ' , $newmembul123 , ' New Today: ' , $row['today'];

After that add this:

  // 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>';


and it should work for you. Back up first before trying this.

archiebald


SaltedWeb

Hi Guys , with so many edits mentioned I am lost as to what to use  :'(

I installed the mod fine on. 1.1.1 ( now 1.1.2 ) I want to use the classic theme
when I switch of course the mod is no longer active.
But is installed.

Do I uninstall and try re-install it?
Or do I edit a PHP file if so what do I edit in?

What do I need to do to make it work in the classic mode?

Thanks you for this Mod I am hopeful to use it on the other Classic Theme.


Cozmo

Knowing your limitations makes you human, exceeding these limitations makes you worthy of being human.

Bigguy

Mods only work on the default theme so if you switch themes you will have to do a bit of editing. The only files that need to be edited seeing as its already installed is any template files it modifies. Obviously BoardIndex.template.php is one of the template files that need to be edited. You can find that edit a couple posts up. For any others you will have to look in the .xml file of the package to see if there are anymore template files to edit. (Not the Package-info.xml file)

SaltedWeb

Hi That,
was part of the question there are to may responses and edits described in this post to make heads or tales as to what are the edits and where  do they take place?


Cozmo
Knowing your limitations makes you human, exceeding these limitations makes you worthy of being human.

Bigguy

Stats.template.php
BoardIndex.template.php

Are the only template files. If you have a Stats.template.php in the default theme folder and NOT in the custom theme you are using it should not have to be done. In Stats.template.php find:

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


And replace with:

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

Carceri

Well, BoardIndex.template is unchanged between 1.1.1 and 1.1.2, so there must be something else wrong.

Quote from: archiebald on February 14, 2007, 10:13:39 AM
Surely,

3.    Execute Modification    C:\Inetpub\wwwroot\forum/Themes/default/BoardIndex.template.php    Test failed

All other pre-installation tests are successful

Photoshocker

Hi, im using Aa New Damage Theme and i cant get this work.

What modifications should i do to get it work?

Thanks.

Inflame

Heya


I was wondering,

is there an option the have a code in a script box from TP to show it to all users online, so I don't need to modify all themes I use with the code's, and everyone can see it right away

Is this an option or just me talking weird?

Bigguy

I think code for that could be found at www.tinyprtal.net. I don't think this mod will do in a block.  

Grozzy

I accidentally installed this on a customized theme, and it didn't work.
Now I got a text on the top of the page saying:
$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';


What can I do to remove it ?

Bigguy

#578
In the modifications.english.php file make sure that the ?> is right at the very end of the file and not at the end of that code.

Grozzy

I want to remove it, I don't want the mod, just want to remove it.

Advertisement: