- Posts: 13
- Thank you received: 0
Kunena 6.2.5 & module Kunena Latest 6.0.7 released
The Kunena team has announce the arrival of Kunena 6.2.5 [K 6.2.5] which is now available for download as a native Joomla extension for J! 4.3.x/4.4.x/5.0.x. This version addresses most of the issues that were discovered in K 6.1 / K 6.2 and issues discovered during the last development stages of K 6.2
Question [Solved] Report to moderator through the PM-system not email
Like others I found that it would be usefull to use the "report to moderator" function through the installed PM system.
After some digging in the source i found that the funtionality is there.
At least for the "Clexus PM" system. I don't know if it is active tough.
For the PM-system I am using "UddeIM" the prepwork has been done. But the final function is not in place.
As seen in the file "\components\com_kunena\template\default\plugin\report\report.php"
at line 184
Below that at line 283 the funtion SendClexusPM() is there.
Is there a wizzard aboard who likes to finish or create the final funtion SendUddeIM()? I am no scriptkiddy outherwise I would finnish it.
Thanks for reading my boring msg :laugh:
Greetings from a rainy Holland
John
___________
I am trying myself now. :S
Is there progres? Oh yes.....
I have changed at line 31 the $type to '1' and the function is executed.
I just have to get the query to the database right.
I will post further progres later :lol:
Please Log in or Create an account to join the conversation.
I made great progress. After some trail and error I got a report out.
UddeIM 1.9 has an API onboard so you can send an IM with just a little coding.
Attached is my \components\com_kunena\template\default\plugin\report\report.php
My coding is not that spectacular, and I had to leave out some blocks of code that didn't respond correctly for my situation.
I am running a localhost to learn. I got some 20 users and the admin is the moderator.
I made the next changes:
At line 32 I added:
I did this because I could not find the place where "type" (line 31) was set
At line 162 I changed:
$sender into $reporter
Because UddeIM uses the id-number and not the name. otherwise the IM originates from "Public-Users" (ID=0)
At line 185 I changed for the correct funtion-call:
This is the function:
When executing collecting the admins-list and the moderators-list from line 99, they turn up empty so there is no recipient. So I hardcoded $admin here.
Perhaps de Devs could incorparate this in the next release. And cleanup some of my coding.
It was a nice puzzle.
Greetings John
Please Log in or Create an account to join the conversation.
I tracked down the way $mod en $admin work.
I could not get the IM out for them.
I found that $mod uses $mod->userid, and $admin uses $amdin->id.
That was one to produce a headacke.
I came up with the next function:
And now where is the catch?
If a mod is an admin too, then he gets a message as mod and one as admin. One message is enough.
How do I check if a mod is or is not an admin?
I have tryed using array_search() but i could not get it to work.
Does anybody have any idee on how to fix this ???
Greetings John
Please Log in or Create an account to join the conversation.
This is a good thing what you are develloping, i have not tested your code, i have just tried to modify a bit your function SendUddeIM(). I do a check on the file uddeim.api.php because in uddeim version before the 1.9, this file doesn't exist. I test if the user if a moderator and like that the pm is send, but i don't know if by default the administrator is set moderator too.
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.
Thank you for the help.
I think my question is not that clear. I will try to explain:
Half of the work has already been done by the original code.
The moderators for the current forum catagory are already known through $mods
The administrators for the site are known through $admins
These two array's are handed down through the code originating from line 100
I need to compare the $mods->userid against the $admin->id
I created a foreach to send to the $admins
I now need a foreach to send to the $mods except if he is an admin.
Otherwise this mod gets double messages.
It should look somthing like this:
This is very simplified but this is what I need. Or rather what I think is needed.
Please Log in or Create an account to join the conversation.
How could I be so dumb. :blush: :blush: :blush:
Trying to develop something with the display-errors off at the serverside.
I noticed it after messing with array-functions.
Meanwhile I already wrote my own search function.
It was a good practice for a former dbase III plus/clipper programmer.
Here it is my solution. If someone can do it simpler using array() stuf be my guest :lol:
The question now is, do you want a Joomla Administrator to receive reports if he is NOT a Moderator. IF not, then cut-out the code you don't need.
@xillibit,
Thanks for your reply. Kick de Devs if you feel like it :lol: , and ask them if they would like to use this in a next release.
One question though:
Where is $type configured in line 31?
Is it hardcoded "0" somwhere or is it changed in the backend?
John
Please Log in or Create an account to join the conversation.
In Kunena 1.5.x series there will have no new features, this thing can be added to Kunena 1.6.0. For the variable $type in line 31, is got by url. But i don't know if it's set in somewhere.
@xillibit,
Thanks for your reply. Kick de Devs if you feel like it :lol: , and ask them if they would like to use this in a next release.
One question though:
Where is $type configured in line 31?
Is it hardcoded "0" somwhere or is it changed in the backend?
John
I haven't yet tested your code.
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.
And about testing, it works for me so take your time.
I hope others will find it useful to
Please Log in or Create an account to join the conversation.
EDIT: dw i fixed it
Please Log in or Create an account to join the conversation.
What was your problem and your fix?
John
Please Log in or Create an account to join the conversation.