<div id="profileholder"> <div id="avatar">'; if (file_exists('./uploads/avatars/' . $key['uuid'] . '.png')) { echo '<img src="./uploads/avatars/' . $key['uuid'] . '.png" style="width:90%; margin:2.5%;"/>'; } else { echo '<img src="./uploads/avatars/default.png" style="width:90%; margin:2.5%;"/>'; } echo ' </div> <div id="user"> <span id="username">' . utf8_encode($dev->getName($key['uuid'])) . '</span></br> <span id="rank">' . getTranslation($dev->getAdminLevel($key['uuid']) . '_level') . '</span> </div> <div id="desc"> <div id="row">Posté le:</div> <div id="value">' . getDate2($key['date']) . '</div> </div> </div> </td> <td style="vertical-align:top; padding:10px;padding-top:0;"> ' . nl2br(getHTMLfromBB(utf8_encode(stripslashes($key['content'])))) . ' </td> </tr> </table> </div>'; } } else { echo '<div style="margin:8px; padding:5px; border: 1px solid #e8e8e8; box-shadow: inset 0 0 0 1px #fefefe, 0 1px 0 #dadada; width:350px;font-family:Tahoma, sans-serif; font-size:0.5em;"> <h1>Aucun commentaire :(</h1> </div>'; }
/** This function modifies the $endpoint_arr and adds each of the statistics found here https://github.com/bio2rdf/bio2rdf-scripts/wiki/Bio2RDF-Dataset-Metrics to the array **/ function retrieveStatistics(&$endpoint_arr) { $warn = ""; if (count($endpoint_arr)) { foreach ($endpoint_arr as $name => $details) { $endpoint_url = $details["endpoint_url"]; $graph_uri = $details["graph_uri"]; if (strlen($endpoint_url) != 0 && strlen($graph_uri) != 0) { //now retrieve each of the stats //nsns counts $nsnsJSON = trim(@file_get_contents(nsQ($endpoint_url, $graph_uri))); $endpoint_arr[$name]["nsnscounts"] = getNSNSCounts($nsnsJSON); //numOfTriples $numOfTriplesJson = trim(@file_get_contents(q1($endpoint_url, $graph_uri))); $endpoint_arr[$name]["triples"] = getNumOfTriples($numOfTriplesJson); //get the date $dateJson = trim(@file_get_contents(getDatasetDateQuery($endpoint_url))); $endpoint_arr[$name]['date'] = getDate2($dateJson); //numOfSubjects $numOfSubjectsJson = trim(@file_get_contents(q2($endpoint_url, $graph_uri))); $endpoint_arr[$name]["unique_subjects"] = getNumOfSubjects($numOfSubjectsJson); //numOfPredicates $numOfPredicatesJson = trim(@file_get_contents(q3($endpoint_url, $graph_uri))); $endpoint_arr[$name]["unique_predicates"] = getNumOfPredicates($numOfPredicatesJson); //numOfUniqueObjects $numOfObjectsJson = trim(@file_get_contents(q4($endpoint_url, $graph_uri))); $endpoint_arr[$name]["unique_objects"] = getNumOfObjects($numOfObjectsJson); //numOfTypes $numOfTypesJson = trim(@file_get_contents(q5($endpoint_url, $graph_uri))); $endpoint_arr[$name]["unique_types"] = getNumOfTypes($numOfTypesJson); //unique predicate-object links and their frequencies $numOfPredObjectFreqsJson = trim(@file_get_contents(q6($endpoint_url, $graph_uri))); $endpoint_arr[$name]["predicate_object_links"] = getPredObjFreq($numOfPredObjectFreqsJson); //unique predicate-literal links and their frequencies $numOfUniquePredicateLiteralLinksandFreqsJson = trim(@file_get_contents(q7($endpoint_url, $graph_uri))); $endpoint_arr[$name]["predicate_literals"] = getPredLitLinks($numOfUniquePredicateLiteralLinksandFreqsJson); //unique subject-predicate-unique object links and their frequencies $numOfSubjectPredicateUniqueObjectJson = trim(@file_get_contents(q8($endpoint_url, $graph_uri))); $endpoint_arr[$name]["subject_count_predicate_object_count"] = getSubPredObjLinks($numOfSubjectPredicateUniqueObjectJson); //unique subject-predicate-unique literal links and their frequencies $numOfSubjectPredUniqueLitJson = trim(@file_get_contents(q9($endpoint_url, $graph_uri))); $endpoint_arr[$name]["subject_count_predicate_literal_count"] = getSubPredLitLinks($numOfSubjectPredUniqueLitJson); //unique subject type-predicate-object type links and their frequencies $numOfSubjectTypePredicateObjectJson = trim(@file_get_contents(q10($endpoint_url, $graph_uri))); $endpoint_arr[$name]["subject_type_predicate_object_type"] = getSubTypePredObjType($numOfSubjectTypePredicateObjectJson); } else { $warn .= "WARNING :: Endpoint " . $name . " does not have all of required information! (missing either the endpoint or graph uri!)!\n"; } } if (strlen($warn)) { echo $warn; } } return $endpoint_arr; }
<td style="width:12%; vertical-align:top;"> <div id="profileholder"> <div id="avatar">'; if (file_exists('../uploads/avatars/' . $key['uuid_author'] . '.png')) { echo '<img src="../uploads/avatars/' . $key['uuid_author'] . '.png" style="width:90%; margin:2.5%;"/>'; } else { echo '<img src="../uploads/avatars/default.png" style="width:90%; margin:2.5%;"/>'; } echo ' </div> <div id="user"> <span id="username" onClick="window.location.href=`../profiles/?id=' . $key['uuid_author'] . '`">' . utf8_encode($dev->getName($key['uuid_author'])) . '</span></br> <span id="rank">' . getTranslation($dev->getAdminLevel($key['uuid_author']) . '_level') . '</span> </div> <div id="desc"> <div id="row">Posté à ' . getTime($key['date_written']) . ' le ' . getDate2($key['date_written']) . '</div> </div> </div> </td> <td style="vertical-align:top; padding:10px;padding-top:0;"> ' . getHTMLfromBB(utf8_encode(stripslashes($key['content']))) . ' </td> </tr> </table> </div>'; } } if (isset($_SESSION['user'])) { if ($dev->isConnected($_SESSION['user']['username'], $_SESSION['user']['password'], $_SESSION['user']['session_id'])) { if ($dev->getForumAdminLevel($dev->getThreadByIDv2($_GET['id'])['forum_id']) <= $dev->getAdminLevel($dev->getID($_SESSION['user']['username']))) { echo '<div id="news">