This topic was marked solved by its starter, on March 8th, 2014, 12:07 PM
Current processed Post id

CerealGuy

  • Posts: 343
Current processed Post id
« on March 6th, 2014, 12:44 AM »
I would love to have in $context a current_postid variable. Otherwise theres no way to get to know the postid from parse_bbc. And im pretty sure there are also other functions which dont know the postid. current_postid should be the postid from the current processed post :D. I dont know if theres another way but searched in all globals and dindt found something :hmm:

regards CerealGuy

Nao

  • Dadman with a boy
  • Posts: 16,063
Re: Current processed Post id
« Reply #1, on March 6th, 2014, 07:40 AM »
AFAIK, post_bbc_parse has this in $bbc_options['cache']…?

However you do not have access to the post type. Very bad idea... should fix that.

CerealGuy

  • Posts: 343
Re: Current processed Post id
« Reply #2, on March 6th, 2014, 11:54 AM »Last edited on March 6th, 2014, 01:15 PM
Quote from Nao on March 6th, 2014, 07:40 AM
AFAIK, post_bbc_parse has this in $bbc_options['cache']…?

However you do not have access to the post type. Very bad idea... should fix that.
WTH, i'm sure i looked into $bbc_options and there was no id ::) Thanks :)

Nao

  • Dadman with a boy
  • Posts: 16,063
Re: Current processed Post id
« Reply #3, on March 7th, 2014, 12:14 AM »
Yes, but without access to $type, how do you know that it's a forum post..?

(I haven't looked at it, possibly the generic type implies a forum post, but I don't think so.)

CerealGuy

  • Posts: 343
Re: Current processed Post id
« Reply #4, on March 7th, 2014, 11:05 AM »
Quote from Nao on March 7th, 2014, 12:14 AM
Yes, but without access to $type, how do you know that it's a forum post..?

(I haven't looked at it, possibly the generic type implies a forum post, but I don't think so.)
You are right, a type would be really nice but perhaps as a global like topic or topicinfo. I also think that a global for postid would be bether. It doesnt has to be an own var, it would also fit into topicinfo or context?!.
The only reason why it works for me is that i process the hide stuff nearly everywhere. In Search, Posts from user via profile, and forum posts. I now looked where else process_bbc is used, and its also used in drafts (of course) but there cache isnt an int its something like 'draft30', which seems like a dirty solution for me (same for pm drafts) ::). And therefore, type would be awesome ;)

Nao

  • Dadman with a boy
  • Posts: 16,063
Re: Current processed Post id
« Reply #5, on March 8th, 2014, 01:00 AM »
Implemented today! :)

As for drafts, these should have a $type of 'post-draft'/'pm-draft' and a 'cache' ID of '30', it would make more sense, I think...!
Opinions?

CerealGuy

  • Posts: 343
Re: Current processed Post id
« Reply #6, on March 8th, 2014, 12:07 PM »
Hmm is cache id of 30 static for drafts? Didnt tooked a closer look at it, but i was a bit suprised that the first draft had an id of 30....
But back to $type, works well and integrated it into the plugin. Thanks for adding it :)