Skip to:
Content

bbPress.org


Ignore:
Timestamp:
11/20/2011 09:39:16 AM (14 years ago)
Author:
johnjamesjacoby
Message:

Add topic sticky dropdown to wp-admin metabox. Fixes #1625. Props GautamGupta.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/plugin/bbp-admin/bbp-topics.php

    r3583 r3624  
    118118        $bbp_contextual_help[] = __( '<strong>Title</strong> - Enter a title for your topic. After you enter a title, you will see the permalink below, which you can edit.', 'bbpress' );
    119119        $bbp_contextual_help[] = __( '<strong>Post editor</strong> - Enter the text for your topic. There are two modes of editing: Visual and HTML. Choose the mode by clicking on the appropriate tab. Visual mode gives you a WYSIWYG editor. Click the last icon in the row to get a second row of controls. The screen icon just before that allows you to expand the edit box to full screen. The HTML mode allows you to enter raw HTML along with your forum text. You can insert media files by clicking the icons above the post editor and following the directions.', 'bbpress' );
    120         $bbp_contextual_help[] = __( '<strong>Topic Attributes</strong> - Select the attributes that your topic should have. The Forum dropdown determines the parent forum that the topic belongs to. Select the forum or category from the dropdown, or leave the default (No Forum) to post the topic without an assigned forum.', 'bbpress' );
     120        $bbp_contextual_help[] = __( '<strong>Topic Attributes</strong> - Select the attributes that your topic should have. The Forum dropdown determines the parent forum that the topic belongs to. Select the forum or category from the dropdown, or leave the default (No Forum) to post the topic without an assigned forum. The topic type drop down indicates the sticky status of the topic. Selecting the super sticky option would stick the topic to the front of your forums, i.e. the topic index, sticky option would stick the topic to its respective forum. Selecting normal would not stick the topic anywhere.', 'bbpress' );
    121121        $bbp_contextual_help[] = __( '<strong>Publish</strong> - The Publish box will allow you to save your topic as Draft or Pending Review. You may Preview your topic before it is published as well. The Visibility will determine whether the topic is Public, Password protected (requiring a password on the site to view) or Private (only the author will have access to it). Topics may be published immediately by clicking the dropdown, or at a specific date and time by clicking the Edit link.', 'bbpress' );
    122122        $bbp_contextual_help[] = __( '<strong>Topic Tags</strong> - You can assign keywords to your topics using Topic Tags. Unlike categories, tags have no hierarchy, meaning there is no relationship from one tag to another. Topics can be added and modified further from the Topic Tags screen.', 'bbpress' );
     
    142142        /** Post Rows *********************************************************/
    143143
    144         $bbp_contextual_help[] = __( 'This screen displays the topics created on your site.',           'bbpress' );
     144        $bbp_contextual_help[] = __( 'This screen displays the topics created on your site.',             'bbpress' );
    145145        $bbp_contextual_help[] = __( 'You can customize the display of this screen in a number of ways:', 'bbpress' );
    146146        $bbp_contextual_help[] =
     
    263263        // Formally update the topic
    264264        bbp_update_topic( $topic_id, $forum_id );
     265
     266        // Stickies
     267        if ( !empty( $_POST['bbp_stick_topic'] ) && in_array( $_POST['bbp_stick_topic'], array( 'stick', 'super', 'unstick' ) ) ) {
     268
     269            // What's the haps?
     270            switch ( $_POST['bbp_stick_topic'] ) {
     271
     272                // Sticky in this forum
     273                case 'stick'   :
     274                    bbp_stick_topic( $topic_id );
     275                    break;
     276
     277                // Super sticky in all forums
     278                case 'super'   :
     279                    bbp_stick_topic( $topic_id, true );
     280                    break;
     281
     282                // Normal
     283                case 'unstick' :
     284                default        :
     285                    bbp_unstick_topic( $topic_id );
     286                    break;
     287            }
     288        }
    265289
    266290        // Allow other fun things to happen
Note: See TracChangeset for help on using the changeset viewer.