Bugfix: Now the unseen counter works.
This commit is contained in:
parent
9c37fc320e
commit
75710df61a
1 changed files with 9 additions and 9 deletions
|
@ -56,10 +56,10 @@ function get_forumlist($uid, $showhidden = true, $lastitem, $showprivate = false
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Forumlist widget
|
* @brief Forumlist widget
|
||||||
*
|
*
|
||||||
* Sidebar widget to show subcribed friendica forums. If activated
|
* Sidebar widget to show subcribed friendica forums. If activated
|
||||||
* in the settings, it appears at the notwork page sidebar
|
* in the settings, it appears at the notwork page sidebar
|
||||||
*
|
*
|
||||||
* @param App $a
|
* @param App $a
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
|
@ -111,13 +111,13 @@ function widget_forumlist($a) {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Format forumlist as contact block
|
* @brief Format forumlist as contact block
|
||||||
*
|
*
|
||||||
* This function is used to show the forumlist in
|
* This function is used to show the forumlist in
|
||||||
* the advanced profile.
|
* the advanced profile.
|
||||||
*
|
*
|
||||||
* @param int $uid
|
* @param int $uid
|
||||||
* @return string
|
* @return string
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
function forumlist_profile_advanced($uid) {
|
function forumlist_profile_advanced($uid) {
|
||||||
|
|
||||||
|
@ -153,18 +153,18 @@ function forumlist_profile_advanced($uid) {
|
||||||
* @brief count unread forum items
|
* @brief count unread forum items
|
||||||
*
|
*
|
||||||
* Count unread items of connected forums and private groups
|
* Count unread items of connected forums and private groups
|
||||||
*
|
*
|
||||||
* @return array
|
* @return array
|
||||||
* 'id' => contact id
|
* 'id' => contact id
|
||||||
* 'name' => contact/forum name
|
* 'name' => contact/forum name
|
||||||
* 'count' => counted unseen forum items
|
* 'count' => counted unseen forum items
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function forums_count_unseen() {
|
function forums_count_unseen() {
|
||||||
$r = q("SELECT `contact`.`id`, `contact`.`name`, COUNT(`item`.`unseen`) AS `count` FROM `item`
|
$r = q("SELECT `contact`.`id`, `contact`.`name`, COUNT(*) AS `count` FROM `item`
|
||||||
INNER JOIN `contact` ON `item`.`contact-id` = `contact`.`id`
|
INNER JOIN `contact` ON `item`.`contact-id` = `contact`.`id`
|
||||||
WHERE `item`.`uid` = %d AND `item`.`visible` AND NOT `item`.`deleted`
|
WHERE `item`.`uid` = %d AND `item`.`visible` AND NOT `item`.`deleted` AND `item`.`unseen`
|
||||||
AND `contact`.`network`= 'dfrn' AND (`contact`.`forum` OR `contact`.`prv`)
|
AND `contact`.`network`= 'dfrn' AND (`contact`.`forum` OR `contact`.`prv`)
|
||||||
AND NOT `contact`.`blocked` AND NOT `contact`.`hidden`
|
AND NOT `contact`.`blocked` AND NOT `contact`.`hidden`
|
||||||
AND NOT `contact`.`pending` AND NOT `contact`.`archive`
|
AND NOT `contact`.`pending` AND NOT `contact`.`archive`
|
||||||
|
|
Loading…
Reference in a new issue