Login
Username: Password:
Remember me

[Sign Up] / [Recover Password]

Theme / Language

Popular
New Torrents
new name
Size: 18.40 MB
Most active
new name
S: 74 L: 3
New Posters
OK.RU BBCODE EMBED
Controls ·  Search New posts · Mark unread

You are in: Forum / Forum / Torrent Trader / v3 Support

Unknown User
2019-12-10 18:02:47
Hello i need to make a bbcode function for OK.RU media

Something like [ok]blalbla[/ok]

EMBED SCRIPT http://cdn.iframe.ly/embed.js

any ideas?
Unknown User
2019-12-10 19:35:56
Wrong regular expression.

$s = preg_replace("/\[ok]https:\/\/(?:www\.)*+ok\.ru\/video\/([\d\-]+)\[\/ok\]/", "<paramb style=\"width:720px; height:400px;\" name=\"movie\" value='http://cdn.iframe.ly/embed.js' allowFullScreen=\"true\"></param><iframe src='https://ok.ru/videoembed/$1' allow=\"encrypted-media\" type=\"application/x-shockwave-flash\" width=\"720\" height=\"400\"></iframe>", $s);


Explanation:
1. For security reasons user must use https://
2. User can choose to use www or not. https://www.ok.ru or https://ok.ru
3. It will capture all numbers without letters even if the link is wrong for example: 151694#ds#@303434 it will always return : 151694303434

Result:
[ok]https://ok.ru/video/1516943034346[/ok]


Output for 7.4.0 | took 14 ms, 15.04 MiB
<paramb style="width:720px; height:400px;" name="movie" value='http://cdn.iframe.ly/embed.js' allowFullScreen="true"></param><iframe src='https://ok.ru/videoembed/1516943034346' allow="encrypted-media" type="application/x-shockwave-flash" width="720" height="400"></iframe> 
Users online

No users online

Search



Statistics

    Torrents

  • Tracking: 3
  • Todays torrents: 0
  • Seeders: 0
  • Leechers: 0
  • Peers: 0
  • Downloaded: 89.96 GB
  • Uploaded: 9.86 GB

  • Members

  • We have: 838
  • New today: 0
  • Guest today: 9

  • Online

  • Total online: 1
  • Members: 0
  • Guests online: 1
  • Comments: 3
  • Messages: 1,728