Re: Private Message mod v1.2.2

gezz wrote:

Connorhd: Is it possible to add the "There are new messages" the main page of my site? Similar to this? I've tried doing it myself using:

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

You did this in header.php so I assumed it would work, and well, I assumed wrong.

Thanks in advance for the help.

Hi,

Try this approach, paste this on top of your php file where you want the message to appear, this is my complete header for my .php because I wanted to show even the postings, board stats, my images on the gallery and create a login on my homepage... (you can strip down other portions of this and experiment)

<? 
define('PUN_ROOT', './');
@include PUN_ROOT.'config.php';


//for login issues
$punbb_path = $_SERVER['SCRIPT_FILENAME'];
$punbb_split = explode('/',$punbb_path);
$punbb_page = end($punbb_split);
$punbb_count = substr_count($punbb_path,'/')-2;
$punbb_path = str_repeat('../',$punbb_count).'./';

require PUN_ROOT.'include/common.php';

define('PUN_TURN_OFF_MAINT', 1); // if forums go down the site will not
define('PUN_QUIET_VISIT', 0); // update last visit when outside of the forums

// If PUN isn't defined, config.php is missing or corrupt
if (!defined('PUN'))
    exit('The file \'config.php\' doesn\'t exist or is corrupt. Please run install.php to install PunBB first.');


// Disable error reporting for uninitialized variables
error_reporting(E_ALL);

// Turn off magic_quotes_runtime
set_magic_quotes_runtime(0);


// Get the forum config
$result = $db->query('SELECT * FROM '.$db->prefix.'config') or error('Unable to fetch forum config', __FILE__, __LINE__, $db->error());
while ($cur_config_item = $db->fetch_row($result))
    $pun_config[$cur_config_item[0]] = $cur_config_item[1];

// Make sure we (guests) have permission to read the forums
$result = $db->query('SELECT g_read_board FROM '.$db->prefix.'groups WHERE g_id=3') or error('Unable to fetch group info', __FILE__, __LINE__, $db->error());
if ($db->result($result) == '0')
    exit('No permission');


// Attempt to load the common language file
@include PUN_ROOT.'lang/'.$pun_config['o_default_lang'].'/common.php';
if (!isset($lang_common))
    exit('There is no valid language pack \''.$pun_config['o_default_lang'].'\' installed. Please reinstall a language of that name.');

//
// Converts the CDATA end sequence ]]> into ]]>
//
function escape_cdata($str)
{
    return str_replace(']]>', ']]>', $str);
}
    // Load the index.php language file
    require PUN_ROOT.'lang/'.$pun_config['o_default_lang'].'/index.php';
?>

Then to show the count for your messages and some links, paste the code below:

<?
        $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());
        if ($db->result($result_messages, 0)){
$notify = "<font color=red>You Have <b>".$db->result($result_messages, 0)."</b> New Message(s)</font>";
        }else{
$notify = "(You Have No New Message)";
}
if($pun_user['id'] > 1)
{
  echo "Welcome back <b>".$pun_user['username']."!</b>  ".$notify."<br>";
  echo "<a href=profile.php?id=".$pun_user['id'].">Edit Profile</a> - <a href=search.php?action=show_user&user_id=".$pun_user['id'].">View Your Posts</a> - <a href=message_list.php>Go To Inbox</a> - <a href=login.php?action=out&id=".$pun_user['id'].">Logout</a><br>Last Visit: ".format_time($pun_user['last_visit'])."<br>";
}
else
{
?>
<form id="login" method="post" action="/login.php?action=in" onsubmit="return process_form(this)">
<a href="login.php?action=forget"><b>Forgotten Password</b></a><br>
<input type="hidden" name="form_sent" value="1" />
<input type="hidden" name="redirect_url" value="<?php echo $_SERVER['SCRIPT_NAME'] ?>" />
<input type="text" name="req_username" size="10" maxlength="25" class="login" />
<input type="password" name="req_password" size="10" maxlength="16" class="login" />
<input type="submit" name="login" value="Login" />
</form>
<?
}
?>

That should do the trick...

Note:
This was taken off my board that includes a login box in place of the message box when not logged in as I have coded it so you may need to edit it accordingly to fit in your board...

If you use the complete code, you can also echo some of the portions of the board in your frontpage or any other page, using the header code above, you can try adding a quickjump on your other .php file then

EX. for quickjump drop down

<?
    // Display the "Jump to" drop list
    if ($pun_config['o_quickjump'] == '1')
    {
        // Load cached quickjump
        @include PUN_ROOT.'cache/cache_quickjump_'.$pun_user['g_id'].'.php';
        if (!defined('PUN_QJ_LOADED'))
        {
            require_once PUN_ROOT.'include/cache.php';
            generate_quickjump_cache($pun_user['g_id']);
            require PUN_ROOT.'cache/cache_quickjump_'.$pun_user['g_id'].'.php';
        }
    }
?>

Showing off your gallery randomly on your other .php file

<?php
$result = $db->query('SELECT id, poster, poster_id, message, posted FROM '.$db->prefix.'gallery_img ORDER BY RAND() LIMIT 4') or error('Unable to fetch user data', __FILE__, __LINE__, $db->error());
while ($data = $db->fetch_assoc($result))
{
echo "".'<a href=img/gallery/'.$data['poster_id'].'_'.$data['posted'].'.jpg target=_blank><img src="img/gallery/'.$data['poster_id'].'_thumbs_'.$data['posted'].'.jpg" alt="'.$data['poster'].'  -  '.$data['message'].'" border="0">'."</a> ";
}

?>

and so on and so forth... customizing punbb is endless, it only ends when you are burnt... lol

102

Re: Private Message mod v1.2.2

update of PM is it simple with punbb 1.3 ?!
or its better to wait ?

103 (edited by da3rX 2006-03-21 12:51)

Re: Private Message mod v1.2.2

"Unable to fetch message and user info." when i try to read a PM.
Any ideas what could be wrong?

EDIT: Never mind, i fixed it. Forgot that i had edited the database tongue

Re: Private Message mod v1.2.2

This notice appears on top of each page...

Notice: Undefined index: o_pms_messages in /var/www/free.fr/f/9/deusl3r/punbb/include/pms/header_new_messages.php on line 11


Still nothing to do to prevent that?

105

Re: Private Message mod v1.2.2

[BUG]

this caracter => ' doesnt work in the replay
for exemple "test'test2" became "test"

106

Re: Private Message mod v1.2.2

wenzlerpaul: thanks alot, ill try this tonight to see if it works!

-gezz

107 (edited by seenxu 2006-04-05 18:18)

Re: Private Message mod v1.2.2

I got error message when I install this mod. it says:

File: /mounted-storage/home16a/sub002/sc18484-OWDW/www/punbb/install_mod.php
Line: 62

PunBB reported: Unable to create table messages.

Database reported: Invalid default value for 'owner' (Errno: 1067)

any ideas? how to avoid this error... thx

problem solved, greet goes to Damos on PunBB Resource

Owner is an interger but default value isn't an integer value  ( i have mysql 5.0, maybe don't accept it :-/ )
I change it to :
Code:

owner int(10) NOT NULL DEFAULT '0',
4 & 5 lines after, sender_id and posted have same pb.
Add 0 to default value

108

Re: Private Message mod v1.2.2

seenxu wrote:

I got error message when I install this mod. it says:

File: /mounted-storage/home16a/sub002/sc18484-OWDW/www/punbb/install_mod.php
Line: 62

PunBB reported: Unable to create table messages.

Database reported: Invalid default value for 'owner' (Errno: 1067)

any ideas? how to avoid this error... thx

looks like a permission issue. login as the owner..

109

Re: Private Message mod v1.2.2

but new problem occured.
there is no "PM" link under user icon.
any ideas how to correct it...
thx wink

110

Re: Private Message mod v1.2.2

seenxu wrote:

but new problem occured.
there is no "PM" link under user icon.
any ideas how to correct it...
thx wink

you didn't follow the directions properly. double check them.

111

Re: Private Message mod v1.2.2

Any chance of there being an e-mail notification option with this mod? Thanks. Love it otherwise.

black robe and swill
I believe Anita Hill
judge will rot in hell
it's the song I hate, it's the song I hate

Re: Private Message mod v1.2.2

Zeke wrote:

Any chance of there being an e-mail notification option with this mod? Thanks. Love it otherwise.

Very frequently requested:

hnstmn wrote:

Little Problem in PM::

I am aware when you PM somebody the script will automatically send that someone an email notifying him/her has a private message waiting back at the forum right? My problem is the script is No Longer sending an email anymore??

Can someone help and tell me what (PHP) file or line of code that is causing this to happen?

Would appreciate...

hnstmn wrote:
lament wrote:

no it doesn't email you when you receive a PM.

I wish it did, and in fact a year ago I brought that up..

Thanks for the quick reply and into refreshing my mind that the PM script does not send any email.

And yes, it would be nice if it did like you discribed.

Thanks for the responds...

Connorhd wrote:

It will do in a future version. But i don't plan on releasing one until 1.3

Also see: email notification of PM? on Punres.

Looking for a certain modification for your forum? Please take a look here before posting.

Re: Private Message mod v1.2.2

How can we make sure that the admin gets a copy of each PM?

114

Re: Private Message mod v1.2.2

How can I make the message "There are new messages" appear on the front-page of my site?

Re: Private Message mod v1.2.2

the download link is not working, any ideas where to download it, or when it will be available?

rockblock
jump your block
le parkour

116

Re: Private Message mod v1.2.2

rockblock wrote:

the download link is not working, any ideas where to download it, or when it will be available?

Download here: http://www.mytempdir.com/620351

Re: Private Message mod v1.2.2

minis wrote:
rockblock wrote:

the download link is not working, any ideas where to download it, or when it will be available?

Download here: http://www.mytempdir.com/620351

great man, many thanks

rockblock
jump your block
le parkour

118

Re: Private Message mod v1.2.2

Endre wrote:

How can I make the message "There are new messages" appear on the front-page of my site?

No one?
I've already got the Users online and forum activity on the front page.. would be nice to have PM-info too smile

Re: Private Message mod v1.2.2

Endre wrote:
Endre wrote:

How can I make the message "There are new messages" appear on the front-page of my site?

No one?
I've already got the Users online and forum activity on the front page.. would be nice to have PM-info too smile

Isn't that what this post is talking about?

Looking for a certain modification for your forum? Please take a look here before posting.

120 (edited by coltsivers 2006-04-27 18:37)

Re: Private Message mod v1.2.2

I hacked the code to add the "Preview" option

http://www.punres.org/viewtopic.php?pid=6375#p6375

Re: Private Message mod v1.2.2

Hi, I have problem, because I installed PM, did all of the mods and then my forum was BLANK. My forum is in Polish, , can it be a problem? I couldn't find polish PM. Please help me...!!! cause my users want private messaging badly.

122 (edited by dharmil 2006-04-29 16:35)

Re: Private Message mod v1.2.2

ok i had done some mod ifcations here
this is the new page hting this shows all the new messages instell of all the messages
http://forum.dharmil.info/other.JPG

and a thing that tells you hoew many new messages you have
http://forum.dharmil.info/top.JPG

to see it go to http://forum.dharmil.info/

if any one is intrested in this you can tell me and i will show you how to do it

http://www.dharmil.info/ - My site

http://www.yourarcadesite.1.vg/ - My Arcade, Play 250 games online for free and Save your high score!

http://www.forums.dharmil.info/ - My forums i created using php/mysql still working on them about 15% or more done

123

Re: Private Message mod v1.2.2

I'm not sure if this has been reported before or if it's a known bug, but I have this problem:

I've been using the PM system on my PunBB fora for a while, and I finally wanted to check my "sent messages" section.

But, whenever I click on "Switch to Sent" it always has zero messages there.  I've sent many messages, though.

Any ideas?  Is this common?

Thanks!

124

Re: Private Message mod v1.2.2

Sent messages arn't saved by default.

125

Re: Private Message mod v1.2.2

people on my board are telling me they are getting errors about having a full inbox even when they only have 4 or 5 messages in there. what could be causing this?