Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if(!empty($phrase)) {
- $network_query_posts = network_query_posts( $parameters );
- $i = 0;
- //found_posts
- if( network_have_posts() && isset($GLOBALS['network_query']->found_posts) && $GLOBALS['network_query']->found_posts > intval( $global_site_search_per_page ) ) {
- $next = 'yes';
- $navigation_content = $this->new_pagination( $GLOBALS['network_query'], $current_site->path . $this->global_site_search_base . '/' . urlencode($phrase) );
- }
- if ( network_have_posts() ) {
- $content .= (isset($navigation_content)) ? $navigation_content : '';
- $content .= '<div style="float:left; width:100%">';
- $content .= '<table border="0" border="0" width="100%" bgcolor="">';
- $content .= '<tr>';
- $content .= '<td style="background-color:' . $global_site_search_background_color . '; border-bottom-style:solid; border-bottom-color:' . $global_site_search_border_color . '; border-bottom-width:1px; font-size:12px;" width="10%"> </td>';
- $content .= '<td style="background-color:' . $global_site_search_background_color . '; border-bottom-style:solid; border-bottom-color:' . $global_site_search_border_color . '; border-bottom-width:1px; font-size:12px;" width="90%"><center><strong>' . __('Posts', 'globalsitesearch') . '</strong></center></td>';
- $content .= '</tr>';
- // Search results
- $avatar_default = get_option('avatar_default');
- $tic_toc = 'toc';
- while( network_have_posts()) {
- network_the_post();
- //=============================//
- $author_id = network_get_the_author_id();
- $the_author = get_user_by( 'id', $author_id );
- if(!$the_author) {
- $post_author_display_name = __('Unknown', 'globalsitesearch');
- } else {
- $post_author_display_name = $the_author->display_name;
- }
- $tic_toc = ($tic_toc == 'toc') ? 'tic' : 'toc';
- $bg_color = ($tic_toc == 'tic') ? $global_site_search_alternate_background_color : $global_site_search_background_color;
- //=============================//
- $content .= '<tr>';
- $content .= '<td style="background-color:' . $bg_color . '; padding-top:10px; text-align: center;" valign="top" width="10%"><a style="text-decoration:none;" href="' . network_get_permalink() . '">' . get_avatar( $author_id, 32, $avatar_default ) . '</a></td>';
- $content .= '<td style="background-color:' . $bg_color . '; padding-top:10px; vertical-align: top;" width="90%" valign="top">';
- $content .= '<strong><a style="text-decoration:none;" href="' . network_get_permalink() . '">' . network_get_the_title() . '</a></strong> - ';
- $content .= __('Post by ', 'globalsitesearch');
- if ( function_exists('members_directory_site_admin_options') ) {
- $post_author_nicename = $the_author->user_nicename;
- $content .= '<strong><a style="text-decoration:none;" href="http://' . $current_site->domain . $current_site->path . $members_directory_base . '/' . $post_author_nicename . '/">' . $post_author_display_name . '</a> </strong> ';
- } else {
- $content .= '<strong>' . $post_author_display_name . ': </strong> ';
- }
- $content .= ' on ';
- $content .= date("d M Y", strtotime($network_query_posts[$i]->post_date));
- $content .= ' in ';
- $blog_details = get_blog_details($network_query_posts[$i]->BLOG_ID);
- $content .= '<a href="'.$blog_details->siteurl.'" target="_blank">'.$blog_details->blogname.'</a>';
- $content .= '<br>';
- $the_content = network_get_the_content();
- $content .= substr(strip_tags( $the_content ),0, 250) . ' (<a href="' . network_get_permalink() . '">' . __('More', 'globalsitesearch') . '</a>)';
- $content .= '</td>';
- $content .= '</tr>';
- $i++;
- }
- $content .= '</table>';
- $content .= '</div>';
- $content .= (isset($navigation_content)) ? $navigation_content : '';
- } else {
- $content .= '<p>';
- $content .= '<center>';
- $content .= __('Nothing found for search term(s).', 'globalsitesearch');
- $content .= '</center>';
- $content .= '</p>';
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement