timbios Posted February 14, 2015 Report Share Posted February 14, 2015 Заходим в /system/modules/messages.php и ищем следующие строки: mozg_clear_cache_file('user_'.$for_user_id.'/im'); mozg_create_cache('user_'.$for_user_id.'/im_update', '1'); и ниже вставляем://Вставляем событие в моментальные оповещания $row_owner = $db->super_query("SELECT user_last_visit FROM `".PREFIX."_users` WHERE user_id = '{$for_user_id}'"); $update_time = $server_time - 70; if($row_owner['user_last_visit'] >= $update_time){ $db->query("INSERT INTO `".PREFIX."_updates` SET for_user_id = '{$for_user_id}', from_user_id = '{$user_info['user_id']}', type = '8', date = '{$server_time}', text = '{$msg}', user_photo = '{$user_info['user_photo']}', user_search_pref = '{$user_info['user_search_pref']}', lnk = '/messages'"); mozg_create_cache("user_{$for_user_id}/updates", 1); } Далее заходим в /system/modules/im.php и ищем следующий код: $check_im_2 = $db->super_query("SELECT iuser_id FROM ".PREFIX."_im WHERE iuser_id = '".$for_user_id."' AND im_user_id = '".$user_id."'"); if(!$check_im_2) $db->query("INSERT INTO ".PREFIX."_im SET iuser_id = '".$for_user_id."', im_user_id = '".$user_id."', msg_num = 1, idate = '".$server_time."', all_msg_num = 1"); else $db->query("UPDATE ".PREFIX."_im SET idate = '".$server_time."', msg_num = msg_num 1, all_msg_num = all_msg_num 1 WHERE iuser_id = '".$for_user_id."' AND im_user_id = '".$user_id."'"); и ниже вставляем://Вставляем событие в моментальные оповещания $row_owner = $db->super_query("SELECT user_last_visit FROM `".PREFIX."_users` WHERE user_id = '{$for_user_id}'"); $update_time = $server_time - 70; if($row_owner['user_last_visit'] >= $update_time){ $db->query("INSERT INTO `".PREFIX."_updates` SET for_user_id = '{$for_user_id}', from_user_id = '{$user_info['user_id']}', type = '8', date = '{$server_time}', text = '{$msg}', user_photo = '{$user_info['user_photo']}', user_search_pref = '{$user_info['user_search_pref']}', lnk = '/messages'"); mozg_create_cache("user_{$for_user_id}/updates", 1); } Теперь идём в админку и редактируем main.tplИщем:else if(row[0] == 4) uTitle = 'Новый комментарий к заметке'; и ниже вставляем: else if(row[0] == 8) uTitle = 'Новое сообщение'; Далее находим:else uTitle = 'Событие'; и ниже вставляем:if(row[0] == 8){ sli = row[6].split('/'); tURL = (location.href).replace('http://' location.host, '').replace('/', '').split('#'); if(!sli[2] && tURL[0] == 'messages') return false; if($('#new_msg').text()) msg_num = parseInt($('#new_msg').text().replace(')', '').replace('(', '')) 1; else msg_num = 1; $('#new_msg').html("<div class="headm_newac" style="margin-left:37px"> " msg_num "</div>"); } Вот и все! 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.