76

Re: Private Message mod v1.2.2

FredrikK wrote:

When installing:

"An error was encountered
File: /customers/brunna.se/brunna.se/httpd.www/install_mod.php
Line: 76

PunBB reported: Unable to add columns to table

Database reported: Duplicate column name 'g_pm' (Errno: 1060)"

What to do? sad

seems like the column is already in the database.

77 (edited by FredrikK 2005-11-12 17:57)

Re: Private Message mod v1.2.2

I'm stupid... it works, nevermind! smile

hej!

78

Re: Private Message mod v1.2.2

How would one add the functionality so that users get an e-mail with the e-mail in their profile when they get a new PM?

79

Re: Private Message mod v1.2.2

sorry bad english

I need som help vid the pm link in main you se what i mean in the picks
I have got in Private Message but not in teh main forum

This is in main forum
http://sweo.se/filer/dump0.JPG


this in pm
http://sweo.se/filer/dump2.JPG

this link a want to show in forum how do a do that plz help

Re: Private Message mod v1.2.2

You must have missed part of the readme, you need to redo the bit that is for viewtopic.php

81 (edited by zamla 2005-11-23 18:49)

Re: Private Message mod v1.2.2

Connorhd wrote:

You must have missed part of the readme, you need to redo the bit that is for viewtopic.php

Thanks it work

one more
how do i get a popup message that tells i got a pm then i logging in the forum like in the other forum

Mvh Zamla

82

Re: Private Message mod v1.2.2

one more
how do i get a popup message that tells i got a pm then i logging in the forum like in the other forum

Mvh Zamla

83

Re: Private Message mod v1.2.2

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...

84

Re: Private Message mod v1.2.2

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..

85

Re: Private Message mod v1.2.2

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...

Re: Private Message mod v1.2.2

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

87

Re: Private Message mod v1.2.2

I wanted an easy way for people to see if they had any new messages, so here is what I did

I have miniportal, so I decided to make it a block, but you could apply the code to anything

First I added a entry to the messages table to store whether or not they have viewed the message yet

ALTER TABLE `pun_messages` ADD `read` TINYINT( 1 ) DEFAULT '0' NOT NULL ;

Make sure you replace pun_messages with whatever your messages table is, if it is different

Second, I modified the template file so it would know I want a block there.

Open up include/functions.php and add the following at the very end of the file:

//
// Generate the messages block
//
function generate_messagesblock()
{
    global $pun_config, $lang_common, $pun_user, $db;
    
    $messages_return = "";
    
    if (!$pun_user['is_guest']) {
        $result = $db->query('SELECT count(*) FROM '.$db->prefix.'messages WHERE status=0 AND owner='.$pun_user['id']) or error('Unable to count messages', __FILE__, __LINE__, $db->error());
        list($num_messages) = $db->fetch_row($result);
        
        $result = $db->query('SELECT count(*) FROM '.$db->prefix.'messages WHERE `read`=0 AND status=0 AND owner='.$pun_user['id']) or error('Unable to count unread messages', __FILE__, __LINE__, $db->error());
        list($num_messages_unread) = $db->fetch_row($result);
        
        $messages_return .= "You currently have <b>".$num_messages."</b> messages, of which ";
        
        if ($num_messages_unread>0) {
            $messages_return .= "<font color=\"red\">";
        }
        
        $messages_return .= "<b>".$num_messages_unread."</b> are new";
        
        if ($num_messages_unread>0) {
            $messages_return .= "</font>";
        }
        
        $messages_return .= ".<br><a href=\"message_list.php\">Click here to view them</a>.";
    } else {
        $messages_return .= "Please log in to check your messaging status.";
    }

    return $messages_return;
}

Then open include/template/main.tpl, and find this:

    <div class="block">
        <h2><span>Menu</span></h2>
        <div class="box">
        <pun_sidelinks>            
        </div>
    </div>

After it, add:

    <div class="block">
        <h2 class="block2"><span>Messages</span></h2>
        <div class="box">
            <div class="inbox">
                <pun_messagesblock>
            </div>
        </div>
    </div>

Then open header.php, and find this:

// START SUBST - <pun_sidelinks>
$tpl_main = str_replace('<pun_sidelinks>','<div class="inbox">'."\n\t\t\t". generate_navlinks()."\n\t\t".'</div>', $tpl_main);
// END SUBST - <pun_sidelinks>

After it, add:

// START SUBST - <pun_messagesblock>
$tpl_main = str_replace('<pun_messagesblock>','<div class="inbox">'."\n\t\t\t". generate_messagesblock()."\n\t\t".'</div>', $tpl_main);
// END SUBST - <pun_messagesblock>

Now open message_list.php, and find this:

    // Do signature parsing/caching
    if (isset($cur_post['signature']) && $pun_user['show_sig'] != '0')
    {
        $signature = parse_signature($cur_post['signature']);
    }

After it, add:

    //Mark it as read
    $result = $db->query('UPDATE '.$db->prefix.'messages SET `read`=1 WHERE id='.$id) or error('UPDATE '.$db->prefix.'messages SET read=1 WHERE `id`='.$id.'Unable to set message as read', __FILE__, __LINE__, $db->error());

And that's it.  Save and upload header.php, message_list.php, include/functions.php, and include/template/main.tpl

Right now message_list.php doesnt make the message title look any different if its unread, I just wanted to keep it simple

If this is completely useless to everyone, sorry :X

88

Re: Private Message mod v1.2.2

I installed this last night. It works great! Awesome mod.

89

Re: Private Message mod v1.2.2

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.

-gezz

90

Re: Private Message mod v1.2.2

is it possible to make to show number of new messages near text "you have new messages". exmple "you have new messages (3)"

Re: Private Message mod v1.2.2

minis wrote:

is it possible to make to show number of new messages near text "you have new messages". exmple "you have new messages (3)"

yup, look at my posting here

http://www.punres.org/viewtopic.php?pid=4734#p4734

92 (edited by minis 2006-02-10 16:32)

Re: Private Message mod v1.2.2

thanks, it works.

another question is: is it possible to delete all messages from database using admin panel or i have to do this manualy in phpmyadmin?

93

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.

-gezz

94

Re: Private Message mod v1.2.2

Quick removing the messages.

Open message_list.php
FIND

<form method="post" action="message_list.php">

REPLACE WITH

<script language="JavaScript" type="text/JavaScript">
 function ChekUncheck()
 {
          var i;
          for (i = 0; i < document.delet.elements.length; i++) {
               if(document.delet.chek.checked==true){
                  document.delet.elements[i].checked = true;
               } else{
                      document.delet.elements[i].checked = false;
                 }
          }
 }
</script>
<form method="post" action="message_list.php" name="delet">

FIND

                    <th ></th>
                    <?php } else { ?>
                    <th class="tcr"><?php echo $lang_pms['Date'] ?></th>
                    <?php } ?>

REPLACE WITH

                    <th ><input name="chek" type="checkbox" value="" onClick="ChekUncheck()"></th>
                    <?php } else { ?>
                    <th class="tcr"><?php echo $lang_pms['Date'] ?></th>
                    <?php } ?>
ERROR - MIRROR

95 (edited by minis 2006-02-19 17:35)

Re: Private Message mod v1.2.2

How to disable autosave when sending messages?

and i want to delete all users messages. is it possible?

96

Re: Private Message mod v1.2.2

would this work with .10?

97

Re: Private Message mod v1.2.2

Works fine with PunBB 1.2.10

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

98

Re: Private Message mod v1.2.2

Just installed this mod... doesn't get much easier than that... the install readme was clear and easy to follow and I did a check on my system and no problems whatsoever...

Awesome job Connerhd cool

99

Re: Private Message mod v1.2.2

Hey Connorhd, is there a way to make not only the text appear telling the person they have a new message but also have a small pop-up box that lets them know they have a message as well or possibly an email notification that they have a PM waiting?

Thanks

100 (edited by hnstmn 2006-03-01 00:26)

Re: Private Message mod v1.2.2

Unable to delete multiple messages at once.

I have a problem with the delete multiple/selected message function in the Private Messaging and does not seem to work correctly. Meaning, if I select 5 messages to delete, and after pushing the submit button, it only delete's one message out of the 5..

Does anyone else have this problem?

Thanks