Advertisement:

Author Topic: Ohara YouTube Embed  (Read 200113 times)

Offline Suki

  • Kaizoku Jotei
  • Developer
  • SMF Super Hero
  • *
  • Posts: 15,564
  • Oh, wouldn't it be great if I *was* crazy?
    • MissAllSunday on GitHub
    • SMF mods
Re: Ohara YouTube Embed
« Reply #300 on: March 05, 2015, 06:04:27 PM »
There is a fix floating around the simpleportal support topic but I wouldn't recommend it, relying on global vars is sloppy and careless.

Simpleportal's developer should really use the $parse_tags param in their calls to parse_bbc() to only allow the bbc tags that they want instead of relying on third party mod authors to do their job for them.
Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

Look at them. They're just asking for it. Maybe the human race deserves to be wiped out.

Offline 420Connect.co.uk

  • Full Member
  • ***
  • Posts: 413
    • 420connect.info on Facebook
    • @4twentyconnect on Twitter
    • 420 Connect
Re: Ohara YouTube Embed
« Reply #301 on: March 06, 2015, 12:04:38 PM »
Thanks Suki!

I'll test it out for now and hopefully they make this change in a future release  O:)
www.420Connect.co.uk ~ A Social Network For The #CannabisCommunity ~ Come say "High" ;)

Offline KirkhamsEbooks

  • Jr. Member
  • **
  • Posts: 282
Re: Ohara YouTube Embed
« Reply #302 on: March 07, 2015, 09:18:51 PM »
My Youtube icon has disappeard from the bbc code for new posts.

Any suggestions?  Using 2.0.4

Rick

Offline Deaks

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 22,170
  • Gender: Male
Re: Ohara YouTube Embed
« Reply #303 on: March 07, 2015, 09:28:07 PM »
My Youtube icon has disappeard from the bbc code for new posts.

Any suggestions?  Using 2.0.4

Rick

yeh update your forum!!!

Offline SaltedWeb

  • Sr. Member
  • ****
  • Posts: 861
  • Gender: Male
  • The Tired One
Re: Ohara YouTube Embed
« Reply #304 on: March 08, 2015, 01:30:52 AM »
My Youtube icon has disappeard from the bbc code for new posts.

Any suggestions?  Using 2.0.4

Rick
Is the icon just gone or are the words for it missing as well ?
Knowing your limitations makes you human, exceeding these limitations makes you worthy of being human.

Offline KirkhamsEbooks

  • Jr. Member
  • **
  • Posts: 282
Re: Ohara YouTube Embed
« Reply #305 on: March 08, 2015, 03:07:26 AM »


Rick
Quote
Is the icon just gone or are the words for it missing as well ?

Updated and yes the icon and words are gone although the feature can still be used by hand.
Code: [Select]
[youtube]myvideopath[/youtube]Rick

Offline Deaks

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 22,170
  • Gender: Male
Re: Ohara YouTube Embed
« Reply #306 on: March 08, 2015, 09:17:03 AM »
godsbusinessway < this site?

Still needs updated SMF is on version 2.0.9 and their have been some LARGE security patches since then.

Offline Suki

  • Kaizoku Jotei
  • Developer
  • SMF Super Hero
  • *
  • Posts: 15,564
  • Oh, wouldn't it be great if I *was* crazy?
    • MissAllSunday on GitHub
    • SMF mods
Re: Ohara YouTube Embed
« Reply #307 on: March 08, 2015, 12:43:13 PM »


Rick
Quote
Is the icon just gone or are the words for it missing as well ?

Updated and yes the icon and words are gone although the feature can still be used by hand.
Code: [Select]
[youtube]myvideopath[/youtube]Rick

Download the mod, unzip it, get the addHooks.php file, upload that file to your forum's root where SSI.php is  an call it with your browser:  misite.com/forum/addHooks.php  you'll see a blank page then delete that file from your server.
Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

Look at them. They're just asking for it. Maybe the human race deserves to be wiped out.

Offline jack_1985

  • Semi-Newbie
  • *
  • Posts: 29
Re: Ohara YouTube Embed
« Reply #308 on: March 09, 2015, 04:45:46 AM »
Hey Suki,

First off, thanks for the great work!

I have a question I hope you could help me with though. When I try to create a post with just a youtube video in it, I always receive the error message "message body was left empty".
(So I need to add extra characters or words to the message to be able to place it). Any ideas why this happens?

Thanks in advance!

Offline Suki

  • Kaizoku Jotei
  • Developer
  • SMF Super Hero
  • *
  • Posts: 15,564
  • Oh, wouldn't it be great if I *was* crazy?
    • MissAllSunday on GitHub
    • SMF mods
Re: Ohara YouTube Embed
« Reply #309 on: March 09, 2015, 09:32:20 AM »
You missed the code edit on Sources/Post.php

On that file find this:

<img>

and replace it with this:

<img><iframe>

Theres two instances of it so make sure you replace both.  I guess you are also missing the other edit so in your Sources/Subs.php file fine this:

// Sift out the bbc for a performance improvement.

and above that add this:

// Ohara youtube embed
   $message = OYTE_Preparse($message);



BTW the new version only compatible with SMF 2.1 makes no edits and it would be easier to add more sites.
Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

Look at them. They're just asking for it. Maybe the human race deserves to be wiped out.

Offline jack_1985

  • Semi-Newbie
  • *
  • Posts: 29
Re: Ohara YouTube Embed
« Reply #310 on: March 09, 2015, 11:42:52 AM »
Ah, a stupid mistake from my side. Thank you for the quick response! :)

Offline Suki

  • Kaizoku Jotei
  • Developer
  • SMF Super Hero
  • *
  • Posts: 15,564
  • Oh, wouldn't it be great if I *was* crazy?
    • MissAllSunday on GitHub
    • SMF mods
Re: Ohara YouTube Embed
« Reply #311 on: March 10, 2015, 01:06:38 PM »
Heres a new version: 1.2.1:

New features/Bug fixes:

Auto-embed regex improved
Added the option to disable the auto-embed feature via $context['ohara_disable'].
Use closures instead of create_function()
Change the way youtube videos are displayed, faster pages specially with multiple videos, thanks to Infernuza for the tip.
previous version didn't uninstalled any Spanish language file.
Don't assume Sources is always going to be located at boardurl Dunno how many times I actually fixed this over the years...

To upgrade just uninstall the old version and install the new one or just download the package, unzip it and upload the Sources and Themes folder to your forum's root dir.

For those brave souls testing SMF 2.1 there is also a new version, only compatible with it, some of the new features:

Full OOP approach using the Ohara helper class.
Regex improvements.
Drop compatibility with SMF 2.0.x
Add compatibility with SMF 2.1
Add a setting to disable auto-embedding.
Auto-embed regex improved
Added the option to disable the auto-embed feature via $context['ohara_disable'].
Schema-less urls
Change the way youtube videos are displayed, faster pages specially with multiple videos, thanks to Infernuza for the tip.
No file edits.

It was almost completely re-written. It now allows more sites to be added easily (just upload a class file to the Sources/OharaYTEmbed and any other extra css/bbc image/js files to their respective folders), this is also the first mod to use my helper class which aims to normalize all my mods and code in general.

The first link in the downloads section is a ready to install package. Using the "source code" links will result in a failed and bogus installation since this mod relies on third party git repos to work properly.
Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

Look at them. They're just asking for it. Maybe the human race deserves to be wiped out.

Offline 420Connect.co.uk

  • Full Member
  • ***
  • Posts: 413
    • 420connect.info on Facebook
    • @4twentyconnect on Twitter
    • 420 Connect
Re: Ohara YouTube Embed
« Reply #312 on: March 10, 2015, 04:53:11 PM »
Thanks for the update Suki! :)

Just wondering if:
" Added the option to disable the autoembed feature via $context['ohara_disable']."

relates to the SP shoutbox link issue I had a few days ago?
www.420Connect.co.uk ~ A Social Network For The #CannabisCommunity ~ Come say "High" ;)

Offline Obcy

  • Semi-Newbie
  • *
  • Posts: 33
Re: Ohara YouTube Embed
« Reply #313 on: March 11, 2015, 08:56:06 AM »
Hey Suki,

First off, thanks for the great work!

I have a question I hope you could help me with though. When I try to create a post with just a youtube video in it, I always receive the error message "message body was left empty".
(So I need to add extra characters or words to the message to be able to place it). Any ideas why this happens?

Thanks in advance!
The problem still exists version 1.2.1

Offline Suki

  • Kaizoku Jotei
  • Developer
  • SMF Super Hero
  • *
  • Posts: 15,564
  • Oh, wouldn't it be great if I *was* crazy?
    • MissAllSunday on GitHub
    • SMF mods
Re: Ohara YouTube Embed
« Reply #314 on: March 11, 2015, 10:22:55 AM »
Thanks for the update Suki! :)

Just wondering if:
" Added the option to disable the autoembed feature via $context['ohara_disable']."

relates to the SP shoutbox link issue I had a few days ago?

Yes.

Hey Suki,

First off, thanks for the great work!

I have a question I hope you could help me with though. When I try to create a post with just a youtube video in it, I always receive the error message "message body was left empty".
(So I need to add extra characters or words to the message to be able to place it). Any ideas why this happens?

Thanks in advance!
The problem still exists version 1.2.1

And it will continue to exists if you missed the file edits this mod does... the issue is not within the mod but rather your installation failed to do the necessary file edits.
Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

Look at them. They're just asking for it. Maybe the human race deserves to be wiped out.

Offline Obcy

  • Semi-Newbie
  • *
  • Posts: 33
Re: Ohara YouTube Embed
« Reply #315 on: March 11, 2015, 10:50:32 AM »
Tested fresh install.
I checked all the correct installation of hand.
Error still exist.

Offline Suki

  • Kaizoku Jotei
  • Developer
  • SMF Super Hero
  • *
  • Posts: 15,564
  • Oh, wouldn't it be great if I *was* crazy?
    • MissAllSunday on GitHub
    • SMF mods
Re: Ohara YouTube Embed
« Reply #316 on: March 11, 2015, 11:07:53 AM »
Please double check that you have indeed the code edits listed at: http://custom.simplemachines.org/mods/index.php?action=parse;mod=3268;attach=240866;smf_version=2.0.9

The package manager could show no errors during installs and still fail to do the edits on weird server configurations so a manual check needs to be done to make sure the proper file edits were done.


edit,
Oh my! I forgot the youtube BBC now gets added with a div instead of an iframe....  meh... I will release a new version shortly. To manually fix this just search for

<img><iframe>

in Sources/Post.php and replace it with:

<img><iframe><div>

on both locations.
Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

Look at them. They're just asking for it. Maybe the human race deserves to be wiped out.

Offline Obcy

  • Semi-Newbie
  • *
  • Posts: 33
Re: Ohara YouTube Embed
« Reply #317 on: March 11, 2015, 11:30:49 AM »
Thank you very much works ; )

Offline Obcy

  • Semi-Newbie
  • *
  • Posts: 33
Re: Ohara YouTube Embed
« Reply #318 on: March 13, 2015, 06:51:58 AM »
Sources/Subs-Portal.php
Code: (Find) [Select]
$context['aeva_disable'] = true;
Code: (Replace) [Select]
$context['aeva_disable'] = true;
$context['ohara_disable'] = true;

Not working. Put  link in simpleportal 2.3.6 shoutbox   not visible.

Offline Suki

  • Kaizoku Jotei
  • Developer
  • SMF Super Hero
  • *
  • Posts: 15,564
  • Oh, wouldn't it be great if I *was* crazy?
    • MissAllSunday on GitHub
    • SMF mods
Re: Ohara YouTube Embed
« Reply #319 on: March 13, 2015, 09:32:03 AM »
If you cannot see the actual video then its working as it should, that edit is for disabling turning youtube links into videos on the shoutbox.
Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

Look at them. They're just asking for it. Maybe the human race deserves to be wiped out.