Quote:
Originally Posted by jdelasko
Thanks. I'd sure appreciate it. The docs on HTLMpurifier.org aren't much help.... most of the docs assume that the person reading them somehow magically can fill in the missing pieces. Here's a good example: http://htmlpurifier.org/dev/docs/enduser-youtube.html
They give an example of youtube filter code and then they make this statement:
And the corresponding usage:
Code:
<?php $config->set('Filter', 'YouTube', true); ?>
The above code/usage is the sum total of the directions they give on the implementation.
|
Hi, I am unable to get it working 100% yet but this what I have so far.
Step 1:
Make sure you have YouTube.php in /z/includes/HTMLPurifier/Filter/
Step 2:
Open /z/includes/external_auth/vbulletin36.php
Find:
PHP Code:
$this->html_purifier =& new HTMLPurifier($config);
Add After:
PHP Code:
require_once (ZDIR . '/includes/HTMLPurifier/Filter/YouTube.php');
$this->html_purifier->addFilter(new HTMLPurifier_Filter_YouTube());
Step 3:
Make sure /z/js/tiny_mce/plugins/media/ exists.
Step 4:
Open /z/includes/template/header.php
Find:
PHP Code:
if(defined('SIMPLE_WYSIWYG')) {
$ret .= "<script language=\"javascript\" type=\"text/javascript\" src=\"{$prefix}js/tiny_mce/tiny_mce.js\"></script>
<script language=\"javascript\" type=\"text/javascript\">
tinyMCE.init({
mode : \"exact\",
elements : \"z_tinymce_editor\",
theme: \"simple\",
visual: \"true\",
width: \"650\"
});
</script>";
Replace with:
PHP Code:
if(defined('SIMPLE_WYSIWYG')) {
$ret .= "<script language=\"javascript\" type=\"text/javascript\" src=\"{$prefix}js/tiny_mce/tiny_mce.js\"></script>
<script language=\"javascript\" type=\"text/javascript\">
tinyMCE.init({
mode : \"exact\",
elements : \"z_tinymce_editor\",
theme: \"simple\",
visual: \"true\",
width: \"650\",
plugins : \"media\",
theme_advanced_buttons1_add : \"media\",
cleanup: true
});
</script>";
Find:
PHP Code:
$ret .= "<script language=\"javascript\" type=\"text/javascript\" src=\"{$prefix}js/tiny_mce/tiny_mce.js\"></script>
<script language=\"javascript\" type=\"text/javascript\">
tinyMCE.init({
mode : \"exact\",
elements : \"z_tinymce_editor\",
theme: \"advanced\",
visual: \"true\",
theme_advanced_toolbar_location : \"top\",
theme_advanced_buttons1 : \"removeformat,separator,fontselect,fontsizeselect,separator,forecolor,separator, undo, redo\",
theme_advanced_buttons2 : \"bold, italic,underline,separator,justifyleft,justifycenter,justifyright,separator,bullist,numlist,outdent,indent, separator,link,image,blockquote\",
theme_advanced_buttons3 : \"\",
width: \"650\"
});
</script>";
Replace With:
PHP Code:
$ret .= "<script language=\"javascript\" type=\"text/javascript\" src=\"{$prefix}js/tiny_mce/tiny_mce.js\"></script>
<script language=\"javascript\" type=\"text/javascript\">
tinyMCE.init({
mode : \"exact\",
elements : \"z_tinymce_editor\",
theme: \"advanced\",
visual: \"true\",
theme_advanced_toolbar_location : \"top\",
theme_advanced_buttons1 : \"removeformat,separator,fontselect,fontsizeselect,separator,forecolor,separator, undo, redo\",
theme_advanced_buttons2 : \"bold, italic,underline,separator,justifyleft,justifycenter,justifyright,separator,bullist,numlist,outdent,indent, separator,link,image,blockquote\",
theme_advanced_buttons3 : \"media\",
width: \"650\",
plugins: \"media\",
media_types: \"swf\",
cleanup: true
});
</script>";
This will add a media button to the editor. From there you can point the url to youtube's video player for a specific video and you should be set. While the editor will let you post any type of swf media, HTMLPurifier will only allow youtube content. Posting object/embed directly does not work for initial submission. Previewing or editing will cause tiny mce to recognize it as a media file and process accordingly. That's really the only issue which I am looking into with Tiny MCE Support.