Regex for showthread
#4
What is wrong with:
domain.com/showthread.php?tid=([0-9]+)

From what I can understand it would get any amount of numbers coming after tid and will stop if there is anything not a number after it, for example:
tid=200&xyz

It would stop at & and get you 200.

EDIT:

If you're using it inside a plugin, you can access $post['tid'] directly if you reference $post, from a postbit.

EDIT2:

This is what mybb uses for merging threads, which shows you 2 examples on how to get the URL, split and get the tid from it:

https://github.com/mybb/mybb/blob/4fad94...n.php#L108
Reply


Messages In This Thread
Regex for showthread - by Sazze - 2016-06-29, 05:33 PM
RE: Regex for showthread - by Sazze - 2016-07-01, 07:31 AM
RE: Regex for showthread - by WallBB - 2016-07-01, 08:44 AM
RE: Regex for showthread - by sleeping - 2016-07-07, 07:14 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)