Author |
Message |
izone
Involved
![Involved Involved](modules/Forums/images/ranks/4stars.gif)
![](modules/Forums/images/avatars/Animaniacs/Animaniacs_-_Pinky.gif)
Joined: Sep 07, 2004
Posts: 354
Location: Sweden
|
Posted:
Thu Sep 16, 2004 10:01 am |
|
I was looking for a way to make the new pm pop up for user be shown in the first login insted of when the user goes to the forum. (As you know normally when you first go to the forum section you get a pop up for new pm)
And I found this:
Code:
/*****READ ALL OF THE DIRECTIONS CAREFULLY!!!*********
*****MAKE BACKUPS OF YOUR FILES PRIOR TO EDITING*****/
/*************************************************
* phpBB 2.1 Port Popup New PM's Hack *
* *
* Written by: feignofdeath aka Elantra *
* *
* This hack enables the New PM window to popup *
* anywhere in the site that a user browses, *
* and not just in the Forums!!!! *
* *
* Please follow the directions carefully! *
* (hack tested with phpNuke 6.0 & * 2.0.6 port *
* *
* http://webpromod.sourceforge.net *
*************************************************/
modules/Forums/includes/page_header.php:
Replace this line (line 262):
$s_privmsg_new = 1;
With this:
$s_privmsg_new = 0;
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 .= "<s cript language='javas cript'>\n"
."<!--\n"
."var win = window.open('modules.php?name=Private_Messages&popup=1&mode=newpm', '', 'height=225,width=400')"
."//-->\n"
."</s cript>";
}
/////////////////// 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 .= "<s cript language='javas cript'>\n"
."<!--\n"
."var win = window.open('modules.php?name=Private_Messages&popup=1&mode=newpm', '', 'height=225,width=400')"
."//-->\n"
."</s cript>";
}
/////////////////// END OF ALTERNATE BLOCK STEP HACK ///////////////////////////////////
If you have a problem... Post on the boards @ http://webpromod.sourceforge.net
|
But when I do as he says and activate "Who is online" block I get this error:
Code:
Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in /home/SITENAME/public_html/SITENAME/includes/sql_layer.php on line 286
|
(in this message I changed the name of site to SITENAME).
and in this file (sql_layerphp) on line 286 the code is:
Code:
$row = mysql_fetch_row($res);
|
So I don't know how to fix it. Or if anybody has a better way to do it?
I've sent an email to the address in the s cript and dosn't got any answer yet. I use nuke 7,5 withe phpbb 2.0.10.
By the way: there was no modules/Forums/includes/page_header.php insted I find this file in include/page_header.php.
Please help.
Regards
OBS! because of Sentinel is running here I change every s-c-r-i-p-t words to s cript! |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
Raven
Site Admin/Owner
![](modules/Forums/images/avatars/45030c033f18773153cd2.gif)
Joined: Aug 27, 2002
Posts: 17088
|
Posted:
Thu Sep 16, 2004 11:11 am |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
izone
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Thu Sep 16, 2004 12:21 pm |
|
Thank you Raven.
I've added the code and it give me the same error message as before.
What shall I do?
Regards |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
Raven
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Thu Sep 16, 2004 12:29 pm |
|
It should also have displayed the query that would identify the table that has the problem. Did it not? |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
izone
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Thu Sep 16, 2004 12:38 pm |
|
No Raven. I just gott this code:
Code:
Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in /home/iranzon/public_html/iranyad/includes/sql_layer.php on line 286
|
|
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
izone
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Thu Sep 16, 2004 12:43 pm |
|
and in my sql_layer.php file from line 285 is like this:
Code:
case "MySQL":
$row = mysql_fetch_row($res);
echo mysql_error();
return $row;
break;;
|
|
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
Raven
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Thu Sep 16, 2004 12:45 pm |
|
Line 286 is not the issue . Try this. In includes/sql_layer.php, set $sql_debug to 1. Then load the page again. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
izone
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Thu Sep 16, 2004 12:51 pm |
|
Now I get this:
Code:
SQL query: select user_new_privmsg from nuke_users where username='admin'
Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in /home/iranzon/public_html/iranyad/includes/sql_layer.php on line 286
|
Thank you Raven to giving me your time. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
Holbrookau
Hangin' Around
![](modules/Forums/images/avatars/blank.gif)
Joined: Jun 25, 2004
Posts: 32
|
Posted:
Thu Sep 16, 2004 8:51 pm |
|
This mod was written for PHP-Nuke6.0 and uses the old sql layer. You will need to add the variable $dbi to the global line in that block.
In blocks/block-Who_Is_Online.php -
Find:Code:global $user, $cookie, $prefix, $db, $user_prefix;
| Replace it with:Code:global $user, $cookie, $prefix, $db, $user_prefix, $dbi;
|
|
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
izone
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Fri Sep 17, 2004 2:10 am |
|
It works it works...
Thank you very much Raven, Thank you very much Holbrookau!
You are the best! ![Laughing](modules/Forums/images/smiles/icon_lol.gif) |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
|