Kunena 6.0.8 Released (17 Jan 2023)

The Kunena team has announce the arrival of Kunena 6.0.8 [K 6.0.8] which is now available for download as a native Joomla extension for J! 4.2.x. This version addresses most of the issues that were discovered in K 6.0 and issues discovered during the development stages of K 6.0.

This category contains miscellaneous, uncategorised user contributions, (templates, modules, plugins and hacks) relating to older versions of Kunena that are no longer supported.

The topics in this category are for historical interest only. Owing to the structural changes that occurred in K 1.7, many of the ideas in these topics will not work with later versions and, for that reason, the topics are locked.

Question How Write code : $user_origine_id= "USER ID of MESSAGE SOURCE"

More
11 years 1 month ago - 11 years 1 month ago #1 by JSMario
Hello

I started on the API Kunena and Joomla
How to write this code.

$id_user_of_post = 'The ID of the user of the message spirit moderate')

I want to remove points AlphaUserPoints to the "ID of Origin POST" (the user origni) when the moderator delete a message in the forum

I write this, but is dont' work ::

$user_origine_id = $this-> get ('user ID off thread')

Can you corrige me ????!


Very thinks for your good help !!!
Last edit: 11 years 1 month ago by JSMario.

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

More
11 years 1 month ago #2 by xillibit
Hello,

1°) You need ot check if the user which is removing the message is a moderator, there is a function in Kunena to check if an user is a moderator
2°) Then, you can remove points to the user in AUP

I don't provide support by PM, because this can be useful for someone else.

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

More
11 years 1 month ago #3 by JSMario
Yes off course, I know

I know the fonction to test if modérator :
<?php if (CKunenaTools::isModerator($this->my->id)) : ?>


but I don't know this fonction in PHP :
$user_origine_id = "USER ID of MESSAGE"

Can you help me ?

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

  • C0n
  • C0n's Avatar
  • Offline
  • Premium Member
  • Only the strongest will survive
More
11 years 1 month ago - 11 years 1 month ago #4 by C0n
You mean you are trying to grab the ID of the current post or the userid that created the post ?
Code:
$usr_id = $user->get('id'); $postid = JRequest::getVar('id'); echo $postid; //current id of topic / thread being viewed echo $usr_id; //current user id of logged in member
Last edit: 11 years 1 month ago by C0n.

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

More
11 years 1 month ago #5 by JSMario
Is not OK, don't work in the fonction "public function onAfterDelete($message)"


Is possible whith this :

$user_post_origine_id = KunenaFactory::getPOST ($userid);

Can you indicate the good formule ?

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

More
11 years 4 weeks ago #6 by JSMario
I need the ID off the user as POST the message

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

Time to create page: 0.214 seconds