Skip to Content Skip to Menu

🌟Discover the Joomla AI Plugin that wrote its own story! - CB Editor Assistant 1.1now for Joomla 3, 4 & 5!
✍️ 5-Day Free Trial, then 🎯 save up to 30% with our 🛍️ Intro Offer (First 50 users, ends Dec. 25th)
🌲 Merry Christmas! Great savings on Professional and Developer Memberships! Get 25% off now with code XMAS-2024!

show user-content from database on his tab

  • Michh
  • Michh
  • OFFLINE
  • Posts: 1
  • Thanks: 0
  • Karma: 0
14 years 3 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 or Create an account to join the conversation.

  • nant
  • nant
  • OFFLINE
  • Posts: 12339
  • Thanks: 1467
  • Karma: 877
14 years 3 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 or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum