Exemple #1
0
 
  <div id="bloggers_navigation">
    
      <h3>nuestros bloggers</h3>
      <!-- navigator --> 
      <div class="navi"></div> 

      <!-- prev link --> 
      <a class="prev"></a>
 
      <div id="bloggers_box" class="scrollable">
        
        <ul class="items">

          <?php 
get_blogs();
?>
      
        </ul>
    
      </div>
  
      <!-- next link --> 
      <a class="next"></a>

    </div>


</div> <!-- content_feed -->

<input type='submit' name='submit' value='Submit'/>
</div>
</form>
<h3>Blog Workspace</h3>
<?php 
$workspace = $_GET['workspace'];
if ($_POST['workspace']) {
    $workspace = $_POST['workspace'];
}
$workspace = mysql_escape_string($workspace);
if (!$workspace) {
    $workspace = 'false';
}
$blog_ids = array();
if ($workspace != 'false') {
    $blog_ids = get_blogs_with_tag($workspace);
} else {
    $blog_ids = get_blogs_with_no_tags();
}
if (sizeof($blog_ids)) {
    $blogs = get_blogs($blog_ids, array("latest" => true, "limit" => 1000, "show_new_blogs" => true, "show_inactive" => true));
    foreach ($blogs as $blog) {
        print_blog($blog, array("add_tag" => true, "workspace" => $workspace));
    }
} else {
    print "No such blogs";
}
?>
</div>
<?php 
include "footer.php";
Exemple #3
0
       TYPE="application/x-shockwave-flash" 
       PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer">
</EMBED>
</OBJECT>
</div>
<h3>Stats overview</h3>
<table width='100%' cellspacing='0' cellpadding='0'>
<tr>
	<td width='33%' valign='top'><h3>Top Blogs</h3></td>
	<td width='33%' valign='top'><h3>Top Publishers</h3></td>
	<td width='33%' valign='top'><h3>Top Tags</h3></td>
</tr>
<tr>
	<td width='33%' valign='top'>
		<?php 
            $blogs = get_blogs(array(), array("limit" => 25));
            if (sizeof($blogs)) {
                tabulate_blogs($blogs);
            }
            ?>
		
	</td>
	<td width='33%' valign='top'>
		<?php 
            $journals = get_journals(false, 25, "rank ASC", array("return_full" => true));
            if (sizeof($journals)) {
                tabulate_journals($journals);
            }
            ?>
	</td>
	<td width='33%' valign='top'>
Exemple #4
0
?>
</div>
</div>
<?php 
print_searchbox("Blogs");
?>
</div>
<div class='content'>
<?php 
$safe_skip = false;
$safe_skip = mysql_escape_string($_GET["skip"]);
if (!is_numeric($safe_skip)) {
    $safe_skip = false;
}
$filters = array();
$filters['limit'] = $GLOBALS["config"]['blogs_per_page'];
if ($safe_skip) {
    $filters['skip'] = $safe_skip;
} else {
    $filters['skip'] = 0;
}
$blogs = get_blogs(get_blogs_with_tag($safe_category), $filters);
print_pagination($blogs, $safe_skip, "blogs.php", $GLOBALS["config"]['blogs_per_page']);
foreach ($blogs as $blog) {
    print_blog($blog, array("tagcloud" => true));
}
print_pagination($blogs, $safe_skip, "blogs.php", $GLOBALS["config"]['blogs_per_page']);
?>
</div>
<?php 
include "footer.php";
        $matches = array();
        preg_match_all("/xmlUrl=[\\'\"](.*?)[\"\\']/i", $page, $matches);
        for ($i = 0; $i < sizeof($matches[1]); $i++) {
            $blog = $matches[1][$i];
            $blog_id = get_blog_id($blog);
            if ($blog_id) {
                array_push($blog_ids, $blog_id);
            }
        }
    }
} elseif ($_SAFE['category']) {
    $blog_ids = get_blogs_with_tag($_SAFE['category']);
}
if (sizeof($blog_ids) || $_SAFE['all']) {
    # at least one blog on the public blogroll is also in Postgenomic
    $blogs = get_blogs($blog_ids, array("limit" => 20, "require_portraits" => true));
    print "document.write(\"";
    $counter = 0;
    $large_images = 2;
    $small_images = sizeof($blogs) - $large_images;
    $half = ceil($small_images / 2) + $large_images;
    $width = $large_images * 64 + ceil($small_images / 2) * 32;
    print "<table border='0' cellspacing='0' cellpadding='0' width='{$width}'>";
    print "<tr>";
    for ($i = 0; $i < $large_images; $i++) {
        $blog = $blogs[$i];
        $size = 64;
        print "<td>";
        printf("<a href='%s'><img border='0' src='%s' height='%d' width='%d' /></a>", $blog['url'], $blog['image'], $size, $size);
        print "</td>";
    }
Exemple #6
0
 $filters = array();
 # basics...
 $filters['limit'] = $blogs_return_limit;
 if ($limit && $limit < $max_blogs_return_limit) {
     $filters['limit'] = $limit;
 }
 if ($start && is_numeric($start)) {
     $filters['skip'] = $start;
 }
 # category
 $blog_ids = array();
 if ($category) {
     $blog_ids = get_blogs_with_tag($category);
 }
 # get blogs
 $blogs = get_blogs($blog_ids, $filters);
 # return blogs
 if ($format == "json") {
     $json = new Services_JSON();
     if ($blogs) {
         $buffer .= $json->encode($blogs);
     }
     if ($callback) {
         printf("%s(%s)", $callback, $buffer);
     } else {
         print $buffer;
     }
 } else {
     # default is to return results as an Atom feed
     $buffer .= atom_header();
     if ($blogs) {
<?php

include "functions.php";
$PAGE_TYPE = "blogs";
$PAGE_TITLE = $config["name"] . " - Blog details";
include "header.php";
include "blogs_menu.php";
$safe_blog_id = mysql_escape_string($_GET['blog_id']);
$details = get_blogs(array($safe_blog_id), array("show_new_blogs" => true));
$details = $details[0];
?>
<div class='sidebar'>
<div class='sidebox'>
<div class='sidebox_title'>Subscribe to this blog</div>
<div class='sidebox_content'>
<a href="http://www.bloglines.com/sub/<?php 
print $details['feed_url'];
?>
">
<img src="http://www.bloglines.com/images/sub_modern9.gif" border="0" alt="Subscribe with Bloglines" />
</a>
<a href="http://fusion.google.com/add?feedurl=<?php 
print urlencode($details['feed_url']);
?>
"><img src="http://buttons.googlesyndication.com/fusion/add.gif" width="104" height="17" border="0" alt="Add to Google"></a>
<a href="http://www.newsgator.com/ngs/subscriber/subext.aspx?url=<?php 
print $details['feed_url'];
?>
"><img runat="server" src="http://www.newsgator.com/images/ngsub1.gif" alt="Subscribe in NewsGator Online" border="0" /></a>
</div>
</div>
function parse_search_results($results)
{
    $num_results = 0;
    $total_results = 0;
    $limit = 0;
    $return;
    if ($results) {
        $lines = explode("\n", $results);
        # filter out blank lines
        $filenames = array();
        foreach ($lines as $line) {
            if (strlen($line) >= 3) {
                array_push($filenames, $line);
            }
            $matches = array();
            preg_match("/===META=TYPE===(\\d+)===/", $line, $matches);
            if ($matches[1]) {
                $num_results = $matches[1];
            }
            $matches = array();
            preg_match("/===META=TOTAL===(\\d+)===/", $line, $matches);
            if ($matches[1]) {
                $total_results = $matches[1];
            }
            $matches = array();
            preg_match("/===META=LIMIT===(\\d+)===/", $line, $matches);
            if ($matches[1]) {
                $limit = $matches[1];
            }
        }
        # first get any posts
        $posts = array();
        if (sizeof($filenames)) {
            $posts_files = get_posts_by_filenames($filenames);
            if (sizeof($posts_files)) {
                $post_ids = array_values($posts_files);
                $post_filenames = array_keys($posts_files);
                $posts = get_posts("published_on", array("post_id" => $post_ids, "order_by_filenames_array" => $filenames));
                # add rows_returned field to first post (used by pagination algorithm)
                $posts[0]["rows_returned"] = $num_results;
            }
        }
        # then any blogs
        $blogs = array();
        if (sizeof($filenames)) {
            $blogs_files = get_blogs_by_filenames($filenames);
            if (sizeof($blogs_files)) {
                $blogs = get_blogs($blogs_files);
                $blogs[0]["rows_returned"] = $num_results;
            }
        }
        # and any papers...
        $papers = array();
        if (sizeof($filenames)) {
            $paper_ids = array();
            foreach ($filenames as $filename) {
                $matches = array();
                preg_match("/paper_(\\d+)\\.xml/i", $filename, $matches);
                if ($matches) {
                    array_push($paper_ids, $matches[1]);
                }
            }
            if (sizeof($paper_ids)) {
                $papers = get_papers("cited", array("paper_id" => $paper_ids));
                $papers[0]["rows_returned"] = $num_results;
            }
        }
        $return["posts"] = $posts;
        $return["blogs"] = $blogs;
        $return["papers"] = $papers;
        $return["limit"] = $limit;
        $return["total_results"] = $total_results;
        $return["num_results"] = $num_results;
    }
    return $return;
}
Exemple #9
0
<?php

// include des fonctions d'access à la base de données BLOG
include_once 'MODELE/BLOGS/get_blogs.php';
if (isset($tag_id)) {
    $blogs = get_blogs_by_tag_id($tag_id);
    // On récupère les posts relatifs au tag sélectionné
} else {
    if (isset($user_id)) {
        $blogs = get_blogs_by_user($user_id);
        // On récupère les posts relatifs au user sélectionné
    } else {
        if (isset($post_id)) {
            $blogs = get_blogs_by_id($post_id);
            // On récupère les posts relatifs au post_id, cad 1 seul en théorie
        } else {
            if (isset($tag_name)) {
                $blogs = get_blogs_by_tag_name($tag_name);
                // On récupère les posts relatifs au post_id, cad 1 seul en théorie
            } else {
                $blogs = get_blogs();
                // On récupère tous les posts (les 10 premiers)
            }
        }
    }
}
include_once 'VUE/BLOGS/v_blogs.php';