Kunena 7.0.4 Released

The Kunena team has announce the arrival of Kunena 7.0.4 [K 7.0.4] in stable which is now available for download as a native Joomla extension for J! 5.4.x/6.0.x. This version addresses most of the issues that were discovered in K 6.2 / K 6.3 / K 6.4 and issues discovered during the last development stages of K 7.0

Question how to request user posts?

More
17 years 1 month ago - 17 years 1 month ago #7367 by NLkaiser
What files do you need to include and what variable do you need to use to request how mutch user posts the user has? tnx

( I would like to show kunena posts on the jomsocial profile)
Last edit: 17 years 1 month ago by NLkaiser.

Please Log in or Create an account to join the conversation.

More
17 years 1 month ago - 17 years 1 month ago #7398 by NLkaiser
Can some1 thell me what I am doing wrong?
Code:
$db->setQuery("SELECT posts FROM #__fb_users" . "WHERE userid=" . $user->id);

or
Code:
$database->setQuery("SELECT posts FROM #__fb_users WHERE userid = '$user'"); $db = $database->loadObjectList();

But that gives a "Call to a member function setQuery() on a non-object in" error
Last edit: 17 years 1 month ago by NLkaiser.

Please Log in or Create an account to join the conversation.

More
17 years 1 month ago #7455 by Matias
Add

global $database;

into the beginning of your function.

Please Log in or Create an account to join the conversation.

More
17 years 1 month ago - 17 years 1 month ago #7515 by NLkaiser
ok the code now looks like this:
Code:
global $database; // Get CUser object $user = CFactory::getUser( $userid ); $database->setQuery("SELECT posts FROM #__fb_users WHERE userid = '$user'"); $db = $database->loadObjectList();

it gives this error:
Code:
Catchable fatal error: Object of class CUser could not be converted to string in /www/components/com_community/templates/bubble/profile.index.php on line 113

line 113 is:
Code:
$database->setQuery("SELECT posts FROM #__fb_users WHERE userid = '$user'");

is thare a other way to request the user point number of a user?
Last edit: 17 years 1 month ago by NLkaiser.

Please Log in or Create an account to join the conversation.

More
17 years 1 month ago #9711 by Matias
That's not the right line.

Look at: /www/components/com_community/templates/bubble/profile.index.php line 113: there you are trying to convert object to a string.

Please Log in or Create an account to join the conversation.

More
17 years 1 month ago #9882 by NLkaiser
nvm I olready got it :P

Please Log in or Create an account to join the conversation.

Time to create page: 0.242 seconds