The Youtube tag is not XHTML compliant in its present form, so I dug around on the web and found the solution to that, which had already been deployed and tested on my blog but needed more code fiddling to fix in QSFP.
This also raises the size of the video preview window to 640x400 and alters the javascript uses to produce the tag in the post box.
Index: C:/Code Repositories/QSFP Branch/qsfportal/lib/bbcode.php
===================================================================
--- C:/Code Repositories/QSFP Branch/qsfportal/lib/bbcode.php (revision 362)
+++ C:/Code Repositories/QSFP Branch/qsfportal/lib/bbcode.php (revision 363)
@@ -657,7 +657,8 @@
function _process_youtube(&$node)
{
- return '<object width="425" height="350"><param name="movie" value="http://www.youtube.com/v/'.$node->text.'"></param><embed src="http://www.youtube.com/v/'.$node->text.'" type="application/x-shockwave-flash" width="425" height="350"></embed></object>';
+ $node->text = str_replace( 'watch?v=', 'v/', $node->text );
+ return '<object type="application/x-shockwave-flash" width="640" height="400" data="'.$node->text.'"><param name="movie" value="'.$node->text.'" /><param name="allowscriptaccess" value="always" /><param name="wmode" value="transparent" /></object>';
}
function _process_google_video(&$node)
Index: C:/Code Repositories/QSFP Branch/qsfportal/func/jsdata.php
===================================================================
--- C:/Code Repositories/QSFP Branch/qsfportal/func/jsdata.php (revision 363)
+++ C:/Code Repositories/QSFP Branch/qsfportal/func/jsdata.php (revision 364)
@@ -154,7 +154,7 @@
'tag' => 'youtube',
'title' => $this->lang->bbcode_youtube,
'value' => $this->lang->bbcode_youtube,
- 'action' => 'bbCode'
+ 'action' => 'bbcURL'
);
$results['buttons'][] = array(
'tag' => 'bcove',
Index: C:/Code Repositories/QSFP Branch/qsfportal/javascript/postboxplain.js
===================================================================
--- C:/Code Repositories/QSFP Branch/qsfportal/javascript/postboxplain.js (revision 364)
+++ C:/Code Repositories/QSFP Branch/qsfportal/javascript/postboxplain.js (revision 365)
@@ -56,11 +56,11 @@
var text = getText(textarea);
var isURL = (text.substring(0,7) == "http://"
;
- if (type == 'img') {
+ if (type == 'img' || type == 'youtube' ) {
if (isURL) {
- var code = "
";
+ var code = "[" + type + "]" + text + "[/" + type + "]";
} else {
- var code = text + "
+ "" alt="" />";
+ var code = text + "[" + type + "]" + prompt(textarea.jsdata_url + ":",""
+ "[/" + type + "]";
}
} else {
var code = "[" + type + "=" + (isURL ? text : prompt(textarea.jsdata_address + ":",""
) + "]" + ((text && !isURL) ? text : prompt(textarea.jsdata_detail + ":",""
) + "[/" + type + "]";
I have not investigated the other two video options as nobody seems to use them, ever.
.........................
PDNS-Admin | Sandbox | Arthmoor MUD Hosting Services | The Truth About Medievia: A Saga of Code Theft.
"The past was erased, the erasure was forgotten, the lie became truth." -- George Orwell, 1984