This is a site for discussing roleplaying games. Have fun doing so, but there is one major rule: do not discuss political issues that aren't directly and uniquely related to the subject of the thread and about gaming. While this site is dedicated to free speech, the following will not be tolerated: devolving a thread into unrelated political discussion, sockpuppeting (using multiple and/or bogus accounts), disrupting topics without contributing to them, and posting images that could get someone fired in the workplace (an external link is OK, but clearly mark it as Not Safe For Work, or NSFW). If you receive a warning, please take it seriously and either move on to another topic or steer the discussion back to its original RPG-related theme.
NOTICE: Some online security services are reporting that information for a limited number of users from this site is for sale on the "dark web." As of right now, there is no direct evidence of this, but change your password just to be safe.

Author Topic: Well I thought I was done :(  (Read 934 times)

Guest (Deleted)

  • Newbie
  • *
  • G
  • Posts: 0
Well I thought I was done :(
« on: March 04, 2006, 02:30:42 PM »
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.

Maximum Fu

  • Jr. Member
  • **
  • M
  • Posts: 51
Well I thought I was done :(
« Reply #1 on: March 04, 2006, 02:33:32 PM »
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.
Their prison is only in their own minds, yet they are in that prison; and so afraid of being taken in that they cannot be taken out.

-The Last Battle by C.S. Lewis

Guest (Deleted)

  • Newbie
  • *
  • G
  • Posts: 0
Well I thought I was done :(
« Reply #2 on: March 04, 2006, 03:10:32 PM »
And I got it! :)

Here's the code - note it cost me about 20 sanity points.

if ($this->forum['showfirstpost']==AND $post['postid']==$this->thread['firstpostid'])
{
	
$game = array();
	
preg_match('/<!-- SYNOPSIS:((.|s)*?)-->/'$post['message'], $matches);
	
$game['synopsis'] = $matches[1];

	
preg_match('/<!-- LINKS:((.|s)*?)-->/'$post['message'], $matches);
	
$game['links'] = $matches[1];


	
preg_match('/<!-- ANNOUNCE:((.|s)*?)-->/'$post['message'], $matches);
	
$game['announce'] = $matches[1];

	
$this->templatename 'postbit_first';
}

Knightcrawler

  • Hero Member
  • *****
  • K
  • Posts: 504
Well I thought I was done :(
« Reply #3 on: March 04, 2006, 03:15:18 PM »
AHHHHH!!!!!!!

Roll for sanity loss.

[dice=1]6[/dice]
Knightcrawler

"I Am Become Death, Destroyer Of Worlds"

Megamieuwsel

  • Full Member
  • ***
  • M
  • Posts: 139
Well I thought I was done :(
« Reply #4 on: March 04, 2006, 03:18:55 PM »
Sanity check as well:
[dice=6]1[/dice]

Name Lips

  • Likes Egyptian Rivers
  • Hero Member
  • *****
  • N
  • Posts: 501
Well I thought I was done :(
« Reply #5 on: March 06, 2006, 01:04:34 AM »
No mortal programmer could have done that. It's certain now. There's a ghost horse in the machine...
Next phase, new wave, dance craze, anyways, it's still rock and roll to me.

You can talk all you want about theory, craft, or whatever. But in the end, it's still just new ways of looking at people playing make-believe and having a good time with their friends. Intellectualize or analyze all you want, but we've been playing the same game since we were 2 years old. We just have shinier books, spend more money, and use bigger words now.