Helping you Build Your Own Social Network!

Faster, better and easier!

Add tags to forum after it has been created...

(6 posts) (3 voices)

  1. Brajesh ~ Anyone,

    I've been asking this question over at buddypress.org, but have not gotten too far... I need a way for an admin or moderator to add tags to a forum topic after it has been created. Many of our "newbie" users do not understand the value of using tags yet and simply do not include them...so I would like to be able to add them after they post them. Do you or anyone here know of a mod/hack/plugin to allow this?

    There is a track ticket for this at BP for 1.3 but that is a far way off still...
    http://trac.buddypress.org/ticket/2281

    Here is the code that they mention that could be used to make this happen, but I don't know where to put it or how to expand it so moderators/admins can use it on the site:

    <label><?php _e( 'Tags (comma separated):', 'buddypress' ) ?></label>
    <input type="text" name="topic_tags" id="topic_tags" value="" />
    Posted 1 year ago #
  2. @pisanojm, I can't believe it's been 5 months since I posted that in trac :-)
    http://trac.buddypress.org/ticket/2281

    This is what I did to make sure I got the tags in edit in my child theme. Copy over edit.php from bp-themes/bp-default/groups/single/forum/edit.php to your child theme following the same folder name and structure e.g. yourchildtheme/groups/single/forum/
    So if you don't have the folders yet, you create folder in folder, etc and add edit.php per structure

    Open up edit.php and add that code you posted to between label for topic_text and <?php do action....:

    <label for="topic_text"><?php _e( 'Content:', 'buddypress' ) ?></label>
    <textarea name="topic_text" id="topic_text"><?php bp_the_topic_text() ?></textarea>
    
    <label><?php _e( 'Tags (comma separated):', 'buddypress' ) ?></label>
    <input type="text" name="topic_tags" id="topic_tags" value="" />
    
    <?php do_action( 'bp_group_after_edit_forum_topic' ) ?>

    Save file and upload to your child theme per folder structure mentioned above.

    Posted 1 year ago #
  3. @mercime

    First, Thank you for responding... @R-a-y on BP just responded to this as well... I've actually done this based on his recommendation, while the box now appears to enter them, BP doesn't appear to be saving the tags after I enter them and click "save changes"..

    I've posted more and included a picture here:
    http://buddypress.org/community/groups/how-to-and-troubleshooting/forum/topic/adding-topic-tags-after-topic-creation/

    Any further help would be greatly appreciated.

    Posted 1 year ago #
  4. Hi,
    Please add the following line to buddypress/bp-groups.php on line 476

    <?php
    
    if(!empty($_POST["topic_tags"]))
      bb_add_topic_tags($topic_id,$_POST["topic_tags"]);//add the new tags
    ?>

    So, the new code should look like

    if(!empty($_POST["topic_tags"]))
      bb_add_topic_tags($topic_id,$_POST["topic_tags"]);//add the new tags
    					do_action( 'groups_edit_forum_topic', $topic_id );
    					bp_core_redirect( bp_get_group_permalink( $bp->groups->current_group ) . 'forum/topic/' . $topic_slug . '/' );

    We are simply adding one line "bb_add_topic_tags" to save the new tags. It should work. Please let me know if it does not.

    Posted 1 year ago #
  5. Brajesh,

    Awesome. Works like a charm. As always, you "rock"!

    Posted 1 year ago #
  6. Great! So who will do the honors of submitting patches to edit.php and bp-groups.php for said trac ticket? Cheers.

    Posted 1 year ago #

Reply

You must log in to post.