Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
jlopez
wicopa
Commits
d5635cc6
Commit
d5635cc6
authored
Jun 21, 2019
by
jlopez
Browse files
Merge branch 'develop' into 'master'
Develop See merge request
!8
parents
5627fe49
5086e4d5
Pipeline
#209
passed with stage
in 50 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
container.php
View file @
d5635cc6
...
...
@@ -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"
>
...
...
dao/DBquery.php
View file @
d5635cc6
...
...
@@ -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`"
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment