A Christmas Gift: VM Notifications
Posted January 8th 2012, 8:37pm
Well yes it would. You can add any HTML you wish to it.

For friend request notification: viewtopic.php?t=8467
φ
Posts: 509
Joined: July 9th 2011, 11:00pm
Location: England
Likes Given: 15
Likes Received: 26
A Christmas Gift: VM Notifications
Posted January 9th 2012, 5:20am
Not for PunBB.
φ
Posts: 63
Joined: November 7th 2011, 12:00am
Likes Received: 4
A Christmas Gift: VM Notifications
Posted January 9th 2012, 8:55am
φ
Posts: 509
Joined: July 9th 2011, 11:00pm
Location: England
Likes Given: 15
Likes Received: 26
A Christmas Gift: VM Notifications
Posted January 10th 2012, 12:09am
It works fine, Thanks LGforum.

But with new private messages notification popup, it disappear when i make refresh.
and with friend request notification popup, just it disappear when i click close, and this is good!
so, can i use friend request notification popup code for pop up for PM's too ?

or can you edit this code
 <!-- BEGIN switch_enable_pm_popup -->
<div id="privMsgPopUp">
<a href="/privmsg?folder=inbox">You have new private messages.</a><br /><br />

<span class="closeBtn" onclick="document.getElementById('privMsgPopUp').style.display='none';">Close</span>
</div>
<!-- END switch_enable_pm_popup -->

for that ?
φ
Posts: 63
Joined: November 7th 2011, 12:00am
Likes Received: 4
A Christmas Gift: VM Notifications
Posted January 10th 2012, 2:01am
That's because remember when you had the old private message pop up, it would only pop up when you log in once, it wouldn't pop up every page refresh. It's better that way. You could add a JavaScript to check the pm link on the navbar to display the pop up, but i won't be doing that here.
φ
Posts: 509
Joined: July 9th 2011, 11:00pm
Location: England
Likes Given: 15
Likes Received: 26
A Christmas Gift: VM Notifications
Posted January 10th 2012, 3:00am
Well, what about this idea ? it is a friend request notification but for private message pop up.
    var CopyrightNotice = 'Friend request notification for forumotion phpBB3 and IPB2/Invision boards. Copyright © 2011 by Dion Designs. All Rights Reserved. Use and/or modification of this script is allowed, provided this entire copyright notice remains in the original or modified script. Distribution is not allowed without written consent from Dion Designs.';
var Modification="Slight Modification from LGforum @ AvacWeb.com, for PunBB. Credits to Dion";
function setupbox() {
var z=document.getElementById('privMsgPopUp');
var x=z.firstChild.lastChild.previousSibling.previousSibling.innerHTML;
if (x.indexOf('title="Accept"')>0) {
z.innerHTML='<a href="/privmsg?folder=inbox">You have a new Private Message</a>';
document.getElementById('privMsgPopUp').style.display='block';
}
else { z.innerHTML=""; }
}

$(function() {
x=document.createElement('div');
x.id='privMsgPopUp';
x.style.display='none';
x.innerHTML='<div id="privMsgPopUp"></div><a style="cursor:pointer" class="button2" onclick="$(\'#privMsgPopUp\').fadeOut()">Close</a>';
document.body.insertBefore(x,document.body.firstChild);
$('#privMsgPopUp').load('/privmsg?folder=inbox #main-content .main', function() { setupbox();});
});
φ
Posts: 63
Joined: November 7th 2011, 12:00am
Likes Received: 4
A Christmas Gift: VM Notifications
Posted January 10th 2012, 4:47am
It was a good try but it won't work.
Also, that script would be massive overkill for such a task.
φ
Posts: 509
Joined: July 9th 2011, 11:00pm
Location: England
Likes Given: 15
Likes Received: 26
A Christmas Gift: VM Notifications
Posted January 10th 2012, 7:00am
This is what i did:

1- This code in description


<span id=unl>{USERLINK}</span>


2- this in template:

<!-- BEGIN switch_desc -->
<p id="pun-desc">{switch_desc.SITE_DESCRIPTION}</p>
<!-- END switch_desc -->
<script type="text/javascript">
var CopyrightNotice = 'User info code for forumotion boards. Copyright © 2011 by Dion Designs. All Rights Reserved. Use, modification, and/or distribution of this script is allowed, provided this entire copyright notice remains in the original, copied, or modified script.';

var x=document.getElementById('unl');
x.style.display='none';
var uid=x.childNodes[0].href.substring(x.childNodes[0].href.indexOf('&u=')+3);
var uname=x.childNodes[0].innerHTML;
x.innerHTML='<span id="uid">'+uid+'</span><span id="uname">'+uname+'</span>';
document.body.insertBefore(x,document.body.firstChild);
</script>


3- javascript file (in homepage)


var CopyrightNotice='Visitor Message Notification script for Forumotion Boards. Copyright © by LGforum. All Rights Reserved. Use and  modification of this script is not allowed without this entire copyright notice in the original, copied, or modified script. No distribution without consent.';
$(function(){
var a=new XMLHttpRequest();
a.onreadystatechange=function() {
if (a.readyState==4 && a.status==200) {
var x=a.responseText.indexOf('title="New message" /> by ');
if (x != -1) {
var c=a.responseText.substring(x,a.responseText.indexOf('</a>',x)+4);
var user=c.substring(26,c.length);
var html="<div id='LGnewVM'>Notification: '"+user+"' has left you a Visitor Message!<br><br><span onclick=\"document.getElementById('LGnewVM').style.display='none';\">Close</span></div>";
document.body.innerHTML+=html;
}
}
} a.open("GET","/u" +uid+ "wall",true); a.send(); });


4- the last step this

    #LGnewVM {
position: fixed;
top: 5px; right: 5px;
border: 2px solid #105289;
background: #fff;
border-radius: 6px;
font-size: 13px;
text-align: center;
padding: 10px;
}
#LGnewVM span {
border: 1px solid #000;
background: #CCC;
color: #000;
padding: 3px;
cursor: pointer;
}
#LGnewVM span:hover {
background: #666;
color: #fff;
}



But still doesn't works with PunBB board, why ?
φ
Posts: 63
Joined: November 7th 2011, 12:00am
Likes Received: 4
A Christmas Gift: VM Notifications
Posted January 10th 2012, 8:10am
Becaouse of this:
I said:
Visitor Message Notifications
(for phpbb3 and invision, it might work in other versions... I didn't check)


It wasn't made for PunBB.
And don't quote the whole first post... its just tons to scroll thorugh.
φ
Posts: 509
Joined: July 9th 2011, 11:00pm
Location: England
Likes Given: 15
Likes Received: 26
A Christmas Gift: VM Notifications
Posted January 11th 2012, 9:55am
Great :D
well done...
φ
Posts:
Avatar
Guest
A Christmas Gift: VM Notifications
Posted March 21st 2012, 11:10am
the first post isn't showing !
φ
Posts: 42
Joined: October 11th 2011, 11:00pm
Likes Given: 13
Likes Received: 1

Who is online

Users browsing this forum: No registered users and 1 guest