Change code for YouTube

Go down

Solved Change code for YouTube

Post by smurfavr on 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 : 1743
Reputation : 17
Language : Bulgarian

http://smurfa.bulgarianforum.net/

Back to top Go down

Solved Re: Change code for YouTube

Post by Draxion on 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.


NEVER provide your founder's account or email
Please provide forum's URL when dealing with design and appearance issues
Don't forget to mark the topic as Change code for YouTube Solved11 when the issue is resolved. This helps the staff greatly.
PM Support is prohibited!
TOS | General Rules | FAQ | Tricks & Tips | Latest Updates | Introduce Yourself

Change code for YouTube Draxio14
Draxion
Draxion
Support Moderator
Support Moderator

Male Posts : 2292
Reputation : 287
Language : English
Location : USA

http://www.draxionsgameden.com/

Back to top Go down

Solved Re: Change code for YouTube

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

smurfavr
smurfavr
Active Poster

Male Posts : 1743
Reputation : 17
Language : Bulgarian

http://smurfa.bulgarianforum.net/

Back to top Go down

Solved Re: Change code for YouTube

Post by skouliki on 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 : 6050
Reputation : 947
Language : English,Greek
Location : Greece

http://iconskouliki.forumgreek.com

Back to top Go down

Solved Re: Change code for YouTube

Post by SarkZKalie on 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 : 1053
Reputation : 177
Language : English

https://www.rotavn.xyz/

Back to top Go down

Solved Re: Change code for YouTube

Post by smurfavr on 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 : 1743
Reputation : 17
Language : Bulgarian

http://smurfa.bulgarianforum.net/

Back to top Go down

Solved Re: Change code for YouTube

Post by SLGray on 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 : 45670
Reputation : 3219
Language : English
Location : United States

https://help.forumotion.com/

Back to top Go down

Solved Re: Change code for YouTube

Post by smurfavr on 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 : 1743
Reputation : 17
Language : Bulgarian

http://smurfa.bulgarianforum.net/

Back to top Go down

Solved Re: Change code for YouTube

Post by vietkanpy on 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 on June 16th 2017, 11:00 am

Thank you vietkanpy.
smurfavr
smurfavr
Active Poster

Male Posts : 1743
Reputation : 17
Language : Bulgarian

http://smurfa.bulgarianforum.net/

Back to top Go down

Solved Re: Change code for YouTube

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

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


NEVER provide your founder's account or email
Please provide forum's URL when dealing with design and appearance issues
Don't forget to mark the topic as Change code for YouTube Solved11 when the issue is resolved. This helps the staff greatly.
PM Support is prohibited!
TOS | General Rules | FAQ | Tricks & Tips | Latest Updates | Introduce Yourself

Change code for YouTube Draxio14
Draxion
Draxion
Support Moderator
Support Moderator

Male Posts : 2292
Reputation : 287
Language : English
Location : USA

http://www.draxionsgameden.com/

Back to top Go down

Back to top


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