Commit 549fba2e authored by Romain Loth's avatar Romain Loth

fix localdb publications displays

parent 90b42c9f
<?php
// manage the dynamical additional information in the left panel.
ini_set('display_errors',1);
ini_set('display_startup_errors',1);
error_reporting(-1);
// DISPLAY THE RESULTS
function displayDoc($docId, $score, $base) {
$output = "";
// POSS score should have a data-score attribute
$output = "<li class='searchhit' title='".$score."'>";
$output.="<p><b>".$base[$docId]['title']."</b> by <span class='author'>".$base[$docId]['author']."</span> [".$base[$docId]['pubdate']."], <i>".$base[$docId]['journal']."</i></p>";
$output.="<p><b>keywords:</b> ".$base[$docId]['keywords']."</p>";
$output.="<p><span class='hit-text'>".$base[$docId]['text']."</span></p>";
$output.="</li>";
return $output;
}
$htmlout = "<ul class=infoitems>\n";
$nb_displayed = 0;
foreach ($sims as $doc => $freq) {
// doc limit
if ($nb_displayed > $max_item_displayed) {
break;
}
$rowid = ltrim($doc, 'd');
$thisdoc = displayDoc($rowid, $freq, $base);
// echodump("doc", $thisdoc);
$htmlout .= $thisdoc."\n";
// doc limit
$nb_displayed++;
}
$htmlout .= "</ul>\n";
echo '<br/><h4><font color="#0000FF"> Full text of top '.$max_item_displayed."/".count($sims).' related publications:</font></h4>'.$htmlout;
?>
......@@ -112,6 +112,7 @@ foreach ($wos_ids as $id => $score) {
$sql = 'SELECT data FROM ISITITLE WHERE id='.$id.' group by data';
$output = "";
foreach ($base->query($sql) as $row) {
$external_link="<a href=http://google.com/webhp?#q=".urlencode('"'.$row['data'].'"')." target=blank>".' <img width=15px src="libs/img2/google.png"></a>';
$output.="<li title='".$score."'>";
......@@ -135,11 +136,6 @@ foreach ($wos_ids as $id => $score) {
continue;
}
}
if ($total_count<$count_max){
$related .= $total_count;
}else{
$related .= ">".$count_max;
}
$output .= "</ul>"; #####
......@@ -306,7 +302,8 @@ function imagestar($score,$factor,$twjs) {
}
return $star_image;
}
if($max_item_displayed>$related) $max_item_displayed=$related;
echo $news.'<br/><h4><font color="#0000FF"> Full text of top '.$max_item_displayed.'/'.$related.' related publications:</font></h4>'.$output;
if($max_item_displayed>$total_count) $max_item_displayed=$total_count;
// echo $news.'<br/><h4><font color="#0000FF"> Full text of top '.$max_item_displayed.'/'.$related.' related publications:</font></h4>'.$output;
echo '<br/><h4><font color="#0000FF"> Full text of top '.$max_item_displayed.'/'.$total_count.' related publications:</font></h4>'.$output;
//pt - 301 ; 15.30
?>
......@@ -12,8 +12,6 @@ $project_root = "../";
include('parameters_details.php');
$max_item_displayed=6;
if ($_GET['dbtype'] == "sql") {
$base = new PDO("sqlite:".$project_root.$graphdb);
include('default_div.php');
......@@ -101,34 +99,7 @@ else {
arsort($sims);
// echodump("sims", $sims);
// DISPLAY THE RESULTS
function displayDoc($docId, $score, $base) {
$output = "";
// POSS score should have a data-score attribute
$output = "<li title='".$score."'>";
$output.="<p><b>".$base[$docId]['title']."</b></p>";
$output.="<p>".$base[$docId]['author']." [".$base[$docId]['pubdate']."], <i>(".$base[$docId]['journal'].")</i></p>";
$output.="<p>".$base[$docId]['keywords']."</p>";
$output.="<p>".$base[$docId]['text']."</p>";
$output.="</li>";
return $output;
}
$htmlout = "<ul>\n";
foreach ($sims as $doc => $freq) {
$rowid = ltrim($doc, 'd');
$thisdoc = displayDoc($rowid, $freq, $base);
echodump("doc", $thisdoc);
$htmlout .= $thisdoc;
}
$htmlout = "</ul>\n";
echo '<br/><h4><font color="#0000FF"> Full text of top '.count($sims).' related publications:</font></h4>'.$htmlout;
include ('csv_div.php');
}
}
......
......@@ -18,6 +18,9 @@ $gexf= str_replace('"','',$_GET["gexf"]);
$mainpath=dirname(getcwd())."/";
$graphdb = $gexf_db[$gexf];
// number of docs to display setting
$max_item_displayed = 7;
// echodump("graphdb", $graphdb);
function echodump($title, $anyObj) {
......
......@@ -172,6 +172,22 @@ html.waiting {
cursor: pointer;
}
.author {
font-variant: small-caps;
}
.searchhit {
font-family: "Roboto", "Droid Sans", sans-serif;
border: 1px solid #222;
padding: 7px 0 7px 12px;
margin: 10px 10px 0 0;
}
.hit-text {
color: #444;
font-family: "Crete Round", "garamond", serif ;
padding: 5px;
}
#tab-container {
margin: 7px;
......@@ -258,6 +274,20 @@ p.micromessage{
color: '#222'
}
#information .information-vcard {
border: 2px solid #555;
padding: 2em 1em .3em 1em;
background-color:#fff;
border-radius: .3em;
}
#information .information-links {
padding: 7px 0 0 20px;
}
ul.infoitems {
list-style: none;
}
/* switch css -- generic (src: proto.io/freebies/onoff/)*/
.onoffswitch {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment