The forum of the forums
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Change code for YouTube

+2
Draxion
smurfavr
6 posters

Go down

Solved Change code for YouTube

Post by smurfavr June 11th 2017, 12:36 pm

This code automatically adds YouTube videos by adding a link to a theme.

How do I make the code do the same for this site? https://www.vbox7.com/

Code:
$(function () {
    // Auto youtube transform
    // Hancki - FdF
    $('.post-entry a, .postbody .content a, .postbody a').html(function (i, html) {
        return html.replace(/(?:https:\/\/)?(?:http:\/\/)?(?:www\.)?(?:youtube\.com|youtu\.be)\/(?:watch\?v=)?(.+)/g, '<iframe width="420" height="345" src="http://www.youtube.com/embed/$1" frameborder="0" allowfullscreen></iframe>');
    });
});


Last edited by smurfavr on June 16th 2017, 11:00 am; edited 1 time in total
smurfavr
smurfavr
Active Poster

Male Posts : 1883
Reputation : 22
Language : Bulgarian

http://smurfa.bulgarianforum.net/

Back to top Go down

Solved Re: Change code for YouTube

Post by Draxion June 11th 2017, 1:40 pm

Hi there and good morning!

Where did you get that code? If you didn't get it from here, you may have to contact the person who wrote it for that question.
Draxion
Draxion
Helper
Helper

Male Posts : 2518
Reputation : 321
Language : English
Location : USA

https://www.talesoftellene.com/

Back to top Go down

Solved Re: Change code for YouTube

Post by smurfavr June 11th 2017, 1:58 pm

smurfavr
smurfavr
Active Poster

Male Posts : 1883
Reputation : 22
Language : Bulgarian

http://smurfa.bulgarianforum.net/

Back to top Go down

Solved Re: Change code for YouTube

Post by skouliki June 11th 2017, 2:16 pm

you are using many codes from that forum and most of them seems to be having issues with your forum
https://help.forumotion.com/t153077-vbox7-by-hotrofm
https://help.forumotion.com/t153089-the-code-hides-the-login-button-in-the-admin-panel
https://help.forumotion.com/t153091-change-code-for-youtube

are you sure all codes are for your forum version? as i suggested before the best solution is to ask the author of that code in the forum you mentioned
skouliki
skouliki
Manager
Manager

Female Posts : 15026
Reputation : 1680
Language : English,Greek
Location : Greece

http://iconskouliki.forumgreek.com

Back to top Go down

Solved Re: Change code for YouTube

Post by SarkZKalie June 11th 2017, 2:20 pm

Use YouTube bbcode, man! Stop being a lazy guy :v


Change code for YouTube Sarkzk10
SarkZKalie
SarkZKalie
Support Moderator
Support Moderator

Male Posts : 1407
Reputation : 218
Language : English

https://rotavn.forumotion.com/

Back to top Go down

Solved Re: Change code for YouTube

Post by smurfavr June 11th 2017, 2:25 pm

skouliki
The codes work for my forum just want to make minor changes to them.

SarkZKalie
I want to use another site other than Jetubbe, please if you can not help not write in a topic.
smurfavr
smurfavr
Active Poster

Male Posts : 1883
Reputation : 22
Language : Bulgarian

http://smurfa.bulgarianforum.net/

Back to top Go down

Solved Re: Change code for YouTube

Post by SLGray June 11th 2017, 8:28 pm

The topic was posted in the wrong section, so I have moved it to the correct section.
Please read our forum rules:  ESF General Rules
Can you not use the flash button for that site?


Change code for YouTube Slgray10

When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
SLGray
SLGray
Administrator
Administrator

Male Posts : 51452
Reputation : 3519
Language : English
Location : United States

https://forumsclub.com/gc/128-link-directory/

Back to top Go down

Solved Re: Change code for YouTube

Post by smurfavr June 11th 2017, 11:02 pm

SLGray wrote:
Can you not use the flash button for that site?

No.
smurfavr
smurfavr
Active Poster

Male Posts : 1883
Reputation : 22
Language : Bulgarian

http://smurfa.bulgarianforum.net/

Back to top Go down

Solved Re: Change code for YouTube

Post by vietkanpy June 16th 2017, 7:44 am

Code:
$(function () {
    $('.post-entry a, .postbody .content a, .postbody a').html(function (i, html) {
        return html.replace(/(?:https:\/\/)?(?:http:\/\/)?(?:www\.)?(?:vbox7\.com)\/(?:play\:)?(.+)/g, '<iframe width="420" height="345" src="https://www.vbox7.com/emb/external.php?vid=$1" frameborder="0" allowfullscreen></iframe>');
    });
});
vietkanpy
vietkanpy
Forumember

Male Posts : 89
Reputation : 33
Language : vietnam

http://benhxahoivn.com/

Back to top Go down

Solved Re: Change code for YouTube

Post by smurfavr June 16th 2017, 11:00 am

Thank you vietkanpy.
smurfavr
smurfavr
Active Poster

Male Posts : 1883
Reputation : 22
Language : Bulgarian

http://smurfa.bulgarianforum.net/

Back to top Go down

Solved Re: Change code for YouTube

Post by Draxion June 16th 2017, 11:17 am

Problem solved & topic archived.
Please read our forum rules: ESF General Rules
Draxion
Draxion
Helper
Helper

Male Posts : 2518
Reputation : 321
Language : English
Location : USA

https://www.talesoftellene.com/

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum