getOwnerGUID() == $user->getGUID()) { register_error(elgg_echo("content_subscriptions:action:subscribe:error:owner")); forward(REFERER); } // subscribe or unsubscribe if (content_subscriptions_check_subscription($entity->getGUID(), $user->getGUID())) { // unsubscribe if (content_subscriptions_unsubscribe($entity->getGUID(), $user->getGUID())) { system_message(elgg_echo("content_subscriptions:action:subscribe:success:unsubscribe")); } else { register_error(elgg_echo("content_subscriptions:action:subscribe:error:unsubscribe")); } } else { // subscribe if (content_subscriptions_subscribe($entity->getGUID(), $user->getGUID())) { system_message(elgg_echo("content_subscriptions:action:subscribe:success:subscribe")); } else { register_error(elgg_echo("content_subscriptions:action:subscribe:error:subscribe")); } } forward(REFERER);