[2.0.18] Track PMs

All new MODs released in our MOD Database will be announced in here. All support for released MODs needs to take place in here. No new MODs will be accepted into the MOD Database for phpBB2
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.
Post Reply

Rating:

Excellent!
9
82%
Very Good
0
No votes
Good
0
No votes
Fair
1
9%
Poor
1
9%
 
Total votes: 11

User avatar
raiisak
Registered User
Posts: 36
Joined: Sun Dec 04, 2005 3:23 am

Post by raiisak » Tue Dec 06, 2005 10:53 pm

double post :oops:
Last edited by raiisak on Tue Dec 06, 2005 10:55 pm, edited 1 time in total.

User avatar
raiisak
Registered User
Posts: 36
Joined: Sun Dec 04, 2005 3:23 am

Post by raiisak » Tue Dec 06, 2005 10:54 pm

Tnx asinshesq! I think I am starting to get the whole picture now :)
Still posting the big Q thoug.. lol :)

fahraeus
Registered User
Posts: 134
Joined: Tue Nov 23, 2004 3:47 pm

Post by fahraeus » Wed Dec 07, 2005 2:32 am

deleted - I'm having some coffee...

fahraeus
Registered User
Posts: 134
Joined: Tue Nov 23, 2004 3:47 pm

Post by fahraeus » Wed Dec 07, 2005 3:13 am

Manipe wrote:
fahraeus wrote:http://www.phpbbhacks.com/download.php?id=2127

Thank you in advance.

That link leads nowhere, just redirects to the phpbbhacks homepage.

Anyway, I know what you are talking about.
What you need to do is find where the sql inserts the data for the PM, and insert this before it.

Code: Select all

$sql = "SELECT MAX(privmsgs_id) AS privmsgs_track_id
	FROM " . PRIVMSGS_TABLE;
	if ( !$result = $db->sql_query($sql) )
	{
		message_die(GENERAL_ERROR, 'Could not get PM track id', '', __LINE__, __FILE__, $sql);
	}

	$row = $db->sql_fetchrow($result);
	$pm_track_id = $row['privmsgs_track_id'] + 1;
The in the sql command, you need to add ", privmsgs_track_id" to the end of the INSERT INTO line, and you need to add ", $pm_track_id" at the end of the VALUES line.
The sql command should look like this then

Code: Select all

$sql = "INSERT INTO " . PRIVMSGS_TABLE . "(some, other, columns, privmsgs_track_id)
VALUES('some', 'other', 'columns', $pm_track_id);
I hope this helps.


Sorry for posting the wrong link.

I implemented the code changes above. Now the welcome messages to others doesn't show up when you reply to your welcome message, and that is good. But neither does the welcome message sent to you. The review box is there but completly emtpy, which doesn't look very professional. Then when replying back and forth to the welcome message no history show up at all.

I know this is not your mod's "fault", but if you can help, I'd be very happy.

asinshesq
Registered User
Posts: 6266
Joined: Sun Feb 22, 2004 9:34 pm
Location: NYC
Name: Alan

new feature suggestion...

Post by asinshesq » Wed Dec 07, 2005 7:33 pm

Manipe and phanomk, another thought just occurred to me. Manipe, your code deviates from the regular topic review code in not limiting the number of pms that get included in the review window. The regular topic review code (as well as phantomk's revised version of Manipe's mod) both add the line:
LIMIT " . $board_config['posts_per_page'];
which limits the number of posts or pms in the review window to whatever number of posts the board is supposed to show per page.

I think adding that limitation is a good idea: by avoiding pages that have a zillion posts or pms on them, that should lessen the load on the board server and speed up download times. But the drawback is that if a user has a pm conversation that goes back and forth too many times he won't be able to review the entire discussion when he replies.

So, what I was thinking about was this: how about if you use the regular topic review approach of limiting the number of pms shown in the review window, but you also adopt the normal viewtopic approach when a user first opens a pm to read it. When he does that, the mod could in effect give him a view similar to that in viewtopic where the new pm would be shown as well as all of the prior pms with the same tracking_id. And if there were more pms with the tracking_id than the number of posts permitted on a page, the view would get divided into pages aqnd the user could click to see a prior page. Make sense?

So, how hard would it be to import the viewtopic approach to the situation in which a user is reading a pm?

Manipe
Former Team Member
Posts: 1146
Joined: Thu Jul 22, 2004 6:30 pm
Location: Éire
Contact:

Re: new feature suggestion...

Post by Manipe » Wed Dec 07, 2005 8:10 pm

asinshesq wrote: So, how hard would it be to import the viewtopic approach to the situation in which a user is reading a pm?

Not hard at all. I'm still slightly sceptical about where to put it. i.e. in a box, or just under the PM.
Good idea though.
My MODs: [ Topics a user has started ] , [ Profile views ] , [ Colour on poll results ] , [ Topic posters ] , [ Add number to PM ] , [ Default avatar ] , [ View category name ] , [ Null vote ] , [ Forum description in viewforum ] , [ Resync forum ids ] , [ View PM while replying ] , [ Quick poll insert ] , [ Limit login attempts ] , [ Track PMs ]

www.ManipeF1.com

Manipe
Former Team Member
Posts: 1146
Joined: Thu Jul 22, 2004 6:30 pm
Location: Éire
Contact:

Post by Manipe » Wed Dec 07, 2005 8:10 pm

fahraeus wrote:
Manipe wrote:
fahraeus wrote:http://www.phpbbhacks.com/download.php?id=2127

Thank you in advance.

That link leads nowhere, just redirects to the phpbbhacks homepage.

Anyway, I know what you are talking about.
What you need to do is find where the sql inserts the data for the PM, and insert this before it.

Code: Select all

$sql = "SELECT MAX(privmsgs_id) AS privmsgs_track_id
	FROM " . PRIVMSGS_TABLE;
	if ( !$result = $db->sql_query($sql) )
	{
		message_die(GENERAL_ERROR, 'Could not get PM track id', '', __LINE__, __FILE__, $sql);
	}

	$row = $db->sql_fetchrow($result);
	$pm_track_id = $row['privmsgs_track_id'] + 1;
The in the sql command, you need to add ", privmsgs_track_id" to the end of the INSERT INTO line, and you need to add ", $pm_track_id" at the end of the VALUES line.
The sql command should look like this then

Code: Select all

$sql = "INSERT INTO " . PRIVMSGS_TABLE . "(some, other, columns, privmsgs_track_id)
VALUES('some', 'other', 'columns', $pm_track_id);
I hope this helps.


Sorry for posting the wrong link.

I implemented the code changes above. Now the welcome messages to others doesn't show up when you reply to your welcome message, and that is good. But neither does the welcome message sent to you. The review box is there but completly emtpy, which doesn't look very professional. Then when replying back and forth to the welcome message no history show up at all.

I know this is not your mod's "fault", but if you can help, I'd be very happy.

Can you give me the proper link so?
My MODs: [ Topics a user has started ] , [ Profile views ] , [ Colour on poll results ] , [ Topic posters ] , [ Add number to PM ] , [ Default avatar ] , [ View category name ] , [ Null vote ] , [ Forum description in viewforum ] , [ Resync forum ids ] , [ View PM while replying ] , [ Quick poll insert ] , [ Limit login attempts ] , [ Track PMs ]

www.ManipeF1.com

fahraeus
Registered User
Posts: 134
Joined: Tue Nov 23, 2004 3:47 pm

Post by fahraeus » Wed Dec 07, 2005 8:21 pm

Yes. Welcome Private Message

Track PM and Welcome Private Message are both great mods adding great functionality to phpbb, it would be really nice if they could be made compatible with each other.

Thank you for helping out with an issue that clearly isn't just support for the Track PM mod. Very much appreciated.

asinshesq
Registered User
Posts: 6266
Joined: Sun Feb 22, 2004 9:34 pm
Location: NYC
Name: Alan

Re: new feature suggestion...

Post by asinshesq » Wed Dec 07, 2005 8:23 pm

Manipe wrote:
asinshesq wrote:So, how hard would it be to import the viewtopic approach to the situation in which a user is reading a pm?

Not hard at all. I'm still slightly sceptical about where to put it. i.e. in a box, or just under the PM.
Good idea though.

No box. Instead, I envision it would look exactly the same as things look when you open a topic and look at a string of posts. The view would open up on the last page at the bottom pm (the most recent one) and stacked above it would be the preceding back and forth pms with the same track_id.

By the way, I haven't seen the welcome private message mod fahreous is asking about (dead link...), but I'm guessing that perhaps it doesn't fill in the privmsgs_from_userid field with a regular user_id contained in the USERS_TABLE. In that case, I suspect the sql in your mod wouldn't pick up the pms that have the same track_id since your sql has the line:
AND u.user_id = pm.privmsgs_from_userid
and none of the pms in that back and forth would pass that test. I could be way off base, though, since I haven't seen the code for that mod.

fahraeus
Registered User
Posts: 134
Joined: Tue Nov 23, 2004 3:47 pm

Post by fahraeus » Sat Dec 10, 2005 9:54 am

asinshesq wrote: By the way, I haven't seen the welcome private message mod fahreous is asking about (dead link...), but I'm guessing that perhaps it doesn't fill in the privmsgs_from_userid field with a regular user_id contained in the USERS_TABLE. In that case, I suspect the sql in your mod wouldn't pick up the pms that have the same track_id since your sql has the line:
AND u.user_id = pm.privmsgs_from_userid
and none of the pms in that back and forth would pass that test. I could be way off base, though, since I haven't seen the code for that mod.


Link two posts above works.

I had a look in the database and it seems like the privmsgs_from_userid field is filled with a regular user_id contained in the USERS_TABLE.

asinshesq
Registered User
Posts: 6266
Joined: Sun Feb 22, 2004 9:34 pm
Location: NYC
Name: Alan

Post by asinshesq » Sat Dec 10, 2005 11:12 am

fahraeus wrote: ...I had a look in the database and it seems like the privmsgs_from_userid field is filled with a regular user_id contained in the USERS_TABLE.

What is the privmsg_from_user_id that gets filled in for the welcoming pm? Is it -1? When the recipient receives the wlecoming pm who does the pm say its from (anonymoust?), and who gets the reply when the recipient answers that pm? Are you sure that the user_id has a corresponding username in the users table?

fahraeus
Registered User
Posts: 134
Joined: Tue Nov 23, 2004 3:47 pm

Post by fahraeus » Sun Dec 11, 2005 2:23 pm

asinshesq wrote: What is the privmsg_from_user_id that gets filled in for the welcoming pm? Is it -1? When the recipient receives the wlecoming pm who does the pm say its from (anonymoust?), and who gets the reply when the recipient answers that pm? Are you sure that the user_id has a corresponding username in the users table?


The privmsg_from_user_id that gets filled in is 2, the administrator. You get to choose this in the ACP, where you fill in the name of the author you want as the sender of the welcome message. When reading the welcome message it says it comes from the username of the administrator, since I filled this in. When replying to the welcome message it is sent to the name of the Administrator and the user id 2 is filled in in the database.

So I guess the mod need to be checked to be made compatible somehow. Keeping fingers crossed. :)

asinshesq
Registered User
Posts: 6266
Joined: Sun Feb 22, 2004 9:34 pm
Location: NYC
Name: Alan

Post by asinshesq » Sun Dec 11, 2005 2:44 pm

fahraeus wrote: ...The privmsg_from_user_id that gets filled in is 2, the administrator. You get to choose this in the ACP, where you fill in the name of the author you want as the sender of the welcome message. When reading the welcome message it says it comes from the username of the administrator, since I filled this in. When replying to the welcome message it is sent to the name of the Administrator and the user id 2 is filled in in the database....

I assume when userid sends a regular pm to someone and the recipient answers it, the tracking pm mod works fine, correct? If so, there must be some difference in how the privmsg entry looks when it is sent as a welcome pm versus when userid 2 sends a regular pm. So try this:

Register a test users so userid 2 automatically sends the welcoming pm. Immediately after, have userid2 send a regular pm to the test user. Don't have the test user open anything up (let's keep them unread for now). Next, go into the privmsg table and see how the two pms differ. Each pm should have a track_id that is identical to its privmsg_id and their privmsgs_date shoud be a bit diferent, but otherwise the two rows for those pms should be identical. Are they?

fahraeus
Registered User
Posts: 134
Joined: Tue Nov 23, 2004 3:47 pm

Post by fahraeus » Sun Dec 11, 2005 6:47 pm

I followed instructions in post above. Both messages gets a track id that equals the privmsg_id. Otherwise, the only differences that can be found in the privmsgs table are in the following columns:

privmsgs_attach_sig

and

privmsgs_ip

The welcome message has nothing in the privmsgs_ip field, while the normal sent message has an entry for the same field.

The welcome message has the value 1 in the privmsgs_attach_sig field while the normal send message has the value 0.

Again, thank you for helping.

asinshesq
Registered User
Posts: 6266
Joined: Sun Feb 22, 2004 9:34 pm
Location: NYC
Name: Alan

Post by asinshesq » Sun Dec 11, 2005 6:54 pm

Are you using manipe's or phantomk's version?

And you never confirmed my assumption that the track pm mod is working fine when the recipient answers a regular pm (it's only messed up when the user answers a welcoming pm). Is that assumption correct?

Post Reply

Return to “[2.0.x] MOD Database Releases”