PDA

View Full Version : Who's Chatting and Online


Sinfullilblonde
12-17-2005, 03:27 PM
Hi, we had our on front page where the visitors could see who was in the chat room and who was online. We'd like to add this back to the new version we have. our members really liked this feature...Can you tell me a way we can do this?

Also the shoutbox text is really small...can we bump the size of the font up?

Thanks so much for all your help. :)

Sinfullilblonde
12-19-2005, 04:56 PM
I really could use some help with this...we have tried everything to get this to work and have not been successful. I'd be happy to pay you for your time, we really need this on our site.

natio :: phpFox
12-19-2005, 05:53 PM
hello, i can help you out with it. Im just waiting to get a hold of the chat script cause i think something needs to be added in the FlashChat script to be able to see who is online. Do you by any chance know what the names are of the Mysql tables for the FlashChat script? Did ou got the FlashChat script with phpFoX before when it was a part of the script? If so then i would think the mysql tables are the same, so i can just get an idea of the tables are setup.

Get back to me when you can.

Sinfullilblonde
12-19-2005, 06:02 PM
Hi Mike,

I have the had this working b4 and yes I did get the flashchat script with PHPFoX when it was part of the script.

The Mysql tables for the flashchat are as follows:

flashchat_bans, flashchat_connections, flashchat_ignors, flashchat_messages, flashchat_users, flashchat_rooms

Thanks a lot.... :)

natio :: phpFox
12-22-2005, 02:39 AM
hello, ok i got a hold of the script and did a fix i think that you wanted for you main page.

First we open up "/inc/html/html_welcome.php" and look for this:
Content visible to registered users only.

right under that we can add:
Content visible to registered users only.

Now that code is in it will call the whos online and whos chatting list.
Now we need to get it in the html for the main page. So for this we pop open
"/inc/template/new/index_welcome.php"

Here you can change up the style to fit your page but just for a example just add in what i created and then work from their. Anywho lets first look for:
Content visible to registered users only.

and right under that we can add:
Content visible to registered users only.

and thats it. It should now be show your whos online and members chatting.
get back to me how it turns it out. :)

natio :: phpFox
12-22-2005, 02:40 AM
Content visible to registered users only.

oh yeah about this, you can open up "/home/index.php"
and look for:
Content visible to registered users only.

and change that to something like:
Content visible to registered users only.

:D

Sinfullilblonde
12-28-2005, 08:41 PM
Hi, this works great except it's showing people in the chatroom even thought know one is in there...The Who's online is working find....Who's chatting is showing people in the chat room that aren't there...the chat was empty and this is what is showing....

Thanks :)

Members Online:
BSOTO , liefde , APFairebrz , HeartOfFires , Begonha , APKizzie

Members Chatting:
a2zdragonfly , ADMIN , adolobe , akaycia , alb , AngelFlys , Angelheart735 , AngelsAbove_me , Antigone , antoinet

natio :: phpFox
12-28-2005, 10:09 PM
oh yeah, will look it over again. I think its cause the chat script doesnt update with the online list so it doenst now who is online, ill get a hold of the script and work it in to make it work with the online list. ill get back to you once i check it out. :)

natio :: phpFox
12-30-2005, 11:19 AM
ok, i got a little fix for this. I wasnt able to test it on a server but i would assume it will work.

so if we open up "/inc/html/html_welcome.php" and look for
Content visible to registered users only.

and replace that with
Content visible to registered users only.

Give that a try and get back me.

djema
01-05-2006, 10:48 AM
Hi does this mod work for phpfox 1.05 once i get my flash chat working this would be my next step....

natio :: phpFox
01-05-2006, 12:09 PM
Content visible to registered users only.

Yes, thats correct this will work on 1.05+
Only thing to watch our for is the name to the db table.
The one i used here is called "flashchat_users", this is the default name but if you changed the prefix on setup it might be diff. but other than that yes it will work.

djema
01-07-2006, 08:31 AM
phpfox version 1.05 whos on chat mod

When i do this mod my whole website site goes blank lol please take a look maybe i did something wrong.


this is the html_welcome.php file


<?php
/*################################################# #################
PHPFOX
################################################## ################

Copyright : (C) 2005 The phpFoX Group a Reality Fox Creation
Contact : support@phpfox.com
Support Forum : http://www.phpfox.com/forum/

- phpFoX and all of its source code and files are protected by Copyright Laws.

- The license for phpFoX permits you to install this software on a single domain (.com, .org, .net, etc.).

- You may also not remove the "Powered By phpFoX" or any copyright screen which shows the copyright information and credits for phpFoX (RealityFOX Creations).

################################################## ################*/

$phpfox_template = phpfox_load("index_welcome");

$build = array(
'WELCOME_INTRO' => file_get_contents("".$VAR[5]."/inc/content/welcome_intro.html"),
'ADS' => html_adds(3),
'IMAGE_LOCATION' => $VAR[10],
);
$whos_online_count = 0;
$sub_routine['whos_online'] = "";
$load_whos_online = phpfox_load_while($phpfox_template,"whos_online");
$whos_online1 = mysql_query("SELECT `user` FROM `online` WHERE `user` != '' ORDER BY `time` DESC LIMIT 0,10");
while ($whos_online2 = while ($whos_online_chat2 = mysql_fetch_array($whos_online_chat1))
{
$whos_online__chat_count++;
$int__chat_count = $whos_online__chat_count != 1 ? ',' : '';

$check_online1 = mysql_query("SELECT `user` FROM `online` WHERE `user` = '$whos_online_chat2[login]'");
$check_online2 = mysql_fetch_array($check_online1);

if ( $check_online2['user'] )
{
$sub_routine['whos_online_chatting'] .= phpfox_while($load_whos_online_chat,array(
'RECENT_NAMES_CHAT' => mcheck( $whos_online_chat2['login'] ) == 1 ? ' '. $int__chat_count .' '. ulink($whos_online_chat2['login']) .'' : '',
));
}
}



$whos_online__chat_count = 0;
$sub_routine['whos_online_chatting'] = "";
$load_whos_online_chat = phpfox_load_while($phpfox_template,"whos_online_chatting");
$whos_online_chat1 = mysql_query("SELECT `login` FROM `flashchat_users` WHERE `login` != '' LIMIT 0,10");
while ($whos_online_chat2 = mysql_fetch_array($whos_online_chat1))
{
$whos_online__chat_count++;
$int__chat_count = $whos_online__chat_count != 1 ? ',' : '';

$sub_routine['whos_online_chatting'] .= phpfox_while($load_whos_online_chat,array(
'RECENT_NAMES_CHAT' => mcheck( $whos_online_chat2['login'] ) == 1 ? ' '. $int__chat_count .' '. ulink($whos_online_chat2['login']) .'' : '',
));
}


$a = mysql_query("SELECT `user`,`day`,`month`,`year` FROM `user` WHERE `feature` = '1' ORDER BY rand() LIMIT 0,1");
if ( $b = mysql_fetch_array($a) )
{
$sub_routine['phpfox_featured'] = 1;
$build['FEATURED_IMAGE'] = uimage($b['user'],"60",4,"");
$build['FEATURED_USER'] = ulink($b['user']);
$build['FEATURED_ONLINE'] = check_online($b['user']);
$build['FEATURED_DOB'] = bday("$b[day]","$b[month]","$b[year]");
$build['FEATURED_LOCATION'] = location($b['user']);
$build['FEATURED_ACTIVE'] = user_active($b['user']);
$build['FEATURED_STARSIGN'] = starsign("$b[day]","$b[month]","");
}
else
{
$sub_routine['phpfox_featured_none'] = 1;
}

$counts = 0;
$sub_routine['recent_logins'] = "";
$load_recent = phpfox_load_while($phpfox_template,"recent_logins");
$alogin = mysql_query("SELECT `user` FROM `user` ORDER BY `login` DESC LIMIT 0,8");
while ($blogin = mysql_fetch_array($alogin))
{
$counts++;
$sub_routine['recent_logins'] .= phpfox_while($load_recent,array(
'RECENT_IMAGE' => uimage2($blogin['user'],"60",4,""),
'ADD_BREAK' => $counts == '4' ? '
' : '',
));
}

$o = mysql_query("SELECT * FROM `polls` ORDER BY rand() LIMIT 1");
$p = mysql_fetch_array($o);

if ( $p['id'] )
{
$count = 0;

$POLLS = "";
$split = split(",","$p[option]");
foreach ($split as $poll)
{
$count++;
$POLLS .= '<div><input type="radio" name="an" class="pollinput" value="o'.$count.'" onclick="submit();" style="vertical-align:middle;" />' .$poll.'</div>'."\n";
}

$build['POLL_USER_IMAGE'] = uimage($p['user'],"60",4,"");
$build['POLL_ID'] = $p['id'];
$build['POLL_VALUE'] = $p['poll'];
$build['POLL_TEXT'] = $p['poll'];
$build['POLL_OPTIONS'] = $POLLS;
$build['POLL_LINK'] = "". $VAR[0] ."/poll/?action=result&amp;id=". $p['id'] ."";
$sub_routine['phpfox_polls'] = 1;
}


$sub_routine['show_blogs'] = "";
$load_blog = phpfox_load_while($phpfox_template,"show_blogs");
$a5 = mysql_query("SELECT `user`,`id`,`title` FROM `journal` WHERE `user` != '' ORDER BY `time` DESC LIMIT 0,5");
while ($b6 = mysql_fetch_array($a5))
{
$sub_routine['show_blogs'] .= phpfox_while($load_blog,array(
'BLOG_IMAGE' => uimage($b6['user'],"20",7,"style=\"vertical-align:top;\" onmouseover=\"showInfo('".$VAR[0]."/".newpics($b6['user'])."');\" onmouseout=\"return nd();\""),
'BLOG_TEXT' => $b6['title'] ? ShortenText($b6['title'],"30","","25","",1) : $phpfox_lang['untitled'],
'BLOG_USER' => $b6['user'],
'BLOG_LINK' => ''.$VAR[0].'/blog/view/?ID='.$b6['id'].'',
));
}

html_main(build_tpl($phpfox_template,$build,$sub_r outine),"","");
?>



And this is the other script that needed to be modded index_welcome.tpl

<table style="width:100%;" cellpadding="5" cellspacing="5">
<tr>
<td style="vertical-align:top;">

<table style="width:100%;" cellpadding="4" cellspacing="0">
<tr>
<td style="vertical-align:top;width:50%;">

<table style="width:100%;" cellspacing="0" cellpadding="4">
<tr>
<td style="font-size:7pt;" class="border2">

<table style="width:100%;" class="mainmenu5" cellspacing="0" cellpadding="4">
<tr>
<td style="font-size:8pt;">
{%LANG_FEATURED_MEMBER%}
</td>
</tr>
</table>

<!-- phpfox_featured_START --!>
<table>
<tr>
<td>
<div style="padding:8px;"> {%FEATURED_IMAGE%} </div>
</td>
<td>
<div style="padding:8px;font-size:8pt;" class="color">
<span class="memlink">{%FEATURED_USER%} ( {%FEATURED_ONLINE%} ) </span>

{%LANG_age%}: {%FEATURED_DOB%}

{%LANG_location%}: {%FEATURED_LOCATION%}

{%LANG_activity%}: {%FEATURED_ACTIVE%}

{%LANG_star_sign%}: {%FEATURED_STARSIGN%}
</div>
</td>
</tr>
</table>
<!-- phpfox_featured_END --!>
<!-- phpfox_featured_none_START --!>
<div style="padding:10px;font-size:9pt;" class="color">
{%LANG_no_featured%}
</div>
<!-- phpfox_featured_none_END --!>

</td>
</tr>
</table>




<table style="width:100%;" cellspacing="0" cellpadding="0">
<tr>
<td style="width:2%;">
Content visible to registered users only.
</td>
<td style="width:98%;font-size:8pt;vertical-align:middle;cursor:pointer;" onclick="javascript:window.location.href='{%HOME%}/signup/';" class="mainmenu4" onmouseover="this.className='mainmenu3';document.getElementById ('change1').className='button';" onmouseout="this.className='mainmenu4';document.getElementById ('change1').className='button2';">

<div style="padding-left:5px;">
<span style="vertical-align:middle;"> {%LANG_not_yet_member%} </span>
<input type="button" value="{%LANG_join_now%}" style="vertical-align:middle;" class="button2" id="change1" />
</div>

</td>
</tr>
</table>




{%WELCOME_INTRO%}




<table style="width:100%;" cellpadding="0" cellspacing="0">
<tr>
<td style="vertical-align:top;width:48%;">

<table style="width:100%;" cellspacing="0" cellpadding="4">
<tr>
<td style="font-size:7pt;" class="border2">

<table style="width:100%;" class="mainmenu5" cellspacing="0" cellpadding="4">
<tr>
<td style="font-size:8pt;">
{%LANG_random_polls%}
</td>
<td style="font-size:7pt;text-align:right;">
<span class="cur" id="hidetext2" onclick="SwitchMenu('sub2','hidetext2')">[-]</span>
</td>
</tr>
</table>

<div class="submenu" id="sub2">
<table style="width:100%;height:270px;" cellspacing="0" cellpadding="0">
<tr>
<td style="font-size:7pt;vertical-align:top;">

<!-- phpfox_polls_START --!>
<form method="post" action="{%HOME%}/poll/?action=vote" style="margin:0px;">
<div><input type="hidden" name="id" value="{%POLL_ID%}" /></div>
<div><input type="hidden" name="poll" value="{%POLL_VALUE%}" /></div>


<div style="font-size:7pt;font-weight:bold;" class="color">
<div style="text-align:center;">
{%POLL_USER_IMAGE%}


{%POLL_TEXT%}
</div>

<div style="padding-left:10px;">

{%POLL_OPTIONS%}
</div>
</div>


</form>
<!-- phpfox_polls_END --!>

</td>
</tr>
<tr>
<td>
<div style="font-size:7pt;text-align:right;">
{%LANG_view_poll_results%} ({%POLL_LINK%})
</div>
</td>
</tr>
</table>
</div>


</td>
</tr>
</table>

</td><td style="vertical-align:top;width:4%;">

</td><td style="vertical-align:top;width:48%;">

<table style="width:100%;" cellspacing="0" cellpadding="4">
<tr>
<td style="font-size:7pt;" class="border2">

<table style="width:100%;" class="mainmenu5" cellspacing="0" cellpadding="4">
<tr>
<td style="font-size:8pt;">
{%LANG_new_blogs%}
</td>
<td style="font-size:7pt;text-align:right;">
<span class="cur" id="hidetext8" onclick="SwitchMenu('sub8','hidetext8')">[-]</span>
</td>
</tr>
</table>

<div class="submenu" id="sub8">
<table style="width:100%;height:270px;" cellspacing="0" cellpadding="0">
<tr>
<td style="font-size:7pt;vertical-align:top;">



<!-- show_blogs_START_WHILE --!>
<table style="width:100%;" class="border5">
<tr>
<td style="width:5%;">
{%BLOG_IMAGE%}
</td><td class="color" style="font-size:7pt;vertical-align:top;width:95%;">
{%BLOG_TEXT%} ({%BLOG_LINK%})
<div>BY:{%BLOG_USER%}</div>
</td>
</tr>
</table>


<!-- show_blogs_END_WHILE --!>

</td>
</tr>
<tr>
<td>
<div style="font-size:7pt;text-align:right;">
{%LANG_add_your_blog%} ({%HOME%}/member/submit/?item=blog)
</div>
</td>
</tr>
</table>
</div>

</td>
</tr>
</table>

</td>
</tr>
</table>




</td><td style="vertical-align:top;width:45%;">

<table style="width:100%;" cellspacing="0" cellpadding="0">
<tr>
<td style="vertical-align:top;">

<table style="width:100%;" cellspacing="0" cellpadding="0">
<tr>
<td style="width:2%;">
Content visible to registered users only.
</td>
<td style="width:98%;font-size:8pt;vertical-align:middle;" class="mainmenu3">
<div style="padding-left:10px;">
<span style="vertical-align:middle;"> {%LANG_members_login%} </span>
</div>
</td>
</tr>
</table>

<table style="width:100%;" class="border2" cellspacing="0" cellpadding="10">
<tr>
<td style="font-size:7pt;" class="color">

<div id="formhide1">
<form method="post" style="margin:0px;" action="{%HOME%}/member/">
<table style="width:100%;" cellspacing="0" cellpadding="5">
<tr>
<td style="width:20%;font-size:8pt;text-align:right;" class="color">
<label for="login1">{%LANG_username%}:</label>
</td><td style="width:80%;font-size:8pt;" class="color">
<input id="login1" type="text" name="user" size="30" class="input" onfocus="this.className='input2';document.getElementById('h ide3').style.display='';" onblur="this.className='input';document.getElementById('hi de3').style.display='none';" />
Content visible to registered users only.
</td>
</tr>
<tr>
<td style="width:20%;font-size:8pt;text-align:right;" class="color">
<label for="login2">{%LANG_password%}:</label>
</td><td style="width:80%;font-size:8pt;" class="color">
<input id="login2" type="password" name="pass" size="30" class="input" onfocus="this.className='input2';document.getElementById('h ide4').style.display='';" onblur="this.className='input';document.getElementById('hi de4').style.display='none';" />
Content visible to registered users only.
</td>
</tr>
</table>





<div style="padding:5px;" class="border">
<input type="submit" value="{%LANG_login%}" onclick="document.getElementById('formhide1').style.display ='none';document.getElementById('formhide2').style .display='';" class="button2" onmouseover="this.className='button';" onmouseout="this.className='button2';" />
</div>




<div style="text-align:right;font-size:7pt;" class="color">
[ {%LANG_lost_your_password%} (javascript:void(0);) ]
</div>

</form>
</div>

<div style="display:none;" id="formhide2">
<div style="font-size:10pt;" class="color">
{%LANG_loging_in%}
</div>

<table class="pbar3" cellpadding="0" cellspacing="0">
<tr>
<td>
<span id="progress1"> </span>
<span id="progress2"> </span>
<span id="progress3"> </span>
<span id="progress4"> </span>
<span id="progress5"> </span>
<span id="progress6"> </span>
<span id="progress7"> </span>
<span id="progress8"> </span>
<span id="progress9"> </span>
</td>
</tr>
</table>


<script type="text/javascript">do_prog(9,200);</script>
</div>
</td>
</tr>
</table>

<div style="text-align:center;">


{%ADS%}
</div>



<table style="width:100%;" cellspacing="0" cellpadding="0">
<tr>
<td style="width:2%;">
Content visible to registered users only.
</td>
<td style="width:98%;font-size:8pt;vertical-align:middle;" class="mainmenu3">
<div style="padding-left:10px;">
<span style="vertical-align:middle;"> WHOS ONLINE </span>
</div>
</td>
</tr>
</table>




<div style="font-size:9pt;" class="color">
Members Online:
<div style="padding:6px;">
<!-- whos_online_START_WHILE --!>
{%RECENT_NAMES%}
<!-- whos_online_END_WHILE --!>
</div>


Members Chatting:
<div style="padding:6px;">
<!-- whos_online_chatting_START_WHILE --!>
{%RECENT_NAMES_CHAT%}
<!-- whos_online_chatting_END_WHILE --!>
</div>

</div>






<table style="width:100%;" cellspacing="0" cellpadding="0">
<tr>
<td style="width:2%;">
Content visible to registered users only.
</td>
<td style="width:98%;font-size:8pt;vertical-align:middle;" class="mainmenu3">
<div style="padding-left:10px;">
<span style="vertical-align:middle;"> {%LANG_recent_logins%} </span>
</div>
</td>
</tr>
</table>




<div style="text-align:center;">

<!-- recent_logins_START_WHILE --!>
{%RECENT_IMAGE%}
{%ADD_BREAK%}
<!-- recent_logins_END_WHILE --!>




<div style="text-align:right;font-size:7pt;" class="color">
[ {%LANG_view_more%} ({%HOME%}/browse/) ]
</div>

</div>


</td>
</tr>
</table>




</td>
</tr>
</table>
</td>
</tr>
</table>

natio :: phpFox
01-08-2006, 03:37 PM
hello,

just to confirm first before i test it on 1.05 did you create your flashchat with the prefix flashchat_ or with out it?

If you look at:
Content visible to registered users only.

this is using the default prefix. thing is your site shouldnt go blank if there is a error with a mysql table cause mysql nevers usually gives a fatal error. It could also be the copy and paste issue. well check first the db name and if it still does not work ill test it out on 1.05 and email you the script to make things easier. :)

djema
01-11-2006, 02:41 AM
yes its set to the default flashchat_ can the script be emailed. it will be so much easy
staff@springfieldblock.com

djema
01-30-2006, 08:42 AM
ok back to this when you get a chance :) i havent been able to get a whos chatting in my site, ive look all over and notting :(

natio :: phpFox
01-30-2006, 03:16 PM
Content visible to registered users only.


hello,

can you email me your /inc/template/new/index_welcome.tpl and [b]/inc/html/html_welcome.php[b] .

so just in case you made some other changes i can just send you the fix back to your email.

my email is: mike@phpfox.com

djema
02-13-2006, 08:01 AM
Ok Mike i sent you that email :lol:

djema
02-14-2006, 10:52 AM
Not to be a pain Mike, But did you go over the email i sent you about this post issue?

natio :: phpFox
02-14-2006, 01:15 PM
Content visible to registered users only.

not a prb.

yup will get to it today and will email it to you once its done. :)

djema
02-14-2006, 08:27 PM
awesome thanks Mike.!!