Quote:
edwincee82 wrote:
Create your own block - then link it to (directory of chat module)/flashchat.php
Hi,
I'll be downloading flashchat in a minute. But I'm a newbie and concerned about installing an app into XOOPS that's not an approved module..
How do I do it? Is there anything special I should know? I mean, since it's not a xoop module it's not loaded from the module dashboard, right? Then how is it installed.
Also, on their site I saw this mode for a "flashchart block"
It was written for phpnuke. Can we use it or do we just create our own block?
// ----------------------------------------------------------------------
// POST-NUKE Content Management System
// Copyright (C) 2001 by the Post-Nuke Development Team.
//
http://www.postnuke.com/// ----------------------------------------------------------------------
// Based on:
// PHP-NUKE Web Portal System -
http://phpnuke.org/// Thatware -
http://thatware.org/// ----------------------------------------------------------------------
// LICENSE
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License (GPL)
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// To read the license please visit
http://www.gnu.org/copyleft/gpl.html// ----------------------------------------------------------------------
// Original Author of file: InvalidResponse
// Purpose of file: Show FlashChat Rooms and Members in them
// ----------------------------------------------------------------------
$blocks_modules['FlashChatBlock'] = array(
'func_display' => 'FlashChatBlock_block',
'text_type' => 'FlashChatBlockBlock',
'text_type_long' => 'Show Your Flash Chat Rooms & Chatters',
'allow_multiple' => false,
'form_content' => false,
'form_refresh' => false,
'show_preview' => true
);
pnSecAddSchema('FlashChatBlock::', 'Block title::');
function FlashChatBlock_block($row) {
if (!authorised(0, 'FlashChatBlock::', '$BlockInfo[title]::', ACCESS_READ)) {
return;
}
////////////////////////// CHANGE THIS TO YOUR MODULE'S NAME
$MOD_NAME = 'FlashChat';
//////////////////////////////////////////////////////////////
list($dbconn) = pnDBGetConn();
$pntable = pnDBGetTables();
$conn = pnConfigGetVar('prefix').'_connections';
$rooms = pnConfigGetVar('prefix').'_rooms';
$results = $dbconn->Execute("SELECT id, name FROM $rooms WHERE ispublic='y'");
if ($dbconn->ErrorNo() <> 0) {
$content = "DB Error: ".$dbconn->ErrorNo().": ".$dbconn->ErrorMsg()."
";
exit();
}
while(list($roomid, $roomname) = $results->fields) {
$results->MoveNext();
$results2 =@ $dbconn->Execute("SELECT count(*) FROM $conn WHERE roomid='".$roomid."' AND userid!=''");
if(!$results2->EOF){
list($count) = $results2->fields;
}
// 3 queries is 2 too many.. table merge's didn't play fair..
// feel free to contact me if you knock it down to 1
$results3 =@ $dbconn->Execute("SELECT userid, ip FROM $conn WHERE roomid='".$roomid."' AND userid!=''");
$content .= '
'.$roomname.' [ '.$count.' ]
';
while(list($uid, $ip) = $results3->fields){
$results3->MoveNext();
if($uid){
$content .= '
'
.'
'.pnUserGetVar('uname', $uid).'';
}
if (authorised(0, ''.$MOD_NAME.'Block::', '$BlockInfo[title]::', ACCESS_ADMIN)) {
$content .= ' '.$ip.'';
}
$content .= '
';
}
}
$content .= '
';
$row['content'] = $content;
return themesideblock($row);
}
?>