Merge pull request #3966 from rabuzarus/20171122_-_port_tagcloud

A tag cloud widget for the profile page
This commit is contained in:
Hypolite Petovan 2017-11-26 11:16:14 -05:00 committed by GitHub
commit 3fbf2e3bcf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 242 additions and 2 deletions

View file

@ -98,6 +98,8 @@ function profile_content(App $a, $update = 0) {
$category = ((x($_GET,'category')) ? $_GET['category'] : '');
}
$hashtags = (x($_GET, 'tag') ? $_GET['tag'] : '');
if (Config::get('system','block_public') && (! local_user()) && (! remote_user())) {
return login();
}
@ -185,6 +187,7 @@ function profile_content(App $a, $update = 0) {
$a->page['aside'] .= posted_date_widget(System::baseUrl(true) . '/profile/' . $a->profile['nickname'],$a->profile['profile_uid'],true);
$a->page['aside'] .= categories_widget(System::baseUrl(true) . '/profile/' . $a->profile['nickname'],(x($category) ? xmlify($category) : ''));
$a->page['aside'] .= tagcloud_wall_widget();
if (can_write_wall($a,$a->profile['profile_uid'])) {
@ -254,6 +257,11 @@ function profile_content(App $a, $update = 0) {
//$sql_extra .= protect_sprintf(file_tag_file_query('item',$category,'category'));
}
if (x($hashtags)) {
$sql_post_table .= sprintf("INNER JOIN (SELECT `oid` FROM `term` WHERE `term` = '%s' AND `otype` = %d AND `type` = %d AND `uid` = %d ORDER BY `tid` DESC) AS `term` ON `item`.`id` = `term`.`oid` ",
dbesc(protect_sprintf($hashtags)), intval(TERM_OBJ_POST), intval(TERM_HASHTAG), intval($a->profile['profile_uid']));
}
if ($datequery) {
$sql_extra2 .= protect_sprintf(sprintf(" AND `thread`.`created` <= '%s' ", dbesc(datetime_convert(date_default_timezone_get(),'',$datequery))));
}