You are missing our premiere tool bar navigation system! Register and use it for FREE!

NukeCops  
•  Home •  Downloads •  Gallery •  Your Account •  Forums • 
Readme First
- Readme First! -

Read and follow the rules, otherwise your posts will be closed
Modules
· Home
· FAQ
· Buy a Theme
· Advertising
· AvantGo
· Bookmarks
· Columbia
· Community
· Donations
· Downloads
· Feedback
· Forums
· PHP-Nuke HOWTO
· Private Messages
· Search
· Statistics
· Stories Archive
· Submit News
· Surveys
· Theme Gallery
· Top
· Topics
· Your Account
Who's Online
There are currently, 160 guest(s) and 0 member(s) that are online.

You are Anonymous user. You can register for free by clicking here
Nuke Cops :: View topic - Pop up Private messages anywhere. [ ]
 Forum FAQ  •  Search  •   •  Memberlist  •  Usergroups   •  Register  •  Profile •    •  Log in to check your private messages  •  Log in

 
Post new topic  Reply to topicprinter-friendly view
View previous topic Log in to check your private messages View next topic
Author Message
mikem
Theme Guru
Theme Guru


Joined: Jan 13, 2003
Posts: 1582

Location: Corn fields of Indiana

PostPosted: Sun Mar 30, 2003 4:00 pm Reply with quoteBack to top

I don't know if anyone is interested in this little trick.
By default, phpBB has a Pop-Up Private message notification built in. However, this ONLY works when you enter the forums.

Here's how to make it so your Pop-Up for PM's work on any page of Nuke.

Credit goes to
feignofdeath aka Elantra
of
http://webpromod.sourceforge.net

Code:
blocks/block-Who_is_online.php  (Note: This block must be on the lefthand side for the popup to appear @ every location, if you don't use this block follow alternate step)

Add this chunk on the line before ?> (line 65)

cookiedecode($user);
$username = $cookie[1];
$result = sql_query("select user_new_privmsg from ".$user_prefix."_users where username='$username'", $dbi);
list($numrow) = sql_fetch_row($result, $dbi);
if ($numrow > 0) {
   $content .= "<script language='javascript'>\n"
             ."<!--\n"
             ."var win = window.open('modules.php?name=Private_Messages&popup=1&mode=newpm', '', 'height=225,width=400')"
             ."//-->\n"
             ."</script>";
}


/////////////////// END OF HACK UNLESS YOU NEED ALTERNATE BLOCK STEP /////////////////////

Alternate Step for 2nd part of hack

first make sure that the block at least has a statement that reads:
global $user, $cookie, $prefix, $dbi, $user_prefix;

this line should be near the top  (normally within the first 10 lines of code)
if not add that line as for this hack needs it.

You should now be able to copy this code into any block you want that shows up in the lefthand side:

cookiedecode($user);
$username = $cookie[1];
$result = sql_query("select user_new_privmsg from ".$user_prefix."_users where username='$username'", $dbi);
list($numrow) = sql_fetch_row($result, $dbi);
if ($numrow > 0) {
   $content .= "<script language='javascript'>\n"
             ."<!--\n"
             ."var win = window.open('modules.php?name=Private_Messages&popup=1&mode=newpm', '', 'height=225,width=400')"
             ."//-->\n"
             ."</script>";
}


/////////////////// END OF ALTERNATE BLOCK STEP HACK ///////////////////////////////////

If you have a problem... Post on the boards @ http://webpromod.sourceforge.net


mikem

_________________
Getting Started | My Projects

Last edited by mikem on Sun Mar 30, 2003 5:33 pm; edited 1 time in total
Find all posts by mikemView user's profileSend private message
sixonetonoffun
Major
Major


Joined: Jan 13, 2003
Posts: 892


PostPosted: Sun Mar 30, 2003 4:45 pm Reply with quoteBack to top

Shouldn't that be changed to something like this?? To avoid the MySQL fetch row result warnings??? (I didn't test this)
Code:


cookiedecode($user);
$username = $cookie[1];
$sql = "select user_new_privmsg from ".$user_prefix."_users where username='$username'";
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$user_new_privmsg = $row[user_new_privmsg];
if ($user_new_privmsg > 0) {
   $content .= "<script language='javascript'>\n"
             ."<!--\n"
             ."var win = window.open('modules.php?name=Private_Messages&popup=1&mode=newpm', '', 'height=225,width=400')"
             ."//-->\n"
             ."</script>";
}

_________________
www.netflake.com
www.glowoptics.com
Find all posts by sixonetonoffunView user's profileSend private message
mikem
Theme Guru
Theme Guru


Joined: Jan 13, 2003
Posts: 1582

Location: Corn fields of Indiana

PostPosted: Sun Mar 30, 2003 5:27 pm Reply with quoteBack to top

probably should be. This code was written for Nuke6.0 with Tom's phpBBport2.0.6, but I have it running as-is on our site running the latest 6.5 release with all patches and it works perfectly.

The uname should defiantely be changed to username...

mikem

_________________
Getting Started | My Projects
Find all posts by mikemView user's profileSend private message
sixonetonoffun
Major
Major


Joined: Jan 13, 2003
Posts: 892


PostPosted: Sun Mar 30, 2003 5:47 pm Reply with quoteBack to top

Edit Ooops

Ok here is what I did for 6.5 maybe someone else would like to too Very Happy

In footer.php after
if (eregi("footer.php",$_SERVER['PHP_SELF'])) {
Header("Location: index.php");
die();
}
Code:

global $user, $cookie, $prefix, $dbi, $user_prefix;
cookiedecode($user);
$username = $cookie[1];
$sql = "select user_new_privmsg from ".$user_prefix."_users where username='$username'";
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$user_new_privmsg = $row[user_new_privmsg];
if ($user_new_privmsg > 0) {
    echo "<script language=\"JavaScript\" src=\"includes/pm.js\"></script>\n";
}

Then upload this file HERE pm.js to your includes directory.

Dunno why I bothered I hate popups in any way shape or form Very Happy
But some people like the pm one for some reason or other Confused

Edit*
Well that don't work for chit in some parts of the site so I guess the gawd dayumed things gotta stay in the block.

_________________
www.netflake.com
www.glowoptics.com
Find all posts by sixonetonoffunView user's profileSend private message
Display posts from previous:      
Post new topic  Reply to topicprinter-friendly view
View previous topic Log in to check your private messages View next 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



Powered by phpBB © 2001, 2005 phpBB Group

Ported by Nuke Cops © 2003 www.nukecops.com
:: FI Theme :: PHP-Nuke theme by coldblooded (www.nukemods.com) ::
Powered by TOGETHER TEAM srl ITALY http://www.togetherteam.it - DONDELEO E-COMMERCE http://www.DonDeLeo.com - TUTTISU E-COMMERCE http://www.tuttisu.it
Web site engine's code is Copyright © 2002 by PHP-Nuke. All Rights Reserved. PHP-Nuke is Free Software released under the GNU/GPL license.
Page Generation: 0.436 Seconds - 70 pages served in past 5 minutes. Nuke Cops Founded by Paul Laudanski (Zhen-Xjell)
:: FI Theme :: PHP-Nuke theme by coldblooded (www.nukemods.com) ::