clan_freadtopic.ash / clan_fpost.ash -- add quick reply to clan forums

zarqon

Well-known member
I know I posted this before, but it doesn't seem to exist anymore, so I'm reposting since I've just made a few updates.

Put both of these in your relay folder to add quick reply to your clan forums. Posts and deletes also now redirect back to the thread.

As mentioned before in the now-nonexistent thread for this script, the response box is also prepopulated with a random entertaining message. I recommend actually posting them in your clan's forum and watching your popularity soar!

I'm also accepting suggestions for further entertaining messages to include.

Enjoy!
 

Attachments

  • clan_fpost.ash
    191 bytes · Views: 52
  • clan_freadtopic.ash
    3.8 KB · Views: 55

Winterbay

Active member
Also, I'm guessing the messages are all in English and would then make me look rather odd in the in-game forum if I posted them since 99% of the rest are in Swedish :)
 

Bale

Minion
Vad är det för fel med svenska? Googlefish är kul!

icon315: Azerbaijani, really? Do you really speak that?
 

Winterbay

Active member
Ahh. I've never called it that, but I totally should :)
I would've guessed on Turkish since that is the main language I know where ü is such a prominent letter.
 

Winterbay

Active member
"I don't understand add laugh dance the topic"? (translated using my own brain that has never ever understood the point of French) :)
 

zarqon

Well-known member
Special note: I tried out my new regex tongs when making this update! The little beasties squirmed around very threateningly, nearly backslashing me in their efforts to escape, but with my regex tongs firmly gripped in hand, I wrested them into submission.

I feel much more confident abut handling regexes now. Perhaps... too confident?
 

matt.chugg

Moderator
Special note: I tried out my new regex tongs when making this update! The little beasties squirmed around very threateningly, nearly backslashing me in their efforts to escape, but with my regex tongs firmly gripped in hand, I wrested them into submission.

I feel much more confident abut handling regexes now. Perhaps... too confident?

OOH, please lend me those tongs, I love and hate regexes in equal amounts, so useful, but I still have to fire up this whenever I want to use one!

Here are 2 I used 20 minutes ago (not written by me, google won this time). 10 points to Zargon (and some gold plated tongs) if you can tell me what they do :) (Hint: I'm in the UK)

Code:
return preg_match('/^(GIR 0AA)|(((A[BL]|B[ABDHLNRSTX]?|C[ABFHMORTVW]|D[ADEGHLNTY]|E[HNX]?|F[KY]|G[LUY]?|H[ADGPRSUX]|I[GMPV]|JE|K[ATWY]|L[ADELNSU]?|M[EKL]?|N[EGNPRW]?|O[LX]|P[AEHLOR]|R[GHM]|S[AEGKLMNOPRSTY]?|T[ADFNQRSW]|UB|W[ADFNRSV]|YO|ZE)[1-9]?[0-9]|((E|N|NW|SE|SW|W)1|EC[1-4]|WC[12])[A-HJKMNPR-Y]|(SW|W)([2-9]|[1-9][0-9])|EC[1-9][0-9]) [0-9][ABD-HJLNP-UW-Z]{2})$/i',$var-renamed-to-remove-answer);

Code:
$regexp = "^([_a-z0-9-]+)(\.[_a-z0-9-]+)*@([a-z0-9-]+)(\.[a-z0-9-]+)*(\.[a-z]{2,4})$";
 

xKiv

Active member
Hehe. I see you managed to remove the var name just before I wanted to point it out ;)

And the second one is obviously a "deconstruct an email", except it wont work if somebody uses uppercase letters, and will leave in the dots.
 

matt.chugg

Moderator
its just to validate an email, thats just the pattern, it also won't work for .museum addresses I don't think but it does the job for me, if it passes that, then the script in question checks for a mx record on the domain, this isn't validation for user input, its for staff, with an ajax request on blur event, so it just gives a headsup that there 'may' be a typo!

I guess you get the tongs!
 

matt.chugg

Moderator
He does it without tongs. Showoff.

Douglas Adams said it better than I could:

It startled xKiv even more when just after he was awarded the Galactic Institute's Prize for Extreme Cleverness he got lynched by a rampaging mob of respectable kolmafia scripters who had finally realized that the one thing they really couldn't stand was a smart ass
 
Top