1
Monika
Poster's status
  • 2008/12/22 19:54

  • Monika

  • Not too shy to talk

  • Posts: 103

  • Since: 2008/12/19


hey please how to do to show in the comments stats the poster's status (whether he is online or offline)?


thank you

2
Anonymous
Re: Poster's status
  • 2008/12/23 0:01

  • Anonymous

  • Posts: 0

  • Since:


Edit class/commentrenderer.php file and replace:
$poster['status'] = $com_poster->isOnline() ? _CM_ONLINE '';

with:
if ( $com_poster->isOnline() ) {
                
$poster['status'] = "Online";
                } else {
                
$poster['status'] = "Offline";
                }


3
Monika
Re: Poster's status
  • 2008/12/23 0:29

  • Monika

  • Not too shy to talk

  • Posts: 103

  • Since: 2008/12/19


Unfortunately your code Mowaffak only works if i set Who's Online block to visible. However, I don't want that block to be visible.

Help me please.

4
trabis
Re: Poster's status
  • 2008/12/23 0:48

  • trabis

  • Core Developer

  • Posts: 2269

  • Since: 2006/9/1 1


You can always "delete" or change the who´s online block template so the code get´s executed but no info is displayed

I´m so lazy, eheh

5
Monika
Re: Poster's status
  • 2008/12/23 3:08

  • Monika

  • Not too shy to talk

  • Posts: 103

  • Since: 2008/12/19


I deleted system_block_online.html from modules\system\templates\blocks and i cleared the catch but the block is still visible.

6
mjoel
Re: Poster's status
  • 2008/12/23 12:04

  • mjoel

  • Quite a regular

  • Posts: 325

  • Since: 2006/12/9


not the same but i use this last time in XOOPS 2.018x to show online status in profile (default profile)

https://xoops.org/modules/newbb/viewtopic.php?topic_id=61786&forum=7&post_id=281715#forumpost281715

never tried it it in XOOPS 2.3 + profilemodule/yogurtmodule

7
trabis
Re: Poster's status
  • 2008/12/23 13:48

  • trabis

  • Core Developer

  • Posts: 2269

  • Since: 2006/9/1 1


Quote:

Monika wrote:
I deleted system_block_online.html from modules\system\templates\blocks and i cleared the catch but the block is still visible.

You did what?!!!
I mean "delete" and not DELETE. Just delete file contents not the file itself! And you need to refresh templates in admin area (preferences).

8
Anonymous
Re: Poster's status
  • 2008/12/23 15:43

  • Anonymous

  • Posts: 0

  • Since:


did you test mjoel's solution ?

I think we need XOOPS to be more OO and more smarty .. webmasters need to put these smarty variables in any page of thier sites.

9
Monika
Re: Poster's status
  • 2008/12/23 23:05

  • Monika

  • Not too shy to talk

  • Posts: 103

  • Since: 2008/12/19


I tried Mjoel solution but i don't know where to put that code exactly? Any help? I want it also to be in a yog urt profile please.

10
mjoel
Re: Poster's status
  • 2008/12/24 2:46

  • mjoel

  • Quite a regular

  • Posts: 325

  • Since: 2006/12/9


i tried this in yogurt 3.3rc2 with XOOPS 2.3
but it is not working..i am always showed as offline

Resized Image

..can someone check what did i do wrong ?..


open modules/yogurt/index.php

find
/**
 * Closing the page
 */ 
include("../../footer.php");
?>


before the code above add this code below

//user online status

$user_online = new XoopsUser($thisUser->getVar('uid'));

if (
$user_online->isOnline())

{
    
$xoopsTpl->assign('user_online'true);

}



open modules/yogurt/templates/yogurt_index.html

find

<class="even"> <img src="images/clock.gif" /> <span class="yogurt-profileinfo-label"><{$lang_lastlogin}>:span><span class="yogurt-profileinfo-value"><{$user_lastlogin}>span>p>


before the code above add this code below
<class="even"> <img src="images/clock.gif" /> <span class="yogurt-profileinfo-label">Online Statusspan><span class="yogurt-profileinfo-value">
<{if 
$user_online == true}>
                <
span style='color:#ee0000;'>Onlinespan><br />
<{else}>
                <
span style='color:#000000;'>Offlinespan><br />
<{/if}>

span>p>


clear cache (eg:\xoops_data\caches\smarty_compile) (except for index.html)

Login

Who's Online

365 user(s) are online (242 user(s) are browsing Support Forums)


Members: 0


Guests: 365


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits