I thought I had the play by post section done, but the fucking thing only grabs single lines. I can't come up with a regex expression that will grab everything so it might be a while till it works.
You see the [noparse][announcement], [links] and [synopsis][/noparse] tags parse their contents into an HTML comment into the post. When the first post reader reads it back it tages that text out of the comment and puts it where it belongs using the side blocks.
Well that's the theory. I think I can safely say that writing regex expressions are the most difficult task a programmer ever has to do.
Hey. I know that can't be easy. I want to thank you for putting in the effort so that we can have our fun.
It is much appreciated.
And I got it! :)
Here's the code - note it cost me about 20 sanity points.
if ($this->forum['showfirstpost']==1 AND $post['postid']==$this->thread['firstpostid'])
{
$game = array();
preg_match('//', $post['message'], $matches);
$game['synopsis'] = $matches[1];
preg_match('//', $post['message'], $matches);
$game['links'] = $matches[1];
preg_match('//', $post['message'], $matches);
$game['announce'] = $matches[1];
$this->templatename = 'postbit_first';
}
AHHHHH!!!!!!!
Roll for sanity loss.
[dice=1]6[/dice]
Sanity check as well:
[dice=6]1[/dice]
No mortal programmer could have done that. It's certain now. There's a ghost horse in the machine...