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 call?
Thanks.
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
Thanks.
Type: | Discussion |
---|---|
Status: | New |
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