| Author |
Message |
pe5pvb New Member


Joined: Oct 16, 2007 Posts: 14
|
Posted:
Wed Feb 13, 2008 4:35 am |
|
I added an extra feature to the Block-User_info.php. It will show a popup when you have a new message. Please don't forget to update your language file when adding this.
How to install:
1. Open Block-User_info.php and add these lines at the end of the settings. (before "You should not need to modify anything below this line")
| Code: | $pm_notify_dropin = TRUE; //Notify users of private message by using a javascript drop box
$pm_dropin_once = FALSE; //If set to true, users will only be notified of private messages once per visit
$dropin_bgcolor = '#EEEEEE'; //Set background color of drop box
$dropin_bordercolor = '#4C44BA'; //Set border color of drop box |
2. Find "$content .= '<img src="images/blocks/email-y.gif"" and add this code before this line:
| Code: | ////////////////Drop box for new Private Message added by Murdock/////////
if ($pm_notify_dropin && $newpms > 0)
{
$content .= '
<script type="text/javascript" language="JavaScript1.2">
// Drop-in content box- By Dynamic Drive
// For full source code and more DHTML scripts, visit http://www.dynamicdrive.com
// This credit MUST stay intact for use
var ie=document.all
var dom=document.getElementById
var ns4=document.layers
var calunits=document.layers? "" : "px"
var bouncelimit=32 //(must be divisible by 8)
var direction="up"
function initbox(){
if (!dom&&!ie&&!ns4)
return
crossobj=(dom)?document.getElementById("dropin").style : ie? document.all.dropin : document.dropin
scroll_top=(ie)? truebody().scrollTop : window.pageYOffset
crossobj.top=scroll_top-250+calunits
crossobj.visibility=(dom||ie)? "visible" : "show"
dropstart=setInterval("dropin()",50)
}
function dropin(){
scroll_top=(ie)? truebody().scrollTop : window.pageYOffset
if (parseInt(crossobj.top)<100+scroll_top)
crossobj.top=parseInt(crossobj.top)+40+calunits
else{
clearInterval(dropstart)
bouncestart=setInterval("bouncein()",50)
}
}
function bouncein(){
crossobj.top=parseInt(crossobj.top)-bouncelimit+calunits
if (bouncelimit<0)
bouncelimit+=8
bouncelimit=bouncelimit*-1
if (bouncelimit==0){
clearInterval(bouncestart)
}
}
function dismissbox(){
if (window.bouncestart) clearInterval(bouncestart)
crossobj.visibility="hidden"
}
function truebody(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}
function get_cookie(Name) {
var search = Name + "="
var returnvalue = ""
if (bad_tag.length > 0) {
offset = bad_tag.indexOf(search)
if (offset != -1) {
offset += search.length
end = bad_tag.indexOf(";", offset)
if (end == -1)
end = bad_tag.length;
returnvalue=unescape(bad_tag.substring(offset, end))
}
}
return returnvalue;
}
function dropornot(){';
if ($pm_dropin_once)
{
$content .= '
if (get_cookie("droppedin")==""){
window.onload=initbox
bad_tag="droppedin=yes"
}';
}
else
{
$content .= '
window.onload=initbox
';
}
$content .= '
}
dropornot()
</script>
';
$content .= '
<div id="dropin" style="position:absolute;visibility:hidden;left:300px;top:100px;width:300px;height:50px;background-color:'.$dropin_bgcolor.';border: 1px solid '.$dropin_bordercolor.'">
<div align="right"><a href="#" onClick="dismissbox();return false">['._CLOSE.'] </a></div>
<br />';
if ($newpms == 1) {
$content .= '<a href=modules.php?name=Private_Messages onClick="dismissbox();">'._YOUHAVE.' <strong>'. $newpms .'</strong> '._NEWMESSAGE.'.</a></div>';
} else {
$content .= '<a href=modules.php?name=Private_Messages onClick="dismissbox();">'._YOUHAVE.' <strong>'. $newpms .'</strong> '._NEWMESSAGES.'.</a></div>';
}
}
////////////////End code for Drop box///////// |
You can change some settings if you like in the setup. Good luck with it. This code was taken from the Info_box block and changed a little to work in the Ravennuke User Info block. |
|
|
|
 |
kguske Site Admin

Joined: Jun 04, 2004 Posts: 4678
|
Posted:
Wed Feb 13, 2008 5:00 am |
|
Thanks! Maybe there is a way to make this configurable... |
|
|
|
 |
montego Site Admin

Joined: Aug 29, 2004 Posts: 7330 Location: Arizona
|
Posted:
Wed Feb 13, 2008 7:32 am |
|
Personally, I've never liked the BBtoNuke integration how the pop-up doesn't work outside of BBtoNuke. IMO, it really should be made a part of mainfile or header just like the site message is... but, that is just me... |
|
|
|
 |
kguske Site Admin

Joined: Jun 04, 2004 Posts: 4678
|
Posted:
Wed Feb 13, 2008 11:08 am |
|
It might also be used to have a different approach for notifying an admin that content is pending, instead of showing it in a hard-coded admin block... |
|
|
|
 |
pe5pvb New Member


Joined: Oct 16, 2007 Posts: 14
|
Posted:
Wed Feb 13, 2008 1:06 pm |
|
For sure. It's very easy to modify it for that use. |
|
|
|
 |
rasterman New Member


Joined: Oct 28, 2007 Posts: 3 Location: Luton UK
|
Posted:
Sat Mar 08, 2008 12:01 pm |
|
Can someone please tell me what I need to add to what language file thx. |
|
|
|
 |
montego Site Admin

Joined: Aug 29, 2004 Posts: 7330 Location: Arizona
|
Posted:
Fri Jul 11, 2008 6:31 am |
|
rasterman, it would be under root/languages. Unless the blocks load their own language files (which I have only seen one of mine do that <wink>), any defines would have to go into these "core" language files. |
|
|
|
 |
|
|
|
|