The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Parse URL
Hi all, im using the anymedia plugin and under all videos I include the original URL to the video.
That i want is that url dont appear like this: http://www .youtube.com/watch?v=AOEpkt7RZy0 (without spaces) I want that it parse the name of the video (or the title of the web) carlitos - el baile de la ducha (or YouTube - carlitos - el baile de la ducha). Very much thanks |
#2
|
|||
|
|||
This will get the title from that page:
Quote:
|
#3
|
|||
|
|||
Great! very much thanks Duck!! that code i will insert it in the template or in the php?
|
#4
|
|||
|
|||
Sorry I'm not able to give you that answer, but due performance issues you should grab the title when the link is posted and not everytime it's viewed as it would slow down your site a lot.
|
#5
|
||||
|
||||
What you'd have to do is create a plugin that pulls the title from YouTube and saves it to the database, to then be displayed each time the page is loaded.
@Ducks: echo substr($src, strrpos($src, '<title>') + 7, strrpos($src, '</title>') - strrpos($src, '<title>')); You could you preg_match as an alternative to this. If you want to use the code you've written, stripos would be better because it's case-insensitive. BTW, why would you want to search starting at the end of the HTML document? Code:
preg_match('%<title>([^<]+)<\/title>%i', file_get_contents ($url), $matches); $title = $matches[1]; |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|