Hello,
Saw some unfilled requests so I decided to fulfill it. The requests were about using the mod Users Online today (http://custom.simplemachines.org/mods/index.php?mod=217) and make a block to show the thing it shows under Users Online on Board Index(Means where the board names are located not the TP Users online today block).
So I made a code to make it work.
P.S. I used the code it uses in BoardIndex.template.php(Modified it a bit to make it work in blocks).
NOTE:It works with left/right/center blocks.
NOTE:You must have Users online today mod (http://custom.simplemachines.org/mods/index.php?mod=217) installed
Tested with TP 0.9.8 with Usersn Online today v 1.4.0
Update!
- Made it to call Modifications.english.php file from the default directory because of some theme's custom Modifications.english.php usage
Insert the fol code in a php Block
//Users online today block by Dragooon
//Uses the mod User Online today by Carceri
//No Credits to Dragooon since I used the template from BoardIndex.template.php
//Works on Right/Left/Center Blocks
global $boarddir, $txt, $context, $settings, $scripturl;
require($boarddir . 'Themes/default/languages/Modifications.english.php');
echo ' ', $txt['uot_users_online_today'], '
<img src="', $settings['images_url'], '/icons/online.gif" alt="', $txt['uot_users_online_today'], '" border="0" />
';
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>' : '', '
' ;
Hope you like it.
This is what i get:
: (: 0, : )
Seriously.
This block is working with me good.
Make sure you got the mod installed.
I just updated it and made it call Mdifications.english.php from the default directory, It may now work.
Hi Dragoon,
Nothing for me either, this is what I get: -
Users Logged In Today (ICON) Total: (Visible: 0, Hidden: )
Regards,
Wilsy.
This uses the Users Online today mod.
So it is its fault not mine.
Hi Dragoon,
I have the mod installed and I wasn't saying it was your fault - I love it so much I just want it to work, that's all ;)
Regards,
Wilsy.
This is based on the mod.
So what the mod will show it will show.I cant really help in that.
See if any errors are being thrown (check your forum error log).
I don't see any 'global' statement in the code, so all those variables/arrays may be undefined at parse time.
Adding this at the top might help:
global $boarddir, $txt, $context, $settings, $scripturl;
So that was missing :P
I forgot to add globals I am sorry about that.
Thanks for all your efforts, they're appreciated.
The script now causes an error as below: -
Fatal error: Unknown: Failed opening required '/home/rewindla/public_html/forumThemes/default/languages/Modifications.english.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/rewindla/public_html/forum/Sources/Load.php(1792) : eval()'d code(35) : eval()'d code on line 6
Sorry to be a pain, would love to get this one working.
Regards,
Wilsy.
Try changing:
require($boarddir . 'Themes/default/languages/Modifications.english.php');
To:
require($boarddir . '/Themes/default/languages/Modifications.english.php');
Or let SMF load it by replacing that line with:
loadLanguage('Modifications');
Thanks JA,
Still no luck, this is the result: -
(https://www.tinyportal.net/index.php?action=dlattach;topic=17742.0;attach=11515;image)
With these in the error logs: -
8: Undefined index: lang_locale
/home/rewindla/public_html/forum/Sources/Subs.php
868
8: Undefined index: smf10b
/home/rewindla/public_html/forum/Sources/Subs.php
863
I have attached my subs.php and Modifications.english.php files in case it's of any use.
Thanks to both of you for your help, it's very appreciated.
Regards,
Wilsy.
This is obviously getting processed brfore some critical pieces are getting parsed, because those two errors refer to the lack of a definition for two entries which are given in the index.<language>.php file.
So, you can try to add this line right before the require/loadLanguage mentioned in the last message:
loadLanguage('index');
Thanks again JA,
Still no luck though :(
It's a real pity because I've just reworked the site a little and this block would come in real handy.
Regards,
Wilsy.
Hey Wilsy, just wanted too see if you ever got it working? i tried all the tips in this thread as well and still get errors such as you posted. Only asking ya, because you seem to be actively trying to get it to work.
jd
No, unfortunatey not :(
It's a real pity as I have this: -
echo '<img src="'.$settings['actual_images_url'].'/icons/online.gif'.'" /> <a href="'.$scripturl.'?action=who"><b>'.$txt[158].'</b></a><br>
<span class="smalltext">';
ssi_whosOnline();
echo '</span>';
...in a centre block showing Users Currently Online and it would have been very nice to have the Users Online Today block below it.
Regards,
Wilsy.
that would be cool. maybe even a combined block as well seperated by a line or something.
I totally agree!
I'm sure one of the coding guru's will be along soon ;)
Regards,
Wilsy.
Wouldn't this do the job?
In a PHP Block (Left, right or center) add:
require("SSI.php");
ssi_whosOnline_today();
I've attached examples below, ;)
Hope this works.
i got a fatal error and i do have the whos online today moday installed.
wilsy, it work for you?
what was the error?
Fatal error: Call to undefined function: ssi_whosonline_today() in /home/content/j/d/w/jdworld/html/Sources/Load.php(1759) : eval()'d code(35) : eval()'d code on line 3
That would be because you either don't have the mod installed, or the mod did not modify the SSI.php file properly. You'll need to ask the mod author for more help on this issue.
I get this: -
Fatal error: Cannot redeclare ssi_shutdown() (previously declared in /home/rewindla/public_html/forum/SSI.php:188) in /home/rewindla/public_html/forum/SSI.php on line 190
Although I haven't tried I think it would work in the block whilst you are in the forum. I need to use the code in a front page block.
Regards,
Wilsy.
you have a duplicate line of the same code delete one of the duplicates.
ok, I got it to work by installing the most users on-line mod, but found out that this PHP Block Code will only show the users if your in the forum, IE: /index.php?action=forum
If your in Tinyportal front end, it will not show anything.
Thats because the mod apply to the SMF files in the default theme, it doesent apply to TP.
Quote from: npereira on August 17, 2007, 02:48:23 AM
ok, I got it to work by installing the most users on-line mod, but found out that this PHP Block Code will only show the users if your in the forum, IE: /index.php?action=forum
If your in Tinyportal front end, it will not show anything.
I took those screen shots from my frontpage. It should work fine. ;)
SMF version: SMF2.0
TP version: TP 1.0RC2
Default Forum Language: Hungarian
Theme name and version: Fire Rock (convert:Tinyportal-eu)
Links url Smf-Tinyportal test Site (http://www.smf-test.tinyportal.eu/)
Me you the tinyportal.net/forum Users block code?
The user online today mod installed.
(I love Would shape my site so, would look than the tinyportal.net side)
Thank you...
Can you rephrase that?
SMF version: SMF2.0
TP version: TP 1.0RC2
Default Forum Language: Hungarian
Theme name and version: Fire Rock (convert:Tinyportal-eu)
Links url Smf-Tinyportal test Site (http://www.smf-test.tinyportal.eu/)
I would like his code the tinyportal.net/forum Users block code?
The smf user online today mod my installed.
(https://www.tinyportal.net/proxy.php?request=http%3A%2F%2Fwww.tinyportal.eu%2Fimg%2Fusers_tinyportal.net.jpg&hash=059bf35b39394aa00c7932773abc13e6e5ea7e75)
Thank you...
tamasir,
That block you see at the bottom of the right panel on this site's BoardIndex is not actually a TinyPortal block. In fact, if you were viewing it with a wider resolution screen, the title on it actually says "Users Logged In". That whole panel that you see on the right side is actually the Info Center that's normally seen under the BoardIndex. This particular theme we are using here has a feature that Bloc coded into it to allow the Info Center to be moved from the bottom to the right side.
So, in other words, we don't have the code for this, it's built into the theme. Sorry about that.
ZarPrime
ZarPrime
I say thank you for the guide to you very much.
Thanks Brad...
tamasir~
SMF version: 2.0
TP version: TP1RC2
I hadn't read all the post here , so just an FYI.
I think the file names and locations have been changed with one of the latest Users online Today.
<name>Users Online Today</name>
<version>2.0 RC4</version>
I got the code snippet working with this.
Changed from original post.
require($boarddir . 'Themes/default/languages/Modifications.english.php');
To:
require($boarddir . '/Themes/default/languages/UsersOnlineToday.english.php');
Thanks
Xt.
Do we have a updated code for this code?
Hi Shadow this it not actually a block.
Read ZP's comment here : http://www.tinyportal.net/index.php?topic=17742.msg273195#msg273195
Hello Freddy,
I do thank you for that info about this topic.
:)
i found this mod http://custom.simplemachines.org/mods/index.php?mod=2369 .
How can we make users online in stats block using auto refresh?