vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4.x Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=245)
-   -   Mini Mods - Auto Youtube Link-Converter (https://vborg.vbsupport.ru/showthread.php?t=261296)

Disasterpiece 04-06-2011 01:26 PM

Quote:

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.

Quote:

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)

Quote:

BTW, my language is English ..
I know, just wanted to point that out in case other users want to use the script as well :)

BadgerDog 04-06-2011 08:55 PM

Quote:

Originally Posted by Disasterpiece (Post 2181532)
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

BadgerDog 04-07-2011 02:58 PM

Quote:

Originally Posted by BadgerDog (Post 2181678)
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

Disasterpiece 04-07-2011 05:46 PM

give me a few examples how your youtube tag works and I'll try to sort it out

BadgerDog 04-07-2011 06:09 PM

Quote:

Originally Posted by Disasterpiece (Post 2182038)
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..... :D

Is this what you mean by examples?

Regards,
Doug

Disasterpiece 04-07-2011 07:05 PM

Then modify the convyt.php like the following:

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

$ytpreg "/\[youtube=([a-zA-Z0-9_-]+)\&?\](.*)\[\/youtube\]/i";
$ytpreg "/\[youtube\]([a-zA-Z0-9_-]+)\&?\[\/youtube\]/i"

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

That should do the trick then.

BadgerDog 04-07-2011 09:15 PM

Quote:

Originally Posted by Disasterpiece (Post 2182060)
Then modify the convyt.php like the following:

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

$ytpreg "/\[youtube=([a-zA-Z0-9_-]+)\&?\](.*)\[\/youtube\]/i";
$ytpreg "/\[youtube\]([a-zA-Z0-9_-]+)\&?\[\/youtube\]/i"

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 .... :up:

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

Disasterpiece 04-07-2011 11:48 PM

heh, I'm afraid you're right. Must've missed that.

ofc
PHP Code:

mysql_select_db($database); 

would make more sense. Try that out.

cheers

alfanexus 04-08-2011 12:05 PM

Would be great if this also worked in blogs and not just forums :)

BadgerDog 04-08-2011 02:03 PM

Quote:

Originally Posted by Disasterpiece (Post 2182147)
heh, I'm afraid you're right. Must've missed that.

ofc
PHP Code:

mysql_select_db($database); 

would make more sense. Try that out.

cheers

Yup ... :up:

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:
PHP Code:

$ytpreg "/\[youtube=([a-zA-Z0-9_-]+)\&?\](.*)\[\/youtube\]/i";
$ytpreg "/\[youtube\]([a-zA-Z0-9_-]+)\&?\[\/youtube\]/i"

Any ideas?

Thanks .. :)

Regards,
Doug


All times are GMT. The time now is 11:25 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01369 seconds
  • Memory Usage 1,754KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (5)bbcode_php_printable
  • (8)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete