function get_top_papers($category = false, $timeframe = false, $filters = array()) { $filters["limit"] = 8; if ($category) { $filters["category"] = $category; } if ($timeframe) { $filters["added_after"] = $timeframe; } return get_papers("cited", $filters); }
.draw(); } ); column.data().unique().sort().each( function ( d, j ) { select.append( '<option value="'+d+'">'+d+'</option>' ) } ); } ); } }); }); </script> <?php //$db = connect(); include 'view_papers.php'; $papers = get_papers(); ?> <div> <table class="table table-striped table-row table1" id="data"> <thead> <tr> <th>Course</th> <th>Branch</th> <th>Semester</th> <th>Name</th> <th>Download</th> </tr> <tr> <td></td>
?> </h1> <table width='100%' cellspacing='10' cellpadding='0'> <tr> <td valign='top' width='*'> <?php print "<h3>All time most popular books & papers</h3>"; $papers = get_papers("cited", array("journal" => $safe_journal_id, "limit" => 5)); foreach ($papers as $paper) { print_paper($paper, array("display" => "minimal")); } ?> </td> <?php $papers = get_papers("cited", array("journal" => $safe_journal_id, "limit" => 5, "published_after" => $last_month)); if ($papers) { ?> <td valign='top' width='50%'> <?php print "<h3>Recently published hot books & papers</h3>"; foreach ($papers as $paper) { print_paper($paper, array("display" => "minimal")); } ?> </td> <?php } ?> </tr>
tinyMCE.init({ mode : "textareas", theme : "simple" }); </script> <div class='content fullwidth'> <?php $paper_id = false; $safe_doi = mysql_escape_string($_GET["doi"]); $safe_paper_id = mysql_escape_string($_GET["paper_id"]); if ($safe_doi) { $safe_paper_id = get_paper_id_from_doi($safe_doi); } if ($safe_paper_id && is_numeric($safe_paper_id)) { $paper_id = $safe_paper_id; } if ($paper_id >= 1) { $papers = get_papers("added_on", array("paper_id" => $paper_id)); if (sizeof($papers) == 1) { $paper = $papers[0]; print_paper($paper, array("magnify" => true, "link_through" => true)); } else { print_error("Couldn't find paper", "Sorry, we couldn't find the paper that you're looking for."); } } else { print_error("Couldn't find paper", "Sorry, we couldn't find the paper that you're looking for."); } ?> </div> <?php include "footer.php";
<td width='50%' valign='top'> <?php $journals = get_journals(false, 10, "num_papers DESC", array("return_full" => true, "skip" => 10)); if (sizeof($journals)) { tabulate_journals($journals, "num_papers"); } ?> </td> </tr> </table> <h3>All Time Most Popular Books & Papers</h3> <p>These are the ten most cited books or papers in the database. Note that only blog posts are counted as citations - comments and external links (like F1000 reviews or Nature Highlights) are ignored. <p>You can see a breakdown of popular books or papers by publisher by clicking on a publisher name. <p><br/> <?php $papers = get_papers("cited", array("limit" => 10)); foreach ($papers as $paper) { print_paper($paper, array("display" => "minimal")); } } else { if ($safe_area == "trends") { ?> <h1>Trends</h1> <?php } else { ?> <h1>Overview</h1> <p>Please note that these statistics refer to the entire Postgenomic database, not just the currently selected category. <?php # generate input XML for graphing component. $xml = post_freq_xml($safe_category);
$cached = get_cache($PAGE_URL); if ($cached) { print $cached; exit; } ob_start(); } if ($type == "paper" || $type == "papers") { # list papers # the ids_only part of the API is a bit hacky because it needs to be backwards compatible # with the original "API" that allowed Pedro to do the Greasemonkey hack. if ($ids_only) { # list all papers in the database (just their IDs, though) $filters['limit'] = 1000000; # absurdly high limit so that everything is returned $papers = get_papers("added_on", $filters); if ($papers) { $doi_ids = array(); $pubmed_ids = array(); $arxiv_ids = array(); $pii_ids = array(); foreach ($papers as $paper) { if ($paper['doi_id']) { $doi_ids[$paper["doi_id"]] = $paper["paper_id"]; } if ($paper['pubmed_id']) { $pubmed_ids[$paper["pubmed_id"]] = $paper["paper_id"]; } if ($paper['arxiv_id']) { $arxiv_ids[$paper["arxiv_id"]] = $paper["paper_id"]; }
?> '><img border='0' src='images/cell_comment.png'/></a></div> <div class='basic_thumbnail'><a href='<?php plinkto("papers.php", $page_vars, array("comment_source" => "Science")); ?> '><img border='0' src='images/science_comment.png'/></a></div> --> <div class='postbox_footer'> </div> </div> </div> <?php print_searchbox("Papers"); ?> </div> <div class='content'> <?php $papers = get_papers($safe_order_by, $filters); # pagination control if ($papers) { print_pagination($papers, $safe_skip, "papers.php", $GLOBALS["config"]['papers_per_page']); foreach ($papers as $paper) { print_paper($paper, array("display" => "minimal")); } print_pagination($papers, $safe_skip, "papers.php", $GLOBALS["config"]['papers_per_page']); } else { print "No papers found."; } ?> </div> <?php include "footer.php";
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; }
print "<p class='description'>Blogs containing posts tagged \"{$safe_tag}\" include...</p>"; foreach ($blogs as $key => $value) { print "<p><a href='" . linkto("blog_search.php", $GLOBALS['page_vars'], array("blog_id" => $key)) . "'>{$value}</a>"; } print "</div>"; print "</div>"; } print "</div>"; print "<div class='content'>"; if ($safe_tag) { print "<h1>Items tagged with \"{$safe_tag}\"</h1>"; $paper_ids = array(); $paper_ids = get_papers_with_tag($safe_tag, true); if ($paper_ids) { print "<h3>Papers</h3>"; $papers = get_papers("cited", array("paper_id" => $paper_ids)); foreach ($papers as $paper) { print_paper($paper, array("display" => "minimal")); } } $post_ids = get_posts_with_tag($safe_tag); if ($post_ids) { print "<h3>Posts</h3>"; $posts = get_posts("cited", array("post_id" => $post_ids)); foreach ($posts as $post) { print_post($post); } } print "</div>"; } else { print_error("No tag specified", "You must specify a tag to search for.");
$filters = array(); $title = "Postgenomic - recent hot papers"; if ($category) { $title = "Postgenomic - recent hot " . strtolower($category) . " papers"; $filters['category'] = $category; } if ($journal) { $filters['journal'] = $journal; $title .= " (from {$journal})"; } # get papers $filters['limit'] = 10; $filters['min_links'] = 1; $last_month = date("Y-m-d", mktime(0, 0, 0, date(m) - 1, date(d), date(Y))); $filters['published_after'] = $last_month; $papers = get_papers("cited", $filters); # return posts $buffer .= atom_header($title); if ($papers) { foreach ($papers as $paper) { $buffer .= paper_atom_entry($paper); } } $buffer .= atom_footer(); print $buffer; } if ($type == "popular_posts") { $filters = array(); $title = "Postgenomic - recently popular posts"; if ($category) { $title = "Postgenomic - recently popular " . strtolower($category) . " posts";