Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

YouTube tag enhancement

  • 24-12-2008 9:27am
    #1
    Closed Accounts Posts: 17,208 ✭✭✭✭


    Given the prevalence of people posting the full video link in the YouTube tag (as may other link tags like [noparse]noparse] have taught them to do), would it be possible to extend the YouTube tag to parse out everything but the actual video code itself?  Should be able to drop everything pre v= and post the optional & marks.


Comments

  • Subscribers Posts: 4,076 ✭✭✭IRLConor


    Given the prevalence of people posting the full video link in the YouTube tag (as may other link tags like [noparse]noparse] have taught them to do), would it be possible to extend the YouTube tag to parse out everything but the actual video code itself?  Should be able to drop everything pre v= and post the optional & marks.

    Something like this would do it (untested):

    [PHP]
    function parse_youtube_link($url) {
    if (preg_match("/[&?]v=(.*?)[&?]/", $url, $matches)) {
    if ($matches[1]) {
    return matches[1];
    }
    }
    return NULL;
    }
    [/PHP]

    You'd probably have to hack vBulletin to do it though since the custom BBCode manager in vBulletin only allows simple find and replace.


Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.

Advertisement