Skip to Content Skip to Menu

mod_cballn1online ?!

18 years 4 months ago #15703 by flyingeagle855
Replied by flyingeagle855 on topic Re:mod_cballn1online ?!
Just wanted to let you all know I just released a new version 1.1 beta that fixed a few bugs that where reported and added a few more fetures.

forge.joomla.org/sf/projects/cbonlinefull

Please Log in or Create an account to join the conversation.

18 years 4 months ago #15776 by flyingeagle855
Replied by flyingeagle855 on topic Re:mod_cballn1online ?!
New update: 1.1 Beta 2

Please Log in or Create an account to join the conversation.

  • irgendwer
  • irgendwer
  • OFFLINE
  • Posts: 41
  • Thanks: 0
  • Karma: 2
18 years 3 months ago #15784 by irgendwer
Replied by irgendwer on topic Re:mod_cballn1online ?!
I am using who is online ext. at the moment which has the function to display a pm button behind the username.
Would be great if you could integrate that into cbonlinefull. B)
Maybe I'll try this myself sometime.
I could upload the who is online ext. module if you want to see the code.
greets

South Korea's got Seoul

Please Log in or Create an account to join the conversation.

18 years 3 months ago #15791 by flyingeagle855
Replied by flyingeagle855 on topic Re:mod_cballn1online ?!
I think this sounds like a good idea. I will put it on my list for the next relese.

It would be great if you can upload the mod for me to look at.

Jesse

Please Log in or Create an account to join the conversation.

  • irgendwer
  • irgendwer
  • OFFLINE
  • Posts: 41
  • Thanks: 0
  • Karma: 2
18 years 3 months ago #15818 by irgendwer
Replied by irgendwer on topic Re:mod_cballn1online ?!
Great!:)
Looks like I don't have the hole zip file anymore so i just post the code:
mod_whosonline_ext.php
[code:1]<?php
/**
* @version $Id: mod_whosonline_ext.php,v 1.0 2005/06/23 11:49:45 cowboy Exp $
* @package MamboHacks
* @copyright (C) 2000 - 2005 MamboHacks.com
* @license www.gnu.org/copyleft/gpl.html GNU/GPL
* Mambo is Free Software
*/

/** ensure this file is being included by a parent file */
defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );

$showmode = $params->get( 'showmode' );
$moduleclass_sfx = $params->get( 'moduleclass_sfx' );

global $profilelink, $displayrealname, $liststyle, $pmlink;
$displayrealname = $params->get( 'displayrealname' );
$liststyle = $params->get( 'liststyle' );
$showchatters = $params->get( 'showchatters' );
$flashchaturl = $params->get( 'flashchaturl' );
$chatroomempty = $params->get( 'chatroomempty' );
$profilelink = $params->get( 'profilelink' );
$pmlink = $params->get( 'pmlink' );

$content="";

if ($showmode==0 || $showmode==2) {
$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();

$query2 = "SELECT DISTINCT count(username) as user_online FROM #__session WHERE guest=0 AND usertype <> 'administrator' AND usertype <> 'superadministrator'";
$database->setQuery($query2);
$user_array = $database->loadResult();

if ($guest_array<>0 && $user_array==0) {
if ($guest_array==1) {
$content.=_WE_HAVE;
$content.=_GUEST_COUNT;
$content.=_ONLINE;
eval ("\$content = \"$content\";"«»);
} else {
$content.=_WE_HAVE;
$content.=_GUESTS_COUNT;
$content.=_ONLINE;
eval ("\$content = \"$content\";"«»);
}
}

if ($guest_array==0 && $user_array<>0) {
if ($user_array==1) {
$content.=_WE_HAVE;
$content.=_MEMBER_COUNT;
$content.=_ONLINE;
eval ("\$content = \"$content\";"«»);
} else {
$content.=_WE_HAVE;
$content.=_MEMBERS_COUNT;
$content.=_ONLINE;
eval ("\$content = \"$content\";"«»);
}
}

if ($guest_array<>0 && $user_array<>0) {
if ($guest_array==1) {
$content.=_WE_HAVE;
$content.=_GUEST_COUNT;
$content.=_AND;
eval ("\$content = \"$content\";"«»);
} else {
$content.=_WE_HAVE;
$content.=_GUESTS_COUNT;
$content.=_ONLINE;
$content.=_AND;
eval ("\$content = \"$content\";"«»);
}

if ($user_array==1) {
$content.=_MEMBER_COUNT;
$content.=_ONLINE;
eval ("\$content = \"$content\";"«»);
} else {
$content.=_MEMBERS_COUNT;
$content.=_ONLINE;
eval ("\$content = \"$content\";"«»);
}

}
}

if ($showmode==1 || $showmode==2) {
$query = "SELECT DISTINCT a.username, a.userid, b.name "
."\n FROM #__session AS a, #__users AS b"
."\n WHERE (a.guest=0) AND b.id = a.userid GROUP BY b.id";
$database->setQuery($query);
$rows = $database->loadObjectList();
$content .= "<br/>";
foreach($rows as $row) {
$content .= ListStyle(LinkIt($row->username, $row->name, $row->userid));
}

if ($content == ""«») {
echo _NONE ."\n";
}
}

if ($showchatters) {

$content .= "<br/><a href=\"#\" onclick=\"javascript: window.open('http://".$flashchaturl."/flashchat.php', '', 'toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=780,height=550'); return false\">\"Live
";

$chatters = '';

$database->setQuery("SELECT #__users.username, #__users.id, #__users.name from #__users, #__fc_connections where #__fc_connections.userid = #__users.id order by updated desc"«»);
if ($this->_result = $database->query()) {
$rows = $database->loadObjectList();
foreach($rows as $row) {
$chatters .= ListStyle(LinkIt($row->username, $row->name, $row->id));
}

if ($chatters == ""«») {
$content .= "<img src=\"".$mosConfig_live_site."/images/M_images/arrow.png\" border=\"0\" alt=\"\"/>".($chatroomempty != '' ? $chatroomempty : "The chatroom is quite..."«»);
}
else {
$content .= $chatters;
}
}
}

function ListStyle($item) {
global $liststyle;

if ($liststyle) {
return "<img src=\"".$mosConfig_live_site."/images/M_images/arrow.png\" border=\"0\" alt=\"\"/>".$item." ";
}
else {
return "<ul><li>" . $item . "</li></ul>\n";
}
}

function LinkIt($username, $name, $id) {

global $database, $mosConfig_absolute_path, $smf_prefix, $mosConfig_sef;
global $profilelink, $displayrealname, $pmlink;

if ($profilelink == 0) {
$link = ($displayrealname ? $name : $username);
}

if ($profilelink == 1 || $pmlink == 1) {
$smfclass = $mosConfig_absolute_path."/administrator/components/com_smf/smf.class.php";
if (!file_exists($smfclass)) {
return "Please install <a href=\"http://www.mambohacks.com\" alt=\"Mambo-SMF Forum\">Mambo-SMF Forum.";
}
require_once($smfclass);
$mosSMF =& new mosSMF();
if (!isset($mosSMF->MAMBOHACKS)) {
return "Please install <a href=\"http://www.mambohacks.com\" alt=\"Mambo-SMF Forum\">Mambo-SMF Forum.";
}
/* get SMF itemid */
$database->setQuery("SELECT id FROM #__menu WHERE link = 'index.php?option=com_smf'"«»);
if ($this->_result = $database->query()) {
$row = mysql_fetch_object($this->_result);
$smfItemid = $row->id;
}
/* get user smf id */
$database->setQuery("SELECT ID_MEMBER FROM {$smf_prefix}members WHERE memberName='$username'"«»);
if ($this->_result = $database->query()) {
$row = mysql_fetch_object($this->_result);
$memberid = $row->ID_MEMBER;
}

$link = "<a href=\"".sefRelToAbs("index.php?option=com_smf&Itemid=".$smfItemid."&action=profile;u=".$memberid)."\">".($displayrealname ? $name : $username)."</a>\n";
$link = str_replace(";u,",";u=",$link);
}

if ($profilelink == 2) {
$link = "<a href=\"". sefRelToAbs('index.php?option=com_comprofiler&task=userProfile&user='. $id)."\">".($displayrealname ? $name : $username)."</a>\n";
}

if ($pmlink == 1) {
$link .= " <a href=\"".sefRelToAbs("index.php?option=com_smf&Itemid=".$smfItemid."&action=pm;sa=send;u=".$memberid)."\"><img src=\"".$mosConfig_live_site."/images/M_images/emailButton.png\" border=\"0\" height=\"10\"></a>\n";
if ($mosConfig_sef) {
$link = str_replace("pm;sa","pm/sa",$link);
$link = str_replace("send;u","send/u",$link);
}
}

if ($pmlink == 2) {
$link .= " <a href=\"". sefRelToAbs('index.php?option=com_pms&page=new&id='. $username)."\"><img src=\"".$mosConfig_live_site."/images/M_images/emailButton.png\" border=\"0\" height=\"10\"></a>\n";
}

return $link;
}

?>[/code:1]
Tell me if you need the xml file too.

EDIT: What you could also add is the way how they count members. Because in your module when there is one guest it shows: "There are 1 guests online..."

Post edited by: irgendwer, at: 2006/06/22 17:01

South Korea's got Seoul

Please Log in or Create an account to join the conversation.

  • irgendwer
  • irgendwer
  • OFFLINE
  • Posts: 41
  • Thanks: 0
  • Karma: 2
18 years 3 months ago #16121 by irgendwer
Replied by irgendwer on topic Re:mod_cballn1online ?!
Hey flyingeagle855

I'm using your mod and found some things i gotta tell you.

The counting of guests and members was below the displayed members so i just cut and paste the code upwards cause it caused some viewing errors.

Second the link to the no photo image works only for english. I manually corrected it and inserted the link to my nophotoimage.

Then i have an error but thats maybe only on my website: I had to change the Male selection name in code. It didn't work in the backend to type in how the male selection and female selection is called. But as I sad that's maybe only an error on my website.

South Korea's got Seoul

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum