Login
Username: Password:
Remember me

[Sign Up] / [Recover Password]

Theme / Language

Popular
New Torrents
new name
Size: 18.40 MB
Most active
new name
S: 74 L: 3
New Posters
[MOD] Popup MP
Controls ·  Search New posts · Mark unread

You are in: Forum / Forum / v2.08 / v2 Only Mods Complete

Unknown User
2010-01-09 23:21:42
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:&nbsp;&nbsp;<a href=mailbox.php?inbox>$inboxpic</a>&nbsp;&nbsp;<b>(<font color=red>$unreadmail</font>)</b>");

}else{

print("My messages:&nbsp;&nbsp;<a href=mailbox.php>$inboxpic</a>&nbsp;&nbsp;<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:&nbsp;&nbsp;<a href=mailbox.php?inbox>$inboxpic</a>&nbsp;&nbsp;<b>(<font color=red>$unreadmail</font></b>");

}else{

print("My messages:&nbsp;&nbsp;<a href=mailbox.php>$inboxpic</a>&nbsp;&nbsp;<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

Unknown User
2010-01-10 12:08:13
Thanks it's very usefull. I will try it now.

------------------

EDIT: Ouvrez login_block.php et cherchez

CODE

//check for new pm's...................


Code doesnt exist in login_block.php
Unknown User
2010-01-10 19:51:53
"Kasparas, post: 61693":
Thanks it's very usefull. I will try it now.
------------------

EDIT: Ouvrez login_block.php et cherchez

CODE

//check for new pm's...................


Code doesnt exist in login_block.php



Depending on what u have coded in your login-block u may find this code in your header.php  theme

But still cant get it working.
Unknown User
2010-01-10 20:05:57
"kardklub, post: 61702":
Depending on what u have coded in your login-block u may find this code in your header.php  theme

I' tried it in header.php also but mod doesnt work :/
Unknown User
2010-01-10 21:58:17
"Kasparas, post: 61703":
I' tried it in header.php also but mod doesnt work :/

it has put in theme.css

and login blocks is his need to find

$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:&nbsp;&nbsp;<a href=mailbox.php?inbox>$inboxpic</a>&nbsp;&nbsp;<b>(<font color=red>$unreadmail</font>)</b>");

}else{

print("My messages:&nbsp;&nbsp;<a href=mailbox.php>$inboxpic</a>&nbsp;&nbsp;<b>(<font color=green>$unreadmail</font>)</b></center>");

}
Unknown User
2010-01-12 20:19:40
"McGyver, post: 61708":
it has put in theme.css
and login blocks is his need to find

$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:&nbsp;&nbsp;<a href=mailbox.php?inbox>$inboxpic</a>&nbsp;&nbsp;<b>(<font color=red>$unreadmail</font>)</b>");

}else{

print("My messages:&nbsp;&nbsp;<a href=mailbox.php>$inboxpic</a>&nbsp;&nbsp;<b>(<font color=green>$unreadmail</font>)</b></center>");

}



ive added to the login block but it stretches the block across the page and disables my site. When i take out require_once("popup_msg.php"); my site returns back to normal. any ideas.

kard
Unknown User
2010-01-12 20:28:38
"kardklub, post: 61731":
ive added to the login block but it stretches the block across the page and disables my site. When i take out require_once("popup_msg.php"); my site returns back to normal. any ideas.
kard



I worked it out

In popup_msg.php change

require_once ("include/functions.php");

To

require_once ("backend/functions.php");

change the next to lines to this

<link rel="stylesheet" type="text/css" href="<?= $site_config["SITEURL"]; ?>/themes/NB-13/theme.css"> This is my theme change yours to your theme.


<script type="text/javascript" src="<?= $site_config["SITEURL"];  ?>/javascript/popup_msg.js"></script>


Just add this in login_block before "end_block();"

##########5v new pm popup#################

//check for new pm's

$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 = "<center><img style=\"border:none\" alt=\"inbox\" title=\"You Have A New Message\" src=\"images/mp/yesmp.png\">";

}else{

$inboxpic = "<center><img style=\"border:none\" alt=\"inbox\" title=\"No New Messages\" src=\"images/mp/nomp.png\">";

}

if ($unreadmail){

print("<br><center><a href=mailbox.php?inbox>$inboxpic</a><br></center>");

}else{

print("<br><center><a href=mailbox.php>$inboxpic</a><br></center>");

}

//end check for pm's

##############end 5v new pop up############################


Sorted  ;)

Kard
Unknown User
2010-01-12 21:08:12
images/mp/nomp.png\">";

"images/mp/yesmp.png\

have you got these images also

thanks

kard
Unknown User
2010-01-13 11:46:27
"kardklub, post: 61735":
images/mp/nomp.png\">";"images/mp/yesmp.png\

have you got these images also

thanks

kard


newmess.gif
newmess.gif
nonew.gif
nonew.gif
Unknown User
2010-01-13 14:59:47
Thanks very much
Unknown User
2010-01-27 05:55:18
Thank you but young concerns(marigolds). In the div, it is the date of the addition to use him who displays and not a date of addition of the message. A solution?

thank you
Unknown User
2010-01-28 00:09:30
As above speaker.

It would be nice if it was date of message.

Also if there could be a delay when you have closed the pop-up before it comes back again.

Just see the problem when you have X of PM in your inbox and close the popup to answer a PM.

Then it comes back again and you have to close.... and so on..

A little bit annoying but loved this and will love it even more if it could be done as said....
Unknown User
2010-04-06 10:48:18
i dont use on mine site logi_blok.php i use only accoun-login.php how do i  fix that to work whit account-login.php to this addon is awesome need that to for mine site,can any one help me to work whit accoun-login.php pls any one   <_<

thx in advance
Unknown User
2013-02-22 11:40:02
can some 1 make this mod for 2.8V thanks
Unknown User
2013-02-22 18:00:32
just change every mysql_query to SQL_Quey_exec
Users online

No users online

Search



Statistics

    Torrents

  • Tracking: 3
  • Todays torrents: 0
  • Seeders: 0
  • Leechers: 0
  • Peers: 0
  • Downloaded: 89.96 GB
  • Uploaded: 9.86 GB

  • Members

  • We have: 838
  • New today: 0
  • Guest today: 9

  • Online

  • Total online: 2
  • Members: 0
  • Guests online: 2
  • Comments: 3
  • Messages: 1,728