Uploaded image for project: 'phpBB'
  1. phpBB
  2. PHPBB-14638

[PHP] multiple UCP subscription events for form data and template variables

XMLWordPrintable

      All of these events are for the Manage subscriptions page in the UCP. They're designed to allow us to add the concept of per-topic and per-forum notification settings (i.e. for this topic I want to be notified by email and board notification, but for this topic I only want board notifications and not emails).

      Identifier: core.ucp_subscribed_post_data
      Location: includes/ucp_main.php, line ~215 (before $unwatch handling)
      Parameters:
      $post_data - the $_POST data from the submitted form, if any.
      Explanation: This would allow us to intercept additional variables we add to the form and perform some form handling if necessary.


      Identifier: core.ucp_main_subscribed_forums_modify_query
      Location: includes/ucp_main.php, line ~301 (just before the execution of the query to grab subscribed forums)
      Parameters:
      $sql_ary - the array containing the SQL parameters for the subscribed forums query
      Explanation: This would allow us to modify the query to get subscribed forums.


      Identifier: core.ucp_main_subscribed_forum_modify_template_vars
      Location: includes/ucp_main.php, line ~363 (after building the template variables array)
      Parameters:
      template_vars - Array containing the template variables for the row
      row - Array containing the subscribed forum row data
      forum_id - Forum ID
      folder_image - Folder image
      folder_alt - Alt text for the folder image
      unread_forum - Whether the forum has unread content or not
      last_post_time - The time of the most recent post, expressed as a formatted date string
      last_post_url - The URL of the most recent post in the forum
      Explanation: This would allow us to incorporate the additional data from the previous hook into the template variables for each subscribed forum.


      Identifier: core.ucp_main_topiclist_count_modify_query
      Location: includes/ucp_main.php, line ~666 (just before the query to get the topic count)
      Parameters:
      sql_array - The subscribed/bookmarked topics query
      forbidden_forum_ary - The list of forbidden forums
      user - The current user
      mode - The type of topic list ('subscribed' or 'bookmarks')
      Explanation: This allows us to modify the query to get the number of subscribed/bookmarked topics. Mostly to ensure this matches up with any modifications we make to the query to get the list of topics in the hook below.


      Identifier: core.ucp_main_topiclist_modify_query
      Location: includes/ucp_main.php, line ~734 (just before the query to get the list of topics)
      Parameters:
      sql_array - The subscribed/bookmarked topics query
      forbidden_forum_ary - The list of forbidden forums
      user - The current user
      mode - The type of topic list ('subscribed' or 'bookmarks')
      Explanation: This allows us to modify the query for the list of subscribed/bookmarked topics so we can pull in additional data.


      Identifier: core.ucp_main_topiclist_topic_modify_template_vars
      Location: includes/ucp_main.php, line ~842 (after the template variables array for each topic is built)
      Parameters:
      template_vars - Array containing the template variables for the row
      row - Array containing the subscribed/bookmarked topic row data
      forum_id - ID of the forum containing the topic
      topic_id - Topic ID
      replies - Number of replies in the topic
      topic_type - Topic type
      folder_img - Folder image
      folder_alt - Alt text for the folder image
      icons - Array containing topic icons
      unread_topic - Whether the topic has unread content or not
      view_topic_url - The URL of the topic
      Explanation: This will allow us to take the additional data from modifying the topic query earlier and add it to the template variables for each topic row.

            Marc Marc
            rfdy rfdy [X] (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: