News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Ohara YouTube Embed

Started by Suki, December 21, 2011, 03:04:59 PM

Previous topic - Next topic

Suki

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.

420Connect.co.uk

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" ;)

KirkhamsEbooks

My Youtube icon has disappeard from the bbc code for new posts.

Any suggestions?  Using 2.0.4

Rick

Deaks

Quote from: KirkhamsEbooks 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

yeh update your forum!!!
~~~~
Former SMF Project Manager
Former SMF Customizer

"For as lang as hunner o us is in life, in nae wey
will we thole the Soothron tae owergang us. In truth it isna for glory, or wealth, or
honours that we fecht, but for freedom alane, that nae honest cheil gies up but wi life
itsel."

SaltedWeb

Quote from: KirkhamsEbooks 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
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.

KirkhamsEbooks



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.
[youtube]myvideopath[/youtube]
Rick

Deaks

godsbusinessway < this site?

Still needs updated SMF is on version 2.0.9 and their have been some LARGE security patches since then.
~~~~
Former SMF Project Manager
Former SMF Customizer

"For as lang as hunner o us is in life, in nae wey
will we thole the Soothron tae owergang us. In truth it isna for glory, or wealth, or
honours that we fecht, but for freedom alane, that nae honest cheil gies up but wi life
itsel."

Suki

Quote from: KirkhamsEbooks 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.
[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.

jack_1985

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!

Suki

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.

jack_1985

Ah, a stupid mistake from my side. Thank you for the quick response! :)

Suki

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.

420Connect.co.uk

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" ;)

Obcy

Quote from: jack_1985 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!
The problem still exists version 1.2.1

Suki

Quote from: 420connect.info 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?

Yes.

Quote from: Obcy on March 11, 2015, 08:56:06 AM
Quote from: jack_1985 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!
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.

Obcy

Tested fresh install.
I checked all the correct installation of hand.
Error still exist.

Suki

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.

Obcy

Thank you very much works ; )

Obcy

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.

Suki

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.

Advertisement: