Topic: Private message mod, new messages notifaction outside punbb

Hi

I have the private message mod installed and it works great.

However I would like to get the "new messages" link (which lights up when you have new messages) into the universal loginbox that my site has.

http://www.amateurillustrator.com

http://www.amateurillustrator.com/forums/

so people know if they have new messages even if they are not on the forums page.

this is my univeral login box code:

<?php

define('PUN_ROOT', './forums/');
include './forums/include/common.php';

global $pun_user;

if ($pun_user['is_guest']) {
echo '<a>Username  &  Password</a>';
  echo "<form color=\"000000\" id=\"login\" method=\"post\" action=\"/forums/login.php?action=in\" onsubmit=\"return process_form(this)\">
<input type=\"hidden\" name=\"form_sent\" value=\"1\" />
<input type=\"hidden\" name=\"redirect_url\" value=\"http://www.amateurillustrator.com/join.php\" />
<input type=\"text\" name=\"req_username\" size=\"25\" maxlength=\"25\" />
<input type=\"password\" name=\"req_password\" size=\"16\" maxlength=\"16\" />
<input type=\"submit\" name=\"login\" value=\"Login\"/>
</form>";

echo '<a href="join.php">Want an account?</a>';

echo '<a>                    </a>';echo '<a>         or          </a>';echo '<a>                   </a>';
echo '<a href="/forums/login.php?action=forget">Forgot your password?</a>';
}

else {
echo "Logged in as: ".pun_htmlspecialchars($pun_user['username'])."
<br>Click <a href=\"/forums/login.php?action=out&id=".$pun_user['id']."&location_out=".$_SERVER['SCRIPT_NAME']."\">here</a> to log out.</div>";
}

?>

now I have tried adding this line to the else bit which is the same line added to header.php to make the new messages link appear inside punbb:

require(PUN_ROOT.'include/pms/header_new_messages.php');

but I get the following errorr:

Parse error: syntax error, unexpected T_REQUIRE in /home/amateuri/public_html/testing.php on line 95


Any help would be great, thanks a lot

cheers

Nick

Punbb w/coppermine and wordpress integrated

see my hack to integrate punbb with wordpress comment system.
Illustration Community

Re: Private message mod, new messages notifaction outside punbb

no takers?

this is my shamelessly putting my post back to the top smile

Punbb w/coppermine and wordpress integrated

see my hack to integrate punbb with wordpress comment system.
Illustration Community

Re: Private message mod, new messages notifaction outside punbb

Make sure the previous line has a ;
Or the else statement is formed like this:
else
{
command 1;
command 2;
}

4 (edited by nickfzx 2006-08-23 11:07)

Re: Private message mod, new messages notifaction outside punbb

yeah ive done that...it doesnt even work if that is the only thing in the else statement actually.

Maybe it is an issue with the mod that it has to be called from a file inside the PUNBB folder, I don't know

all the best

Nick

Punbb w/coppermine and wordpress integrated

see my hack to integrate punbb with wordpress comment system.
Illustration Community

Re: Private message mod, new messages notifaction outside punbb

Can you show the code where the error is?

6 (edited by nickfzx 2006-08-23 13:15)

Re: Private message mod, new messages notifaction outside punbb

http://www.amateurillustrator.com/testindex.php

the code of this page has this line in the right place:
require(./forums/include/pms/header_new_messages.php');

and I make sure there are new messages in my inbox so it should light up.


But nothing.

you would have to be logged in and have new messages to see, so you might want to just take my word for it smile

Punbb w/coppermine and wordpress integrated

see my hack to integrate punbb with wordpress comment system.
Illustration Community

Re: Private message mod, new messages notifaction outside punbb

The code around the require...

Re: Private message mod, new messages notifaction outside punbb

nickfzx, so all the member register runs good with wordpress and coppermine and punbb?

My stuff or my style might sux, but atleast I'm willing to help when I can.
Don't be stupid and help ! We are the stupid one's !!!

Re: Private message mod, new messages notifaction outside punbb

i wish...only coppermine and punbb, I don't know how to integrate punbb and wordpress user tables.

I am not a programmer or anything...I think it would take me a long time to figure out a way of doing this.

Let me know if there's  a way smile

Punbb w/coppermine and wordpress integrated

see my hack to integrate punbb with wordpress comment system.
Illustration Community

10

Re: Private message mod, new messages notifaction outside punbb

there a mod running around i think.. im working on a site right now.
http://bunpai.com
where i took a simple css template and started to mod punbb into it.
use test/test to log in .. i got flashchat working ..

My stuff or my style might sux, but atleast I'm willing to help when I can.
Don't be stupid and help ! We are the stupid one's !!!

11

Re: Private message mod, new messages notifaction outside punbb

i just started this morning doing the moding..
eci talk is the flashchat

My stuff or my style might sux, but atleast I'm willing to help when I can.
Don't be stupid and help ! We are the stupid one's !!!

12

Re: Private message mod, new messages notifaction outside punbb

if ya need any of my code holla!

My stuff or my style might sux, but atleast I'm willing to help when I can.
Don't be stupid and help ! We are the stupid one's !!!

Re: Private message mod, new messages notifaction outside punbb

is that wordpress and punbb, do you have any information on a way to bridge the two?

Punbb w/coppermine and wordpress integrated

see my hack to integrate punbb with wordpress comment system.
Illustration Community

Re: Private message mod, new messages notifaction outside punbb

after a bit of debuging of sorts I have located the line that is causing the problem:

        
echo 'hello';

        // Check for new messages
        $result_messages = $db->query('SELECT COUNT(id) FROM '.$db->prefix.'messages WHERE showed=0 AND owner='.$pun_user['id']) or error('Unable to check for new messages', __FILE__, __LINE__, $db->error());
        
echo 'hello';

the first "hello" appears then this error and no more hello's, what a shame:

hello
Fatal error: Call to a member function on a non-object in /home/amateuri/public_html/testindex.php on line 106

what is a non-object for starters smile

Punbb w/coppermine and wordpress integrated

see my hack to integrate punbb with wordpress comment system.
Illustration Community

Re: Private message mod, new messages notifaction outside punbb

$db is a database object ("object" in an "Object Oriented Programming" or OOP sense).  you can only invoke the query function if you have an instance of the database object, which you must not have.

Re: Private message mod, new messages notifaction outside punbb

do u know how to get an instance?

I really arent great at this smile

Punbb w/coppermine and wordpress integrated

see my hack to integrate punbb with wordpress comment system.
Illustration Community

Re: Private message mod, new messages notifaction outside punbb

If it's in a function, make sure $db is global. Else, make sure common.php is loaded.

Re: Private message mod, new messages notifaction outside punbb

cool thanks for the help I'll spend a bit more time trying to get this stuff to work before i post again

Punbb w/coppermine and wordpress integrated

see my hack to integrate punbb with wordpress comment system.
Illustration Community

Re: Private message mod, new messages notifaction outside punbb

cool soved it...I actually think I had it working a couple of posts back when I could see nothing too its just I hadn't put 'echo' there duh

thanks for all the help...couldnt have done it without you guys smile

Cheers
Nick

Punbb w/coppermine and wordpress integrated

see my hack to integrate punbb with wordpress comment system.
Illustration Community