Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Inserting more than 1 item
#1
PHP Code:
\[vids\](.*?)\[/vids\] 

PHP Code:
<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.
Reply
#2
multiple URLs / items need splitting by using javascript or jquery.

instead, it would be better to use AutoMedia plugin
Reply
#3
(04-12-2017, 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.
Reply
#4
^ 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.
Reply
#5
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.
Reply
#6
(04-12-2017, 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?

PHP Code:
\[gal\](.*?)\[/gal\] 


PHP Code:
[galURL1 URL2 URL3 [/gal
I'm so sorry I couldn't explain it well.
Reply
#7
Users can already insert thumbnails.
[Image: 2.jpg]

Code:
[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
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)