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

jaydub’s picture

This 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.

kenorb’s picture

Production 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 ;)

kenorb’s picture

Status: Active » Fixed

Thanks anyway.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.