Skip to:
Content

bbPress.org

Changeset 89


Ignore:
Timestamp:
04/24/2005 04:43:11 PM (18 years ago)
Author:
matt
Message:

Show tags to the right people, de-dupe public tags.

Location:
trunk
Files:
1 added
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/bb-includes/functions.php

    r88 r89  
    676676}
    677677
     678function get_public_tags ( $topic_id ) {
     679    $tags = get_topic_tags ( $topic_id );
     680    if ( !is_array( $tags ) )
     681        return;
     682    $used_tags   = array();
     683    $public_tags = array();
     684
     685    foreach ( $tags as $tag ) :
     686        if ( !in_array($tag->tag_id, $used_tags) ) :
     687            $public_tags[] = $tag;
     688            $used_tags[]   = $tag->tag_id;
     689        endif;
     690    endforeach;
     691    return $public_tags;
     692}
     693
    678694function bb_find_filename( $text ) {
    679695    $text = preg_replace('|.*?/([a-z]+\.php)/?.*|', '$1', $text);
  • trunk/bb-includes/template-functions.php

    r85 r89  
    493493}
    494494
     495function tag_form() {
     496    global $current_user;
     497    if ($current_user)
     498        include( BBPATH . '/bb-templates/tap-form.php');
     499}
     500
    495501?>
  • trunk/bb-templates/post-form.php

    r24 r89  
    11
    2 <form name="post" id="post" method="post" action="<?php option('uri'); ?>bb-post.php">
     2<form class="postform" method="post" action="<?php option('uri'); ?>bb-post.php">
    33<?php if ( is_forum() ) : ?>
    44<p>Before posting a new topic, <a href="<?php option('uri'); ?>search.php">be sure to search</a> to see if one has been started already.</p>
  • trunk/bb-templates/topic-tags.php

    r82 r89  
    2424
    2525</div>
     26
     27<?php tag_form(); ?>
  • trunk/bb-templates/topic.php

    r82 r89  
    55<h3><a href="<?php option('uri'); ?>"><?php option('name'); ?></a> &raquo; <a href="<?php forum_link(); ?>"><?php forum_name(); ?></a></h3>
    66<h2><?php topic_title(); ?></h2>
    7 <form name="post" id="post" method="post" action="<?php option('uri'); ?>tag-add.php">
    8 <fieldset id="addtag">
    9 Add tag: <input name="tag" type="text" id="tag" size="10" maxlength="30" />
    10 <input type="hidden" name="id" value="<?php topic_id(); ?>" />
    11 <input type="submit" name="Submit" value="Add">
    12 </fieldset>
    13 </form>
    147
    158<?php topic_tags(); ?>
  • trunk/topic.php

    r82 r89  
    2121    $user_tags  = get_user_tags  ( $topic_id, $current_user->user_id );
    2222    $other_tags = get_other_tags ( $topic_id, $current_user->user_id );
     23} elseif ( is_array($tags) ) {
     24    $user_tags  = false;
     25    $other_tags = get_public_tags( $topic_id );
    2326} else {
    2427    $user_tags  = false;
Note: See TracChangeset for help on using the changeset viewer.