Skip to:
Content

BuddyPress.org

Ticket #3240: 3240-2.patch

File 3240-2.patch, 12.7 KB (added by DJPaul, 15 years ago)
  • bp-themes/bp-default/searchform.php

     
    11<?php do_action( 'bp_before_blog_search_form' ) ?>
    22
    3 <form role="search" method="get" id="searchform" action="<?php echo home_url() ?>/">
    4         <input type="text" value="<?php the_search_query(); ?>" name="s" id="s" />
    5         <input type="submit" id="searchsubmit" value="<?php _e( 'Search', 'buddypress' ) ?>" />
     3<div id="searchform">
     4        <form role="search" id="search">
     5                <input type="text" value="<?php the_search_query(); ?>" name="s" id="s" />
     6                <input type="submit" id="searchsubmit" value="<?php _e( 'Search', 'buddypress' ); ?>" />
     7                <span class="ajax-loader"></span>
    68
    7         <?php do_action( 'bp_blog_search_form' ) ?>
    8 </form>
     9                <?php do_action( 'bp_blog_search_form' ) ?>
     10        </form>
     11</div>
    912
    10 <?php do_action( 'bp_after_blog_search_form' ) ?>
     13<?php do_action( 'bp_after_blog_search_form' ) ?>
     14 No newline at end of file
  • bp-themes/bp-default/search.php

     
    1 <?php get_header() ?>
     1<?php get_header(); ?>
    22
    33        <div id="content">
    44                <div class="padder">
    55
    6                 <?php do_action( 'bp_before_blog_search' ) ?>
     6                        <h2 class="pagetitle"><?php _e( 'Search', 'buddypress' ); ?></h2>
     7                        <?php locate_template( array( 'searchform.php'), true ); ?>
    78
    8                 <div class="page" id="blog-search" role="main">
     9                        <div id="search-content">
     10                                <div id="search-loop">
     11                                        <div id="search-tab"></div>
     12                                        <?php locate_template( array( 'search-loop.php' ), true ); ?>
     13                                </div>
     14                        </div>
    915
    10                         <h2 class="pagetitle"><?php _e( 'Site', 'buddypress' ) ?></h2>
    11 
    12                         <?php if (have_posts()) : ?>
    13 
    14                                 <h3 class="pagetitle"><?php _e( 'Search Results', 'buddypress' ) ?></h3>
    15 
    16                                 <?php bp_dtheme_content_nav( 'nav-above' ); ?>
    17 
    18                                 <?php while (have_posts()) : the_post(); ?>
    19 
    20                                         <?php do_action( 'bp_before_blog_post' ) ?>
    21 
    22                                         <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
    23 
    24                                                 <div class="author-box">
    25                                                         <?php echo get_avatar( get_the_author_meta( 'email' ), '50' ); ?>
    26                                                         <p><?php printf( _x( 'by %s', 'Post written by...', 'buddypress' ), bp_core_get_userlink( $post->post_author ) ) ?></p>
    27                                                 </div>
    28 
    29                                                 <div class="post-content">
    30                                                         <h2 class="posttitle"><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php _e( 'Permanent Link to', 'buddypress' ) ?> <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
    31 
    32                                                         <p class="date"><?php printf( __( '%1$s <span>in %2$s</span>', 'buddypress' ), get_the_date(), get_the_category_list( ', ' ) ); ?></p>
    33 
    34                                                         <div class="entry">
    35                                                                 <?php the_content( __( 'Read the rest of this entry &rarr;', 'buddypress' ) ); ?>
    36                                                         </div>
    37 
    38                                                         <p class="postmetadata"><?php the_tags( '<span class="tags">' . __( 'Tags: ', 'buddypress' ), ', ', '</span>' ); ?> <span class="comments"><?php comments_popup_link( __( 'No Comments &#187;', 'buddypress' ), __( '1 Comment &#187;', 'buddypress' ), __( '% Comments &#187;', 'buddypress' ) ); ?></span></p>
    39                                                 </div>
    40 
    41                                         </div>
    42 
    43                                         <?php do_action( 'bp_after_blog_post' ) ?>
    44 
    45                                 <?php endwhile; ?>
    46 
    47                                 <?php bp_dtheme_content_nav( 'nav-below' ); ?>
    48 
    49                         <?php else : ?>
    50 
    51                                 <h2 class="center"><?php _e( 'No posts found. Try a different search?', 'buddypress' ) ?></h2>
    52                                 <?php get_search_form() ?>
    53 
    54                         <?php endif; ?>
    55 
    56                 </div>
    57 
    58                 <?php do_action( 'bp_after_blog_search' ) ?>
    59 
    6016                </div><!-- .padder -->
    6117        </div><!-- #content -->
    6218
    63         <?php get_sidebar() ?>
    64 
    65 <?php get_footer() ?>
     19        <?php get_sidebar(); ?>
     20<?php get_footer(); ?>
     21 No newline at end of file
  • bp-themes/bp-default/search-loop.php

     
     1<!-- blog search loop -->
     2<div id="search-loop-results">
     3        <div class="search-section">
     4                <div class="search-column-component">
     5                <h3><?php _e( 'Blog Posts', 'buddypress' ); ?></h3>
     6        </div>
     7
     8        <div class="search-column-results">
     9                <?php if ( have_posts() ) : ?>
     10
     11                        <?php while ( have_posts() ) : the_post(); ?>
     12
     13                                <div class="search-post" id="post-<?php the_ID(); ?>">
     14                                        <div class="search-author-box">
     15                                                <?php echo get_avatar( get_the_author_meta( 'email' ), '25' ); ?>
     16                                        </div>
     17
     18                                        <div class="search-post-content">
     19                                                <h4 class="posttitle"><a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php printf( esc_attr__( 'Permalink to %s', 'buddypress' ), the_title_attribute( 'echo=0' ) ); ?>"><?php the_title(); ?></a></h4>
     20
     21                                                <div class="search-entry">
     22                                                        <?php the_excerpt( __( 'Read the rest of this entry &rarr;', 'buddypress' ) ); ?>
     23                                                </div>
     24                                        </div>
     25                                </div><!-- .search-post -->
     26
     27                                <?php endwhile; ?>
     28
     29                        <?php else : ?>
     30
     31                                <div id="message" class="info">
     32                                        <p><?php _e( 'Sorry, no blog posts were found.', 'buddypress' ); ?></p>
     33                                </div>
     34
     35                        <?php endif; ?>
     36
     37        </div>
     38</div>
     39
     40
     41<!-- forum search loop -->
     42<?php if ( bp_is_active( 'forums' ) ) : ?>
     43<div class="search-section">
     44        <div class="search-column-component">
     45                <h3><?php _e( 'Forum Topics', 'buddypress' ); ?></h3>
     46        </div>
     47
     48        <div class="search-column-results">
     49                <?php if ( bp_has_forum_topics( array( 'search_terms' => get_search_query( false ) ) ) ) : ?>
     50
     51                        <table class="forumsearch">
     52                                <tr>
     53                                        <th id="th-title"><?php _e( 'Topic Title', 'buddypress' ); ?></th>
     54                                        <th id="th-poster"><?php _e( 'Latest Poster', 'buddypress' ); ?></th>
     55
     56                                        <?php if ( !bp_is_group_forum() ) : ?>
     57                                                <th id="th-group"><?php _e( 'Posted In Group', 'buddypress' ); ?></th>
     58                                        <?php endif; ?>
     59                                </tr>
     60
     61                                <?php while ( bp_forum_topics() ) : bp_the_forum_topic(); ?>
     62                                        <tr class="<?php bp_the_topic_css_class(); ?>">
     63                                                <td class="td-title">
     64                                                        <a class="topic-title" href="<?php bp_the_topic_permalink(); ?>" title="<?php bp_the_topic_title(); ?>">
     65                                                                <?php bp_the_topic_title(); ?>
     66                                                        </a>
     67                                                </td>
     68
     69                                                <td class="td-poster">
     70                                                        <a href="<?php bp_the_topic_permalink(); ?>"><?php bp_the_topic_last_poster_avatar( 'type=thumb&width=20&height=20' ); ?></a>
     71                                                        <div class="poster-name"><?php bp_the_topic_last_poster_name(); ?></div>
     72                                                </td>
     73
     74                                                <?php if ( !bp_is_group_forum() ) : ?>
     75                                                        <td class="td-group">
     76                                                                <a href="<?php bp_the_topic_object_permalink(); ?>"><?php bp_the_topic_object_avatar( 'type=thumb&width=20&height=20' ); ?></a>
     77                                                                <div class="object-name"><a href="<?php bp_the_topic_object_permalink(); ?>" title="<?php bp_the_topic_object_name(); ?>"><?php bp_the_topic_object_name(); ?></a></div>
     78                                                        </td>
     79                                                <?php endif; ?>
     80                                        </tr>
     81                                <?php endwhile; ?>
     82                        </table>
     83
     84                <?php else: ?>
     85
     86                        <div id="message" class="info">
     87                                <p><?php _e( 'Sorry, no forum topics were found.', 'buddypress' ); ?></p>
     88                        </div>
     89
     90                <?php endif; ?>
     91        </div>
     92
     93</div>
     94<?php endif; ?>
     95
     96
     97<!-- members search loop -->
     98<?php if ( bp_is_active( 'members' ) ) : ?>
     99<div class="search-section">
     100        <div class="search-column-component">
     101                <h3><?php _e( 'Members', 'buddypress' ); ?></h3>
     102        </div>
     103
     104        <div class="search-column-results">
     105                <?php if ( bp_has_members( array( 'search_terms' => get_search_query( false ) ) ) ) : ?>
     106
     107                        <ul id="members-list-search" class="item-list">
     108
     109                                <?php while ( bp_members() ) : bp_the_member(); ?>
     110                                        <li>
     111                                                <div class="item-avatar">
     112                                                        <a href="<?php bp_member_permalink() ?>"><?php bp_member_avatar( 'type=thumb&width=25&height=25' ); ?></a>
     113                                                </div>
     114
     115                                                <div class="item">
     116                                                        <div class="item-title">
     117                                                                <a href="<?php bp_member_permalink() ?>"><?php bp_member_name(); ?></a>
     118                                                        </div>
     119                                                </div>
     120                                                <div class="clear"></div>
     121                                        </li>
     122                                <?php endwhile; ?>
     123
     124                        </ul>
     125
     126                <?php else: ?>
     127
     128                <div id="message" class="info">
     129                        <p><?php _e( "Sorry, no members were found.", 'buddypress' ); ?></p>
     130                </div>
     131
     132                <?php endif; ?>
     133        </div>
     134</div>
     135<?php endif; ?>
     136
     137
     138<!-- group search loop -->
     139<?php if ( bp_is_active( 'groups' ) ) : ?>
     140<div class="search-section">
     141        <div class="search-column-component">
     142                <h3><?php _e( 'Groups', 'buddypress' ); ?></h3>
     143        </div>
     144
     145        <div class="search-column-results">
     146                <?php if ( bp_has_groups( array( 'search_terms' => get_search_query( false ) ) ) ) : ?>
     147                        <ul id="group-list-search" class="item-list">
     148
     149                                <?php while ( bp_groups() ) : bp_the_group(); ?>
     150                                        <li>
     151                                                <div class="item-avatar">
     152                                                        <a href="<?php bp_group_permalink() ?>"><?php bp_group_avatar( 'type=thumb&width=25&height=25' ); ?></a>
     153                                                </div>
     154
     155                                                <div class="item">
     156                                                        <div class="item-title">
     157                                                                <a href="<?php bp_group_permalink() ?>"><?php bp_group_name(); ?></a>
     158                                                        </div>
     159                                                </div>
     160                                                <div class="clear"></div>
     161                                        </li>
     162                                <?php endwhile; ?>
     163
     164                        </ul>
     165
     166                <?php else: ?>
     167
     168                        <div id="message" class="info">
     169                                <p><?php _e( "Sorry, no groups were found.", 'buddypress' ); ?></p>
     170                        </div>
     171
     172                <?php endif; ?>
     173
     174        </div>
     175</div>
     176<?php endif; ?>
     177 No newline at end of file
  • bp-themes/bp-default/_inc/css/default-rtl.css

     
    2222        4.3 - Gallery
    2323        4.4 - Images
    2424        4.5 - Posts
     25        4.6 - Search
    25265.0 - BuddyPress
    2627        5.1 - Activity
    2728                5.1.1 - Activity Listing
     
    397398        float: right;
    398399}
    399400
     401/*--------------------------------------------------------------
     4024.6 - Search
     403--------------------------------------------------------------*/
    400404
     405
    401406/*--------------------------------------------------------------
    4024075.0 - BuddyPress
    403408--------------------------------------------------------------*/
  • bp-themes/bp-default/_inc/css/default.css

     
    2222        5.3 - Gallery
    2323        5.4 - Images
    2424        5.5 - Posts
     25        5.6 - Search
    25266.0 - BuddyPress
    2627        6.1 - Activity
    2728                6.1.1 - Activity Listing
     
    10611062
    10621063
    10631064/*--------------------------------------------------------------
     10655.6 - Search
     1066--------------------------------------------------------------*/
     1067#search-content {
     1068        background: #f7f7f7;
     1069        border: 1px solid #ececec;
     1070        -moz-border-radius: 7px;
     1071        -webkit-border-radius: 7px;
     1072        border-radius: 7px;
     1073        margin: 20px 0 20px;
     1074        padding: 0 10px;
     1075        position: relative;
     1076}
     1077#search-tab {
     1078        background: url(../images/search.png) no-repeat 20px top;
     1079        height: 16px;
     1080        margin-top: -16px;
     1081}
     1082#search-loop {
     1083        min-height: 75px;
     1084}
     1085.search-column-component h3 {
     1086        color: #707070;
     1087        font-size: 16px;
     1088}
     1089.search-column-component {
     1090        float: left;
     1091        padding: 10px 10px 0 0;
     1092        text-align: right;
     1093        width: 20%;
     1094}
     1095.search-column-results {
     1096        border-left: 1px solid #e1e3e3;
     1097        float: left;
     1098        padding: 10px 0 42px 10px;
     1099        width: 76%;
     1100}
     1101.search-section {
     1102        display: inline-block;
     1103        width: 100%;
     1104}
     1105.search-section:last-child .search-column-results {
     1106        margin-bottom: 0;
     1107}
     1108input#s {
     1109        border: 1px inset #c3c5c5;
     1110        -moz-border-radius: 3px;
     1111        -webkit-border-radius: 3px;
     1112        border-radius: 3px;
     1113        color: #696a6a;
     1114        font-size: 20px;
     1115        height: 30px;
     1116        width: 300px;
     1117}
     1118input#searchsubmit {
     1119        background-position: 0 bottom;
     1120        height: 35px;
     1121}
     1122div.search-post-content h4.posttitle {
     1123        font-size: 14px;
     1124        margin: 10px 0 10px 35px;
     1125}
     1126div.search-entry {
     1127        margin: 0 0 10px 35px;
     1128}
     1129div.search-post-content {
     1130        border-bottom: 1px solid #eaeaea;
     1131}
     1132.search-section ul.item-list li {
     1133        padding-bottom: 0;
     1134}
     1135
     1136
     1137/*--------------------------------------------------------------
    106411386.0 - BuddyPress
    10651139--------------------------------------------------------------*/
    10661140/*--------------------------------------------------------------
  • bp-themes/bp-default/_inc/global.js

     
    10671067                        jq.cookie('bp-' + objects[i] + '-extras', null, {path: '/'} );
    10681068                });
    10691069        });
     1070
     1071        /* search template */
     1072        jq("#searchsubmit").click(function(e) {
     1073                e.preventDefault();
     1074                jq('form#search span.ajax-loader').show();
     1075
     1076                jq("#search-loop-results").load("/?s=" + escape(jq("#s").val()) + " #search-loop-results", function(response, status, xhr) {
     1077                        if (status == "success") {
     1078                                jq('span.ajax-loader').hide();
     1079                        }
     1080                });
     1081        });
    10701082});
    10711083
    10721084/* Setup activity scope and filter based on the current cookie settings. */