- Posts: 32
- Thank you received: 0
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?
17 years 1 month ago - 17 years 1 month ago #7367
by NLkaiser
how to request user posts? was created 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)
( 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.
17 years 1 month ago - 17 years 1 month ago #7398
by NLkaiser
Replied by NLkaiser on topic Re:how to request user posts?
Can some1 thell me what I am doing wrong?
or
But that gives a "Call to a member function setQuery() on a non-object in" error
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.
17 years 1 month ago #7455
by Matias
Replied by Matias on topic Re:how to request user posts?
Add
global $database;
into the beginning of your function.
global $database;
into the beginning of your function.
Please Log in or Create an account to join the conversation.
17 years 1 month ago - 17 years 1 month ago #7515
by NLkaiser
Replied by NLkaiser on topic Re:how to request user posts?
ok the code now looks like this:
it gives this error:
line 113 is:
is thare a other way to request the user point number of a user?
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.
17 years 1 month ago #9711
by Matias
Replied by Matias on topic Re:how to request user posts?
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.
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.
17 years 1 month ago #9882
by NLkaiser
Replied by NLkaiser on topic Re:how to request user posts?
nvm I olready got it
Please Log in or Create an account to join the conversation.
Time to create page: 0.242 seconds