Page 1 of 1

Show news from a certain user only

Posted: 22. May 2023 20:07
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!

Re: Show news from a certain user only

Posted: 29. July 2023 10:51
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;

Re: Show news from a certain user only

Posted: 30. July 2023 12:28
by Kirk
It doesn't work like that. Several files would have to be changed. This would be a major effort.