Login
User Name:

Password:



Register
Forgot your password?
Template missing: ADMIN_MEMBER_DELETE
Aug 30, 2010, 9:45 pm
By Kline
Making Messes
Aug 5, 2010, 8:46 pm
By Conner
Personal CSS substitution
Aug 5, 2010, 7:00 pm
By Conner
No preview on post edits?
Aug 5, 2010, 11:17 am
By Conner
Video BBCode Buttons
Aug 3, 2010, 11:12 am
By Conner
QSF Portal 1.5
Author: QSF Portal Team
Submitted by: Samson
Ashlander 3 for QSFP 1.4.6
Author: Samson
Submitted by: Samson
QSF Portal 1.4.6
Author: QSF Portal Team
Submitted by: Samson
Ashlander 3 for QSFP 1.4.5
Author: Samson
Submitted by: Samson
QSF Portal 1.4.5
Author: QSF Portal Team
Submitted by: Samson
CommonCrawl, Yandex, Bing

Members: 0
Guests: 0
Stats
Files
Topics
Posts
Members
Newest Member
31
197
873
59
norby500
Affiliates
Arthmoor Quicksilver Forums
View our reviews on Hot Scripts
» QSF Portal » QSF Portal Project » Bugs » [Bug:BBCode] Youtube tag is n...
Forum Rules | Mark all | Recent Posts

[Bug:BBCode] Youtube tag is not XHTML compliant.
< Newer Topic :: Older Topic > Fixed in 1.4.6

Pages:<< prev 1 next >>
Post is unread #1 Feb 26, 2010, 9:14 pm
Go to the bottom of the page Go to the top of the page


Samson
Administrator
GroupAdministrators
Posts315
JoinedOct 9, 2006
WWW

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
       
Pages:<< prev 1 next >>