Use cases include forum categories for classified ads. So the required behavior here would be to automatically lock a new "for sale" type topic, since for some reasons, e.g. forum rules and terms, you as the forum administrator, do not want replies to be public, but you require that the communication should only be done using personal messages.
Here is the code for the hack:
// automatically lock topic if ( ($this->parent->catid == ΧΧΧ) && (! $this->parent->id ) ) { $this->set ( 'locked', 1 ); $message = $this->get ( 'message' ); $message = "[quote]This topic has been automatically locked. Please send a pm if you are interested[/quote]\r\n" . $message; $this->set ( 'message', $message); }
In the code block above, XXX is the category id of the category which will be affected. The category id can be found from Kunena's administration "Category Manager"
The code above also automatically alters the original post and adds a notification in its beginning. You can of course modify the notification, or remove it completely if you don't want a notification in the beginning of the post.
This hack should be placed in:
components/com_kunena/lib/kunena.posting.class.phpin function:
savePost()immediately after this block of code:
// Fill thread/post related information $this->set ( 'parent', $this->parent->id ); $this->set ( 'thread', $this->parent->thread ); $this->set ( 'catid', $this->parent->catid ); if (! $this->get ( 'time' )) $this->set ( 'time', CKunenaTimeformat::internalTime () );
FANTASTIC !!!! is there possibility to delete a post after xx days?
ReplyDeleteThanks
Ourlife01: Hack: Automatically Lock Topics In Kunena >>>>> Download Now
Delete>>>>> Download Full
Ourlife01: Hack: Automatically Lock Topics In Kunena >>>>> Download LINK
>>>>> Download Now
Ourlife01: Hack: Automatically Lock Topics In Kunena >>>>> Download Full
>>>>> Download LINK NC
Ourlife01: Hack: Automatically Lock Topics In Kunena >>>>> Download Now
ReplyDelete>>>>> Download Full
Ourlife01: Hack: Automatically Lock Topics In Kunena >>>>> Download LINK
>>>>> Download Now
Ourlife01: Hack: Automatically Lock Topics In Kunena >>>>> Download Full
>>>>> Download LINK