Jump to content

How to write a hook/app/plugin?


ipbfuck

Recommended Posts

Hi!

yesterday in 10 minute i've write a small plugin for wordpress to make click-able background with cursor and title (demo in my website - i've put manually inside ipb).

now i want try to make a plugin/app/hook for ipb... i've installed ipb in my wamp server; dev tools, all is ok but... really, i don't have any idea on how to continue!

 

1) hook; app; plugin... what is the real difference? when is best to make one instead of another?

2) i need just a little page with a url input a txt input (two setting field) and include a javascript code block in footer with this custom variables.

 

-

how i can do this? someone can help me to make my first plugin? ?

thanks in advance,

S.N.

Link to comment
Share on other sites

Applications are what make up the IPS Community Suite. Applications provided by IPS include ForumsGalleryCommerce, etc. As a third party developer, you can create your own applications to add new areas of the suite.

 

Plugins provide a way for developers to modify or extend the behaviour of applications within the IPS Community Suite.

Further information can be found on: https://community.invisionpower.com/4docs/advanced-usage/development/plugins-r71/

 

 

Link to comment
Share on other sites

ok, thank'u!

please, can u help me to find any guide to make a little hook to put a jquery + 2 setting field in hook page and add this in footer?

i need just to start and understood how this work. if i can work with wp i think i can work also with ipb :)

 

Link to comment
Share on other sites

Hello,

Just now, laltroweb.it said:

then, for this little work the best choice is a hook, im right? :)

Hook is part of plugin or app.

Just now, laltroweb.it said:

but i don't know how to use "setting" key and put it as input field in plugin detail page :/

Go to plugins folder - your plugin - rename settings.rename.php to settings.php and open it.

Add form fields. See 

2. go to ACP - System - Plugins - your plugin - tab Settings. Add settings

Link to comment
Share on other sites

Hi, i've another question sorry!

I've put code in fotter and vaf in form, but i don't have understood how i can put, in same plugin, also a different piece of code in header (for css).

when i go to template class list i cannot found nothing for css inclusion :|

Link to comment
Share on other sites

hi, sorry, i need to ask for clean output.

this is in form setting (no clean, i've try with htmlentities ecc, but nothing seems to work here.

$form->add( new \IPS\Helpers\Form\Text( 'Url', \IPS\Settings::i()->url ) );
$form->add( new \IPS\Helpers\Form\Text( 'Title', \IPS\Settings::i()->title ) );

so, i want try to fix output:

public static function hookData() {
    $url = '{setting="url"}';
    $title = '{setting="title"}';

but also here, var contain quotes, so, eg, i cannot use dd slashes.

 

im sure exist a simplest way, but i don't know.

someone can report me a way for this? thank in advance :)

 

Link to comment
Share on other sites

thank'u very much :)

is more simple with this instead of {setting="key"} :p

now i've used this, and work as expected:

// remove single e double quotes in url
$url = htmlentities(str_replace(array('"', '\''), '', \IPS\Settings::i()->url));

// maintain quotes here, but fix with add addslashes
$title = addslashes(htmlentities(\IPS\Settings::i()->title, ENT_NOQUOTES));

regards :)

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...