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

Sabre™

That's great, but since there are only 2 edits for this mod, you are about to have a learning curve and attempt to fix it yourself.
It is better for you to learn a little, than nothing at all.
So look for the edits this mod makes by following [THESE] instructions in reverse. Meaning, remove the duplicate code.
Or, somebody will assist you if you're unwilling to learn.
Good Luck :)
Do NOT give admin and/or ftp details to just anybody, see if they are trust worthy first!!  Do your homework ;)


Мel

"The ability to speak does not make you intelligent."
- Qui-Gon Jinn

Sabre™

You'll do fine, this one is nice and easy.
But if you do run into an issue, do not hesitate to seek assistance.
Do NOT give admin and/or ftp details to just anybody, see if they are trust worthy first!!  Do your homework ;)


Мel

#1783
OK, thank you.

Yep, that was pretty easy. It works fine now.
"The ability to speak does not make you intelligent."
- Qui-Gon Jinn

cyberhat


rickmastfan67

Has anybody been able to properly code this addon to look like it did in 1.1.x in the 2.0.x branch with the "core" theme or any themes that are based off "core"?

The reason I'm asking is because I just did this myself, but it seems that I made a mistake in the coding in "BoardIndex.template.php" and it's causing the Info Center to get messed up and overflow it's bounds. (See here)


So, here's the code that I put into my file to get it to look properly like 1.1.x in 2.0.x:
// Users Online Today
echo '
<div class="infocenter_section">
<h4 class="titlebg">', $txt['uot_users_online_'.$modSettings['uot_setting_period']], '</h4>
<div class="windowbg">
<p class="section icon">
<img class="icon" src="', $settings['images_url'], '/icons/online.gif', '" alt="', $txt['uot_users_online_'.$modSettings['uot_setting_period']], '" />','
</p>
<div class="windowbg2 sectionbody">
<div class="inline smalltext">
', $txt['uot_total'], ': <b>', $context['num_users_online_today'], '</b>';
if ($context['viewing_allowed'])
echo
' (', $txt['uot_visible'], ': ', ($context['num_users_online_today'] - $context['num_users_hidden_today']), ', ', $txt['uot_hidden'], ': ', $context['num_users_hidden_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['viewing_allowed'])
{
echo
'<br />', implode(', ', $context['list_users_online_today']);
}
echo '
</div>
</div>
</div>';



Somehow, that code is causing the "Info Center" to act up with I have the "Global Headers and Footers" mod installed and I use the Global Footer part.

So, if some of you code geniuses wouldn't mind taking a look at this and can tell me what I did wrong possibly, I would greatly appreciate it.  When I was creating this code, I was taking a look at the "Who's Online" section so I could get image to be in a little box like in 1.1.x.

rickmastfan67

:facepalm:

I've figured out what my mistake was.  I forgot to close out one of the "<div>" commands causing it to somehow to absorb the "Global Footer" from the "Global Headers and Footers" mod.

So, if anybody needs the coding for the 2.0.2 "Core" theme, here ya go.  This should work just fine now.  Hopefully there are no other mistakes in it. :)

./Themes/core/BoardIndex.template.php
Code (Find:) Select
// If they are logged in, but statistical information is off... show a personal message bar.

Code (Add Before:) Select
// Users Online Today
echo '
<div class="infocenter_section">
<h4 class="titlebg">', $txt['uot_users_online_'.$modSettings['uot_setting_period']], '</h4>
<div class="windowbg">
<p class="section icon">
<img class="icon" src="', $settings['images_url'], '/icons/online.gif', '" alt="', $txt['uot_users_online_'.$modSettings['uot_setting_period']], '" />','
</p>
<div class="windowbg2 sectionbody">
<div class="inline smalltext">
', $txt['uot_total'], ': <b>', $context['num_users_online_today'], '</b>';
if ($context['viewing_allowed'])
echo
' (', $txt['uot_visible'], ': ', ($context['num_users_online_today'] - $context['num_users_hidden_today']), ', ', $txt['uot_hidden'], ': ', $context['num_users_hidden_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['viewing_allowed'])
{
echo
'<br />', implode(', ', $context['list_users_online_today']);
}
echo '
</div>
</div>
</div>
</div>';

Castagna

Hello,

I tried to install this mod on SMF 2.0.2 currently, and while i'm installing the mod it appears this error:



errors_template.php has been set as 0777 CHMOD. But still giving this error while im installing the mod.

Please someone can help me, im new on this plataform, Thanks.

TheListener

Rather than post an image of the error please keep it as text.

Any errors in your forums error log?

Forum link?

Castagna

@Old Fossil: Sorry for the pic, and there's no error logs.

Here it's the forum link: ea.vrocker-hosting.co.uk [nofollow]

TheListener

Can you please either open the forum to guests or give me temp admin ( via pm only) access so I can have a look for you.

Castagna

Quote from: Old Fossil on June 06, 2012, 08:03:53 PM
Can you please either open the forum to guests or give me temp admin ( via pm only) access so I can have a look for you.
Sure, try to register and then im going to set admin rights.

TheListener

Quote from: Castagna on June 06, 2012, 08:05:38 PM
Quote from: Old Fossil on June 06, 2012, 08:03:53 PM
Can you please either open the forum to guests or give me temp admin ( via pm only) access so I can have a look for you.
Sure, try to register and then im going to set admin rights.

I may be a while as I have a few errors on my forum at present.

::)

Castagna

Bump!

Someone could help me with this? I still facing this issue when i want to install the mod.

TheListener

Oops I forgot about this.

:-[

Can you please send me the temp admin details via pm and I'll have a look now for ya.

archiebald

I had the 1.6 version of this mod running fine on SMF2.0 which had been upgraded to 2.0.2 via the incremental upgrades.

I just made a cleaner upgrade using the 2.0.2 large upgrade and this mod was disabled.  All attempts to reinstall it and the latest version ends up with it killing my forum.  I am left with just a blank page, no error messages.

The only way I can rrecover is to delete everything and use backups of the forum files and database.

No errors were reported during installation, just instant death.

I am reporting this as unsafe on the mods page.

TheListener

QuoteI am reporting this as unsafe on the mods page.

The mod works as it should on 2.0.2

Did you uninstall the mod completely before upgrading?

Arantor

QuoteI am left with just a blank page, no error messages.

There are going to be errors in the host error log.

QuoteI am reporting this as unsafe on the mods page.

Waste of time. This mod is not unsafe - it installs and functions on a fresh install and has no known vulnerabilities (I've looked in the past) and the team will not remove it because of installation issues on your specific installation.

archiebald

Quote from: Arantor on July 21, 2012, 10:17:48 PM
Waste of time. This mod is not unsafe - it installs and functions on a fresh install and has no known vulnerabilities (I've looked in the past) and the team will not remove it because of installation issues on your specific installation.

Sorry if it upsets you, I can only report what I see.  It killed my forum so as far as I am concerned, it is unsafe.  Maybe other people are having the same problem, I don't know.

Arantor

It's not upsetting me, it's simply that it isn't actually unsafe, it just doesn't function on your specific forum for any one of many separate reasons, and none of them are 'unsafe', and the team will do precisely nothing for that reason - it isn't actually broken.

Advertisement: