исправление бага с оповещанием в плагине
открыть winksend.php
заменить всё содержимое на:
PHP:
<?php
$page = "winksend";
include "header.php";
if( (!$user->user_exists && !$setting['setting_permission_wink']) || ($user->user_exists && (1 & ~(int)$user->level_info['level_wink_allow'])) )
{
$page = "error";
$smarty->assign('error_header', 639);
$smarty->assign('error_message', 656);
$smarty->assign('error_submit', 641);
include "footer.php";
}
$winksend_id = rc_toolkit::get_request('winksend_id');
$winksend = new se_winksend($winksend_id);
if (!$winksend->winksend_exists) {
rc_toolkit::redirect("home.php");
}
if ($_REQUEST['notify']) {
$database->database_query(
"DELETE FROM se_notifys USING se_notifys LEFT JOIN se_notifytypes ON se_notifys.notify_notifytype_id=se_notifytypes.notifytype_id WHERE se_notifys.notify_user_id='"
. $user->user_info['user_id']
. "' AND se_notifytypes.notifytype_name='newwinksend' AND notify_object_id='"
. $winksend_id . "'");
}
if ($_REQUEST['notify']) {
$redirect_url = $url->url_create('winksends', $winksend->winksend_to_user->user_info['user_username']);
rc_toolkit::redirect($redirect_url);
}
$smarty->assign('winksend', $winksend);
include "footer.php";
сохранить файл
далее открыть winksends.php
заменить все содержимое на:
PHP:
<?php
$page = "winksends";
include "header.php";
//rc_toolkit::debug($user);
// DISPLAY ERROR PAGE IF USER IS NOT LOGGED IN AND ADMIN SETTING REQUIRES REGISTRATION
if( (!$user->user_exists && !$setting['setting_permission_wink']) || ($user->user_exists && (1 & ~(int)$user->level_info['level_wink_allow'])) )
{
$page = "error";
$smarty->assign('error_header', 639);
$smarty->assign('error_message', 656);
$smarty->assign('error_submit', 641);
include "footer.php";
}
// DISPLAY ERROR PAGE IF NO OWNER
if($owner->user_exists == 0)
{
$page = "error";
$smarty->assign('error_header', 639);
$smarty->assign('error_message', 828);
$smarty->assign('error_submit', 641);
include "footer.php";
}
$p = rc_toolkit::get_request('p', 1);
$type = rc_toolkit::get_request('type');
$task = rc_toolkit::get_request('task');
$winksend_id = rc_toolkit::get_request('winksend_id');
if ($task == 'delete' && $winksend_id) {
$winksend = new se_winksend($winksend_id);
if ($winksend->winksend_exists and $winksend->winksend_info['winksend_to_user_id'] == $user->user_info['user_id']) {
$winksend->winksend_delete($winksend_id);
//$winksend->winksend_hide();
//rc_toolkit::debug($winksend,'im here');
}
}
//rc_toolkit::debug($owner->user_info['user_id'],"owner->user_info['user_id']");
//rc_toolkit::debug($user->user_info['user_id'],"user->user_info['user_id']");
$winksends_per_page = 10;
$options = array('privacy' => $user);
if ($type == 'sent')
{
$options['user_id'] = $owner->user_info['user_id'];
}
else if ($type == 'received')
{
$options['to_user_id'] = $owner->user_info['user_id'];
}
else
{
$options['related_user_id'] = $owner->user_info['user_id'];
}
$where = "se_winksends.winksend_search='1'";
$se_winksend = new se_winksend(NULL, $options);
$total_winksends = $se_winksend->winksend_total($where);
$page_vars = make_page($total_winksends, $winksends_per_page, $p);
$winksends = array();
if ($total_winksends) {
$winksends = $se_winksend->winksend_list($page_vars[0], $winksends_per_page, "winksend_datecreated DESC", $where);
}
$se_wink = new se_wink();
$most_sent_winks = $se_wink->wink_list(0, 4, "total_winksends DESC", "winksend_search='1' AND winksend_user_id='{$owner->user_info['user_id']}'");
$most_received_winks = $se_wink->wink_list(0, 4, "total_winksends DESC", "winksend_search='1' AND winksend_to_user_id='{$owner->user_info['user_id']}'");
$smarty->assign('most_sent_winks', $most_sent_winks);
$smarty->assign('most_received_winks', $most_received_winks);
$smarty->assign('total_winksends', $total_winksends);
$smarty->assign('winksends', $winksends);
$smarty->assign('p', $page_vars[1]);
$smarty->assign('maxpage', $page_vars[2]);
$smarty->assign('p_start', $page_vars[0]+1);
$smarty->assign('p_end', $page_vars[0]+count($winksends));
$smarty->assign('s', $s);
$smarty->assign('type', $type);
include "footer.php";
не забываем наступать на кнопку спасибо)