Changeset 891
- Timestamp:
- 06/28/2007 07:03:57 AM (19 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
-
bb-admin/content-posts.php (modified) (1 diff)
-
bb-admin/content.php (modified) (1 diff)
-
bb-admin/style.css (modified) (2 diffs)
-
bb-includes/classes.php (modified) (7 diffs)
-
bb-includes/template-functions.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/bb-admin/content-posts.php
r889 r891 7 7 add_filter( 'get_topic_where', 'no_where' ); 8 8 add_filter( 'get_topic_link', 'bb_make_link_view_all' ); 9 $post_query = new BB_Query ( 'post', array( 'post_status' => 1 ) );9 $post_query = new BB_Query_Form( 'post', array( 'post_status' => 1 ) ); 10 10 $bb_posts =& $post_query->results; 11 11 $total = $post_query->found_rows; 12 12 ?> 13 13 14 <h2><?php _e('Deleted Posts'); ?></h2> 14 <h2><?php 15 $h2_search = $post_query->get( 'post_text' ); 16 $h2_forum = $post_query->get( 'forum_id' ); 17 $h2_tag = $post_query->get( 'tag_id' ); 18 $h2_author = $post_query->get( 'post_author_id' ); 19 $h2_status = $post_query->get( 'post_status' ); 20 21 $h2_search = $h2_search ? ' ' . sprintf( __('matching “%s”'), wp_specialchars( $h2_search ) ) : ''; 22 $h2_forum = $h2_forum ? ' ' . sprintf( __('in “%s”') , get_forum_name( $h2_forum ) ) : ''; 23 $h2_tag = $h2_tag ? ' ' . sprintf( __('with tag “%s”'), wp_specialchars( get_tag_name( $h2_tag ) ) ) : ''; 24 $h2_author = $h2_author ? ' ' . sprintf( __('by %s') , wp_specialchars( get_user_name( $h2_author ) ) ) : ''; 25 26 $stati = array( 0 => __('Normal') . ' ', 1 => __('Deleted') . ' ', 'all' => '' ); 27 28 if ( 'all' == $h2_status ) 29 $h2_noun = __('Posts'); 30 else 31 $h2_noun = sprintf( __( '%1$sposts'), $stati[$h2_status], $topic_open[$h2_open] ); 32 33 printf( __( '%1$s%2$s%3$s%4$s%5$s' ), $h2_noun, $h2_search, $h2_forum, $h2_tag, $h2_author ); 34 35 ?></h2> 36 37 <?php $post_query->form( array('tag' => true, 'post_author' => true, 'post_status' => true, 'submit' => __('Filter »')) ); ?> 38 39 <br class="clear" /> 15 40 16 41 <ol id="the-list"> -
trunk/bb-admin/content.php
r884 r891 38 38 ?></h2> 39 39 40 <?php $topic_query-> topic_search_form( array('tag' => true, 'author' => true, 'status' => true, 'open' => true, 'submit' => __('Filter »')) ); ?>40 <?php $topic_query->form( array('tag' => true, 'topic_author' => true, 'topic_status' => true, 'open' => true, 'submit' => __('Filter »')) ); ?> 41 41 42 42 <br class="clear" /> -
trunk/bb-admin/style.css
r881 r891 476 476 } 477 477 478 #topic-search-form fieldset {478 .search-form fieldset { 479 479 float: left; 480 480 margin: 0 1.5ex 1em 0; … … 482 482 } 483 483 484 #topic-search-form fieldset legend {484 .search-form fieldset legend { 485 485 padding: 0 0 .2em 1px; 486 486 } 487 487 488 #topic-search-form .text-input {488 .search-form .text-input { 489 489 padding: 4px 3px; 490 490 } 491 491 492 #topic-search-form #topic-search-form-submit {492 .search-form .submit-input { 493 493 float: left; 494 494 margin: 12px 0 1em; -
trunk/bb-includes/classes.php
r890 r891 345 345 $where .= " AND t.topic_id IN (" . join(',', $tagged_topic_ids) . ")"; 346 346 else 347 $where .= " /* No such tag */ AND 0";347 $where .= " AND 0 /* No such tag */"; 348 348 endif; 349 349 … … 475 475 $where .= " AND p.topic_id IN (" . join(',', $tagged_topic_ids) . ")"; 476 476 else 477 $where .= " /* No such tag */ AND 0";477 $where .= " AND 0 /* No such tag */"; 478 478 endif; 479 479 … … 698 698 } 699 699 700 function topic_search_form( $args = null ) { 700 function form( $args = null ) { 701 $_post = 'post' == $this->type; 702 701 703 $defaults = array( 702 704 'search' => true, 703 705 'forum' => true, 704 706 'tag' => false, 705 'author' => false,706 'status' => false,707 707 'open' => false, 708 'topic_title' => false, 709 710 'id' => 'topic-search-form', 708 'topic_author' => false, 709 'post_author' => false, 710 'topic_status' => false, 711 'post_status' => false, 712 'topic_title' => false, 713 711 714 'method' => 'get', 712 'submit' => __('Search »') 715 'submit' => __('Search »'), 716 'action' => '' 713 717 ); 718 $defaults['id'] = $_post ? 'post-search-form' : 'topic-search-form'; 714 719 715 720 $args = wp_parse_args( $args, $defaults ); … … 719 724 $method = 'get' == strtolower($method) ? 'get' : 'post'; 720 725 $submit = attribute_escape( $submit ); 726 $action = clean_url( $action ); 721 727 722 728 if ( $this->query_vars ) … … 727 733 extract($query_vars, EXTR_PREFIX_ALL, 'q'); 728 734 729 $r = "<form action='' method='$method' id='$id'>\n"; 730 731 $q_search = attribute_escape( $q_search ); 735 $r = "<form action='' method='$method' id='$id' class='search-form'>\n"; 736 732 737 if ( $search ) { 738 if ( $_post ) { 739 $s_value = attribute_escape( $q_post_text ); 740 $s_name = 'post_text'; 741 $s_id = 'post-text'; 742 } else { 743 $s_value = attribute_escape( $q_search ); 744 $s_name = $s_id = 'search'; 745 } 733 746 $r .= "\t<fieldset><legend>" . __('Search…') . "</legend>\n"; 734 $r .= "\t\t<input name=' search' id='search' type='text' class='text-input' value='$q_search'>";747 $r .= "\t\t<input name='$s_name' id='$s_id' type='text' class='text-input' value='$s_value'>"; 735 748 $r .= "\t</fieldset>\n\n"; 736 749 } … … 749 762 } 750 763 751 if ( $ author ) {764 if ( $topic_author ) { 752 765 $q_topic_author = attribute_escape( $q_topic_author ); 753 $r .= "\t<fieldset><legend>" . __(' Author…') . "</legend>\n";766 $r .= "\t<fieldset><legend>" . __('Topic Author…') . "</legend>\n"; 754 767 $r .= "\t\t<input name='topic_author' id='topic-author' type='text' class='text-input' value='$q_topic_author'>"; 755 768 $r .= "\t</fieldset>\n\n"; 756 769 } 757 770 758 if ( $status ) { 759 $r .= "\t<fieldset><legend>" . __('Status…') . "</legend>\n"; 771 if ( $post_author ) { 772 $q_post_author = attribute_escape( $q_post_author ); 773 $r .= "\t<fieldset><legend>" . __('Post Author…') . "</legend>\n"; 774 $r .= "\t\t<input name='post_author' id='post-author' type='text' class='text-input' value='$q_post_author'>"; 775 $r .= "\t</fieldset>\n\n"; 776 } 777 778 $stati = array( 'all' => __('All'), '0' => __('Normal'), '1' => __('Deleted') ); 779 780 if ( $topic_status ) { 781 $r .= "\t<fieldset><legend>" . __('Topic Status…') . "</legend>\n"; 760 782 $r .= "\t\t<select name='topic_status' id='topic-status'>\n"; 761 foreach ( array( 'all' => __('All'), '0' => __('Normal'), '1' => __('Deleted') ) as $status => $label ) { 762 $label = wp_specialchars( $label ); 783 foreach ( $stati as $status => $label ) { 763 784 $selected = (string) $status == (string) $q_topic_status ? " selected='selected'" : ''; 785 $r .= "\t\t\t<option value='$status'$selected>$label</option>\n"; 786 } 787 $r .= "\t\t</select>\n"; 788 $r .= "\t</fieldset>\n\n"; 789 } 790 791 if ( $post_status ) { 792 $r .= "\t<fieldset><legend>" . __('Post Status…') . "</legend>\n"; 793 $r .= "\t\t<select name='post_status' id='post-status'>\n"; 794 foreach ( $stati as $status => $label ) { 795 $selected = (string) $status == (string) $q_post_status ? " selected='selected'" : ''; 764 796 $r .= "\t\t\t<option value='$status'$selected>$label</option>\n"; 765 797 } … … 792 824 echo $r; 793 825 } 794 795 826 } 796 827 -
trunk/bb-includes/template-functions.php
r884 r891 878 878 $query_obj =& $bb_query_form; 879 879 880 $query_obj-> topic_search_form( $args );880 $query_obj->form( $args ); 881 881 } 882 882
Note: See TracChangeset
for help on using the changeset viewer.