예제 #1
0
  
  <!-- Emty Grid -->
  <div class="grid_5">
  </div>
  <?php 
    function search_type($id)
    {
        $arr = array(1 => "Band Name", 2 => "Audio Title", 3 => "Video Title", 5 => "Artist Name", 6 => "Location");
        foreach ($arr as $k => $v) {
            if ($id == $k) {
                $str = $v;
            }
        }
        return $str;
    }
    $header = $_GET['result'] == 'b' ? $_GET['search'] . "'s Music and Video Listings" : "Just Search | Search Term: " . $_GET['search'] . " | Search Type: " . search_type($_GET['sel']);
    ?>
  <div class="grid_16 blog-page">
    <h1><?php 
    echo $header;
    ?>
</h1>
    <h2 class="blog-page-space">Emotions and music are colateral in life. One is necessary to get another one.</h2>
  </div>
  
  <div class="grid_16 list-page">
  
  <!-- Filter-->
    <!--ul class="splitter">
      <li>
        <ul>
예제 #2
0
function blogsfera_widget_search_results()
{
    $title = __('Resultados de la b&uacute;squeda');
    ?>
	
	<li id="search-results" class="clearfix">
		<h2><?php 
    echo $title;
    ?>
</h2>
		<p class="query">Estos son los resultados de su b&uacute;squeda de "<?php 
    current_search();
    ?>
":</p>
		<ul>
			<?php 
    if ($result = search_results()) {
        $list = "";
        $last = count($result) - 1;
        $i = 0;
        reset($result);
        // Display blog info
        if (search_type() == 'blog') {
            foreach ($result as $blog_result) {
                $blog = get_blog_details($blog_result);
                $users = get_users_of_blog_by_rol($blog_result, 'edit_posts');
                $list .= "<li";
                // Display last element class
                if ($i == $last) {
                    $list .= " class='last clearfix'";
                }
                $list .= "><h3><a href='{$blog->siteurl}'>{$blog->blogname}</a></h3><ul>";
                foreach ($users as $user) {
                    $list .= "<li><a class='avatar' href='{$blog->siteurl}'>";
                    $list .= "<img src='" . author_image_path($user->user_id, $display = false) . "' alt='avatar' width='48px' height='48px'/></a>";
                    $list .= "<p style='font-size:15px;'>{$user->display_name}</p></li>";
                }
                $list .= "</ul></li>";
                $i++;
            }
            // Display user info
        } else {
            global $wpdb;
            $current_blog_id = $wpdb->blogid;
            foreach ($result as $user) {
                $blogs = get_blogs_of_user($user['ID'], true);
                foreach ($blogs as $blog_id => $blog) {
                    //$blog = get_active_blog_for_user($user['ID']);
                    switch_to_blog($blog_id);
                    $user_o = new WP_User($user['ID']);
                    if ($user_o->has_cap('edit_posts')) {
                        $list .= "<li";
                        // Display last element class
                        if ($i == $last) {
                            $list .= " class='last clearfix'";
                        }
                        $list .= "><a class='avatar' href='{$blog->siteurl}'>";
                        $list .= "<img src='" . author_image_path($user['ID'], $display = false) . "' alt='avatar' width='48px' height='48px'/>";
                        $list .= "</a><h3><a href='{$blog->siteurl}'>{$blog->blogname}</a></h3>";
                        $list .= "<p>by " . $user['display_name'] . "</p></li>";
                    }
                }
                $i++;
            }
            switch_to_blog($current_blog_id);
        }
        echo $list;
    } else {
        echo "<li>No se hallaron resultados</li>";
    }
    ?>
		</ul>
	</li>
	<?php 
}