Show news from a certain user only

Current Version: 2.3.0
Released: 2023-03-19
Forum rules
Before creating a new support thread, please take a look at the board3 Portal FAQ and use the search!
Many questions have already been answered.

Topic author
edux
Active Member
Posts: 1
Joined: 22. May 2023 19:56

Show news from a certain user only

Post by edux »

Hi, I would like to use the news module but showing only the topics from determinated id user.

In news.php, I tried adding a new sql sentence like: AND topic_poster = (user_id), but it didn't work. :cry:

Code: Select all

				
				$sql = 'SELECT COUNT(topic_id) AS num_topics
					FROM ' . TOPICS_TABLE . '
					WHERE ' . $topic_type . '
						AND topic_visibility = ' . ITEM_APPROVED . '
						AND topic_moved_id = 0
						AND topic_poster = 232
						
	
Somebody can I help me? Thanks!

Mimic
Active Member
Posts: 1
Joined: 29. July 2023 10:33

Re: Show news from a certain user only

Post by Mimic »

Try this code, palyoutube vanced.

Code: Select all

$user_id = 232; // Replace this with the desired user ID

$sql = 'SELECT COUNT(topic_id) AS num_topics
        FROM ' . TOPICS_TABLE . '
        WHERE ' . $topic_type . '
            AND topic_visibility = ' . ITEM_APPROVED . '
            AND topic_moved_id = 0
            AND topic_poster = ' . $user_id;
User avatar

Kirk
Dev
Posts: 1954
Joined: 27. July 2010 18:02
phpBB.de User: Kirk

Re: Show news from a certain user only

Post by Kirk »

It doesn't work like that. Several files would have to be changed. This would be a major effort.
Gruß Udo

Return to “Board3 Portal 2.3.x - English Support”