follow_tag.php 521 B

123456789101112131415161718
  1. <?php
  2. $tag = get_input("tag");
  3. $encoded_tag = htmlspecialchars($tag, ENT_QUOTES, "UTF-8", false);
  4. if (empty($encoded_tag)) {
  5. register_error(elgg_echo("error:missing_data"));
  6. forward(REFERER);
  7. }
  8. tag_tools_toggle_following_tag($encoded_tag);
  9. if (tag_tools_is_user_following_tag($encoded_tag)) {
  10. system_message(elgg_echo("tag_tools:actions:follow_tag:success:follow", array($encoded_tag)));
  11. } else {
  12. system_message(elgg_echo("tag_tools:actions:follow_tag:success:unfollow", array($encoded_tag)));
  13. }
  14. forward(REFERER);