Here's a mod tbdev which display a popup for MP unread.
First popup_msg.js create the file and save it in the js file
Quote:var ns4=document.layersvar ie4=document.all
var ns6=document.getElementById&&!document.all
//drag drop function for NS 4////
/////////////////////////////////
var dragswitch=0
var nsx
var nsy
var nstemp
function drag_dropns(name){
if (!ns4)
return
temp=eval(name)
temp.captureEvents(Event.MOUSEDOWN | Event.MOUSEUP)
temp.onmousedown=gons
temp.onmousemove=dragns
temp.onmouseup=stopns
}
function gons(e){
temp.captureEvents(Event.MOUSEMOVE)
nsx=e.x
nsy=e.y
}
function dragns(e){
if (dragswitch==1){
temp.moveBy(e.x-nsx,e.y-nsy)
return false
}
}
function stopns(){
temp.releaseEvents(Event.MOUSEMOVE)
}
//drag drop function for ie4+ and NS6////
/////////////////////////////////
function drag_drop(e){
if (ie4&&dragapproved){
crossobj.style.left=tempx+event.clientX-offsetx
crossobj.style.top=tempy+event.clientY-offsety
return false
}
else if (ns6&&dragapproved){
crossobj.style.left=tempx+e.clientX-offsetx+"px"
crossobj.style.top=tempy+e.clientY-offsety+"px"
return false
}
}
function initializedrag(e){
crossobj=ns6? document.getElementById("showimage") : document.all.showimage
var firedobj=ns6? e.target : event.srcElement
var topelement=ns6? "html" : document.compatMode && document.compatMode!="BackCompat"? "documentElement" : "body"
while (firedobj.tagName!=topelement.toUpperCase() && firedobj.id!="dragbar"){
firedobj=ns6? firedobj.parentNode : firedobj.parentElement
}
if (firedobj.id=="dragbar"){
offsetx=ie4? event.clientX : e.clientX
offsety=ie4? event.clientY : e.clientY
tempx=parseInt(crossobj.style.left)
tempy=parseInt(crossobj.style.top)
dragapproved=true
document.onmousemove=drag_drop
}
}
document.onmouseup=new Function("dragapproved=false")
////drag drop functions end here//////
function hidebox(){
crossobj=ns6? document.getElementById("showimage") : document.all.showimage
if (ie4||ns6)
crossobj.style.visibility="hidden"
else if (ns4)
document.showimage.visibility="hide"
}
Now popup_msg.php file that you put at the root of your FTP
<?php
//===================================//
// Pop-Up Message System by ShadoW69 //
// Updated by TripleH //
//===================================//
// credits to original coder(s) for //
// supplying the js script and //
// basic html structure //
//===================================//
require_once("include/functions.php");
?>
<link rel="stylesheet" type="text/css" href="themes/<?$THEME?>/theme.css">
<script type="text/javascript" src="js/popup_msg.js"></script>
<div id="showimage" style="position:absolute; width:400px; left:400px; top:250px;">
<table border="0" width="400" bgcolor="161617" cellspacing="0" cellpadding="0">
<tr>
<td width="100%" style="border:none;">
<table border="0" width="100%" cellspacing="0" cellpadding="0" height="36px">
<tr>
<td id="dragbar" width="100%" onmousedown="initializedrag(event)">
<ilayer width="100%" onselectStart="return false">
<layer width="100%" onmouseover="dragswitch=1;if (ns4) drag_dropns(showimage)" onmouseout="dragswitch=0">
<font face="Verdana" color="#007777">
<strong>
<small>
<?php
$res = mysql_query("SELECT COUNT(*) FROM messages WHERE receiver=" . $CURUSER["id"] . " and unread='yes' AND location IN ('in','both')") or print(mysql_error());
$arr = mysql_fetch_row($res);
$unread = $arr[0];
echo "<font face=Verdana color=#ffffff>Vous avez $unread nouveau message" . ($unread > 1 ? "s" : "") . "!</font>";
?>
</small>
</strong>
</font>
</layer>
</ilayer>
</td>
<td id="bar" align="center">
<a href="#" onclick="hidebox();return false">
<img src="images/close.png" width="21px" height="20px" border="0">
</a>
</td>
</tr>
<tr>
<td width="100%" id="mainbody" colspan="2">
<?php
$res = mysql_query("SELECT * FROM messages as m LEFT JOIN users as u on m.sender = u.id WHERE m.receiver=" . $CURUSER["id"] . " AND m.unread = 'yes' AND m.location IN ('in','both') LIMIT 1 ") or die("barf!");
while ($arr = mysql_fetch_assoc($res))
{
if (is_valid_id($arr["sender"]))
{
$sender = "<a href=account-details.php?id={$arr['sender']}>" . ($arr["username"]?$arr["username"]:"[Deleted]") . "</a>";
}
else
$sender = "System";
$elapsed = get_elapsed_time(sql_timestamp_to_unix_timestamp($arr["added"]));
$reply = "mailbox.php?inbox";
$delete = "mailbox.php?id={$arr['id']}&type=in";
?>
De <b><?php echo $sender;?></b> le <?php echo $arr["added"];?> [Il y a <?php echo $elapsed;?> ]
<?php if ($arr["unread"] == "yes") { ?>
<b>(<font color=red>NOUVEAU!</font>)</b>
<?php } ?>
<p>
<table class=main width="100%" border=1 cellspacing=0 cellpadding=10>
<tr>
<td class=text id='c_body'>
<?php echo format_comment($arr["msg"]);?>
</td>
</tr>
</table>
</p>
<p>
<table width="100%" border=0>
<tr>
<td class=embedded>
<?php echo ($arr["sender"] ? "<center><a href=$reply><b>Repondre</b></a>" : "<font class=gray><b>Repondre</b></font><center>"); ?>
</td>
</tr>
</table>
</p>
<?php } ?>
</td>
</tr>
</table>
</td>
</tr>
</table>
</div>
<?php
//===================================//
// Pop-Up Message System End //
//===================================//
?>
Open the CSS of your theme.css and add this (change the colors and images based on your theme)
/*CSS popup MP*/
#dragbar {
cursor:hand;
cursor:pointer;
border:none;
border-left:solid #9999CC 1px;
border-top:solid #9999CC 1px;
padding-left:3px;
background:url(images/NB_ftm.gif) repeat-x;
}
#bar {
cursor:hand;
border:none;
border-top:solid #9999CC 1px;
border-right:solid #9999CC 1px;
background:url(images/NB_ftm.gif) repeat-x;
vertical-align:bottom;
}
#mainbody {
background-color: #bbced4;
border:solid #9999CC 1px;
border-top:none;
border-bottom: solid #9999CC 1px;
border-right: solid #9999CC 1px;
padding:10px;
}
#c_body {
border:solid #3d3d3e 1px;
border-top: solid #9999CC 1px;
border-left: solid #9999CC 1px;
}
Ouvrez login_block.php et cherchez
$res = mysql_query("SELECT COUNT(*) FROM messages WHERE receiver=" . $CURUSER["id"] . " and unread='yes' AND location IN ('in','both')") or print(mysql_error());
$arr = mysql_fetch_row($res);
$unreadmail = $arr[0];
if ($unreadmail)
$inboxpic = "<img style=\"border:none\" alt=\"inbox\" title=\"You have a new massage\" src=\"images/mail/newmess.gif\">";
else
$inboxpic = "<img style=\"border:none\" alt=\"inbox\" title=\"No new massages\" src=\"images/mail/nonew.gif\">";
if ($unreadmail){
print("My messages: <a href=mailbox.php?inbox>$inboxpic</a> <b>(<font color=red>$unreadmail</font>)</b>");
}else{
print("My messages: <a href=mailbox.php>$inboxpic</a> <b>(<font color=green>$unreadmail</font>)</b></center>");
}
Replace
$res = mysql_query("SELECT COUNT(*) FROM messages WHERE receiver=" . $CURUSER["id"] . " and unread='yes' AND location IN ('in','both')") or print(mysql_error());
$arr = mysql_fetch_row($res);
$unreadmail = $arr[0];
if ($unreadmail){
require_once("popup_msg.php");
$inboxpic = "<img style=\"border:none\" alt=\"inbox\" title=\"You have a new massage\" src=\"images/mail/newmess.gif\">";
}else{
$inboxpic = "<img style=\"border:none\" alt=\"inbox\" title=\"No new massages\" src=\"images/mail/nonew.gif\">";
}
if ($unreadmail){
print("My messages: <a href=mailbox.php?inbox>$inboxpic</a> <b>(<font color=red>$unreadmail</font></b>");
}else{
print("My messages: <a href=mailbox.php>$inboxpic</a> <b>(<font color=green>$unreadmail</font>)</b></center>");
}
It is a popular set, I wished that when you descend down the index page the popup am
Here close.png has put in images
screenshot