Oh no! Where's the JavaScript?
Your Web browser does not have JavaScript enabled or does not support JavaScript. Please enable JavaScript on your Web browser to properly view this Web site, or upgrade to a Web browser that does support JavaScript.
Not a member yet? Click here to register.
Forgot Password?

Everyone has access to categories of other user groups when posting news

Asked Modified Viewed 147 times
S
surfuser007
S
  • Newbie, joined since
  • Contributed 4 posts on the community forums.
  • Started 2 threads in the forums
  • Started this discussions
asked
Newbie

Hello everyone, please forgive me for using a translation program.
First, I created a user group and added members.
A new one has been created in the news categories, which should only be visible and available for selection by the user group you have just created.
But all users can access the protected category when posting news.

I want show some categorys in the newsform only to user from a specific group.

I use 9.10.30
Thank you for support and have a nice day
Revilo
PostScript and a word to the developers: respect, the best base for people with disabilities for 25 years
P.P.S.: Take a look to Radiostation https://www.rheydt-live.de/ before vote the poll, thank you
Edited by surfuser007 on 03-04-2024 20:31,
0 replies

Poll: What do you think about use PHPFusion for drive a Radiostation ?

    It is a good way [0/0]0 %
    go not [0/0]0 %

1 post

K
karrak
K
karrak 32
Van mi sosem változik..smile
  • Senior Member, joined since
  • Contributed 310 posts on the community forums.
  • Started 94 threads in the forums
  • Answered 1 question
answered
Senior Member

infusions/news/infusion_db.php
replace this
 $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
 );


replace it with this
 $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
 );


é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)
 );
 }


replace it with this
 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)
 );
 }
2 replies

Category Forum

Settings - 9

Labels

None yet

Statistics

  • Views 0 views
  • Posts 1 post
  • Votes 0 votes
  • Topic users 2 members

2 participants

K
K
karrak 32
Van mi sosem változik..smile
  • Senior Member, joined since
  • Contributed 310 posts on the community forums.
  • Started 94 threads in the forums
  • Answered 1 question
S
S
  • Newbie, joined since
  • Contributed 4 posts on the community forums.
  • Started 2 threads in the forums
  • Started this discussions

Notifications

Track thread

You are not receiving notifications from this thread.

Related Questions

Not yet