Kitz ADSL Broadband Information
adsl spacer  
Support this site
Home Broadband ISPs Tech Routers Wiki Forum
 
     
   Compare ISP   Rate your ISP
   Glossary   Glossary
 
Please login or register.

Login with username, password and session length
Advanced search  

News:

Author Topic: Embedded Youtube links & errors  (Read 2895 times)

kitz

  • Administrator
  • Senior Kitizen
  • *
  • Posts: 33883
  • Trinity: Most guys do.
    • http://www.kitz.co.uk
Embedded Youtube links & errors
« on: August 02, 2015, 07:24:08 PM »

Ive been using the mod YouTube BBCode for many years which allows users to embed youtube videos into forum posts.   Unfortunately the mod has been deprecated and received no further updates or support since 2010. 

Because at the time there wasn't anything else other than AEVA* I continued to use the old one as it wasn't causing any problems.  Until that is I did a PHP/security update a few weeks ago.  Although the mod continues to work on the surface it is generating 1000's of php errors in the log file, so Im about to remove it and see if I can get something else to work.   In the meantime Im not quite sure how it will impact older links.    I will update this thread as I go along.


*Without going into specifics but there appears to be some sort of fall out between the mod creator & SMF.  AEVA media is a $pay for mod, and numerous reports of problems with the free version meant I kept with youtube bbcode for as long as I could.
Logged
Please do not PM me with queries for broadband help as I may not be able to respond.
-----
How to get your router line stats :: ADSL Exchange Checker

kitz

  • Administrator
  • Senior Kitizen
  • *
  • Posts: 33883
  • Trinity: Most guys do.
    • http://www.kitz.co.uk
Re: Embedded Youtube links & errors
« Reply #1 on: August 02, 2015, 07:25:36 PM »

I'm documenting things here because I've done lots of searching this afternoon trying to find out whats going on and others may also have the same issue wondering why they are getting the following error and it may help someone else who googles it.

SMF LOG ERROR
8: Array to string conversion
File: /home/server/public_html/forum/Sources/Subs.php
Line: 2382

the problem is with this part of the code inserted by youtube bbcode

Code: [Select]

// Don't parse the content, just skip it.
elseif ($tag['type'] == 'unparsed_content')
{
$pos2 = stripos($message, '[/' . substr($message, $pos + 1, strlen($tag['tag'])) . ']', $pos1);
if ($pos2 === false)
continue;

$data = substr($message, $pos1, $pos2 - $pos1);         
if (!empty($tag['block_level']) && substr($data, 0, 6) == '<br />')
$data = substr($data, 6);

if (isset($tag['validate']))
$tag['validate']($tag, $data, $disabled);

$code = strtr($tag['content'], array('$1' => $data)); // <-------------------------  HERE!!!!!!!!!!

$message = substr($message, 0, $pos) . "\n" . $code . "\n" . substr($message, $pos2 + 3 + strlen($tag['tag']));

$pos += strlen($code) - 1 + 2;
$last_pos = $pos + 1;

[code]
Logged
Please do not PM me with queries for broadband help as I may not be able to respond.
-----
How to get your router line stats :: ADSL Exchange Checker

Weaver

  • Senior Kitizen
  • ******
  • Posts: 11459
  • Retd s/w dev; A&A; 4x7km ADSL2 lines; Firebrick
Re: Embedded Youtube links & errors
« Reply #2 on: August 02, 2015, 07:39:03 PM »

my PHP is too rusty, I don't know what the argument of array() is meant to mean.
Logged

kitz

  • Administrator
  • Senior Kitizen
  • *
  • Posts: 33883
  • Trinity: Most guys do.
    • http://www.kitz.co.uk
Re: Embedded Youtube links & errors
« Reply #3 on: August 02, 2015, 08:00:54 PM »

Okay now Ive found out exactly what is going on the solution really is very very simple.   
The hardest part was finding out what was throwing the error and then finding a suitable replacement that will be able to correctly handle any posts with the old style code.

Solution

Uninstall:- Youtube BBCode   - Errors immediately stop
Install:- Ohara YouTube Embed

The author has just added support for conversion of YouTube urls in the format used by the older mod and handles the conversion very nicely.


Notification for forum members

The new mod allows insertion of Vimeo and YouTube videos.  Simply click one of the buttons   
Links can be the full urls or the short format
Logged
Please do not PM me with queries for broadband help as I may not be able to respond.
-----
How to get your router line stats :: ADSL Exchange Checker

GigabitEthernet

  • Kitizen
  • ****
  • Posts: 2243
Re: Embedded Youtube links & errors
« Reply #4 on: August 02, 2015, 08:01:24 PM »

Is HTML5 supported?
Logged

kitz

  • Administrator
  • Senior Kitizen
  • *
  • Posts: 33883
  • Trinity: Most guys do.
    • http://www.kitz.co.uk
Re: Embedded Youtube links & errors
« Reply #5 on: August 02, 2015, 08:17:13 PM »

Yep - works fine on the ipad using html5 :)


----
ETA

I've been reliably informed it also works fine in html5 mode on Linux too
« Last Edit: August 02, 2015, 11:56:08 PM by kitz »
Logged
Please do not PM me with queries for broadband help as I may not be able to respond.
-----
How to get your router line stats :: ADSL Exchange Checker
 

anything