Skip to:
Content

bbPress.org

Changeset 129


Ignore:
Timestamp:
06/07/2005 05:38:11 PM (21 years ago)
Author:
mdawaffe
Message:

Use get_tag_link for tag renaming and merging. Thanks tompruess. Fixes #75.

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/bb-admin/tag-merge.php

    r127 r129  
    99$old_id = (int) $_POST['id' ];
    1010$tag = $_POST['tag'];
    11 if ( ! $new_tag = get_tag_by_name( $tag ) )
     11if ( ! $tag = get_tag_by_name( $tag ) )
    1212    die('Tag specified not found.');
    1313
     
    1515    die('Tag to be merged not found.');
    1616
    17 if ( $merged = merge_tags( $old_id, $new_tag->tag_id ) ) {
     17if ( $merged = merge_tags( $old_id, $tag->tag_id ) ) {
    1818    echo 'Number of topics from which the old tag was removed: ' . $merged['old_count'] . "<br />\n";
    1919    echo 'Number of topics to which the new tag was added: ' . $merged['diff_count'] . "<br />\n";
    2020    echo 'Number of rows deleted from tags table: ' . $merged['destroyed']['tags'] ."<br />\n";
    21     echo '<a href="' . $bb->tagpath . "tags/$new_tag->raw_tag" . '">New Tag</a>';
     21    echo '<a href="' . get_tag_link() . '">New Tag</a>';
    2222} else {
    2323    die("Something odd happened when attempting to merge those tags.<br />\n<a href=\"" . $_SERVER['HTTP_REFERER'] . '">Try Again?</a>');
  • trunk/bb-admin/tag-rename.php

    r123 r129  
    1515
    1616if ( $tag = rename_tag( $tag_id, $tag ) )
    17     header('Location: ' . $bb->tagpath . "tags/$tag" );
     17    header('Location: ' . get_tag_link() );
    1818else
    1919    die('There already exists a tag by that name or the name is invalid.  <a href="' . $_SERVER['HTTP_REFERER'] . '">Try Again</a>');
  • trunk/bb-includes/functions.php

    r127 r129  
    684684
    685685    if ( $bbdb->query("UPDATE $bbdb->tags SET tag = '$tag', raw_tag = '$raw_tag' WHERE tag_id = '$tag_id'") )
    686         return $tag;
     686        return get_tag_by_name( $tag );
    687687    return false;
    688688}
Note: See TracChangeset for help on using the changeset viewer.