PHP Web Host - Quality Web Hosting For All PHP Applications Just Great Software
  Login or Register
 • Home • Downloads • Your Account • Forums • 

View next topic
View previous topic


Google
 
Web RavenPHPScripts (This Site)
Post new topic   Reply to topic
Author Message
pe5pvb
New Member
New Member


Joined: Oct 16, 2007
Posts: 14

PostPosted: Wed Feb 13, 2008 4:35 am Reply with quote Back to top

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.
View user's profile Send private message
kguske
Site Admin


Joined: Jun 04, 2004
Posts: 4678

PostPosted: Wed Feb 13, 2008 5:00 am Reply with quote Back to top

Thanks! Maybe there is a way to make this configurable...
View user's profile Send private message
montego
Site Admin


Joined: Aug 29, 2004
Posts: 7330
Location: Arizona

PostPosted: Wed Feb 13, 2008 7:32 am Reply with quote Back to top

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...
View user's profile Send private message Visit poster's website
kguske
Site Admin


Joined: Jun 04, 2004
Posts: 4678

PostPosted: Wed Feb 13, 2008 11:08 am Reply with quote Back to top

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...
View user's profile Send private message
pe5pvb
New Member
New Member


Joined: Oct 16, 2007
Posts: 14

PostPosted: Wed Feb 13, 2008 1:06 pm Reply with quote Back to top

For sure. It's very easy to modify it for that use.
View user's profile Send private message
rasterman
New Member
New Member


Joined: Oct 28, 2007
Posts: 3
Location: Luton UK

PostPosted: Sat Mar 08, 2008 12:01 pm Reply with quote Back to top

Can someone please tell me what I need to add to what language file thx.
View user's profile Send private message Visit poster's website
montego
Site Admin


Joined: Aug 29, 2004
Posts: 7330
Location: Arizona

PostPosted: Fri Jul 11, 2008 6:31 am Reply with quote Back to top

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.
View user's profile Send private message Visit poster's website
Display posts from previous:       
Post new topic   Reply to topic

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Forums ©
 

All logos and trademarks in this site are property of their respective owner.
The comments are property of their posters, all the rest © 2002-2008 by Raven
Proud to be listed at Lobo Links Web Directory

You can syndicate our news using the file xml

CSE HTML Validator Helped Clean up This Page! [Valid RSS] valid RSS 2.0 Valid robots.txt Stop Spam Harvesters, Join Project Honey Pot

Website engines core code is © copyright by PHP-Nuke but has been heavily patched and modified by myself and others.
PHP-Nuke is a free software released under the GNU/GPL.


:: fisubice phpbb2 style by Daz :: PHP-Nuke theme by www.nukemods.com ::

:: fisubice Theme Recoded To 100% W3C CSS & HTML 4.01 Transitional Compliance by Raven and 64bitguy ::

:: W3C CSS Compliance Validation :: W3C HTML 4.01 Transitional Compliance Validation ::

zerosum