PDA

View Full Version : Flashchat - who is online with showing the chatters avatars


quasan
11-01-2004, 10:00 PM
this is a beta release of a "who is online" mod for Flashchat (http://www.tufat.com/)

Version 0.2

What's new:

now working with prefixes for the database tables
now working with gif-avatars too
resize option (yes / no)
better image quality because of gdlib2


Features:

generate dynamically resized avatar-pics for the chatting users
and displays them on the forumhome with the username and a link to their profile


issues/bugs/ todo:

if too many users are chatting, the tablerow grows and grows instead of breaking into a new tablerow (fixing it later)
doesn't show avatars when they aren't stored in the db(thekeeper)


note: you need the gdlib2

installation and upgrade information inside the .zip

Polo
11-02-2004, 09:03 PM
looks good, will try it out ;)

Giveit2u43
11-03-2004, 04:12 PM
Excellent FlashChat mod.. much better than including the info file using phpinclude (I often had probs with that if 3 or more people were in the room) but this hack 7 people in the room and just one extra query on the forumhome, superb stuff.. thanks :)

FilmoreSlim
11-03-2004, 09:54 PM
Hey just installed FlashChat and was looking for something like this! Great job!!

*clicks install

theArchitect
11-04-2004, 12:39 AM
*theArchitect clicks install*.

Great work. I was going to developing something similar, this has saved me having to do it.

karlogaga
11-04-2004, 09:31 AM
Hi Quasan,

this must be an amazing hack if it works! I wonder if you could explain how to do these things a little bit more precisely, as if you were writing for someone who is handicapped in his coding abilitys, cause i really am! (and i still want to implement this very much)

The first thing i dont understand is where you write:

(p.e: http://forum.test.tld), i wonder how to write that URL if the forum is in a subfolder, like http://www.test.com/forum , do i have to write it like that or does it need a "/" at the end?

Next thing is:

insert $chatter[usernames] , ok, just like this:

<td>$chatter[usernames]</td> ? I wonder...



And also for this part:

write conditions like <if condition="$chatter['count'] >0">

..it would be very, very helpful for someone like me who is still learning to have a little but complete example, to see how the syntax of this works.

I hope i didnt work on your nerves too much, i guess for you it is hard to imagine how someone could not know these things i'm asking for...

I would appreciate it very much if you could help me out with this, and anyway thanks for sharing your work!

Karlo

The Keeper
11-04-2004, 03:55 PM
Might be a stupid question, but how do I get into chat? I've installed it, and when I go to the /chat directory it asks for a user and pass. The only one which works is my admin pass, but I didn't buy this to sit in the chatroom myself.

FilmoreSlim
11-04-2004, 05:33 PM
Hey keeper did you follow the vB integration instructions that came with FlashChat?

FilmoreSlim
11-04-2004, 08:16 PM
quasan, this is pretty nice! I was wondering if there was a way to have the same hack without all the re-size options? The avatars on my forum are already small enough and don't need to be resized.

The Keeper
11-05-2004, 12:20 PM
Hey keeper did you follow the vB integration instructions that came with FlashChat?I installed the wrong FlashChat, that guy has two out.

The Keeper
11-05-2004, 12:56 PM
Hmm, not working for me, gives parse errors. For what I can see there are three of these { and only two of these }

The Keeper
11-05-2004, 12:58 PM
Yup, just fixed it, you're missing a closing brace.

quasan
11-05-2004, 01:13 PM
oh hi! i am really amazed that someone uses this :) it's my first "mod"


so let's start over:

@ karlogaga: I will rewrite the instructions in the next release. sorry for that.
with forum.test.tld i ment that you just have to insert there the url of your forum. tld = topleveldomain... so if your forum is http://forum.test.com... insert the url in the script :)

if your location is at : http://www.test.com/forum, please do not use a trailing slash, so http://www.test.com/forum would be right and
http://www.test.com/forum/ would be wrong

<if condition="$chatter['count'] >0"> is a template condition for vbulletin..
for example you could write something like this:


<if condition="$chatter['count'] >0">
in chat are: $chatter[usernames]
<else />
nobody is chatting right now :(
</if>


so when someone is in the chat you'll get the "in chat are + picture" and if no one is chatting there will be the output "nobody is chatting right now:("



@FilmoreSlim yep, that will come next.

@thekeeper: where ? would be cool if you could tell me, so that I can update the file.

thx for your replies:)

The Keeper
11-05-2004, 01:26 PM
Ok, fixed that and now nobody shows up in the box when I have them logged into chat.

The Keeper
11-05-2004, 01:28 PM
@thekeeper: where ? would be cool if you could tell me, so that I can update the file.

thx for your replies:)Just replace

// concatenate the temp stuff to > $chatusers
$chatusers = $chatusers.$temp;

}; // End foreach


with

// concatenate the temp stuff to > $chatusers
$chatusers = $chatusers.$temp;
}
}; // End foreach

karlogaga
11-05-2004, 01:37 PM
@Quasan: Hi, thanks for your answer! I'll try to install it, was working almost all day on the integration of the new version of flaschat in vb3, now it doesnt autologin anymore, what a bummer..

@Keeper: does it work now with your fixes?

The Keeper
11-05-2004, 01:39 PM
It doesn't give a parse error anymore, but the variable $chatter[usernames] is always blank.

quasan
11-05-2004, 01:53 PM
thekeeper: sorry i tripple and quad checked the amount of { and }

there are exactly 3 opening tags and 3 closing brackets.

the first closing } is after the do while loop

the second is

}; // End foreach

and the third: }; // End $count_chatter >0

please recheck this, because the amount of {} is right. I cannot explain where your parse error came from. what message came with the php debugger?

if you are not sure where the error is, please test the following.

open the http://forum.test.com/avatar_resize.php?u=USERID

with a user Userid where the user has a avatar.
for example:

http://forum.test.com/avatar_resize.php?u=1

it should show the resized avatar of the user

The Keeper
11-05-2004, 02:00 PM
Sorry, ignore me, I copied the code wrong, which is why it isn't working for me.

karlogaga
11-05-2004, 02:07 PM
@qasan

ich habs installiert und bekomme das:

mysql_fetch_array(): supplied argument is not a valid MySQL result resource in ...../forum/index.php on line 514

$count = mysql_fetch_array(mysql_query($query_chatonline));

The Keeper
11-05-2004, 02:07 PM
Works now, but the avatar function isn't quite right. People with avatars are showing up as the noavatar thing

karlogaga
11-05-2004, 02:09 PM
mysql_fetch_array(): supplied argument is not a valid MySQL result resource in ...../forum/index.php on line 514

(das ist die line 514 in meinem index.php)

$count = mysql_fetch_array(mysql_query($query_chatonline));

The Keeper
11-05-2004, 02:11 PM
Just realised it only works if the avatars are in teh database, whereas I use a file based system. Hang on and I'll think of a way round that.

karlogaga
11-05-2004, 02:12 PM
Oh, sorry for talking german!

I installed it and get the following error message:

mysql_fetch_array(): supplied argument is not a valid MySQL result resource in ...../forum/index.php on line 514

where line 514 is this one:

$count = mysql_fetch_array(mysql_query($query_chatonline));

quasan
11-05-2004, 02:18 PM
@karlogaga: is the flashchat dbtable in the same database as the forum? your error sounds to me, that the query cannot find the "connections" table of your flashchat table. or do you use a prefix on the flashchat table?

I forgot to implement this in the php because i do not use a prefix.

If you use one. please change the

$query_chatonline ="SELECT COUNT(*) FROM connections WHERE userid IS NOT NULL";

to

$query_chatonline ="SELECT COUNT(*) FROM PREFIX_connections WHERE userid IS NOT NULL";


and insert the prefix of your flashchat db table in there...

I will put it in the next version

karlogaga
11-05-2004, 02:25 PM
thanks, i just found it myself, and i put the prefix before "connections".

I also did it for "users", is that correct?



@karlogaga: is the flashchat dbtable in the same database as the forum? your error sounds to me, that the query cannot find the "connections" table of your flashchat table. or do you use a prefix on the flashchat table?

I forgot to implement this in the php because i do not use a prefix.

If you use one. please change the


to


and insert the prefix of your flashchat db table in there...

I will put it in the next version

karlogaga
11-05-2004, 02:29 PM
..like this:

//Get the username for each chatter
$show_username= $DB_site->query("select username from vb3_user where userid=".intval($val));

where vb3_ is the prefix...

quasan
11-05-2004, 02:30 PM
"SELECT COUNT(*) FROM flashchatprefix_connections WHERE userid IS NOT NULL";

prefix_connections of your flashchat dbprefix

here again:

"SELECT userid FROM flashchatprefix_connections WHERE userid IS NOT NULL";



if you have also a prefix for your vbulletin board:


$DB_site->query("select username from user where userid=".intval($val));


from VBPREFIX_user ...

quasan
11-05-2004, 02:31 PM
..like this:

//Get the username for each chatter
$show_username= $DB_site->query("select username from vb3_user where userid=".intval($val));


where vb3_ is the prefix...


yep exactly :)

@keeper: thx I will have a look at it later. now i have to go shopping:/

The Keeper
11-05-2004, 03:06 PM
Ok I looked at my code, and this appears to work fine now for both flat files and database:

// ### HACK FOR WHO'S CHATTING

$query_chatonline ="SELECT COUNT(*) FROM connections WHERE userid IS NOT NULL";
$count = mysql_fetch_array(mysql_query($query_chatonline));
$count_chatter = $count[0];





// ###################### Start getavatarurl #######################
function fetch_avatar_url($userid)
{
global $DB_site, $session, $vboptions;

if ($avatarinfo = $DB_site->query_first("
SELECT user.avatarid, user.avatarrevision, avatarpath, NOT ISNULL(avatardata) AS hascustom, customavatar.dateline
FROM " . TABLE_PREFIX . "user AS user
LEFT JOIN " . TABLE_PREFIX . "avatar AS avatar ON avatar.avatarid = user.avatarid
LEFT JOIN " . TABLE_PREFIX . "customavatar AS customavatar ON customavatar.userid = user.userid
WHERE user.userid = $userid"))
{
if (!empty($avatarinfo['avatarpath']))
{
return $avatarinfo['avatarpath'];
}
else if ($avatarinfo['hascustom'])
{
if ($vboptions['usefileavatar'])
{
return "$vboptions[avatarurl]/avatar{$userid}_{$avatarinfo[avatarrevision]}.gif";
}
else
{
return "image.php?u=$userid&amp;dateline=$avatarinfo[dateline]";
}
}
else
{
return '';
}
}
}



//if anyone is chatting.....
if($count_chatter >0)
{

//get the uids of the chatters
$query_userid = "SELECT userid FROM connections WHERE userid IS NOT NULL";
$show_userid = mysql_query($query_userid);
$row_show_userid = mysql_fetch_assoc($show_userid);

//build an array of the userids
do {
$userids[] = $row_show_userid['userid'];
} while ($row_show_userid = mysql_fetch_assoc($show_userid));


// Get the usernames and build the outputVar for the template
foreach($userids as $val)
{

//Get the username for each chatter
$show_username= $DB_site->query("select username from user where userid=".intval($val));
$row_show_username = mysql_fetch_assoc($show_username);


//pass the userid to the avatar_resize.php
$chatavatar = fetch_avatar_url($val);


// store the htmloutput for each user in $temp
$temp = "<td><tr>";
$temp.= "<img src=\"$chatavatar\">";
$temp.= "<div align=\"center\">";
$temp.= "<a href=\"member.php?u=".$val."\">".$row_show_username['username']."</a>";
$temp.= "</div>";
$temp.= "</tr><td>";


// concatenate the temp stuff to > $chatusers
$chatusers = $chatusers.$temp;

}; // End foreach



}; // End $count_chatter >0


// surround the $chatusers with some table tags and assign it to a template var
$chatter['usernames'] = "<table><tr>".$chatusers."</tr></table>";

// assign the number of people to a templatevar, so that we can have some conditions on the forumhome-template
$chatter['count'] = $count_chatter;

karlogaga
11-05-2004, 04:01 PM
@quasan, thank you very much for your support, it works now! Even though it only works with .jpg - all the .gif show the noavatar.gif.

Is that supposed to be like that or have i got something wrong? :rolleyes:

FilmoreSlim
11-05-2004, 04:48 PM
the new version of GD doesn't support the "gif" (the format is licensed or something) format. GD doesn't recognize .gif, unless you are running an older version of GD :\

quasan
11-05-2004, 05:17 PM
FilmoreSlim that may be right but even in gdlib2 there are functions to transform gif, etc..
I will add this function to my to do list and have closer look on it

FilmoreSlim
11-05-2004, 08:23 PM
Oh really? Hmm, I need to check that out then! Oh and thanks for supporting this hack quasan :)

quasan
11-05-2004, 09:40 PM
ok using gif pics works now, i hope I get a new version online asap

@FilmoreSlim just use the imagecreatefromgif function for working with gifs

karlogaga
11-06-2004, 03:03 PM
@quasan: did you exchange the .zip already with a version that works with .gif? (dont mean to push you, just wasnt sure what you meant)

@The Keeper: when i use the code you provided in your hack i get the following error:

Fatal error: Cannot redeclare fetch_avatar_url() in ......................./forum/includes/functions_user.php on line 116

Do you know how to fix that?

quasan
11-06-2004, 03:28 PM
@karlogaga

sorry not yet. but I will update the mod this evening and post what's new etc :)

quasan
11-06-2004, 04:56 PM
there it is :) hope that there are no new bugs in it :nervous:

The Keeper
11-06-2004, 05:08 PM
@quasan: did you exchange the .zip already with a version that works with .gif? (dont mean to push you, just wasnt sure what you meant)



@The Keeper: when i use the code you provided in your hack i get the following error:

Fatal error: Cannot redeclare fetch_avatar_url() in ......................./forum/includes/functions_user.php on line 116

Do you know how to fix that?Yeah sorry I put the function in teh wrong place (inside a loop, what an idiot :rolleyes: ) Hang on a sec...

// ### HACK FOR WHO'S CHATTING

$query_chatonline ="SELECT COUNT(*) FROM connections WHERE userid IS NOT NULL";
$count = mysql_fetch_array(mysql_query($query_chatonline));
$count_chatter = $count[0];





// ###################### Start getavatarurl #######################
function fetch_avatar_url($userid)
{
global $DB_site, $session, $vboptions;

if ($avatarinfo = $DB_site->query_first("
SELECT user.avatarid, user.avatarrevision, avatarpath, NOT ISNULL(avatardata) AS hascustom, customavatar.dateline
FROM " . TABLE_PREFIX . "user AS user
LEFT JOIN " . TABLE_PREFIX . "avatar AS avatar ON avatar.avatarid = user.avatarid
LEFT JOIN " . TABLE_PREFIX . "customavatar AS customavatar ON customavatar.userid = user.userid
WHERE user.userid = $userid"))
{
if (!empty($avatarinfo['avatarpath']))
{
return $avatarinfo['avatarpath'];
}
else if ($avatarinfo['hascustom'])
{
if ($vboptions['usefileavatar'])
{
return "$vboptions[avatarurl]/avatar{$userid}_{$avatarinfo[avatarrevision]}.gif";
}
else
{
return "image.php?u=$userid&amp;dateline=$avatarinfo[dateline]";
}
}
else
{
return '';
}
}
}



//if anyone is chatting.....
if($count_chatter >0)
{

//get the uids of the chatters
$query_userid = "SELECT userid FROM connections WHERE userid IS NOT NULL";
$show_userid = mysql_query($query_userid);
$row_show_userid = mysql_fetch_assoc($show_userid);

//build an array of the userids
do {
$userids[] = $row_show_userid['userid'];
} while ($row_show_userid = mysql_fetch_assoc($show_userid));


// Get the usernames and build the outputVar for the template
foreach($userids as $val)
{

//Get the username for each chatter
$show_username= $DB_site->query("select username from user where userid=".intval($val));
$row_show_username = mysql_fetch_assoc($show_username);


//pass the userid to the avatar_resize.php
$chatavatar = fetch_avatar_url($val);


// store the htmloutput for each user in $temp
$temp = "<td><tr>";
$temp.= "<img src=\"$chatavatar\">";
$temp.= "<div align=\"center\">";
$temp.= "<a href=\"member.php?u=".$val."\">".$row_show_username['username']."</a>";
$temp.= "</div>";
$temp.= "</tr><td>";
$temp.= "<br />";


// concatenate the temp stuff to > $chatusers
$chatusers = $chatusers.$temp;

}; // End foreach



}; // End $count_chatter >0


// surround the $chatusers with some table tags and assign it to a template var
$chatter['usernames'] = "<table><tr>".$chatusers."</tr></table>";

// assign the number of people to a templatevar, so that we can have some conditions on the forumhome-template
$chatter['count'] = $count_chatter;


will work. :)

quasan
11-06-2004, 05:14 PM
thanks for helping! I never used the storing of the avatars in the filesystem, so I didn't know what to do.
I will analyse your script and try to implement it into mine in version 0.3 :)

The Keeper
11-06-2004, 06:19 PM
Yeah, teh function for avatar urls is just taken from vBulletin itself, rather than write my own, so it's 100% compatible :)

karlogaga
11-06-2004, 06:22 PM
@The Keeper Sorry, but this code gives me the same error...

The Keeper
11-06-2004, 07:01 PM
Works fine on my site. :\ can you paste for me the entire copy of your index.php?

karlogaga
11-06-2004, 09:55 PM
Works fine on my site. :\ can you paste for me the entire copy of your index.php?

Ok, here you go:


\*================================================ ======================*/

// ####################### SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);

// #################### DEFINE IMPORTANT CONSTANTS #######################
define('NO_REGISTER_GLOBALS', 1);
define('THIS_SCRIPT', 'index');

// ################### PRE-CACHE TEMPLATES AND DATA ######################
// get special phrase groups
$phrasegroups = array('holiday');

// get special data templates from the datastore
$specialtemplates = array(
'userstats',
'birthdaycache',
'maxloggedin',
'iconcache',
'eventcache',
'mailqueue',
'todaymaxonline'
);

// pre-cache templates used by all actions
$globaltemplates = array(
'FORUMHOME',
'forumhome_event',
'forumhome_forumbit_level1_nopost',
'forumhome_forumbit_level1_post',
'forumhome_forumbit_level2_nopost',
'forumhome_forumbit_level2_post',
'forumhome_lastpostby',
'forumhome_loggedinuser',
'forumhome_moderator',
'forumhome_pmloggedin',
'forumhome_subforumbit_nopost',
'forumhome_subforumbit_post',
'forumhome_subforumseparator_nopost',
// [START HACK='Latest Threads On Forum Home' AUTHOR='NTLDR' VERSION='1.0.0' CHANGEID= 1 ]
'forumhome_subforumseparator_post',
'forumhome_latestthreadbit',
// [END HACK='Latest Threads On Forum Home' AUTHOR='NTLDR' VERSION='1.0.0' CHANGEID= 1 ]
'forumhome_todayloggedinuser',
'forumhome_todayloggedinusers'
);

// pre-cache templates used by specific actions
$actiontemplates = array();

// ######################### REQUIRE BACK-END ############################
require_once('./global.php');
require_once('./includes/functions_bigthree.php');
require_once('./includes/functions_forumlist.php');

// ################################################## #####################
// ######################## START MAIN SCRIPT ############################
// ################################################## #####################

// get permissions to view forumhome
if (!($permissions['forumpermissions'] & CANVIEW))
{
print_no_permission();
}

// get forumid if set, otherwise set to -1
globalize($_REQUEST, array('forumid' => INT));

if (! is_array($foruminfo))
{
$forumid = -1;
}
else
{
// draw nav bar
$navbits = array();
$parentlist = array_reverse(explode(',', substr($foruminfo['parentlist'], 0, -3)));
foreach ($parentlist AS $forumID)
{
$forumTitle = $forumcache["$forumID"]['title'];
$navbits["forumdisplay.php?$session[sessionurl]f=$forumID"] = $forumTitle;
}

// pop the last element off the end of the $nav array so that we can show it without a link
array_pop($navbits);

$navbits[''] = $foruminfo['title'];
$navbits = construct_navbits($navbits);
}

// ### WELCOME MESSAGE #################################################
if ($bbuserinfo['userid'])
{ // registered user
$showmemberwelcome = true;
}
else
{ // guest
$showmemberwelcome = false;
}

$today = vbdate('Y-m-d', TIMENOW, false, false);

// ### TODAY'S BIRTHDAYS #################################################
if ($vboptions['showbirthdays'])
{
$birthdaystore = unserialize($datastore['birthdaycache']);
if (!is_array($birthdaystore) OR ($today != $birthdaystore['day1'] AND $today != $birthdaystore['day2']))
{
// Need to update!
require_once('./includes/functions_databuild.php');
$birthdaystore = build_birthdays();
DEVDEBUG('Updated Birthdays');
}
switch($today)
{
case $birthdaystore['day1']:
$birthdays = $birthdaystore['users1'];
break;

case $birthdaystore['day2'];
$birthdays = $birthdaystore['users2'];
break;
}
// memory saving
unset($birthdaystore);

$show['birthdays'] = iif ($birthdays, true, false);
}
else
{
$show['birthdays'] = false;
}

// ### TODAY'S EVENTS #################################################
if ($vboptions['showevents'])
{
require_once('./includes/functions_calendar.php');

$future = gmdate('n-j-Y' , TIMENOW + 43200 + (86400 * ($vboptions['showevents'] - 1)));
$eventstore = unserialize($datastore['eventcache']);

if (!is_array($eventstore) OR $future != $eventstore['date'])
{
// Need to update!
require_once('./includes/functions_databuild.php');
$eventstore = build_events();
DEVDEBUG('Updated Events');
}

unset($eventstore['date']);
$events = array();
$eventcount = 0;
foreach ($eventstore AS $eventid => $eventinfo)
{
$offset = iif (!$eventinfo['utc'], $bbuserinfo['tzoffset'], $bbuserinfo['timezoneoffset']);
$eventinfo['dateline_from_user'] = $eventinfo['dateline_from'] + $offset * 3600;
$eventinfo['dateline_to_user'] = $eventinfo['dateline_to'] + $offset * 3600;
$gettime = TIMENOW - $vboptions['hourdiff'];
$iterations = 0;

if ($bbuserinfo['calendarpermissions']["$eventinfo[calendarid]"] & CANVIEWCALENDAR OR $eventinfo['holidayid'])
{
if ($eventinfo['userid'] == $bbuserinfo['userid'] OR $bbuserinfo['calendarpermissions']["$eventinfo[calendarid]"] & CANVIEWOTHERSEVENT OR $eventinfo['holidayid'])
{
while ($iterations < $vboptions['showevents'])
{
$todaydate = getdate($gettime);
if (cache_event_info($eventinfo, $todaydate['mon'], $todaydate['mday'], $todaydate['year']))
{
if (!$vboptions['showeventtype'])
{
$events["$eventinfo[eventid]"][] = $gettime;
}
else
{
$events["$gettime"][] = $eventinfo['eventid'];
}
$eventcount++;
}
$iterations++;
$gettime += 86400;
}
}
}
}

if (!empty($events))
{
ksort($events, SORT_NUMERIC);
foreach($events AS $index => $value)
{
$pastevent = 0;
$pastcount = 0;
unset($eventdates, $comma, $daysevents);
if (!$vboptions['showeventtype'])
{ // Group by Event // $index = $eventid
unset($day);
foreach($value AS $key => $dateline)
{
if (($dateline - 86400) == $pastevent AND !$eventinfo['holidayid'])
{
$pastevent = $dateline;
$pastcount++;
continue;
}
else
{
if ($pastcount)
{
$eventdates = construct_phrase($vbphrase['event_x_to_y'], $eventdates, vbdate($vboptions['dateformat'], $pastevent, false, true, false));
}
$pastcount = 0;
$pastevent = $dateline;
}
if (!$day)
{
$day = vbdate('Y-n-j', $dateline, false, false);
}
$eventdates .= $comma . vbdate($vboptions['dateformat'], $dateline, false, true, false);
$comma = ', ';
$eventinfo = $eventstore["$index"];
}
if ($pastcount)
{
$eventdates = construct_phrase($vbphrase['event_x_to_y'], $eventdates, vbdate($vboptions['dateformat'], $pastevent, false, true, false));
}



if ($eventinfo['holidayid'])
{
$callink = "<a href=\"calendar.php?$session[sessionurl]do=getinfo&amp;day=$day\">" . $vbphrase['holiday_title_' . $eventinfo['varname']] . "</a>";
}
else
{
$callink = "<a href=\"calendar.php?$session[sessionurl]do=getinfo&amp;day=$day&amp;e=$eventinfo[eventid]&amp;c=$eventinfo[calendarid]\">$eventinfo[title]</a>";
}
}
else
{ // Group by Date
$eventdate = vbdate($vboptions['dateformat'], $index, false, true, false);
$day = vbdate('Y-n-j', $index, false, false);
foreach($value AS $key => $eventid)
{
$eventinfo = $eventstore["$eventid"];
if ($eventinfo['holidayid'])
{
$daysevents .= $comma . "<a href=\"calendar.php?$session[sessionurl]do=getinfo&amp;day=$day\">" . $vbphrase['holiday_title_' . $eventinfo['varname']] . "</a>";
}
else
{
$daysevents .= $comma . "<a href=\"calendar.php?$session[sessionurl]do=getinfo&amp;day=$day&amp;e=$eventinfo[eventid]&amp;c=$eventinfo[calendarid]\">$eventinfo[title]</a>";
}
$comma = ', ';
}
}
eval('$upcomingevents .= "' . fetch_template('forumhome_event') . '";');
}
// memory saving
unset($events, $eventstore);
}
$show['upcomingevents'] = iif ($upcomingevents, true, false);
$show['todaysevents'] = iif ($vboptions['showevents'] == 1, true, false);
}
else
{
$show['upcomingevents'] = false;
}

// ### LOGGED IN USERS #################################################
$activeusers = '';
if ($vboptions['displayloggedin'])
{
$datecut = TIMENOW - $vboptions['cookietimeout'];
$numbervisible = 0;
$numberregistered = 0;
$numberguest = 0;

$forumusers = $DB_site->query("
SELECT
user.username, (user.options & $_USEROPTIONS[invisible]) AS invisible, user.usergroupid,
session.userid, session.inforum, session.lastactivity,
IF(displaygroupid=0, user.usergroupid, displaygroupid) AS displaygroupid
FROM " . TABLE_PREFIX . "session AS session
LEFT JOIN " . TABLE_PREFIX . "user AS user ON(user.userid = session.userid)
WHERE session.lastactivity > $datecut
" . iif($vboptions['displayloggedin'] == 1, "ORDER BY username ASC") . "
");

if ($bbuserinfo['userid'])
{
// fakes the user being online for an initial page view of index.php
$bbuserinfo['joingroupid'] = iif($bbuserinfo['displaygroupid'], $bbuserinfo['displaygroupid'], $bbuserinfo['usergroupid']);
$userinfos = array
(
$bbuserinfo['userid'] => array
(
'userid' => $bbuserinfo['userid'],
'username' => $bbuserinfo['username'],
'invisible' => $bbuserinfo['invisible'],
'inforum' => 0,
'lastactivity' => TIMENOW,
'usergroupid' => $bbuserinfo['usergroupid'],
'displaygroupid' => $bbuserinfo['displaygroupid'],
)
);
}
else
{
$userinfos = array();
}
$inforum = array();

while ($loggedin = $DB_site->fetch_array($forumusers))
{
$userid = $loggedin['userid'];
if (!$userid)
{ // Guest
$numberguest++;
$inforum["$loggedin[inforum]"]++;
}
else if (empty($userinfos["$userid"]) OR ($userinfos["$userid"]['lastactivity'] < $loggedin['lastactivity']))
{
$userinfos["$userid"] = $loggedin;
}
}

foreach($userinfos AS $userid => $loggedin)
{
$numberregistered++;
if ($userid != $bbuserinfo['userid'])
{
$inforum["$loggedin[inforum]"]++;
}
$loggedin['musername'] = fetch_musername($loggedin);

if (fetch_online_status($loggedin))
{
$numbervisible++;
eval('$activeusers .= ", ' . fetch_template('forumhome_loggedinuser') . '";');
}
}

// memory saving
unset($userinfos, $loggedin);

$activeusers = substr($activeusers , 2); // get rid of initial comma

$DB_site->free_result($loggedins);

$totalonline = $numberregistered + $numberguest;
$numberinvisible = $numberregistered - $numbervisible;

// ### MAX LOGGEDIN USERS ################################
$maxusers = unserialize($datastore['maxloggedin']);
if (intval($maxusers['maxonline']) <= $totalonline)
{
$maxusers['maxonline'] = $totalonline;
$maxusers['maxonlinedate'] = TIMENOW;
build_datastore('maxloggedin', serialize($maxusers));
}

$recordusers = $maxusers['maxonline'];
$recorddate = vbdate($vboptions['dateformat'], $maxusers['maxonlinedate'], true);
$recordtime = vbdate($vboptions['timeformat'], $maxusers['maxonlinedate']);

$show['loggedinusers'] = true;
}
else
{
$show['loggedinusers'] = false;
}

// ### WHO WAS ONLINE TODAY ########################
if ((int)$maxusers['maxonline'] <= $totalonline)
{
$time = time();
$maxloggedin = "$totalonline " . $time . " " . $maxusers['maxonline'] . " " . $maxusers['maxonlinedate'];
$maxusers[0] = $totalonline;
$maxusers[1] = $time;
}

$todayloggedinusers = "";
$numbertodayonline = 0;
$numbertodayonlineinvisible = 0;
$todaynumberregistered = 0;

$todayusers=$DB_site->query("SELECT userid, username, usergroupid, lastactivity, options FROM ".TABLE_PREFIX."user
WHERE lastactivity > " . (mktime(0,0,0,date("m"),date("d"),date("Y")) + (($bbuserinfo['timezoneoffset']-$vboptions[timeoffset])*3600)) . "
ORDER BY username");

while ($todayuser=$DB_site->fetch_array($todayusers))
{
$todayuser['options'] = intval($todayuser['options']);
foreach($_USEROPTIONS AS $optionname => $optionval)
{
$todayuser["$optionname"] = iif($todayuser['options'] & $optionval, 1, 0);
}

$todaynumberregistered++;
$numbertodayonline++;
$invisibleuser = '';
$userid = $todayuser['userid'];
$lastactivetime = vbdate($vboptions['timeformat'], $todayuser[lastactivity]);

if ($todayuser['invisible']==1 and $bbuserinfo['usergroupid']!=6)
{
$numbertodayonlineinvisible++;
continue;
}
if ($todayuser['invisible'] == 1)
{ // Invisible User but show to Admin
$invisibleuser = '*';
}

$username = fetch_musername($todayuser);

if (!$todayloggedinuser)
{
eval("\$todayloggedinuser = \"".fetch_template('forumhome_todayloggedinuser')."\";");
}
else
{
eval("\$todayloggedinuser .= \", ".fetch_template('forumhome_todayloggedinuser')."\";");
}
}

$DB_site->free_result($todayusers);

if ($bbuserinfo[usergroupid] == 6) {
$todayonline = $numbertodayonline;
} else {
$todayonline = $numbertodayonline - $numbertodayonlineinvisible;
}

if ((int)$maxusers[2] <= $numbertodayonline) {
$time = time();
$maxloggedin = $maxusers[0] . " " . $maxusers[1] . " $numbertodayonline " . $time;
$maxusers[2] = $numbertodayonline;
$maxusers[3] = $time;
}

// ### MAX LOGGEDIN USERS TODAY ################################
$todaymaxusers = unserialize($datastore['todaymaxonline']);
if (intval($todaymaxusers['todaymaxonline']) <= $todaynumberregistered)
{
$todaymaxusers['todaymaxonline'] = $todaynumberregistered;
$todaymaxusers['todaymaxonlinedate'] = mktime(0, 0, 0, date('m'), date('d'), date('Y'));
$DB_site->query("REPLACE INTO " . TABLE_PREFIX . "datastore (title, data) VALUES ('todaymaxonline', '" . addslashes(serialize($todaymaxusers)) . "')");
}

$todayrecordusers = $todaymaxusers['todaymaxonline'];
$todayrecorddate = vbdate($vboptions['dateformat'], $todaymaxusers['todaymaxonlinedate'], 1);

eval("\$todayloggedinusers = \"".fetch_template('forumhome_todayloggedinusers')."\";");

// ### GET FORUMS & MODERATOR iCACHES ########################
cache_ordered_forums(1);
if ($vboptions['showmoderatorcolumn'])
{
cache_moderators();
}
else
{
$imodcache = array();
$mod = array();
}

// define max depth for forums display based on $vboptions[forumhomedepth]
define('MAXFORUMDEPTH', $vboptions['forumhomedepth']);

$forumbits = construct_forum_bit($forumid);

// ### BOARD STATISTICS #################################################

// get total threads & posts from the forumcache
$totalthreads = 0;
$totalposts = 0;
if (is_array($forumcache))
{
foreach ($forumcache AS $forum)
{
$totalthreads += $forum['threadcount'];
$totalposts += $forum['replycount'];
}
}
$totalthreads = vb_number_format($totalthreads);
$totalposts = vb_number_format($totalposts);

// get total members and newest member from template
$userstats = unserialize($datastore['userstats']);
$numbermembers = vb_number_format($userstats['numbermembers']);
$newusername = $userstats['newusername'];
$newuserid = $userstats['newuserid'];

// [START HACK='Latest Threads On Forum Home' AUTHOR='NTLDR' VERSION='1.0.0' CHANGEID= 2 ]
// #################### PROCESS LATEST THREADS #######################
// fetch the permissions for each forum
$forumperms = array();
foreach($forumcache AS $forum) {

$forumperms["$forum[forumid]"] = fetch_permissions($forum['forumid']);

// ## HIDE FORUMS WITHOUT THE CANVIEW OR CANVIEWOTHERS PERMISSION ##
if (!($forumperms["$forum[forumid]"] & CANVIEW) || !($forumperms["$forum[forumid]"] & CANVIEWOTHERS)) {
$limitfids .= ','.$forum['forumid'];
}
}
unset($forum);

if ($vboptions['threadpreview'] > 0) {
$previewfield = ', post.pagetext AS preview';
$previewjoin = 'LEFT JOIN '.TABLE_PREFIX.'post AS post ON(post.postid = thread.firstpostid)';
}

$getthreads = $DB_site->query("
## GET LATEST THREADS ##
SELECT thread.*,thread.iconid AS threadiconid $previewfield
FROM ".TABLE_PREFIX."thread AS thread
LEFT JOIN ".TABLE_PREFIX."deletionlog AS deletionlog ON(thread.threadid = deletionlog.primaryid AND type = 'thread')
$previewjoin
WHERE open = '1'
AND forumid NOT IN (0$limitfids)
AND thread.visible = '1'
AND deletionlog.primaryid IS NULL
ORDER BY lastpost
DESC LIMIT 5");

while($thread = $DB_site->fetch_array($getthreads)) {

$threads = true;
$thread['title'] = fetch_censored_text(fetch_trimmed_title(unhtmlspec ialchars($thread['title']), 22));
$thread['date'] = vbdate($vboptions['dateformat'], $thread['lastpost'], 1);
$thread['time'] = vbdate($vboptions['timeformat'], $thread['lastpost']);
$thread['preview'] = preg_replace('#\[quote(=(&quot;|"|\'|).*\\2)?\](.*)\[/quote\]#siU', '', $thread['preview']);
$thread['preview'] = htmlspecialchars_uni(fetch_trimmed_title(strip_bbc ode(fetch_censored_text($thread['preview']), false, true), $vboptions['threadpreview']));
$thread['replycount'] = vb_number_format($thread['replycount']);
$thread['views'] = vb_number_format($thread['views']);

// thread icon
$show['icon'] = false;
$icon = fetch_iconinfo($thread['iconid']);

if (is_array($icon)) {
$show['icon'] = true;
$thread['threadiconpath'] = $icon['iconpath'];
$thread['threadicontitle'] = $icon['title'];
}

// show goto new post
$show['firstnew'] = false;
$bbforumview = fetch_bbarray_cookie('forum_view', $thread['forumid']);

if ($bbforumview > $bbuserinfo['lastvisit']) {
$lastread = $bbforumview;
} else {
$lastread = $bbuserinfo['lastvisit'];
}

if ($thread['lastpost'] > $lastread) {

$threadview = fetch_bbarray_cookie('thread_lastview', $thread['threadid']);

if ($thread['lastpost'] > $threadview) {
$show['firstnew'] = true;
$show['icon'] = false;
}
}

exec_switch_bg();

eval("\$threadbits .= \"".fetch_template('forumhome_latestthreadbit')."\";");
}
if ($threads) {
$show['latestthreads'] = true;
}
// memory saving
unset($thread, $threads);
$DB_site->free_result($getthreads);
// [END HACK='Latest Threads On Forum Home' AUTHOR='NTLDR' VERSION='1.0.0' CHANGEID= 2 ]


// ### USERS IN CHAT #####Version 0.1##############################################


$chatusers = '';
$chatavatar = '';

//get the number of people who are chatting
// ### HACK FOR WHO'S CHATTING

$query_chatonline ="SELECT COUNT(*) FROM connections WHERE userid IS NOT NULL";
$count = mysql_fetch_array(mysql_query($query_chatonline));
$count_chatter = $count[0];





// ###################### Start getavatarurl #######################
function fetch_avatar_url($userid)
{
global $DB_site, $session, $vboptions;

if ($avatarinfo = $DB_site->query_first("
SELECT user.avatarid, user.avatarrevision, avatarpath, NOT ISNULL(avatardata) AS hascustom, customavatar.dateline
FROM " . TABLE_PREFIX . "user AS user
LEFT JOIN " . TABLE_PREFIX . "avatar AS avatar ON avatar.avatarid = user.avatarid
LEFT JOIN " . TABLE_PREFIX . "customavatar AS customavatar ON customavatar.userid = user.userid
WHERE user.userid = $userid"))
{
if (!empty($avatarinfo['avatarpath']))
{
return $avatarinfo['avatarpath'];
}
else if ($avatarinfo['hascustom'])
{
if ($vboptions['usefileavatar'])
{
return "$vboptions[avatarurl]/avatar{$userid}_{$avatarinfo[avatarrevision]}.gif";
}
else
{
return "image.php?u=$userid&amp;dateline=$avatarinfo[dateline]";
}
}
else
{
return '';
}
}
}



//if anyone is chatting.....
if($count_chatter >0)
{

//get the uids of the chatters
$query_userid = "SELECT userid FROM connections WHERE userid IS NOT NULL";
$show_userid = mysql_query($query_userid);
$row_show_userid = mysql_fetch_assoc($show_userid);

//build an array of the userids
do {
$userids[] = $row_show_userid['userid'];
} while ($row_show_userid = mysql_fetch_assoc($show_userid));


// Get the usernames and build the outputVar for the template
foreach($userids as $val)
{

//Get the username for each chatter
$show_username= $DB_site->query("select username from user where userid=".intval($val));
$row_show_username = mysql_fetch_assoc($show_username);


//pass the userid to the avatar_resize.php
$chatavatar = fetch_avatar_url($val);


// store the htmloutput for each user in $temp
$temp = "<td><tr>";
$temp.= "<img src=\"$chatavatar\">";
$temp.= "<div align=\"center\">";
$temp.= "<a href=\"member.php?u=".$val."\">".$row_show_username['username']."</a>";
$temp.= "</div>";
$temp.= "</tr><td>";
$temp.= "<br />";


// concatenate the temp stuff to > $chatusers
$chatusers = $chatusers.$temp;

}; // End foreach



}; // End $count_chatter >0


// surround the $chatusers with some table tags and assign it to a template var
$chatter['usernames'] = "<table><tr>".$chatusers."</tr></table>";

// assign the number of people to a templatevar, so that we can have some conditions on the forumhome-template
$chatter['count'] = $count_chatter;



// ### ALL DONE! SPIT OUT THE HTML AND LET'S GET OUTA HERE... ###

eval('$navbar = "' . fetch_template('navbar') . '";');
eval('print_output("' . fetch_template('FORUMHOME') . '");');

/*================================================= =====================*\
|| ################################################## ##################
|| # Downloaded: 16:13, Fri Aug 6th 2004
|| # CVS: $RCSfile: index.php,v $ - $Revision: 1.132 $
|| ################################################## ##################
\*================================================ ======================*/
?>

FilmoreSlim
11-07-2004, 02:56 AM
karlogaga why not just attach the file? :p

quasan I seem to be having probs with line "exif_imagetype", seems my server doesn't support it or something. Isn't that the same as "getimagesize"?

No avatars show up now ... I'm gonna check out your update closer a little later!

Thanks :)

quasan
11-07-2004, 10:20 AM
do you have gdlib2 ?
or 1.6 ?

parajsa
11-07-2004, 11:00 AM
Greetings, i installed the hack, but from moment to moment, it shows me this error:

mysql_fetch_array(): supplied argument is not a valid MySQL result resource in ..../index.php on line 438

and the code is this on line 438:

line 437: $query_chatonline ="SELECT COUNT(*) FROM ".FLASHCHAT_PREFIX."connections WHERE userid IS NOT NULL";
line 438: $count = mysql_fetch_array(mysql_query($query_chatonline));

How can i avoid this error to be happen again?

Thanks in advanced.

quasan
11-07-2004, 11:06 AM
@parajsa

hi, you modified the sql command. as I wrote: No need to edit anything below" :)


Just define your flashchat database prefix here:
define(FLASHCHAT_PREFIX,"FLASH_");

replace the FLASH_ with your prefix

or if you aren't using a prefix
define(FLASHCHAT_PREFIX,"");

FilmoreSlim
11-07-2004, 03:22 PM
my gd version is (2.0.23)..

parajsa
11-07-2004, 10:30 PM
Hi there quasan,
I use the form: define(FLASHCHAT_PREFIX,""); coz i am not using prefix;

But it does continue to show that error, it is not permenent, but time after time, it show itself on the begginin of the forum.

What can i do, this happen, when a user enters the chat, or get out of it.

Thank u for ur help, and for the good hack.

karlogaga
11-08-2004, 08:17 AM
@quasan the new code just shows the user-name, it doesnt show any avatars, not even the no-avatar.png... php-info says the version of gd is bundled (2.0.28 compatible)

quasan
11-08-2004, 12:18 PM
we will try to locate any of your errors.
that couldn't be that hard, because I tried this mod on 2-3 vbulletins and it works.

I am back tomorrow and than the bughunting starts:)

sorry for these "bugs" but on my systems it just runs :rolleyes:

Sweet Evil
11-17-2004, 04:20 AM
Can someone help me figure out how to not* show the avatars?
I just want the names to show up. Thanks!

OrangeFlea
11-19-2004, 05:08 AM
I love the chat, but I'm looking for something a little more simple and a little more discreate with respect to any "Who's Chatting" feature.

In fact, I'm looking for something more along the lines of "how many" in chat. An accurate count of members in the chat room set next to the chat link on the navbar. Is there a code like this available? Or can you make one?

This would really help.

EPS
11-19-2004, 10:41 PM
I love the chat, but I'm looking for something a little more simple and a little more discreate with respect to any "Who's Chatting" feature.

In fact, I'm looking for something more along the lines of "how many" in chat. An accurate count of members in the chat room set next to the chat link on the navbar. Is there a code like this available? Or can you make one?

This would really help.


this would be great! i search for this too. don't need the avatars on the top...

Sweet Evil
11-20-2004, 09:15 PM
Yea I been trying to figure out how to remove the avatars with no luck ;(

GoTTi
12-12-2004, 08:59 PM
yea sweet i just found this hack here...would like it to show just the user names in the chat not the icons.

GoTTi
12-12-2004, 09:03 PM
figured it out.

i put // infront of


$temp.= "<img src=\"$chatavatar\">";


and that stops the icon from loading.

Sweet Evil
12-12-2004, 11:40 PM
Thanks Da_GoTTi! :)

morrow
12-20-2004, 01:32 PM
Can you maybe update the zip file with the newest instructions? Following this thread is a bit confusing.

Thanks alot.

theArchitect
01-17-2005, 08:51 AM
I am getting an error with this hack.

I have found that putting this hack in global.php rather than index.php I am getting more members using the Chat Room as they can see more easily who is in the chat room. Many of them only visit the index page once and then don't see it again until they log-out.

However, if I install the code into the global.php file then when someone is in the chat room the Who's Online Page doesn't work nor do a lot of the user profiles. THe pages instead return this error.

If you have any thoughts as to what might be causing this it would be appreciated.

Database error in vBulletin 3.0.5:

Invalid SQL:
SELECT userid, username, IF(displaygroupid=0, user.usergroupid, displaygroupid) AS displaygroupid
FROM user AS user
WHERE userid IN (0Array)

mysql error: Unknown column '0Array' in 'where clause'

mysql error number: 1054

Inzagi
01-17-2005, 09:11 AM
hi quasan,
does this hack also display the avatar in the chat itself or just in the index ?

fringehead
01-18-2005, 02:36 AM
I get some errors when an upcomming even displays on the index page.

Warning: fopen(./appdata/appTime.txt): failed to open stream: No such file or directory in /FlashChat/inc/classes/chatServer.php on line 60

Warning: fwrite(): supplied argument is not a valid stream resource in /FlashChat/inc/classes/chatServer.php on line 61

Warning: fflush(): supplied argument is not a valid stream resource in /FlashChat/inc/classes/chatServer.php on line 63

Warning: fclose(): supplied argument is not a valid stream resource in /FlashChat/inc/classes/chatServer.php on line 64
sarcasticfringehead

Any idea?

Thanks

Sean

PnL
01-18-2005, 07:15 AM
Is there a way to put this "Who's online" on every forum page? I tried inserting the code under FORUMDISPLAY but it doesn't show who's in flashchat

theArchitect
01-18-2005, 09:13 PM
Is there a way to put this "Who's online" on every forum page? I tried inserting the code under FORUMDISPLAY but it doesn't show who's in flashchat
I had worked it and and was putting the script in global.php, and the template changes in the navbar template. However, if someone is in the chat room then the script stops Who's Online and most member profiles from working. So I am waiting to hear back with a fix for the error and then it will be good to go.

PnL
01-22-2005, 04:04 AM
Great mod but a request.

Is there a way to change the font size of the username that is showing up? I'd like to make it smaller than default and nothing I've tried seems to work.

Any suggestions?

Craigr
01-26-2005, 12:29 PM
Great mod but a request.

Is there a way to change the font size of the username that is showing up? I'd like to make it smaller than default and nothing I've tried seems to work.

Any suggestions?
Find this in your edited index.php:

$temp.= "<a href=\"member.php?u=".$val."\">".$row_show_username['username']."</a>";


Replace with:

$temp.= "<div class=\"smallfont\"><a href=\"member.php?u=".$val."\">".$row_show_username['username']."</a></div>";


Worked fine for me. :)

quasan
01-26-2005, 01:33 PM
hi guys,
i am so sorry that I didn't provide any updates in the past.
but there was a lot going on in my life

@fringehead
yo have to make the appdata dir writable to your server.
chmod it to 777

@Inzagi
just on the index. it's a hack for the vbulletin and not a hack of the chat itself

@all
i'll provide a new version the next days

PnL
02-09-2005, 08:24 PM
Find this in your edited index.php:

$temp.= "<a href=\"member.php?u=".$val."\">".$row_show_username['username']."</a>";


Replace with:

$temp.= "<div class=\"smallfont\"><a href=\"member.php?u=".$val."\">".$row_show_username['username']."</a></div>";


Worked fine for me. :)


Thanks CraigR - worked like a charm! :)

Now if I could only figure out how to make the "Who's In Chat" show up on every page instead of the just the main forums page I'd be in business!!

quasan ..... is there a way to do this? I tried adding it to the display template but it doesn't show the users/avatars of those in chat. I think this would be a useful mod so you can always tell when someone is in the chatroom. Also useful to update the "Who's IN Chat" since people do not randomly refresh the main forum home page, but moving to a new forum/thread will automatically refresh the "Who's In Chat" if its available on each page. What d'ya think?

Paul

Craigr
02-10-2005, 11:30 AM
Thanks CraigR - worked like a charm! :)

Now if I could only figure out how to make the "Who's In Chat" show up on every page instead of the just the main forums page I'd be in business!!

quasan ..... is there a way to do this? I tried adding it to the display template but it doesn't show the users/avatars of those in chat. I think this would be a useful mod so you can always tell when someone is in the chatroom. Also useful to update the "Who's IN Chat" since people do not randomly refresh the main forum home page, but moving to a new forum/thread will automatically refresh the "Who's In Chat" if its available on each page. What d'ya think?

Paul
Rather than putting the code in index.php you could put it in global.php then simply add the $chatter[usernames] part in a template that appears in all pages, such as header, footer, navbar. This way you will get the online users on every page.

PnL
02-10-2005, 06:49 PM
Rather than putting the code in index.php you could put it in global.php then simply add the $chatter[usernames] part in a template that appears in all pages, such as header, footer, navbar. This way you will get the online users on every page.

Once again I have to extend thanks to you Craigr! Worked like a charm.

Thanks!
Paul

PnL
02-21-2005, 12:48 AM
Noticed recently that when the code is put in global.php that the profile pages do not appear - it causes an MySQL error. Here are the symptoms:

When no one appears in "Who's In Chat" then clicking on a username brings up their profile with no problems. If the user shows up in "Who's In Chat" then clicking on the username (either in Who's Online or Who's In Chat) brings up the error mentioned about:

----------------------------------------------------

Database error in vBulletin 3.0.7:

Invalid SQL:
SELECT userid, username, IF(displaygroupid=0, user.usergroupid, displaygroupid) AS displaygroupid
FROM user AS user
WHERE userid IN (0Array,2)

mysql error: Unknown column '0Array' in 'where clause'

mysql error number: 1054

----------------------------------------------------

If I log everyone out of Flash Chat and refresh the forum page - I have access to the profiles again. What is causing this error? I haven't tried to reproduce this with the "Who's In Chat" code in index.php. This error is completely reproducible and seems to originate from this hack.

Anyone have suggestions?

Thanks,
Paul

BTW - I have the navbar template modded to have the "Who's In Chat" show up on each page.

fringehead
02-21-2005, 01:21 AM
We are in the same boat as TheArchitect. Our profiles break when people are in the chat room. Any fix for this? PnL posted the error.

Thanks,

Sean

fringehead
02-23-2005, 01:09 AM
We are going to have to install another flashchat mod. We really like this one, it's too bad it breaks the profiles... I see you guys haven't posted in about 1 month... I'm loosing hope!!! You never address the Architect's issues either.....

Sean

Paul M
02-23-2005, 07:30 AM
There is an alternative here (https://vborg.vbsupport.ru/showthread.php?s=&threadid=73042). :)

cartheym
03-15-2005, 08:39 AM
nice hack & works well but for one problem.....

i use vBadvanced and have put this hack into a module - i have done this successfully (having put hack into global.php) and it works perfectly when operating within the forum
(i.e. www.gpcricket.com.au/forum/)
however when i go my other pages on the website
(eg. http://www.gpcricket.com.au/index.php?page=shirts)
that are controlled by vBadvanced the avatar does not appear and I get a 'x' in a box, like a missing pic file link, in its place above each name (see screenshots)

any assistance to retrieve the avatars from webpages outside of the forum would be greatly appriciated

FYI i have returned the module to text-based for the moment