The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#11
|
|||
|
|||
![]()
No.
|
#12
|
|||
|
|||
![]()
Well, there is one...I made it yesterday and it's not checked for absolute Cross Browser Compatibility yet. The implementation of this Hack isn't perfect yet, too...but it 's doing a fine job here on a vB 1.1.5(Hm, could be done with templates...some lines could be optimized...). This Hack doesn't only add the requested Popup - in the browser window itself, it can be moved or closed, it also changes the routine, the New PM's are counted. The problem I see here is that in the normal PM Hack they are counted based on $bblastvisit...hm, but if I read a New (yet unread) PM it will still show up as New PM in $pmloggedin...So I added an extra Field to fix this problem, it get's 1 - New PM - by default, now if you read the PM this field is set to 0 - Old PM. Now you see only unread PM's as new PM's in $pmloggedin...Because this field has 1 as default you should do a query (update privatercvd set pmnew=0 where pmnew=1) after you've installed my Hack to set all existing PM's to 0.
I've also included a new Option in the profile, so that each Member can choose if he likes to be notified by this Popup when New PM's are there. So, here are the instructions (hey, forgive me if they are not perfect ![]() Insert new filed in Table privatercvd: newpm SMALLINT(1),DEAFULT(1) Insert new Filed in Table user: usepopup SMALLINT(1),DEFAULT(1) Now we gotta do some changes on the following files: private.php, member.php und index.php private.php: find: Code:
} #end show Code:
$DB_site->query("UPDATE privatercvd SET newpm=0 WHERE msgid=$msgid"); find: Code:
$newpmcounta = $DB_site->query_first("SELECT COUNT(msgid) AS msgid FROM privatercvd WHERE toid=$bbuserid AND UNIX_TIMESTAMP(datetime)>$bblastvisit"); $newpmcount = $newpmcounta[msgid]; if ($newpmcount == 0) { $lightbulb = 'images/off.gif'; } else { $lightbulb = 'images/on.gif'; } Code:
$newpm = $DB_site->query_first("SELECT COUNT(msgid) AS msgid FROM privatercvd WHERE toid=$bbuserid AND newpm=1"); $newpms = $newpm[msgid]; $usepop = $DB_site->query_first("SELECT usepopup FROM user WHERE userid=$bbuserid"); $usepopup = trim($usepop[usepopup]); Code:
$lastuserlink = "<a href=\"private.php?action=show&msgid=$lastsent[msgid]&password=$bbpassword\">$lastuser</a>"; Code:
if ($usepopup==1 and $newpms>0) { ?> <div id="showimage" style="position:absolute;width:250px;left:250;top:250"> <table border="1" bordercolor="#ff6600" width="250" bgcolor="#143f70" cellspacing="0" cellpadding="2"> <tr><td width="100%"><table border="0" width="100%" cellspacing="0" cellpadding="0" height="36"> <tr><td onMousedown="initializedragie()" style="cursor:hand" width="100%"><ilayer width="100%" onSelectStart="return false"> <layer width="100%" onMouseover="dragswitch=1;drag_dropns(showimage)" onMouseout="dragswitch=0"><font face="Verdana" color="#FFFFFF" size="+1"><b>PN Benachrichtigung</b></font></layer></ilayer></td> <td style="cursor:hand"><a href="#" onClick="hidebox();return false"><img src="images/cross.gif" width="16" height="14" border=0></a></td></tr><tr><td width="100%" bgcolor="#FFFFFF" style="padding:4px" colspan="2"> <small><b><font face="Verdana" size="1">Hello <? echo ($username); ?>,</b><br>You've got <b><? echo ($newpms); ?></b> new PM's. The last PM came from <b><? echo ($lastuser); ?></b>. Click <b><a href="private.php?action=show&msgid=<? echo ($lastsent[msgid]); ?>&password=<? echo ($bbpassword); ?>">here</a></b>, to go directly to this message - or <b><a href="private.php">here</a></b>, to go to your PM Box.</small> </td></tr></table></td></tr></table></div> <? } find (will be found two times, do it for both!!!): Code:
$emailonpm=iif($emailonpm=="yes",1,0); Code:
//Popup Hack $usepopup=iif($usepopup=="yes",1,0); //End Pop Hack Code:
$DB_site->query("UPDATE user SET birthday='$birthday',password='".addslashes($password)."',email='".addslashes($email)."',homepage='".addslashes($homepage)."',icq='".addslashes($icq)."',aim='".addslashes($aim)."',yahoo='".addslashes($yahoo)."',biography='".addslashes($biography)."',signature='".addslashes($signature)."',adminemail=$adminemail,showemail=$showemail,invisible=$invisible,cookieuser=$cookieuser,daysprune=$prunedays,timezoneoffset=$timezoneoffset,emailnotification=$emailnotification,receivepm=$receivepm,emailonpm=$emailonpm Code:
,usepopup=$usepopup Code:
$userinfo=$DB_site->query_first("SELECT birthday,email,password,homepage,icq,aim,yahoo,biography,signature,adminemail,showemail,invisible,cookieuser,daysprune,timezoneoffset,emailnotification,receivepm,emailonpm Code:
,usepopup Code:
if ($userinfo[emailonpm]==1) { $emailonpmchecked="checked"; $emailonpmnotchecked=""; } else { $emailonpmchecked=""; $emailonpmnotchecked="checked"; } Code:
//Popup Hack if ($userinfo[usepopup]==1) { $usepopupchecked="checked"; $usepopupnotchecked=""; } else { $usepopupchecked=""; $usepopupnotchecked="checked"; } //End Popup Hack Code:
$DB_site->query("INSERT INTO user (birthday,userid,username,password,email,homepage,icq,aim,yahoo,biography,signature,adminemail,showemail,invisible,usertitle,joindate,canpost,cookieuser,daysprune,lastvisit,lastactivity,usergroupid,timezoneoffset,emailnotification,receivepm,emailonpm Code:
,usepopup Code:
('$birthday',NULL,'".addslashes($username)."','".addslashes($password)."','".addslashes($email)."','".addslashes($homepage)."','".addslashes($icq)."','".addslashes($aim)."','".addslashes($yahoo)."','".addslashes($biography)."','".addslashes($signature)."',$adminemail,$showemail,$invisible,'".addslashes($usertitle)."',".time().",1,$cookieuser,$prunedays,".time().",".time().",$newusergroupid,$timezoneoffset,$emailnotification,$receivepm,$emailonpm Code:
,$usepopup find: Code:
$newpmconut Code:
$newpms find: Code:
<TR bgcolor="#DEDEDE"> <TD><normalfont><B>eMail Benachrichtigung bei Privaten Nachrichten (PMs)</B></normalfont><br> <smallfont>W?hlst Du diese Option, dann erh?lst Du eine Email, wenn Dir jemand eine Private Nachricht hinterlassen hat.</smallfont></TD> <TD><normalfont><INPUT TYPE="RADIO" NAME="emailonpm" VALUE="yes" $emailonpmchecked> Ja <INPUT TYPE="RADIO" NAME="emailonpm" VALUE="no" $emailonpmnotchecked> Nein</normalfont> </TD></tr> Code:
<!-- Popup Hack --> <TR bgcolor="#DEDEDE"> <TD><normalfont><B>Auf neue PN's via Popup Benachrichtigung hinweisen?</B></normalfont><br> <smallfont>Bitte w?hle hier aus, ob Du bei neuen privaten Nachrichten sobald Du das Forum oder die Startseite betrittst mittles eines Popupfensters hingewiesen werden willst.</smallfont></TD><TD><normalfont><INPUT TYPE="RADIO" NAME="usepopup" VALUE="yes" $usepopupchecked> Ja<INPUT TYPE="RADIO" NAME="usepopup" VALUE="no" $usepopupnotchecked> Nein</normalfont> </TD></tr> <!-- Popup Hack --> In your Head include the following script: Code:
<script language="JavaScript1.2"> //drag drop function for NS 4//// ///////////////////////////////// var dragswitch=0 var nsx var nsy var nstemp function drag_dropns(name){ 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 IE 4+//// ///////////////////////////////// var dragapproved=false function drag_dropie(){ if (dragapproved==true){ document.all.showimage.style.pixelLeft=tempx+event.clientX-iex document.all.showimage.style.pixelTop=tempy+event.clientY-iey return false } } function initializedragie(){ iex=event.clientX iey=event.clientY tempx=showimage.style.pixelLeft tempy=showimage.style.pixelTop dragapproved=true document.onmousemove=drag_dropie } if (document.all){ document.onmouseup=new Function("dragapproved=false") } ////drag drop functions end here////// function hidebox(){ if (document.all) showimage.style.visibility="hidden" else if (document.layers) document.showimage.visibility="hide" } </script> And here's the pic for the close button: ![]() |
![]() |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|