A hiba jelenség.
Létrehoztam egy felhasználói csoportot, és hozzáadtam tagokat.
Egy új bejegyzést tettem a hírkategóriákban, amely csak egy felhasználói csoport számára látható és választható.
De minden felhasználó hozzáférhet a védett kategóriához hírek közzétételekor.
Néhány kategóriát csak egy adott csoporthoz tartozó felhasználó számára szeretnék megjeleníteni a hírűrlapon.
A Megoldás:
infusions->news->infusion_db.php
cseréld le ezt
$result = dbquery("SELECT
ns.news_id AS id,
ns.news_subject AS title,
ns.news_news AS content,
ns.news_reads AS views_count,
ns.news_datestamp AS datestamp,
nc.news_cat_id AS cat_id,
nc.news_cat_name AS cat_name,
ni.news_image AS image_main,
ni.news_image_t1 AS image_thumb,
ni.news_image_t2 AS image_thumb2,
nc.news_cat_image AS cat_image,
".(!empty($comments_query) ? $comments_query : '')."
".(!empty($ratings_query) ? $ratings_query : '')."
u.user_id, u.user_name, u.user_status
FROM ".DB_NEWS." AS ns
LEFT JOIN ".DB_NEWS_IMAGES." AS ni > ns.news_start OR ns.news_start = 0)
AND ns.news_draft = 0
AND (".time()." < ns.news_end OR ns.news_end = 0)
AND ".groupaccess('ns.news_visibility')." AND ".groupaccess("nc.news_cat_visibility")." ".(multilang_table("NS") ? "AND ".in_group('news_language', LANGUAGE) : "")."
GROUP BY ns.news_id
ORDER BY ns.news_datestamp DESC LIMIT ".$limit
);
erre.
$result = dbquery("SELECT
ns.news_id AS id,
ns.news_subject AS title,
ns.news_news AS content,
ns.news_reads AS views_count,
ns.news_datestamp AS datestamp,
nc.news_cat_id AS cat_id,
nc.news_cat_name AS cat_name,
ni.news_image AS image_main,
ni.news_image_t1 AS image_thumb,
ni.news_image_t2 AS image_thumb2,
nc.news_cat_image AS cat_image,
".(!empty($comments_query) ? $comments_query : '')."
".(!empty($ratings_query) ? $ratings_query : '')."
u.user_id, u.user_name, u.user_status
FROM ".DB_NEWS." AS ns
LEFT JOIN ".DB_NEWS_IMAGES." AS ni ON ni.news_id=ns.news_id
LEFT JOIN ".DB_NEWS_CATS." AS nc ON nc.news_cat_id = ns.news_cat
LEFT JOIN ".DB_USERS." AS u ON ns.news_name = u.user_id
WHERE (".time()." > ns.news_start OR ns.news_start = 0)
AND ns.news_draft = 0
AND (".time()." < ns.news_end OR ns.news_end = 0)
AND ".groupaccess('ns.news_visibility')." ".(multilang_table("NS") ? "AND ".in_group('news_language', LANGUAGE) : "")."
GROUP BY ns.news_id
ORDER BY ns.news_datestamp DESC LIMIT ".$limit
);
és az infusions->news->classes->news->news.php
protected static function getNewsQuery(array $filters = []) {
$news_settings = self::getNewsSettings();
$cat_filter = self::checkNewsFilter();
$pattern = "SELECT %s(nr.rating_vote) FROM ".DB_RATINGS." AS nr WHERE nr.rating_item_id = n.news_id AND nr.rating_type = 'N'";
$sql_count = sprintf($pattern, 'COUNT');
$sql_sum = sprintf($pattern, 'SUM');
return "SELECT n.*, nc.*, nu.user_id, nu.user_name, nu.user_status, nu.user_avatar , nu.user_level, nu.user_joined,
($sql_sum) AS news_sum_rating,
($sql_count) AS news_count_votes,
(SELECT COUNT(ncc.comment_id) FROM ".DB_COMMENTS." AS ncc WHERE ncc.comment_item_id = n.news_id AND ncc.comment_type = 'N') AS comments_count,
ni.news_image, ni.news_image_t1, ni.news_image_t2
FROM ".DB_NEWS." AS n
LEFT JOIN ".DB_NEWS_IMAGES." AS ni >='".time()."') AND news_draft='0'
".(!empty($filters['condition']) ? "AND ".$filters['condition'] : '')."
GROUP BY ".(!empty($filters['group_by']) ? $filters['group_by'] : 'news_id')."
ORDER BY ".(!empty($filters['order']) ? $filters['order'].',' : '')." news_sticky DESC, ".$cat_filter['order']."
LIMIT ".(!empty($filters['limit']) ? $filters['limit'] : $_GET['rowstart'].",".(!empty($news_settings['news_pagination']) ? $news_settings['news_pagination'] : 12)
);
}
erre.
protected static function getNewsQuery(array $filters = []) {
$news_settings = self::getNewsSettings();
$cat_filter = self::checkNewsFilter();
$pattern = "SELECT %s(nr.rating_vote) FROM ".DB_RATINGS." AS nr WHERE nr.rating_item_id = n.news_id AND nr.rating_type = 'N'";
$sql_count = sprintf($pattern, 'COUNT');
$sql_sum = sprintf($pattern, 'SUM');
return "SELECT n.*, nc.*, nu.user_id, nu.user_name, nu.user_status, nu.user_avatar , nu.user_level, nu.user_joined,
($sql_sum) AS news_sum_rating,
($sql_count) AS news_count_votes,
(SELECT COUNT(ncc.comment_id) FROM ".DB_COMMENTS." AS ncc WHERE ncc.comment_item_id = n.news_id AND ncc.comment_type = 'N') AS comments_count,
ni.news_image, ni.news_image_t1, ni.news_image_t2
FROM ".DB_NEWS." AS n
LEFT JOIN ".DB_NEWS_IMAGES." AS ni ON ni.news_id=n.news_id AND ".(!empty($_GET['readmore']) ? "n.news_image_full_default=ni.news_image_id" : "n.news_image_front_default=ni.news_image_id")."
LEFT JOIN ".DB_USERS." AS nu ON n.news_name=nu.user_id
LEFT JOIN ".DB_NEWS_CATS." AS nc ON n.news_cat=nc.news_cat_id
".(multilang_table("NS") ? "WHERE ".in_group('news_language', LANGUAGE)." AND " : "WHERE ").groupaccess('news_visibility')." AND ".groupaccess("nc.news_cat_visibility")." AND (news_start='0'||news_start<='".time()."')
AND (news_end='0'||news_end>='".time()."') AND news_draft='0'
".(!empty($filters['condition']) ? "AND ".$filters['condition'] : '')."
GROUP BY ".(!empty($filters['group_by']) ? $filters['group_by'] : 'news_id')."
ORDER BY ".(!empty($filters['order']) ? $filters['order'].',' : '')." news_sticky DESC, ".$cat_filter['order']."
LIMIT ".(!empty($filters['limit']) ? $filters['limit'] : $_GET['rowstart'].",".(!empty($news_settings['news_pagination']) ? $news_settings['news_pagination'] : 12)
);
}
Elviekben jól kell most már működnie.
Ja és csak hogy jó legyen.. a letöltéseknél is hasonló a hiba jelenség.