View this hack in action on
www.noticeboardonline.com
or view my blog for support:
joomlahax.blogspot.com/
Enjoy!
1: post.php (/components/com_kunena/template/default/)
1.1) Find:
Code:
else if ($do == "deletepostnow")
{
if (!$is_Moderator)
1.2) Change to:
Code:
else if ($do == "deletepostnow")
{
$modified_reason = addslashes(mosGetParam($_POST, "modified_reason", null));
$modified_by = $my->id;
$modified_time = CKunenaTools::fbGetInternalTime();
$id = (int) $id;
$database->setQuery("SELECT * FROM #__fb_messages LEFT JOIN #__fb_messages_text ON #__fb_messages.id=#__fb_messages_text.mesid WHERE #__fb_messages.id=$id");
$message1 = $database->loadObjectList();
check_dberror("Unable to load messages.");
$mes = $message1[0];
$userid = $mes->userid;
//Check for a moderator or superadmin
if ($is_Moderator) {
$allowEdit = 1;
}
if ($fbConfig->useredit == 1 && $my->id != "")
{
//Now, if the author==viewer and the viewer is allowed to edit his/her own post the let them edit
if ($my->id == $userid) {
if(((int)$fbConfig->useredittime)==0) {
$allowEdit = 1;
}
else {
$modtime = $mes->modified_time;
if(!$modtime) {
$modtime = $mes->time;
}
if(($modtime + ((int)$fbConfig->useredittime) + ((int)$fbConfig->useredittimegrace)) >= CKunenaTools::fbGetInternalTime()) {
$allowEdit = 1;
}
}
}
}
if (!$allowEdit == 1)
1.1.1) Find:
Code:
else if ($do == "delete")
{
if (!$is_Moderator)
1.1.2) Change to:
Code:
else if ($do == "delete")
{
$modified_reason = addslashes(mosGetParam($_POST, "modified_reason", null));
$modified_by = $my->id;
$modified_time = CKunenaTools::fbGetInternalTime();
$id = (int) $id;
$database->setQuery("SELECT * FROM #__fb_messages LEFT JOIN #__fb_messages_text ON #__fb_messages.id=#__fb_messages_text.mesid WHERE #__fb_messages.id=$id");
$message1 = $database->loadObjectList();
check_dberror("Unable to load messages.");
$mes = $message1[0];
$userid = $mes->userid;
//Check for a moderator or superadmin
if ($is_Moderator) {
$allowEdit = 1;
}
if ($fbConfig->useredit == 1 && $my->id != "")
{
//Now, if the author==viewer and the viewer is allowed to edit his/her own post the let them edit
if ($my->id == $userid) {
if(((int)$fbConfig->useredittime)==0) {
$allowEdit = 1;
}
else {
$modtime = $mes->modified_time;
if(!$modtime) {
$modtime = $mes->time;
}
if(($modtime + ((int)$fbConfig->useredittime) + ((int)$fbConfig->useredittimegrace)) >= CKunenaTools::fbGetInternalTime()) {
$allowEdit = 1;
}
}
}
}
if (!$allowEdit == 1)
2: message.php (/components/com_kunena/template/default_ex/) * NB: default_ex must be the template you are using)
2.1) Find:
Code:
if ($msg_edit) {
echo " | " . $msg_edit;
2.2) Change to:
Code:
if ($msg_edit) {
echo " | " . $msg_edit;
echo " | " . $msg_delete;
3: view.php (/components/com_kunena/template/default_ex/) * NB: default_ex must be the template you are using)
3.1) Find:
Code:
if($allowEdit)
{
$msg_edit = CKunenaLink::GetTopicPostLink('edit', $catid, $fmessage->id , $fbIcons['edit']?'<img src="' . KUNENA_URLICONSPATH . $fbIcons['edit'] . '" alt="Edit" border="0" title="' . _VIEW_EDIT . '" />':_GEN_EDIT);
3.2) Change to:
Code:
if($allowEdit)
{
$msg_delete = CKunenaLink::GetTopicPostLink('delete', $catid, $fmessage->id , $fbIcons['delete']?'<img src="' . KUNENA_URLICONSPATH . $fbIcons['delete'] . '" alt="Delete" border="0" title="' . _VIEW_DELETE . '" />':_GEN_DELETE);
$msg_edit = CKunenaLink::GetTopicPostLink('edit', $catid, $fmessage->id , $fbIcons['edit']?'<img src="' . KUNENA_URLICONSPATH . $fbIcons['edit'] . '" alt="Edit" border="0" title="' . _VIEW_EDIT . '" />':_GEN_EDIT);