show user-content from database on his tab

13 years 6 months ago #141461 by Michh
Hi, I have a component for questions and would like to show the question from the user on their cb-tab. So that every user can see which specific questions the other user asked or answered. E.g. it schould look like the result of the kunena-forum plugin, where you can see the postings of every single user in detail.

For the answer component I tried the code:

php:
// no direct access
defined('_JEXEC') or die('Restricted access');
$user =& JFactory::getUser();
$userid = $user->get('id');

$query = "SELECT
question
FROM #__answers_questions
WHERE
userid = " . $userid ;
$db =& JFactory::getDBO();
$db->setQuery( $query );
$row = $db->loadObject();
echo $row->question;

As a result I got the first question from the person who was logged in and on every user tab I got the same questions.

In other words:
I log in and post a question. I can see the question on my communit builder tab. Visiting another user´s community builder tab, I see there also my question. That is wrong, because the tab of the other user should only display his question and not my question.

Is there anybody with an idea what went wrong?
Best regards
Micki

Please Log in to join the conversation.

13 years 6 months ago #141462 by nant
[mod note: why on earth was this posted in the CBSubs forum area? - moved to more appropriate forum]

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.150 seconds

Facebook Twitter LinkedIn