Commit d5635cc6 authored by jlopez's avatar jlopez
Browse files

Merge branch 'develop' into 'master'

Develop

See merge request !8
parents 5627fe49 5086e4d5
Pipeline #209 passed with stage
in 50 seconds
......@@ -13,6 +13,19 @@ $labels = array();
$tags = array();
$descriptions = array();
$rawtags = $db->getAllPublicTags();
$alltags = array();
foreach( $rawtags as $tgs) {
$etags = explode(" ", $tgs);
foreach( $etags as $tgs2) {
array_push($alltags, $tgs2);
}
}
$alltags = array_count_values($alltags);
arsort($alltags);
$popularTags = array_slice($alltags, 0, 5);
if(isset($_GET['type'])) {
$type = $_GET['type'];
}
......@@ -154,6 +167,21 @@ require_once "./inc/php/buildHeader.php";
</div>
<br/>
<div class="row">
<div class="col-12">
<h3 >Top public tags :</h3>
<?php
foreach ($popularTags as $key => $value){
echo '<span class="badge"><h6>'.$key.'</h6></span>';
}
?>
</div>
</div>
<br/><br/>
<div class="row">
......
......@@ -180,6 +180,16 @@ class DBquery
return $results;
}
public function getAllPublicTags() {
$sql = "SELECT tags FROM `Container` WHERE tags <> '' AND visibility = 1;";
$result = mysqli_query($this->dbh, $sql);
$results = array();
while($row = mysqli_fetch_assoc($result)){
array_push($results, $row['tags']);
}
return $results;
}
public function getContainers($type, $author, $labels, $tags, $descriptions) {
$sql = "SELECT * FROM `Container`";
......
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