MyBB Community Forums

Full Version: Inserting more than 1 item
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
\[vids\](.*?)\[/vids\]

<ul id="svList">
  <li class="svThumb ytVideo" data-videoID="$1"></li>
  <li class="svThumb ytVideo" data-videoID="$2"></li>
  <li class="svThumb ytVideo" data-videoID="$3"></li>
</ul>

Hi. This mycode I created is to show a video gallery on my forums.
My problem is I want more than 3 videos inserted inside the RegEx but somehow It won't show the rest.
Not sure if I should be using three $1 or $1 $2 $3 instead.
multiple URLs / items need splitting by using javascript or jquery.

instead, it would be better to use AutoMedia plugin
(2017-04-12, 03:35 AM).m. Wrote: [ -> ]multiple URLs / items need splitting by using javascript or jquery.

instead, it would be better to use AutoMedia  plugin

Hi. Thanks for your reply.
And how would I be able to do that with AutoMedia?
My goal is to let my members use a short MyCode & add their multiple Youtube videos so that their signatures doesn't fill up the entire forum & end up with long document.
^ with automedia plugin, users do not have to post any codes.
instead they can post youtube videos links directly & those videos get embedded.

depending on number of videos,
page does gets filled with video thumbnails / embedding - not sure how that is handled.
AutoMedia is using MyBB's "Maximum Videos per Post" setting for limiting the number of embedded objects per post. For signatures the automatic embedding can be disabled by the administrator in the plugin settings.
(2017-04-12, 05:03 PM)doylecc Wrote: [ -> ]AutoMedia is using MyBB's "Maximum Videos per Post" setting for limiting the number of embedded objects per post. For signatures the automatic embedding can be disabled by the administrator in the plugin settings.

I see. Thanks for your reply.

Let's say I ditched the video but switched to image gallery, how do I go about this?
Imagine having about 10 thumbnails to show, how would the RegEx look like?

\[gal\](.*?)\[/gal\]


[gal] URL1 URL2 URL3 [/gal]
I'm so sorry I couldn't explain it well.
Users can already insert thumbnails.
[Image: 2.jpg]

[url=https://www.youtube.com/watch?v=_sqL8dVIG2k][img]http://img.youtube.com/vi/_sqL8dVIG2k/2.jpg[/img][/url]

You can create a shorter MyCode to only require the video ID or video URL.

But always try to use proper regular expressions, not just plain "(.*?)".
http://stackoverflow.com/questions/19377...outube-url