PDA

View Full Version : Reference to the post before the current in a plugin


Rankun
02-24-2012, 05:21 AM
Hello!

I'm currently writing a number of plugins for a game we plan on our forums. One part of this game is that a game master can drop items in form of posts and a participant can pick these items up. However, I'm stuck at the point where I have to check whether the post before the own post contains such an item.

Look at this sample code:
if (is_member_of($post, 161)) {
if (strstr($post['message'], 'GET') != False) {
$post['title'] = '<i>-- ITEM OBTAINED --</i> ('.$itemname.')';
}
}Group 161 is the participants of the game, and here, if one of them posts GET, he can pick up said item. However, I don't see any way how to check if there's an item hidden in the post above his. I'm looking for a variable like $prevpost['message']. If anyone has a clever idea ... :)