Log in

View Full Version : Post dateline from bbcode plugin


ctrlbrk
04-17-2012, 12:41 AM
Hi,

I need a fixed-in-time dateline time() that does not change when someone quotes a reply.

Example:
1) Bob writes a post today. BBcode works, and uses time() to generate a dateline.
2) John replies to Bob's post at a later date, and the BBcode needs to reference the fixed-in-time time() from the original post 1, but instead it generates a new dateline as of John's reply.

There is no $post[dateline] in the bbcode_create.

The goal is for the bbcode to generate a dateline based on the POST dateline, and not the current system time().

Any help greatly appreciated.

kh99
04-17-2012, 12:48 AM
You could try putting "global $post;" in your plugin code.

ctrlbrk
04-17-2012, 12:56 AM
You could try putting "global $post;" in your plugin code.

Thx. Tried that, still no $post

--------------- Added [DATE]1334631758 at 1334631758 ---------------

BTW, any unique number that is unique to every post would be fine.

kh99
04-17-2012, 11:12 AM
Well, there's the postid - in fact when you press the "quote" button you get bbcode tags with the postid in there. For instance if I quote your post above you get this:

[QUOTE=ctrlbrk;2320761]...

but I think that works by writing the postid into the code for the Quote button.

Thinking about it more, trying to use $post probably wouldn't work because it would be the information for the reply being created, not the post being quoted.