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

Add event to modify search parameters before searching

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Minor Minor
    • 3.1.3-RC1
    • 3.1.2
    • None
    • None

      An extension I'm creating needs to modify the ex_fid_ary variable before it is set in the SQL query. The core.search_get_posts_data and core.search_get_topic_data do not allow me to do this (see this topic -> https://www.phpbb.com/community/viewtopic.php?f=461&t=2279731). I'm proposing an event before pre-made searches are created (currently line 313 in search.php). I've included an event below - please add more parameters as see fit.

      /**
      * Event to modify the SQL parameters before being assigned to searches.
      *
      * @event core.search_modify_param_before
      * @var	array	ex_fid_ary		Array of excluded forum ids
      * @since 3.1.3
      */
      $vars = array(
          'ex_fid_ary',
      );
      extract($phpbb_dispatcher->trigger_event('core.search_modify_param_before', compact($vars)));

            nickvergessen Joas Schilling
            kinerity Kailey Truscott [X] (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: