Members: 16,996
Threads: 38,845
Posts: 159,389
Online: 27

Newest Member: Kl_broka@rediffmail.com


Odoo.tv - Outdoor Television


Sedo - Domains kaufen und verkaufen das Projekt mambers.com steht zum Verkauf Besucherstatistiken von mambers.com etracker® Web-Controlling statt Logfile-Analyse
Old 13.06.2004, 05:02   #1 (permalink)
Junior Mamber
 
Join Date: Jun 2004
Posts: 38
gregmac is on a distinguished road
Default Patch: mod_online guests display

Basically lifted the code from mod_whosonline.php, and cleaned the display of mod_online (comma-seperated, instead of newlines)

It displays something like "gregmac, someuser, 4 guests"

Code:
--- ORIGINAL/modules/mod_online.php     Tue May 18 13:54:46 2004
+++ modules/mod_online.php      Sat Jun 12 21:52:14 2004
@@ -12,16 +12,37 @@

 defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );

+// get the parameters
+$params = mosParseParams( $module->params );
+$guests = isset( $params->guests ) ? $params->guests : 'no';
+
 $query = "SELECT DISTINCT a.username"
 ."\n FROM #__session AS a"
 ."\n WHERE (a.guest=0)";
 $database->setQuery($query);
 $rows = $database->loadObjectList();
-$content = "";
+$users = array();
 foreach($rows as $row) {
-       $content.= "<b>".$row->username."</b>";
-       $content.= "<br />";
+       $users[] = "<b>".$row->username."</b>";
 }

-if ($content=="") $content.=_NONE;
+if ($guests == 'yes') {
+       $query1 = "SELECT count(session_id) as guest_online FROM #__session WHERE guest=1 AND (usertype is NULL OR usertype='')";
+       $database->setQuery($query1);
+       $guest_array = $database->loadResult();
+
+       if ($guest_array == 1) {
+               $guest_txt .= _GUEST_COUNT;
+       } else {
+               $guest_txt .= _GUESTS_COUNT;
+       }
+       eval ("\$guest_txt = \"$guest_txt\";");
+       $users[] = $guest_txt;
+}
+
+if (count($users) > 0) {
+       $content = implode(", ",$users)."<br />";
+} else {
+       $content = _NONE;
+}
 ?>
And for the lazy:

Code:
<?php
// $Id: mod_online.php,v 1.7 2004/01/13 14:50:38 rcastley Exp $
/**
* Users Online Module
* @package Mambo Open Source
* @Copyright (C) 2000 - 2003 Miro International Pty Ltd
* @ All rights reserved
* @ Mambo Open Source is Free Software
* @ Released under GNU/GPL License : http://www.gnu.org/copyleft/gpl.html
* @version $Revision: 1.7 $
**/

defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );

// get the parameters
$params = mosParseParams( $module->params );
$guests = isset( $params->guests ) ? $params->guests : 'no';

$query = "SELECT DISTINCT a.username"
."\n FROM #__session AS a"
."\n WHERE (a.guest=0)";
$database->setQuery($query);
$rows = $database->loadObjectList();
$users = array();
foreach($rows as $row) {
        $users[] = "<b>".$row->username."</b>";
}

if ($guests == 'yes') {
        $query1 = "SELECT count(session_id) as guest_online FROM #__session WHERE guest=1 AND (usertype is NULL OR usertype='')";
        $database->setQuery($query1);
        $guest_array = $database->loadResult();

        if ($guest_array == 1) {
                $guest_txt .= _GUEST_COUNT;
        } else {
                $guest_txt .= _GUESTS_COUNT;
        }
        eval ("\$guest_txt = \"$guest_txt\";");
        $users[] = $guest_txt;
}

if (count($users) > 0) {
        $content = implode(", ",$users)."<br />";
} else {
        $content = _NONE;
}
?>
Enjoy
[/code]
gregmac is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
Old 13.06.2004, 05:03   #2 (permalink)
Junior Mamber
 
Join Date: Jun 2004
Posts: 38
gregmac is on a distinguished road
Default Re: Patch: mod_online guests display

Forgot to mention:

to display the guests, put "guests = yes" in the module options
gregmac is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 16.06.2004, 22:55   #3 (permalink)
Baby Mamber
 
Join Date: Jun 2004
Posts: 22
snarkpit is on a distinguished road
Default Re: Patch: mod_online guests display

Thanks gregmac, very handy.. What do you think the chances are of tieing that the the user profile so when you click the user, you see thier info?

Thanks for the mod greg.
snarkpit is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 04.08.2004, 13:39   #4 (permalink)
Baby Mamber
 
Join Date: Aug 2004
Posts: 1
kalima is on a distinguished road
Question Re: Patch: mod_online guests display

Hi,

I'm trying to replace the username by the name of the connected users instead. But simply changing "username" by "name" in the original mod_online.php, or in your version doesn't work. I have the same issue with AkoComment.

Would you have an idea how to fix this ?


Thanks a lot,
Fabien
kalima is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
new Modules -> Display Menu - JSCook & Simple stingrey Development Announcements 14 15.07.2004 18:44
updated version Display News Modules -> Version 1-3 stingrey Development Announcements 0 08.06.2004 20:28
safemode patch compatible with Mambo 4.5 Stable-1.0.7 ? pe7er Mambo 4.5 Installation and Upgrades 3 28.05.2004 18:11
Problem with online users display E_Motion Mambo 4.5 General Talk 1 08.05.2004 23:13
Component to display banners in content webfitz Component Development 4 22.04.2004 12:23


All times are GMT +2. The time now is 18:14.

Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.1.0
A vBSkinworks Design
© Copyright 2004-2008 by Arthur Konze Webdesign.