Можно конечно советовать всем пользователям разрешать в браузере показ всплывающих окон с вашего сайта, а можно пойти другим путём, сделать сообщение в модальном окне.
Источник: http://www.electric-house.ru/forum/view ... 146#p34146
Нам потребуется небольшая правка скрипта, установленного в overall_header.html и CSS оформление модального окна в виде конверта на jQuery.
Открываем шаблон overall_header.html, ищем:
Код: Выделить всё
<script type="text/javascript">
// <![CDATA[
var jump_page = '{LA_JUMP_PAGE}:';
var on_page = '{ON_PAGE}';
var per_page = '{PER_PAGE}';
var base_url = '{A_BASE_URL}';
var style_cookie = 'phpBBstyle';
var style_cookie_settings = '{A_COOKIE_SETTINGS}';
var onload_functions = new Array();
var onunload_functions = new Array();
<!-- IF S_USER_PM_POPUP -->
if ({S_NEW_PM})
{
var url = '{UA_POPUP_PM}';
window.open(url.replace(/&/g, '&'), '_phpbbprivmsg', 'height=225,resizable=yes,scrollbars=yes, width=400');Код: Выделить всё
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
Две последних строки комментируем или удаляем:
Код: Выделить всё
//var url = '{UA_POPUP_PM}';
//window.open(url.replace(/&/g, '&'), '_phpbbprivmsg', 'height=225,resizable=yes,scrollbars=yes, width=400');Вместо них, или после них, ставим:
Код: Выделить всё
$(document).ready(function() {
$("body").append("<div id='form_popuppm'><div class='jq_popuppm'><p class='close_win'><a href='' class='close' onClick='$(\"#form_popuppm\").hide()' title='{L_CLOSE_WINDOW}'>[x]</a></p><p class='new_message'><b>Вам пришло новое личное сообщение!</b></p><p class='click_view'><b><a href='ucp.php?i=pm&folder=inbox' class='view' title='{L_GO}'>{L_GO}</a></b></p><br /><p style='font-size: 1.2em; text-align: center'>{PRIVATE_MESSAGE_INFO}</p><cite>http://www.electric-house.ru</cite></div></div>");
$("#form_popuppm").hide();
$("#form_popuppm").show(1000);
});
Код: Выделить всё
/* Popup PM */
#form_popuppm {
overflow: hidden;
width: 530px;
height: 446px;
position: fixed;
top: 0px;
left: 0;
-webkit-transition: all 1s ease-in-out .3s;
-moz-transition: all 1s ease-in-out .3s;
-o-transition: all 1s ease-in-out .3s;
transition: all 1s ease-in-out .3s;
}
#form_popuppm:before {
content:"";
position: absolute;
bottom: 128px;
left: 0px;
background: url("http://www.stroi-help.ru/forum/images/popuppm-before.png");
width: 530px;
height: 316px;
}
#form_popuppm:after {
content:"";
position: absolute;
bottom: 0px;
left: 0;
background:url("http://www.stroi-help.ru/forum/images/popuppm-after.png");
width: 530px;
height: 260px;
}
#form_popuppm.hide:after, #form_popuppm.hide:before {
display: none;
}
#form_popuppm:hover {
height: 576px;
top: -100px;
}
.jq_popuppm {
background: url("http://www.stroi-help.ru/forum/images/popuppm-letter_bg.png") repeat 0 0 #f7f2ec;
position: relative;
top: 200px;
overflow: hidden;
height: 200px;
width: 400px;
margin: 0px auto;
padding: 20px;
border: 1px solid #fff;
border-radius: 3px;
-moz-border-radius: 3px; -webkit-border-radius: 3px;
box-shadow: 0px 0px 3px #9d9d9d, inset 0px 0px 27px #fff;
-moz-box-shadow: 0px 0px 3px #9d9d9d, inset 0px 0px 14px #fff;
-webkit-box-shadow: 0px 0px 3px #9d9d9d, inset 0px 0px 27px #fff;
-webkit-transition: all 1s ease-in-out .3s;
-moz-transition: all 1s ease-in-out .3s;
-o-transition: all 1s ease-in-out .3s;
transition: all 1s ease-in-out .3s;
}
#form_popuppm:hover .jq_popuppm {
height: 330px;
}
.jq_popuppm p.close_win {
text-align: right;
}
.jq_popuppm a.close {
font-size: 10px;
}
.jq_popuppm p.click_view {
text-align: center;
}
.jq_popuppm a.view {
font-size: 13px;
}
.jq_popuppm p.new_message {
margin-top: 20px;
text-align: center;
font-size: 1.3em;
}
.jq_popuppm cite {
font-size: 12px;
text-align: center;
display: block;
margin-top: 100px;
}
