Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #11  
Old 02-11-2001, 02:38 PM
Guest
 
Posts: n/a
Default

No.
Reply With Quote
  #12  
Old 02-13-2001, 09:30 AM
Guest
 
Posts: n/a
Default

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
insert above:
Code:
   $DB_site->query("UPDATE privatercvd SET newpm=0 WHERE msgid=$msgid");
index.php:

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'; 
	}
replace with:
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]);
find:
Code:
$lastuserlink = "<a href=\"private.php?action=show&msgid=$lastsent[msgid]&password=$bbpassword\">$lastuser</a>";
insert below:
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>
<?
}
member.php:

find (will be found two times, do it for both!!!):
Code:
$emailonpm=iif($emailonpm=="yes",1,0);
insert below:
Code:
//Popup Hack
$usepopup=iif($usepopup=="yes",1,0);
//End Pop Hack
find:
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
insert:
Code:
,usepopup=$usepopup
find:
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
insert:
Code:
,usepopup
find:
Code:
if ($userinfo[emailonpm]==1) {
    $emailonpmchecked="checked";
    $emailonpmnotchecked="";
  } else {
    $emailonpmchecked="";
    $emailonpmnotchecked="checked";
  }
insert below:
Code:
//Popup Hack
   if ($userinfo[usepopup]==1) {
    $usepopupchecked="checked";
    $usepopupnotchecked="";
  } else {
    $usepopupchecked="";
    $usepopupnotchecked="checked";
  }
  //End Popup Hack
find:
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
insert:
Code:
,usepopup
direct below find:
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
insert:
Code:
,$usepopup
Template pmloggedin

find:
Code:
$newpmconut
replace with:
Code:
$newpms
Template modifyprofile:

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>
insert below:
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:
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 10:06 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.03128 seconds
  • Memory Usage 2,192KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (23)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (2)post_thanks_box
  • (2)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (2)post_thanks_postbit_info
  • (2)postbit
  • (2)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete