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.
The forum of the forums
+2
Draxion
smurfavr
6 posters

    Change code for YouTube

    smurfavr
    smurfavr
    Active Poster


    Male Posts : 1881
    Reputation : 22
    Language : Bulgarian

    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
    Draxion
    Draxion
    Helper
    Helper


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

    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.
    smurfavr
    smurfavr
    Active Poster


    Male Posts : 1881
    Reputation : 22
    Language : Bulgarian

    Solved Re: Change code for YouTube

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

    skouliki
    skouliki
    Manager
    Manager


    Female Posts : 15311
    Reputation : 1705
    Language : English,Greek
    Location : Greece

    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

    SarkZKalie
    SarkZKalie
    Support Moderator
    Support Moderator


    Male Posts : 1442
    Reputation : 220
    Language : English

    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
    smurfavr
    smurfavr
    Active Poster


    Male Posts : 1881
    Reputation : 22
    Language : Bulgarian

    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.
    SLGray
    SLGray
    Administrator
    Administrator


    Male Posts : 51498
    Reputation : 3523
    Language : English
    Location : United States

    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.
    smurfavr
    smurfavr
    Active Poster


    Male Posts : 1881
    Reputation : 22
    Language : Bulgarian

    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.
    vietkanpy
    vietkanpy
    Forumember


    Male Posts : 89
    Reputation : 33
    Language : vietnam

    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>');
        });
    });
    smurfavr
    smurfavr
    Active Poster


    Male Posts : 1881
    Reputation : 22
    Language : Bulgarian

    Solved Re: Change code for YouTube

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

    Thank you vietkanpy.
    Draxion
    Draxion
    Helper
    Helper


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

    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

      Current date/time is September 22nd 2024, 11:34 pm