Question on board's latest post (timestamp)

Get help with installation and running phpBB 3.0.x here. Please do not post bug reports, feature requests, or MOD-related questions here.
Scam Warning
Forum rules
END OF SUPPORT: 1 January 2017 (announcement)
Locked
xiaolu
Registered User
Posts: 283
Joined: Sun Sep 29, 2013 7:37 pm

Question on board's latest post (timestamp)

Post by xiaolu » Tue Oct 11, 2016 3:35 am

First, my phpBB board is of 3.0.11

Then refer to the attached pics, I was running the "Hello" mod which shows the latest post (user who posted at what time, etc).

My question is not really about this mod in particular, but rather about how to get timestamp of latest post.

Per the two attached pics, it would appear to me the timestamp user_lastpost_time from table _USERS also includes the time a user last sent a PM (personal message) which is really NOT a post at all.

Now my question is, within the same table _USERS, is there any field that indicates field user_lastpost_time is for a PM (not for post to a topic)?

I know if I join the table _USERS with table _POST or table _PRIVMSGS, I shall be able to exclude such user_lastpost_time that is not for a post at all. But I'd user keep the query within the same table _USERS

By the way, in table _USERS, I see this field: user_last_privmsg. Maybe I could check on this field (like if user_last_privmsg <> user_lastpost_time so as to identify user_lastpost_time is for a post to a topic)?

Thanks!
Attachments
1104_1.jpg
1104_2.jpg

User avatar
AmigoJack
Registered User
Posts: 5589
Joined: Tue Jun 15, 2010 11:33 am
Location: グリーン ヒル ゾーン
Contact:

Re: Question on board's latest post (timestamp)

Post by AmigoJack » Tue Oct 11, 2016 7:35 am

  1. No: user_lastpost_time's main purpose is to detect (and thus prevent) flooding (and rapid bumping), which is also the reason why it isn't distinguishing between posts and PMs.
  2. No: user_last_privmsg is aimed at receiving PMs to notify members of new PMs without doing it again and again - it's not about sent PMs.
The worst thing about censorship is ███████████
Affin wrote:
Tue Nov 20, 2018 9:51 am
The problem is probably not my English but you do not want to understand correctly.
...
We will not come anybody anyway, nevertheless, it's best to shit this.

xiaolu
Registered User
Posts: 283
Joined: Sun Sep 29, 2013 7:37 pm

Re: Question on board's latest post (timestamp)

Post by xiaolu » Tue Oct 11, 2016 10:48 am

Thanks. So the mod (HELLO) getting member with latest

Code: Select all

user_lastpost_time
from table

Code: Select all

_USERS
as the member who made the newest post is wrong (which is what I am trying to correct).

User avatar
AmigoJack
Registered User
Posts: 5589
Joined: Tue Jun 15, 2010 11:33 am
Location: グリーン ヒル ゾーン
Contact:

Re: Question on board's latest post (timestamp)

Post by AmigoJack » Tue Oct 11, 2016 10:54 am

Depends on the definition: either you count PMs as submitted texts or you don't. If you're unable to modify that yourself you have to link to the MOD in question.
The worst thing about censorship is ███████████
Affin wrote:
Tue Nov 20, 2018 9:51 am
The problem is probably not my English but you do not want to understand correctly.
...
We will not come anybody anyway, nevertheless, it's best to shit this.

xiaolu
Registered User
Posts: 283
Joined: Sun Sep 29, 2013 7:37 pm

Re: Question on board's latest post (timestamp)

Post by xiaolu » Tue Oct 11, 2016 12:18 pm

Thanks again. I guess I am counting a post to a topic as "last post" with which a member could see and say: "Ha, this guy just posted on the board, so let me read his latest post (I can't read any personal message he sent to or received from any other member anyway:-)". After all I guess is, that HELLO mod serves the purpose of letting people know who posted last on the board.

Anyway, just now I had to/chose to join _USERS table with _POSTS table to (based on _POSTS.post_time), select the user who "really" last posted to a topic. I mean I modified that HELLO mode to change

from this:

Code: Select all

	$sql = 'SELECT u.user_id, u.username, u.user_colour, u.user_lastpost_time, u.user_from, u.user_occ, u.user_allow_pm
		FROM xiaolu_users u
		WHERE ' . $db->sql_in_set('user_type', $ignore_users, true) . '
			AND user_inactive_reason = 0 
		ORDER BY user_lastpost_time DESC';
to this:

Code: Select all

	$sql = 'SELECT u.user_id, u.username, u.user_colour, p.post_time, u.user_from, u.user_occ, u.user_allow_pm
		FROM xiaolu_users u, xiaolu_posts p
		WHERE ' . $db->sql_in_set('user_type', $ignore_users, true) . '
			AND u.user_inactive_reason = 0 AND
			AND u.user_id = p.poster_id
		ORDER BY p.post_time DESC';
And I tested it, and it worked.

Thanks again!

User avatar
AmigoJack
Registered User
Posts: 5589
Joined: Tue Jun 15, 2010 11:33 am
Location: グリーン ヒル ゾーン
Contact:

Re: Question on board's latest post (timestamp)

Post by AmigoJack » Tue Oct 11, 2016 2:05 pm

xiaolu wrote:let me read his latest post (I can't read any personal message he sent to or received from any other member anyway:-)
You also can't read posts that reside in forums where you have no read access to either. For a precise display you'd have to display the "last post" time to each user individually, based on his current read permissions throughout the board.
The worst thing about censorship is ███████████
Affin wrote:
Tue Nov 20, 2018 9:51 am
The problem is probably not my English but you do not want to understand correctly.
...
We will not come anybody anyway, nevertheless, it's best to shit this.

xiaolu
Registered User
Posts: 283
Joined: Sun Sep 29, 2013 7:37 pm

Re: Question on board's latest post (timestamp)

Post by xiaolu » Tue Oct 11, 2016 3:12 pm

Makes sense, and thanks! I'd need to add check on if latest post is accessible to an individual user/reader.

Locked

Return to “[3.0.x] Support Forum”