Register Members List Search Today's Posts Mark Forums Read

Reply
 
Mod Options
Auto Youtube Link-Converter Details »
Auto Youtube Link-Converter
Mod Version: 1.4, by Disasterpiece (Coder) Disasterpiece is offline
Developer Last Online: Sep 2018 I like it Show Printable Version Email this Page

vB Version: 4.1.2 Rating: (82 votes - 4.88 average) Installs: 787
Released: 01 Apr 2011 Last Update: 23 May 2011 Downloads: 3711
Not Supported Uses Plugins Re-usable Code  

So basically this is a total easy-to-implement plugin, which converts standard youtube links to video-embeds on the fly without urging users to use the video-button because I think it is unnecessary.


On post display, the plugin checks if the post contains at least 1 youtube link in the form of

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

and converts them using the default vB video bbcode parser.

Code can be modified to fit your needs, altough there shouldn't be much to add.
If you're the special performance-freak, I'm curious if you can enhance data/query-performance. So let me know if you do.

INSTALL:

- Download attached XML File and import it as an addon.


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


Now every post containing youtube-links should display the embedded video instead.
Works with any number of youtube-links and any kind of text surrounding them.

Let me know if you have trouble/questions.

Download Now

Only licensed members can download files, Click Here for more information.

Show Your Support

  • To receive notifications regarding updates -> Click to Mark as Installed.
  • If you like this modification support the author by donating.
  • This modification may not be copied, reproduced or published elsewhere without author's permission.
  #31  
Old 06 Apr 2011, 14:26
Disasterpiece's Avatar
Disasterpiece Disasterpiece is offline
 
Join Date: Apr 2007
So, I simply execute that PHP file you attached and it will go through our entire database, altering them to something else?
Correct. Keep in mind that the execution starts the moment you open the url in your browser. So enter the database credentials before you run the url.

I have no database prefix .... it just shows in the config file for vBulletin as ' ' with no prefix in between the single quotes. Just leave it as two single quotes in your PHP file?
Righto, just leave it as '' then. (without space)

BTW, my language is English ..
I know, just wanted to point that out in case other users want to use the script as well
Reply With Quote
  #32  
Old 06 Apr 2011, 21:55
BadgerDog BadgerDog is offline
 
Join Date: Oct 2006
Real name: Doug
Originally Posted by Disasterpiece View Post
Correct. Keep in mind that the execution starts the moment you open the url in your browser. So enter the database credentials before you run the url.

Righto, just leave it as '' then. (without space)
Understood ... will try this out after a full backup and advise ...

Regards,
Doug
Reply With Quote
  #33  
Old 07 Apr 2011, 15:58
BadgerDog BadgerDog is offline
 
Join Date: Oct 2006
Real name: Doug
Originally Posted by BadgerDog View Post
Understood ... will try this out after a full backup and advise ...

Regards,
Doug
Hi....

Entered our specific information, backed up and then executed PHP file.

All it came back with was the phrase No query result and no [youtube] records weres changed?

Am I doing something wrong?

Regards,
Doug
Reply With Quote
  #34  
Old 07 Apr 2011, 18:46
Disasterpiece's Avatar
Disasterpiece Disasterpiece is offline
 
Join Date: Apr 2007
give me a few examples how your youtube tag works and I'll try to sort it out
Reply With Quote
  #35  
Old 07 Apr 2011, 19:09
BadgerDog BadgerDog is offline
 
Join Date: Oct 2006
Real name: Doug
Originally Posted by Disasterpiece View Post
give me a few examples how your youtube tag works and I'll try to sort it out
Special BBCodes were added to our site over the years so that they appear in posts like this:

[youtube=QT7kEMxSdZU]British Training Film[/youtube]

.. or, like this ...

[youtube]QT7kEMxSdZU[/youtube]

Now, these videos appear twice (they repeat) in each post with your excellent new YouTube mod installed, except yours presents a wide screen video, where the old ones were 4x3. Yours is better.....

Is this what you mean by examples?

Regards,
Doug
Reply With Quote
  #36  
Old 07 Apr 2011, 20:05
Disasterpiece's Avatar
Disasterpiece Disasterpiece is offline
 
Join Date: Apr 2007
Then modify the convyt.php like the following:

Replace the $ytpreg = ... line with each one of those:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

You'll have to run the script 2 times, each time with one of those lines.

That should do the trick then.
Reply With Quote
  #37  
Old 07 Apr 2011, 22:15
BadgerDog BadgerDog is offline
 
Join Date: Oct 2006
Real name: Doug
Originally Posted by Disasterpiece View Post
Then modify the convyt.php like the following:

Replace the $ytpreg = ... line with each one of those:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

You'll have to run the script 2 times, each time with one of those lines.

That should do the trick then.
Hi...

I changed the individual line as above and created two different PHP files. I then ran each one and in both cases, the PHP execution returned No query result.....

I'm not sure what else could be wrong because the BBCode it should be locating is exactly as above, but if I emailed you the three files, one of which would be my config.php for vBulletin, perhaps could have a quick look?

Appreciate your support ....

I did notice that your PHP file refers to:

$database = xxxxx

.. but then the line that opens the database says:

$db = mysql_connect($host, $username, $password);
mysql_select_db($database_name);

Is that correct? .. or should it be:

mysql_select_db($database);

Regards,
Doug
Reply With Quote
  #38  
Old 08 Apr 2011, 00:48
Disasterpiece's Avatar
Disasterpiece Disasterpiece is offline
 
Join Date: Apr 2007
heh, I'm afraid you're right. Must've missed that.

ofc
Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

would make more sense. Try that out.

cheers
Reply With Quote
  #39  
Old 08 Apr 2011, 13:05
alfanexus alfanexus is offline
 
Join Date: Dec 2008
Would be great if this also worked in blogs and not just forums
Reply With Quote
  #40  
Old 08 Apr 2011, 15:03
BadgerDog BadgerDog is offline
 
Join Date: Oct 2006
Real name: Doug
Originally Posted by Disasterpiece View Post
heh, I'm afraid you're right. Must've missed that.

ofc
Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

would make more sense. Try that out.

cheers
Yup ...

That got it running, although after passing 150,000 posts and then checking one with a duplicate, the post content using this BBCode syntax still shows a duplicate. Your real-time wide screen conversion, plus the old BBCode using this syntax.

[youtube]-QIO_G9gs0A[/youtube]

I'm using these (one at a time):

Replace the $ytpreg = ... line with each one of those:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Any ideas?

Thanks ..

Regards,
Doug

Last edited by BadgerDog; 08 Apr 2011 at 15:16.
Reply With Quote
  #41  
Old 08 Apr 2011, 19:09
Disasterpiece's Avatar
Disasterpiece Disasterpiece is offline
 
Join Date: Apr 2007
hm, try this one, altough it doesn't make any sense:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Would be great if this also worked in blogs and not just forums
I'd love to, but sadly I don't know which hooks to use. I have no vbcms

If anyone offers me admin access to a test installation, I'm able to create a plugin for vbcms too.
Reply With Quote
  #42  
Old 08 Apr 2011, 21:30
BadgerDog BadgerDog is offline
 
Join Date: Oct 2006
Real name: Doug
Originally Posted by Disasterpiece View Post
hm, try this one, altough it doesn't make any sense:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.
Nope…. thanks for trying ....

Not sure why it doesn't work, as it's opening the database now and processing it ...

Just seems to process 150,000+ posts and skips every one of them …

150588: Skipping...
150589: Skipping...
150590: Skipping...
150591: Skipping...
150592: Skipping...
150593: Skipping...
150594: Skipping...
150595: Skipping...
150596: Skipping...
150597: Skipping...
150598: Skipping...
150599: Skipping...
150600: Skipping...
150601: Skipping...
150602: Skipping...


FINISHED 588 runs with 0 queries

Click Here to continue….
Imbedded BBCodes look like this ..

[youtube]FM6wHknkAPk[/youtube]
[youtube]XTGuRgcGujs[/youtube]
[youtube]Ie88A51IxY4[/youtube]

Regards,
Doug
Reply With Quote
  #43  
Old 09 Apr 2011, 00:25
Randomm Randomm is offline
 
Join Date: Jul 2010
tagged
BTW can you make one with images?
Reply With Quote
  #44  
Old 10 Apr 2011, 00:06
Disasterpiece's Avatar
Disasterpiece Disasterpiece is offline
 
Join Date: Apr 2007
Originally Posted by BadgerDog View Post
Nope…. thanks for trying ....

Not sure why it doesn't work, as it's opening the database now and processing it ...

Just seems to process 150,000+ posts and skips every one of them …



Imbedded BBCodes look like this ..

[youtube]FM6wHknkAPk[/youtube]
[youtube]XTGuRgcGujs[/youtube]
[youtube]Ie88A51IxY4[/youtube]

Regards,
Doug
And you clicked the link everytime until it has no queries left to run? The link is at the bottom of each page.

Otherwise I'm out of ideas.
What could help immensly is: Export only your vb posts table, put it into an archive and send it to me via PM so I can run the script myself and test out why it doesn't replace the tags.

Originally Posted by Randomm View Post
tagged
BTW can you make one with images?
Sure
Reply With Quote
  #45  
Old 10 Apr 2011, 10:36
BadgerDog BadgerDog is offline
 
Join Date: Oct 2006
Real name: Doug
Originally Posted by Disasterpiece View Post
And you clicked the link everytime until it has no queries left to run? The link is at the bottom of each page.

Otherwise I'm out of ideas.
What could help immensly is: Export only your vb posts table, put it into an archive and send it to me via PM so I can run the script myself and test out why it doesn't replace the tags.
Yes Sir ... clicked it each time at every 10,000 posts and ran all the way through to the end ...

I'll try to figure out how to export the post table and send it to you. Never done anything like that before.

Appreciate your help .. very gracious of you ...

Regards,
Doug
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Mod Options

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


New To Site? Need Help?

All times are GMT. The time now is 15:00.

Layout Options | Width: Wide Color: