Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> PHP
Author Message
kenno
Worker
Worker



Joined: Jul 26, 2009
Posts: 117
Location: Scunthorpe, UK

PostPosted: Mon Aug 29, 2011 3:22 pm Reply with quote

killing-hours wrote:
Hrm... not sure. BTW... one thing I noticed on my own the other day was that the chat list looks for an image to display next to their name. If you don't set something... it's going to show tons of hits on your site as 404 pages. When you see those show up in your tracked sentinal page... find out where it's looking for the image and put a 1x1 px blank image in there so it doesn't throw off your hit counter. Otherwise .... you have to manually make images for everyone. (bah on that)

Here is a 1x1 px image.
http://www.mediafire.com/?5onhxb2b8edmy4p


I will add that image.

Two things I have to look into fixing now are the problem I mentioned above, where the name links, only link back to your own forum profile and not of the user name listed in the chat bar.

Also there seems to be a problem where the whole chat conversation gets wiped out as you browse the rest of the site and forums while chatting, so basically as soon as you click a link the convo is wiped.

I am gonna have a search around there support forums

Thanks Mark
 
View user's profile Send private message
killing-hours
RavenNuke(tm) Development Team



Joined: Oct 01, 2010
Posts: 438
Location: Houston, Tx

PostPosted: Mon Aug 29, 2011 3:27 pm Reply with quote

For the conversation wiping out... try changing the session setting in the integration.php and see if that does it. I forget what I did when I ran into that issue.

The link problem... I'm not sure.. I didn't have that issue.

_________________
Money is the measurement of time - Me
"You can all go to hell…I’m going to Texas" -Davy Crockett 
View user's profile Send private message
kenno







PostPosted: Mon Aug 29, 2011 3:33 pm Reply with quote

Which session setting ?
To what?

I see this in the integration.php

Code:
/* ADVANCED */


define('SET_SESSION_NAME','');         // Session name
define('DO_NOT_START_SESSION','1');      // Set to 1 if you have already started the session
define('DO_NOT_DESTROY_SESSION','0');   // Set to 1 if you do not want to destroy session on logout
define('SWITCH_ENABLED','0');      
define('INCLUDE_JQUERY','1');   
define('FORCE_MAGIC_QUOTES','0');
 
killing-hours







PostPosted: Mon Aug 29, 2011 3:41 pm Reply with quote

Try setting "DO_NOT_START_SESSION, 0"

Not sure that it will help... just trying to retrace my steps when I had the same issue. I forget off hand how I solved it. It's a whole lot of trial and error testing.
 
kenno







PostPosted: Mon Aug 29, 2011 4:29 pm Reply with quote

That has done it mate, thanks again for all your help with this.

So on yours does all your profile links work from the chat bar as they should ?
 
killing-hours







PostPosted: Mon Aug 29, 2011 5:09 pm Reply with quote

That is part of the "getlink()" function I believe. I may have jacked that one up because I initially wasn't going to fool with it but at the last minute I tossed it out there. It may be wrong but I honestly don't feel like looking at it tonight. I'll look at it tomorrow and see what I can come up with.
 
killing-hours







PostPosted: Tue Aug 30, 2011 10:40 am Reply with quote

Ok... quick fix for the profile issue. Instead of ".getUserId()" at the end of the "getLink()" function... change it to read

Code:
.$link;


So it will look like this:

Code:
return "/modules.php?name=Forums&file=profile&mode=viewprofile&u=".$link;


That will fix it. Wink Thanks for pointing it out... I'll correct the tutorial!
 
kenno







PostPosted: Sat Sep 03, 2011 5:17 am Reply with quote

Just wanted to say that fixed this
Thanks a lot

Also where about`s in Sentinel will I find these 404 error pages to include this image ?

Mark
 
killing-hours







PostPosted: Sat Sep 03, 2011 7:24 pm Reply with quote

The tracked Ip menu ---> Display tracked ip's

What happens is that the chatbar will look for an image to display next to the users name in a chatbox when it is opened. Sorta like and avatar works on forums. Since the chatbar is "generally" programmed for php websites... it looks in a certain directory somewhere. If you notice your hit counter on your website higher that "usual" then you need to look in the tracked ip menu and see that it's not actually the chatbar trying to find images and returning 404 pages since the images aren't being found. Therefore... throwing off your hit counter. =)
 
kenno







PostPosted: Wed Sep 14, 2011 1:43 pm Reply with quote

Has anyone else installed this at all ?.

I am curious as since I installed this I have been getting a lot of server problems and my host is saying

Quote:
Hello,

I have checked the server logs to investigate the issues you are facing.

Your site is running some mysql queries that are running long and having to be killed off by the server. These are to database;
rvnuke1

At the time I checked the server 56 concurrent queries were running querying some 11584 rows of data. If possible indexing the database tables and or optimising queries could reduce the load being placed on the server.

Please let us know what questions you have and what else we can do to help.


Kind Regards,
Max S
Linux Systems Administrator
HostGator.com LLC


I have asked them to try being more specific but I have not installed any else other then this cometchat on my site for sometime and never had any problems at all.

Just thought I would ask on here aswell

Mark
 
killing-hours







PostPosted: Wed Sep 14, 2011 2:08 pm Reply with quote

killing-hours wrote:
Please... don't forget to set a cron job to delete old messages after some time otherwise the database will be filled with messages and slow things down.



On page two of this thread at the very bottom. Depending on how many users you have using cometchat... the database can fill up pretty quick with messages. Each time the bar queries the database for updates.. it has to comb through those messages. = Huge database... huge resource hog.
 
kenno







PostPosted: Wed Sep 14, 2011 3:09 pm Reply with quote

Right I see, but even doing that I do not think it will help that much

Look at this what I have just been sent from my hosts

Quote:
Hello,


Unfortunately, we were forced to suspend the script "/home/bulldogs/public_html/index.php" as it was causing a high load on the server, and due this affecting all of the other accounts on the system, We were forced to take immediate action for the health of the server.

It appears that this script is an ajax system and generally scripts of this nature make a lot of requests constantly. We recommend that you take steps to reduce the number of calls that this makes, such as increasing the time before refreshes, or making it so that the script only preforms an update after specific user actions. However, the original authors of the script might have more information on how to optimize this in such a fashion that it will not cause a load issue again.

If you reply back to this with your IP address (http://www.hostgator.com/ip.shtml) we will be more than happy to go ahead enable HTTP access for you, so that you can safely work on the script without it causing further issues. Please let us know how you would like to proceed.


After searching on the CometChat forums it seems like they only seem to want to push you accros to there CometService which is an extra change to take the load off your own server for a monthly fee, or pay a one time fee.
http://www.cometchat.com/cometservice

There are also a few posts regarding the same issues I am facing

http://www.cometchat.com/support/topic/1648-using-to-many-processes-on-a-shared-hosting-plan/page__p__6666

I really can`t believe for a site like mine, which has on average maybe 10 users on at a time max, that it could cause this time of server load issues.

I think I may have to remove this as I can`t afford to pay another monthly service just for a chat function

Mark
 
killing-hours







PostPosted: Wed Sep 14, 2011 3:20 pm Reply with quote

You could try setting cometchat to update at longer intervals in the cometchat admin area. maybe 5 or 10 mins instead of 1 minute which is default I think. just means the bar won't be near as "instant" as you'd like.

Everything has it's drawbacks... especially ajax on a shared server. I had a similar issue while developing my work module... I have 4 users using the system which is based on ajax and was updating every 1 min = 4 requests per minute + end users on the system viewing work (x Users) so my app was triggering the firewall on the servers and banning our ip address. Solution was to tone down the ajax requests to every 5 minutes.
 
kenno







PostPosted: Wed Sep 14, 2011 3:31 pm Reply with quote

Do you mean in the config.php file, I have just done that actually and set it to 7 mins instead of the 1 min.

I am going to ask and make a ticket to CometChat as its really a blag if this will not work on a shared server on a site really as small as mine.

What I don`t understand though is my host has disabled a section of my homepage index.php but the rest of the site functions including cometchat so I can`t see how they say they have stopped the load when cometchat is still functioning ?
 
killing-hours







PostPosted: Wed Sep 14, 2011 3:34 pm Reply with quote

You've got me.

And actually... there is an interface within cometchat for admins.

http://YOURSITE.com/COMETCHAT_FOLDER/admin
 
kenno







PostPosted: Wed Sep 14, 2011 4:11 pm Reply with quote

I never actually even seen that admin interface !!!!! doh!! I have been using the config file all the time.

Anyway I have made a ticket to CometChat and asked them what they suggest aswell.

Can I ask a really stupid question, how can i set a cron job up to delete that Cometchat table say everyday ?

Thanks Mark
 
killing-hours







PostPosted: Thu Sep 15, 2011 7:38 am Reply with quote

http://www.siteground.com/tutorials/cpanel/cron_jobs.htm

&

http://manual.b2evolution.net/Set_up_a_cpanel_cron_job

Cron jobs just run a certain script at a set interval. So basically... you'll have a .php script in the cometchat folder that you can alter to do w/e you want on that cron run. Since you want it to empty that table... write your query to delete that table then optimize it after the delete to keep the table neat.

*** Edit ***

The file in the cometchat folder is "cron.php" and it's already setup to delete read messages older than "X" days.

cron.php:
Code:
include_once (dirname(__FILE__).DIRECTORY_SEPARATOR."cometchat_init.php");


$sql = ("delete from cometchat where cometchat.read = 1 and ('".getTimeStamp()."'-cometchat.sent)>10800");
$query = mysql_query($sql);
if (defined('DEV_MODE') && DEV_MODE == '1') { echo mysql_error(); }

foreach ($trayicon as $t) {
   if (file_exists(dirname(__FILE__).'/modules/'.$t[0].'/cron.php')) {
      include_once(dirname(__FILE__).'/modules/'.$t[0].'/cron.php');
   }
}

foreach ($plugins as $p) {
   if (file_exists(dirname(__FILE__).'/plugins/'.$p.'/cron.php')) {
      include_once(dirname(__FILE__).'/plugins/'.$p.'/cron.php');
   }
}


Also might want to read this...

http://www.cometchat.com/documentation/optimizing-performance
 
kenno







PostPosted: Thu Sep 15, 2011 2:54 pm Reply with quote

Thanks for that, so basically my cron job wants to run that file cron.php to delete old messages stored in cometchat table.
I will have a go at setting this cron job up now

This is the reply I got from CometChat

Quote:
Hello Mark,

Yes, CometChat works on shared servers. Unfortunately, same hosts may not want
any chat software on their servers. We have thousands of websites running
CometChat on shared servers.

Here is an optimization guide which will help you reduce load:

http://www.cometchat.com/documentation/optimizing-performance

If you still face load issues, we suggest you subscribe to CometService for as
low as $9/month.

If you do not wish to use CometService, we can provide you with third-party
transports like BeaconPush or Pusher absolutely free of additional cost ($199
value). You can learn more at:

http://www.cometchat.com/cometservice

If you are still unsatisfied after that, we will be happy to refund your money.


Warm Regards,

CometChat Technical Support Team
http://www.cometchat.com
 
NeapolitanWorld
Involved
Involved



Joined: Nov 06, 2005
Posts: 339
Location: Los Angeles, USA

PostPosted: Thu Sep 22, 2011 12:59 pm Reply with quote

killing-hours wrote:
Here ya go... give this a shot and see if it gets you setup or not. I think I covered all my bases but I may have missed something somewhere as there were many different things I tested and changed during the course.

http://sclindow.net/article4.html


thanks for the step by step, my question is if i have RN installed on a sub directory ie public_html/RN/
Should I run the cometchat still on the root, or the sub directory where i have my RN site installed?
i tested in both root or sub directory and get following error on install:

Parse error: syntax error, unexpected '}' in /nfs/c01/h12/mnt/44596/domains/xxx.com/html/cometchat/integration.php on line 50

any ideas?
thanks...

_________________
My Raven Site Only registered users can see links on this board! Get registered or login! 
View user's profile Send private message
killing-hours







PostPosted: Thu Sep 22, 2011 1:05 pm Reply with quote

Not sure... there are so many different things to try and see what works and what doesn't... Since I had already played around with cometchat some time ago and somewhat remembered how to do things... I decided to write up the tutorial.

However, there are so many different things that "could" be done with it or variables to try... I simply don't have the time to try them. Sorry... not sure what to tell ya. (although... I believe you can set the "base" directory in the config.php or integreation.php.. forget which.)

Also, the parse error sounds like something is wrong with the coding in the integration.php.
 
NeapolitanWorld







PostPosted: Thu Sep 22, 2011 3:03 pm Reply with quote

thanks! will try a few things. i'm just playing around with it Smile
 
Guardian2003
Site Admin



Joined: Aug 28, 2003
Posts: 6799
Location: Ha Noi, Viet Nam

PostPosted: Fri Sep 23, 2011 2:52 pm Reply with quote

I know this is OffTopic but I'm looking forward to HTML 5 becoming more mainstream because you could potentially store data in the users browser session, which coupled with AJAX would make chat scripts like this a much more viable option.
 
View user's profile Send private message Send e-mail
killing-hours







PostPosted: Fri Sep 23, 2011 3:04 pm Reply with quote

Not sure how that would benefit or be much more different than the way this would work.

The way this chatbar works is by writing the messages to the db.. then retrieving them on an interval.

The problem with doing this on a shared server is (A) tons of ajax calls to your server in rapid succession which "generally" shared hosts frown upon... (B) if you have 10+ users sending 100+ messages per day.. that's 1000 records per day that the chatbar has to comb through the following day as people log on. = Massive db. The way to avoid that is to erase those records on a daily interval thereby keeping the messages table low and easy on the server.

If we all had the abilities of google... or facebook... this chatbar wouldn't put a dent in our operations... however, since we are on a "shoe string" type budget... there are things have have to be given up in order to achieve the best possible results.

On a side note... ever wonder where those messages in google talk go???

Do Do do do Do Do do do..... you're in... the... twighlight zone!
 
Guardian2003







PostPosted: Fri Sep 23, 2011 3:36 pm Reply with quote

killing-hours wrote:
Not sure how that would benefit or be much more different than the way this would work.

The current crop of chat scripts have always had the same issues that you have already mentioned; excessive HTTP requests (polling), excessive SQL queries or size of the data being stored.

Newer technologies will allow the use websockets to reduce the number of HTTP requests needed and you can even store data on a 'Local Database' (a client side SQLlite-esque database).
The stumbling block at the moment is is that no one can decide on what type of database type to use as 'the standard'.
 
NeapolitanWorld







PostPosted: Fri Sep 23, 2011 4:37 pm Reply with quote

I actually got it started and installed after reading carefully the entire thread...just missed some fixes and so on that were not on the article. nice job! now i just need to fix the avatar thumbs broken, any idea? i also had everything show as (0) until i changed the getFriends function to:

Code:
function getFriendsList($userid,$time) {

   $sql = ("select DISTINCT ".TABLE_PREFIX.DB_USERTABLE.".".DB_USERTABLE_USERID." userid, ".TABLE_PREFIX.DB_USERTABLE.".".DB_USERTABLE_NAME." username, ".TABLE_PREFIX.DB_USERTABLE.".".DB_USERTABLE_LASTACTIVITY." lastactivity, ".TABLE_PREFIX.DB_USERTABLE.".".DB_USERTABLE_USERID." avatar, ".TABLE_PREFIX.DB_USERTABLE.".".DB_USERTABLE_USERID." link, cometchat_status.message, cometchat_status.status from ".TABLE_PREFIX."userlist join ".TABLE_PREFIX.DB_USERTABLE." on  ".TABLE_PREFIX."userlist.relationid = ".TABLE_PREFIX.DB_USERTABLE.".".DB_USERTABLE_USERID." left join cometchat_status on ".TABLE_PREFIX.DB_USERTABLE.".".DB_USERTABLE_USERID." = cometchat_status.userid where ".TABLE_PREFIX."userlist.friend = 'yes' and ".TABLE_PREFIX."userlist.userid = '".mysql_real_escape_string($userid)."' order by username asc");
   if (defined('DISPLAY_ALL_USERS') && DISPLAY_ALL_USERS == 1) {
      $sql = ("select DISTINCT ".TABLE_PREFIX.DB_USERTABLE.".".DB_USERTABLE_USERID." userid, ".TABLE_PREFIX.DB_USERTABLE.".".DB_USERTABLE_NAME." username, ".TABLE_PREFIX.DB_USERTABLE.".".DB_USERTABLE_LASTACTIVITY." lastactivity, ".TABLE_PREFIX.DB_USERTABLE.".".DB_USERTABLE_USERID." avatar, ".TABLE_PREFIX.DB_USERTABLE.".".DB_USERTABLE_USERID." link, cometchat_status.message, cometchat_status.status from ".TABLE_PREFIX.DB_USERTABLE." left join cometchat_status on ".TABLE_PREFIX.DB_USERTABLE.".".DB_USERTABLE_USERID." = cometchat_status.userid where ".TABLE_PREFIX.DB_USERTABLE.".".DB_USERTABLE_USERID." <> '".mysql_real_escape_string($userid)."' and ('".$time."'-lastactivity < '".((ONLINE_TIMEOUT)*2)."') and (cometchat_status.status IS NULL OR cometchat_status.status <> 'invisible' OR cometchat_status.status <> 'offline') order by username asc");

   } 
   return $sql;
}


thanks again killing-hours.
jc
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> PHP

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©