Thread: Show Thread Enhancements - Automatic Embedded Video (youtube, plus many more)
View Single Post
 
Old 06-27-2007, 08:04 AM
dizzy100 dizzy100 is offline
 
Join Date: Mar 2006
Posts: 155
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by mfyvie View Post
Fixable solution? Yeah, disable Viper's mod! I didn't have time to completely reverse engineer his mod, but I'll explain what I saw. He's going in to the bbcode parser and screwing around. The bad part is things like this:

Code:
    // Everything that's left is invalid calls to the BBCode, so let's ditch it
    // Not using an array since the pre-PHP5 replica function can't handle arrays
    $text = str_ireplace('[YOUTUBE', '[INVALIDYOUTUBE', $text);
    $text = str_ireplace('[/YOUTUBE]', '[/INVALIDYOUTUBE]', $text);
    $text = str_ireplace('[GVIDEO', '[INVALIDGVIDEO', $text);
    $text = str_ireplace('[/GVIDEO]', '[/INVALIDGVIDEO]', $text);
If you look closely, instead of checking for [YOUTUBE] (which is the tag he uses, also not a good choice to use the same name tag as everyone else might and to delete it if you uninstall the product...), he is checking for [youtube (without the ending bracket).

This basically means that he is looking for any other tag which starts with the word youtube, and trashing it. Since I chose youtubevid to try to be unique, his mod is killing my tag, which is why it isn't showing up until you disable his mod.
Yikes yes that does seem like sloppy code. I'll have to look at a workable solution.

Disabling vipers code won't work as his bbcode fails to function then. I can only assume hes parsing as its displayed to alter the {param} tag as he presents his bbcode as

Code:
            <object width="425" height="340" type="application/x-shockwave-flash" data="http://www.youtube.com/v/{param}">
                <param name="movie" value="http://www.youtube.com/v/{param}" />
                <param name="wmode" value="transparent" />
                <em><strong>ERROR:</strong> If you can see this, then <a href="http://www.youtube.com/">YouTube</a> is down or you don't have Flash installed.</em>
            </object>
But we posted in the youtube videos using the url link

http://www.youtube.com/watch?v=1eKifSDgU48

So this results in quite a messed up

Code:
            <object width="425" height="340" type="application/x-shockwave-flash" data="http://www.youtube.com/v/http://www.youtube.com/watch?v=1eKifSDgU48">
                <param name="movie" value="http://www.youtube.com/v/http://www.youtube.com/watch?v=1eKifSDgU48" />
                <param name="wmode" value="transparent" />
                <em><strong>ERROR:</strong> If you can see this, then <a href="http://www.youtube.com/">YouTube</a> is down or you don't have Flash installed.</em>
            </object>
The only workable option i've so far found is to remove vipers code completely and manually edit each youtube embedded video replacing his tags with your tags and removing the front line url so

[YOUTUBE]http://www.youtube.com/watch?v=1eKifSDgU48[/YOUTUBE]

becomes

[YOUTUBEvid]1eKifSDgU48{/YOUTUBEvid]

That works effectively but will require some work to track down each post that has his tags embedded.

Thankfully there is a solution to this using phpmyadmin.

Just enter into your database and type in the following mysql in the SQL tag to show you all your posts that have referance to youtube tags (note on a big board this could be many]

Code:
SELECT *
FROM `post`
WHERE `pagetext` LIKE '%[youtube]%'
LIMIT 0 , 30
The you just have to edit the tags from

[YOUTUBE]http://www.youtube.com/watch?v=VZBxfntDq3M[/YOUTUBE]

to

[YOUTUBEvid]VZBxfntDq3M[/YOUTUBEvid]

removing referance to the url and adding this new embedded bbcode.

Its a cludge but if you only have around 50 or so linked youtube videos is likely the best course of action to get this mod working and remove vipers.
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01182 seconds
  • Memory Usage 1,782KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (4)bbcode_code
  • (1)bbcode_quote
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • showpost_complete