[wp-meta] [Making WordPress.org] #2214: Forums: Automate Support badges

Making WordPress.org noreply at wordpress.org
Mon Sep 4 01:47:57 UTC 2017


#2214: Forums: Automate Support badges
----------------------------+------------------
 Reporter:  SergeyBiryukov  |       Owner:
     Type:  task            |      Status:  new
 Priority:  normal          |   Milestone:
Component:  Support Forums  |  Resolution:
 Keywords:                  |
----------------------------+------------------

Comment (by SergeyBiryukov):

 Replying to [comment:4 danieltj]:
 > Is the source code for this open or closed source? Can a non-committer
 take a look at this (i.e. me)?

 The two key components are both open-sourced:
 * The [source:sites/trunk/profiles.wordpress.org/public_html/wp-
 content/plugins/wporg-profiles-association-handler wporg-profiles-
 association-handler] plugin.
 * The [source:sites/trunk/wordpress.org/public_html/wp-content/plugins
 /support-forums support-forums] plugin.

 However, neither of them is present in the Meta Environment, so it might
 be tricky to set up a local install. I'll document my experience of
 creating a local Support Forums install here:

 * Prerequisites:
  * The [https://plugins.trac.wordpress.org/browser/bbpress/trunk/ latest
 trunk version of bbPress].
  * The [source:sites/trunk/wordpress.org/public_html/wp-content/plugins
 /support-forums support-forums] plugin.
  * The [source:sites/trunk/wordpress.org/public_html/wp-content/themes/pub
 /wporg-support wporg-support] theme.
  * The https://wordpress.org/header.php file.
   * Download the file, add `<?php wp_head(); ?>` before `</head>`.
   * Replace `<title>WordPress</title>` with:
 {{{
 <title><?php wp_title( '·', true, 'right' ); bloginfo( 'name' );
 ?></title>
 }}}
   * Replace `<body id="wordpress-org" >` with:
 {{{
 <body id="wordpress-org" <?php body_class(); ?>>
 <script type="text/javascript">document.body.className =
 document.body.className.replace('no-js','js');</script>
 }}}
  * The https://wordpress.org/footer.php file.
   * Download the file, add `<?php wp_footer(); ?>` before `</body>`.
 * Setup:
  * Add the following constants to `wp-config.php`:
 {{{
 define('WPORGPATH', dirname(__FILE__) . '/wp-content/wporg/' );

 define('WPORG_SUPPORT_FORUMS_BLOGID', 1);
 define('WPORG_PLUGIN_DIRECTORY_BLOGID', 1);
 define('WPORG_THEME_DIRECTORY_BLOGID', 1);
 }}}
  * Copy the downloaded `header.php` and `footer.php` files to `WPORGPATH`
 directory.
  * Install WP with `http://wporg.dev/support` as the home URL.
  * Activate bbPress.
  * Activate the `support-forums` plugin and other
 [source:sites/trunk/wordpress.org/public_html/wp-content/plugins/ wporg-
 bbp-* plugins], if needed.
  * Switch to the `wporg-support` theme.
  * In Reading Settings, select a static page as a front page
  * Open the front page for editing and set `bbPress - Support (Index)` as
 page template.
  * Create a few test forums, topics, and replies.

 That should be it for getting the Support Forums up and running locally.

 I think a solution for this ticket would look like this:
 * In `wporg-profiles-association-handler`, create a handler for the
 forums. There are two existing handlers that could be used as an example:
 `handle_wordcamp_association()` and `handle_polyglots_association()`.
 * When creating a new topic or reply (on `bbp_new_topic` and
 `bbp_new_reply` actions), check if the user has more then 400 posts in
 total, and submit a request to the association handler created on the
 previous step.

 I haven't worked with the `wporg-profiles-association-handler` plugin yet,
 but feel free to ask any questions, and we'll figure it out together :)

--
Ticket URL: <https://meta.trac.wordpress.org/ticket/2214#comment:5>
Making WordPress.org <https://meta.trac.wordpress.org/>
Making WordPress.org


More information about the wp-meta mailing list