Closed (fixed)
Project:
Activity
Version:
6.x-1.x-dev
Component:
Code
Priority:
Minor
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
20 Oct 2008 at 14:17 UTC
Updated:
3 Nov 2008 at 21:12 UTC
Using PHP 4.x, following error appears after Activity module has been enabled:
Parse error: parse error, unexpected T_OBJECT_OPERATOR in /sites/all/modules/contributions/activity/activity.module on line 415
Solution is to change:
$result = db_query("SELECT COUNT(*) FROM {activity} WHERE module = '%s' AND type = '%s' AND operation = '%s' AND data = '%s' AND created >= %d", $module, $type, $operation, serialize($data), (time() - variable_get('activity_time_limit', 30)));
if (db_fetch_object($result)->count != 0) {
return FALSE;
}
to:
// check time limit, ignore activity if within the limit
$result = db_fetch_object(db_query("SELECT COUNT(*) FROM {activity} WHERE module = '%s' AND type = '%s' AND operation = '%s' AND data = '%s' AND created >= %d", $module, $type, $operation, serialize($data), (time() - variable_get('activity_time_limit', 30))));
if ($result->count != 0) {
return FALSE;
}
Comments
Comment #1
jaydub commentedThis has come up before in:
#256897: Parse Error
#277345: Parse error
Are you not able to upgrade to php5? The Go PHP5 movement http://www.gophp5.org/ has the right idea. There are so many reasons to go with php5 and virtually no reasons anymore to stick with php4.
Comment #2
kenorb commentedProduction server is still runing on PHP 4.x, because there are lots of old web sites done by some guys who wrote it in 4.x ;)
So it's was not my choice, but I'm hardly trying to change it for 5.x ;)
Comment #3
kenorb commentedThanks anyway.
Comment #4
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.