Support Forum

Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
coding-topic
Adding custom plugin to TinyMCE
Avatar
tracychilders
Member
Free Members
sp_UserOfflineSmall Offline
May 23, 2012 - 11:23 am

I would like to know how can I add a custom javascript plugin to your TinyMCE plugin? Is it possible doing it via hook? Thanks!

Avatar
bluantinoo
ITA
Member
Free Members
sp_UserOfflineSmall Offline
May 23, 2012 - 1:24 pm

Hi tracychilders,

I've added a plugin to SP TinyMCE and it has been simpler than I expected.

Just put the unzipped plugin via ftp inside this path:

wp-content/sp-resources/forum-plugins/tinymce-richtext/tynimce/plugins/

Then you go in wp-admin -> forums -> Components -> Editor (TinyMCE)

where you can add your plugin just writing his name inside the first input field "TinyMCE plugins"

in the following screenshot you can see where I've put the plugin folder ("jbimages" in my case) and how I've installed TinyMCE Images Plugin to upload images (third party plugin that you can find here: http://justboil.me/tinymce-ima.....es-plugin/

Image EnlargerImage Enlarger

screenshot are in italian, I hope you can understand 🙂

PS: here you can find a list of "core" buttons and plugins for TinyMCE: http://www.tinymce.com/wiki.ph.....s/controls

Avatar
tracychilders
Member
Free Members
sp_UserOfflineSmall Offline
May 23, 2012 - 2:00 pm

Thanks for the reply bluantinoo. I'm just using my boss account here. I'm developing a plugin that will add programmatically my custom plugin to SimplePress TinyMCE. Is this possible? 

In Wordpress I can add a custom plugin to tinymce using this filter

add_filter("mce_external_plugins", "your_callback_function"); Is there any hook or filter in SimplePress that I can use like this? Thanks!

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
May 23, 2012 - 2:21 pm

No - not at the moment although we have talked about adding something at some stage.
But it sounds like you know you way around the code. If you would like to take a look at the init code and se if you can work out what you want we will be more than happy to add it to the core to ensure it is safe in future updates.

andy-signature.png
YELLOW
SWORDFISH
Avatar
tracychilders
Member
Free Members
sp_UserOfflineSmall Offline
May 24, 2012 - 4:06 pm

Thanks. I will try that out and post it here if it works. By they way, I'm using this hook "sf_hook_post_save" before in SimplePress 4.4.5 but I can't find it anymore. Is there any alternative hook for

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
May 24, 2012 - 4:26 pm

I will be looking myself at this at some stage soon but over the next few days I am totally stuck for spare time. But if you get stuck then do shout.

We no longer have the old 'hooks' file and have instead adopted the standard WP Actions and FIlters hooks so these are what you need to use for V5.

There are three around that area:

'sph_new_post_pre_data_saved' which is run before the post save. This passes in the $newpost array with all the data for the new post.

'sph_new_post_data' which contains the SQL insert SP DB object prior to being actioned.

'sph_new_post_data_saved' which is run immediately after a successful save and also passes in the $newpost array. This is probably the closest to the old post save hook of course. If you use it don't forget to return the $newpost array!

andy-signature.png
YELLOW
SWORDFISH
Avatar
tracychilders
Member
Free Members
sp_UserOfflineSmall Offline
May 24, 2012 - 4:53 pm

Thanks! sph_new_post_data_saved is what I need.

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
May 24, 2012 - 10:23 pm

good to hear. thanks for the update.

Forum Timezone: Europe/Stockholm
Most Users Ever Online: 1170
Currently Online:
Guest(s) 1
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Mr Papa: 19448
Ike: 2086
Brandon: 864
kvr28: 804
jim: 650
FidoSysop: 577
Conrad_Farlow: 531
fiddlerman: 358
Stefano Prete: 325
Member Stats:
Guest Posters: 619
Members: 17361
Moderators: 0
Admins: 4
Forum Stats:
Groups: 7
Forums: 17
Topics: 10127
Posts: 79625