We are no longer offering accounts on this server. Consider https://gitlab.freedesktop.org/ as a place to host projects.

Commit bebd0c87 authored by Mike Sheldon's avatar Mike Sheldon

Ensure that artist tag clouds only show free artists (e.g. when showing...

Ensure that artist tag clouds only show free artists (e.g. when showing artists tagged with a specific tag)
parent ffa4d05f
......@@ -40,8 +40,14 @@ class TagCloud {
if (!is_string($table)) return false;
if (!is_integer($limit)) return false;
$sizes = array('xx-large', 'x-large', 'large', 'medium', 'small', 'x-small', 'xx-small');
$query = 'SELECT ' . $field . ', count(*) AS count FROM ' . $table;
$query .= (!is_null($constraint)) ? ' WHERE ' : null;
if($field == 'artist') {
$query = 'SELECT ' . $field . ', count(*) AS count FROM ' . $table . ' INNER JOIN artist ON ' . $table . '.' . $field . ' = artist.name '
. ' WHERE artist.streamable = 1';
$query .= (!is_null($constraint)) ? ' AND ' : null;
} else {
$query = 'SELECT ' . $field . ', count(*) AS count FROM ' . $table;
$query .= (!is_null($constraint)) ? ' WHERE ' : null;
}
if ($constrained_field) {
$query .= (!is_null($constraint)) ? $constrained_field . ' = ' . $adodb->qstr($constraint) : null;
} elseif ($field == 'track') {
......
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