101

Re: Private Message System

Chacmool. It is a bit annoying that you eventually get so many RE: substrings in the subject-line when a message bounces back and forth as it usually does yikes). I think it would be better to have a piece of code that checks whether RE: has occured previously. Pseudocode could be something like:

if (strncmp($msg_subject[...], 'RE: ', 4))
   $msg_subject[...] = strcat('RE: ', $msg_subject[...]

however, I'm not sure where the adding of the 'RE: ' occurs (haven't checked it out yet).
But I'm sure such a mod of the mod would be pretty simple and straightforward. Even a checkbox in the admin-properties would be a simple thing to create for this, too.

No electrons were harmed in the creation of this post.
However, many were excited and some may have enjoyed the experience.

102

Re: Private Message System

Hmmm... fixed it anawayz smile :
file: /message_send.php
line: 186

// Add subject
//$subject = "RE: " . $message['subject'];
//modified by Rasmus Anthin:
$subject = $message['subject'];
if(strncmp($subject, "RE: ", 4))
    $subject = "RE: " . $subject;

worx fine too. wink

No electrons were harmed in the creation of this post.
However, many were excited and some may have enjoyed the experience.

103

Re: Private Message System

Hmmm... I got another idea... why not make the RE: -thingy language dependent? So that it would be SV: in Swedish...
Wouldn't be that hard too I guess...

No electrons were harmed in the creation of this post.
However, many were excited and some may have enjoyed the experience.

104

Re: Private Message System

I've found a security issue with this mod that allows users to read every PM (if they know what they are doing!)

I'm sure it shouldn't be too hard to fix but will contact Chacmool.
You might want to consider disabling this mod if PM privacy is important on your board.

105

Re: Private Message System

you mean with the "RE:"-thingy I just altered?!

No electrons were harmed in the creation of this post.
However, many were excited and some may have enjoyed the experience.

106

Re: Private Message System

No, this is on an unmodified install of the pm system.
I've emailed Chacmool about it.

107

Re: Private Message System

Ok, I've knocked up a little fix for this...

Open message_list.php:
FIND:

// Set user
        $result = $db->query('SELECT status FROM '.$db->prefix.'messages WHERE id='.$id) or error('Unable to get message status', __FILE__, __LINE__, $db->error());

CHANGE TO:

// Set user
        $result = $db->query('SELECT status,owner FROM '.$db->prefix.'messages WHERE id='.$id) or error('Unable to get message status', __FILE__, __LINE__, $db->error());

BEFORE:

if ($cur_post['showed'] == 0){

ADD:

if ($cur_user[id] != $cur_post[owner])
        message($lang_common['No permission']);

You might want to test this before making it live!

Cheers,
Rich

108

Re: Private Message System

Oh, thanks alot! I've made the changes in the code and put a new version here.
Download the file and replace message_list.php OR change it manually:

In message_list.php find:

    // Set user
    $result = $db->query('SELECT status FROM '.$db->prefix.'messages WHERE id='.$id) or error('Unable to get message status', __FILE__, __LINE__, $db->error());
    list($status) = $db->fetch_row($result);
    $status == 0 ? $where = 'u.id=m.sender_id' : $where = 'u.id=m.owner';

    $result = $db->query('SELECT m.id AS mid,m.subject,m.sender_ip,m.message,m.smileys,m.posted,m.showed,u.id,username,registered,email,title,url,icq,msn,aim,yahoo,location,use_avatar,email_setting,num_posts FROM '.$db->prefix.'messages AS m,'.$db->prefix.'users AS u WHERE '.$where.' AND m.id='.$id) or error('Unable to fetch message and user info', __FILE__, __LINE__, $db->error());
    $cur_post = $db->fetch_assoc($result);
    
    if ($cur_post['showed'] == 0){
        $db->query('UPDATE '.$db->prefix.'messages SET showed=1 WHERE id='.$id) or error('Unable to update message info', __FILE__, __LINE__, $db->error());
    }

Change to:

    // Set user
    $result = $db->query('SELECT status,owner FROM '.$db->prefix.'messages WHERE id='.$id) or error('Unable to get message status', __FILE__, __LINE__, $db->error());
    list($status, $owner) = $db->fetch_row($result);
    $status == 0 ? $where = 'u.id=m.sender_id' : $where = 'u.id=m.owner';

    $result = $db->query('SELECT m.id AS mid,m.subject,m.sender_ip,m.message,m.smileys,m.posted,m.showed,u.id,username,registered,email,title,url,icq,msn,aim,yahoo,location,use_avatar,email_setting,num_posts FROM '.$db->prefix.'messages AS m,'.$db->prefix.'users AS u WHERE '.$where.' AND m.id='.$id) or error('Unable to fetch message and user info', __FILE__, __LINE__, $db->error());
    $cur_post = $db->fetch_assoc($result);

    if ($owner != $cur_user['id'])
        message($lang_common['No permission']);

    if ($cur_post['showed'] == 0){
        $db->query('UPDATE '.$db->prefix.'messages SET showed=1 WHERE id='.$id) or error('Unable to update message info', __FILE__, __LINE__, $db->error());
    }

109

Re: Private Message System

No Probs. Just took me a while to figure out the owner part smile

Cheers,
Rich

110

Re: Private Message System

Chacmool -

The change listed above is for V1.07 of your mod - what changes were made in the package for V1.06?  I set up a forum back in late April and installed this mod, so I'm assuming that I installed V1.05.

Just need to know what the changes were for V1.06 so that I can make them manually along with the change listed above.

(I read your Changelog with the V1.07 package, but it goes from 4/18 to 6/21, so I wasn't able to see what was changed for sure in V1.06.)

111

Re: Private Message System

I don't think there was anything more between. What you could do is to just replace the files that is included in the package. Most (almost all) changes after the release has been made in these files, so there should be no problem updating (replace files instead of being required to alter the punbb-files all over again).

Re: Private Message System

i installed your mod by your instructions and i get this error when i try to load the forums now. any ideas? if you need more info please keep in mind that i'm not a coder and will only be able to give you as much info as i know/can.

An error was encountered
Error: Unable to check for new messages.

~James
FluxBB - Less is more

113

Re: Private Message System

Dr.Jeckyl wrote:

i installed your mod by your instructions and i get this error when i try to load the forums now. any ideas? if you need more info please keep in mind that i'm not a coder and will only be able to give you as much info as i know/can.

An error was encountered
Error: Unable to check for new messages.

Did you run install_mod.php? (It alter/install the database tabels)

114 (edited by Dr.Jeckyl 2004-06-22 10:03)

Re: Private Message System

i did but all i got was a blank page, is this supposed to happen? thanks for the speedy reply.

EDIT: i got it mostly working now... i will report back ina couple minutes with a screenshot or 2 of my new issue.

~James
FluxBB - Less is more

115 (edited by Dr.Jeckyl 2004-06-22 10:20)

Re: Private Message System

ok here is the issue i thik i have. is the area outlined in red the pm system? also is there supposed to be some descriptions in the yellow outlined area?

http://forgamers-bygamers.com/users/DrJ/errorpunbb.gif

also, where does it let you know that you have messeges?

~James
FluxBB - Less is more

Re: Private Message System

update: all fixed! i had these files:

   admin_options.php       
   functions_navlinks.php 
   header_new_messages.php
   profile_delete.php     
   profile_quicksend.php   
   viewtopic_PM-link.php   

in their own folder and not in the /include folder.

so far everything works. thanks for the cool mod.

~James
FluxBB - Less is more

117

Re: Private Message System

Yay! Great :)

118 (edited by Dr.Jeckyl 2004-06-22 10:44)

Re: Private Message System

i just noticed why i had them in their own folder, your instructions appear to want them in their own folder:

your readme file wrote:

admin_options.php       to /include/pms/
   functions_navlinks.php  to /include/pms/
   header_new_messages.php to /include/pms/
   profile_delete.php      to /include/pms/
   profile_quicksend.php   to /include/pms/
   viewtopic_PM-link.php   to /include/pms/

i had to put them just in the /include folder for it to work(and it works fine now). so just a heads up.

~James
FluxBB - Less is more

119

Re: Private Message System

Hm, that's not right... which version are you installing?

Edit: V1.0.7 is the latest one, and can be downloaded here.

Re: Private Message System

Private_Message_System-v1.0.7

~James
FluxBB - Less is more

121

Re: Private Message System

Okay, but... hmm, weird.

And you had to put the files in /include and not in /include/pms/ to make it work?

This is the code from the readme-file, there should be in the pms-folder:

<?php require($pun_root.'include/pms/admin_options.php'); ?>

Re: Private Message System

i can show you a shot of the folder if you'd like...

~James
FluxBB - Less is more

123 (edited by Dr.Jeckyl 2004-06-22 10:52)

Re: Private Message System

you know what... i just renamed the pms folder to double check my issue and the pm system stopped working.... weird. i have no clue what i did or didn't do to fix it but it works now so i am not going to push my luck. disregard all my posts about the pms folder. tongue

thanks for your quick help Chacmool, it is appreciated.

~James
FluxBB - Less is more

Re: Private Message System

Chacmool!

if ($owner != $cur_user['id'])
        message($lang_common['No permission']);

if you add above code to message_list.php, you cannot read even your own message! need not to be added.

125

Re: Private Message System

jacobswell wrote:

Chacmool!

if ($owner != $cur_user['id'])
        message($lang_common['No permission']);

if you add above code to message_list.php, you cannot read even your own message! need not to be added.

*sigh*

Did you use the new version now or did you alter the code yourself?