Close the PM Notify bar

Download and support for PhpBB3 PM Notify & Guest Register bar
User avatar
Makis
BBCoder III
BBCoder III
Posts: 91
Joined: 10 Mar 2010, 18:01
BBCodes: 67
Favourite MOD: Welcome On Index
Location: Athens Greece

Close the PM Notify bar

Post by Makis »

Good evening Mr. Stoker its nice have you back again.

I found this mode very useful but I didn’t install it yet because in my board some users don’t have the permission to read pm for some time and for various reasons, so I’m asking you to tell please if and how you can give the option to user to close that pm bar notification without read the pm.

Thanks in advance
User avatar
Stoker
Site Admin
Site Admin
Posts: 3558
Joined: 12 May 2008, 23:26
BBCodes: 239
Favourite BBCode: Anipro
Favourite MOD: PrettyPhoto
Location: Denmark
Contact:

Re: Download PM Notify & Guest Register bar

Post by Stoker »

All these tough questions :)
You need a cookie. I have no plans for this yet. but maybe in the future.
Here is an example on how it is done: http://www.christianbullock.com/2011/ph ... al-notices
Board rules! No PM support
User avatar
Makis
BBCoder III
BBCoder III
Posts: 91
Joined: 10 Mar 2010, 18:01
BBCodes: 67
Favourite MOD: Welcome On Index
Location: Athens Greece

Re: Download PM Notify & Guest Register bar

Post by Makis »

Thank you very much I really appreciate it. :)
User avatar
Stoker
Site Admin
Site Admin
Posts: 3558
Joined: 12 May 2008, 23:26
BBCodes: 239
Favourite BBCode: Anipro
Favourite MOD: PrettyPhoto
Location: Denmark
Contact:

Re: Download PM Notify & Guest Register bar

Post by Stoker »

I have been playing with it tonight, but with no success.
I will see if I can figure it out later.
Board rules! No PM support
User avatar
Makis
BBCoder III
BBCoder III
Posts: 91
Joined: 10 Mar 2010, 18:01
BBCodes: 67
Favourite MOD: Welcome On Index
Location: Athens Greece

Re: Download PM Notify & Guest Register bar

Post by Makis »

Thanks again…I ll be around :reggae:
User avatar
Stoker
Site Admin
Site Admin
Posts: 3558
Joined: 12 May 2008, 23:26
BBCodes: 239
Favourite BBCode: Anipro
Favourite MOD: PrettyPhoto
Location: Denmark
Contact:

Re: Close the PM Notify bar

Post by Stoker »

Okay, here is what to do.
I have tried it on a area51 and it is working :)

Donwload, unzip and upload this folder to your forum:
script.zip
(25.28 KiB) Downloaded 260 times
Open styles/prosilver/template/overall_header.html
Find:

Code: Select all

<script type="text/javascript" src="{T_TEMPLATE_PATH}/forum_fn.js"></script>
add after:

Code: Select all

<script src="{ROOT_PATH}script/jquery-1.4.js" type="text/javascript"></script>
<script src="{ROOT_PATH}script/jquery.cookie.js" type="text/javascript"></script>
<script type="text/javascript">
// <![CDATA[
$(document).ready(function() {
    $("a.cross").click(function() {
        $(".global-notice").fadeOut();
        $.cookie('noticeState', 'hidden', { expires: 3, path: '/'});
    });
    var noticeState = $.cookie('noticeState');
    if(noticeState == 'hidden') {
        $(".global-notice").hide();
    };
});
// ]]>
</script>
Make sure that jquery isnt allready included.

Next step is when the mod is installed.
Find:

Code: Select all

<!-- IF not S_USER_LOGGED_IN and not S_IS_BOT and not S_IN_UCP -->
<div id="info"><div id="infobar">
<a href="{U_REGISTER}"><img style="width: 50px; height: 50px; padding-right: 100px; vertical-align:middle;" alt="" src="{T_THEME_PATH}/images/reg.png" />{L_PMG_WELCOME} {SITENAME}. {L_PMG_REGISTER}<img style="width: 50px; height: 50px; padding-left:100px; vertical-align:middle;" alt="" src="{T_THEME_PATH}/images/reg.png" /></a>
</div></div>
<!-- ENDIF -->

<!-- IF not S_IS_BOT and S_USER_LOGGED_IN and S_USER_PM_POPUP and S_DISPLAY_PM and (S_USER_NEW_PRIVMSG or S_USER_UNREAD_PRIVMSG) -->
<div id="info"><div id="infobar">
<a href="{U_PRIVATEMSGS}"><img style="width:50px; height: 50px; padding-right: 100px; vertical-align:middle;" alt="" src="{T_THEME_PATH}/images/mail.png" />{L_PMG_HELLO} {S_USERNAME} {L_PMG_YOUHAVE} {PRIVATE_MESSAGE_INFO}<!-- IF PRIVATE_MESSAGE_INFO_UNREAD --> {L_PMG_AND} {PRIVATE_MESSAGE_INFO_UNREAD}<!-- ENDIF --><img style="width: 50px; height: 50px; padding-left:100px; vertical-align:middle;" alt="" src="{T_THEME_PATH}/images/mail.png" /></a>
</div></div>
<!-- ENDIF -->
Replace with:

Code: Select all

<!-- IF not S_USER_LOGGED_IN and not S_IS_BOT and not S_IN_UCP -->
<div id="info" class="global-notice"><div id="infobar">
<a href="{U_REGISTER}"><img style="width: 50px; height: 50px; padding-right: 100px; vertical-align:middle;" alt="" src="{T_THEME_PATH}/images/reg.png" />{L_PMG_WELCOME} {SITENAME}. {L_PMG_REGISTER}<img style="width: 50px; height: 50px; padding-left:100px; vertical-align:middle;" alt="" src="{T_THEME_PATH}/images/reg.png" /></a>
</div><a class="cross" href="#">Close</a></div>
<!-- ENDIF -->

<!-- IF not S_IS_BOT and S_USER_LOGGED_IN and S_USER_PM_POPUP and S_DISPLAY_PM and (S_USER_NEW_PRIVMSG or S_USER_UNREAD_PRIVMSG) -->
<div id="info" class="global-notice"><div id="infobar">
<a href="{U_PRIVATEMSGS}"><img style="width:50px; height: 50px; padding-right: 100px; vertical-align:middle;" alt="" src="{T_THEME_PATH}/images/mail.png" />{L_PMG_HELLO} {S_USERNAME} {L_PMG_YOUHAVE} {PRIVATE_MESSAGE_INFO}<!-- IF PRIVATE_MESSAGE_INFO_UNREAD --> {L_PMG_AND} {PRIVATE_MESSAGE_INFO_UNREAD}<!-- ENDIF --><img style="width: 50px; height: 50px; padding-left:100px; vertical-align:middle;" alt="" src="{T_THEME_PATH}/images/mail.png" /></a>
</div><a class="cross" href="#">Close</a></div>
<!-- ENDIF -->
Save, upload and refresh template.

Now you have a Close link on both register and notify bar.
The cookie is set to last 3 days.

Thank to Christian for the guide on his site.
Board rules! No PM support
User avatar
Fire-Fox
BBCoder IV
BBCoder IV
Posts: 275
Joined: 22 Mar 2010, 13:24
Location: Denmark

Re: Close the PM Notify bar

Post by Fire-Fox »

Nice one!

nice to have you back again Stoker :)
User avatar
Makis
BBCoder III
BBCoder III
Posts: 91
Joined: 10 Mar 2010, 18:01
BBCodes: 67
Favourite MOD: Welcome On Index
Location: Athens Greece

Re: Close the PM Notify bar

Post by Makis »

So I have no words to say more than 'thank you' for one nore time :hi:
User avatar
Makis
BBCoder III
BBCoder III
Posts: 91
Joined: 10 Mar 2010, 18:01
BBCodes: 67
Favourite MOD: Welcome On Index
Location: Athens Greece

Re: Close the PM Notify bar

Post by Makis »

I’m back… :twisted:
“Close” doesn’t close the bar, on click just jumps to the top of the page.

Double checked everything :?
User avatar
Stoker
Site Admin
Site Admin
Posts: 3558
Joined: 12 May 2008, 23:26
BBCodes: 239
Favourite BBCode: Anipro
Favourite MOD: PrettyPhoto
Location: Denmark
Contact:

Re: Close the PM Notify bar

Post by Stoker »

It works here, but it can conflict with other jquery scripts.
Post a link to your board and I will have a look.
Board rules! No PM support
Locked