Get data from newly created posting

Permalink Browser Info Environment
Hi,

I'm looking to add a table in my package that will hold data for whether a posting has been viewed by the user or not. The aim being to show a count of "unread" postings.

Table structure will have fields for:
nID // My notification ID
pID // Posting ID
uID // User ID
isRead // either 0 or 1

I will retrieve data by a join on the tables where "isRead" is zero


To implement this though, I would need to know the posting ID and the toUID following a posting being made.

Is there a way to access these following the
$wall->postAndPossiblyRegister
call?

Thanks.

Type: Discussion
Status: New
waynethorley
View Replies: View Best Answer
jshannon replied on at Permalink Best Answer Reply
jshannon
Hi.

Theoretically, the postAndPossiblyRegister could return the $post, which would allow you to get the uid and pid.

But do you (your package) only care about the posts that your package makes? What about all the other posts that it wouldn't necessarily be able to track?

Maybe the best way would be to outer join your table with posts, selecting on the uID, and doing all your counts that way. Then you add rows to your table only when read?

James
waynethorley replied on at Permalink Reply
waynethorley
Excellent point. Thanks!

concrete5 Environment Information

Browser User-Agent String

Hide Post Content

This will replace the post content with the message: "Content has been removed by an Administrator"

Hide Content

Request Refund

You have not specified a license for this support ticket. You must have a valid license assigned to a support ticket to request a refund.