http://wiki.soholaunch.com/index.php?title=Creating_a_basic_plugin&feed=atom&action=historyCreating a basic plugin - Revision history2024-03-28T15:53:30ZRevision history for this page on the wikiMediaWiki 1.18.1http://wiki.soholaunch.com/index.php?title=Creating_a_basic_plugin&diff=5374&oldid=prevCameron Allen: /* Create an install_manifest.php for your plugin */2013-12-04T16:39:26Z<p><span class="autocomment">Create an install_manifest.php for your plugin</span></p>
<table class='diff diff-contentalign-left'>
<col class='diff-marker' />
<col class='diff-content' />
<col class='diff-marker' />
<col class='diff-content' />
<tr valign='top'>
<td colspan='2' style="background-color: white; color:black;">←Older revision</td>
<td colspan='2' style="background-color: white; color:black;">Revision as of 16:39, 4 December 2013</td>
</tr><tr><td colspan="2" class="diff-lineno">Line 50:</td>
<td colspan="2" class="diff-lineno">Line 50:</td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>$plugin_homepage = "http://example.com";</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>$plugin_homepage = "http://example.com";</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>$plugin_description = "Adds drag and drop 'Hello World' item to the Page Editor";</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>$plugin_description = "Adds drag and drop 'Hello World' item to the Page Editor";</div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"># This creates a link on the admin panel to the script specified (helloworld_settings.php)</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;">$plugin_options_link = "helloworld_settings.php";</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"># This creates a button & description on the admin panel to the script specified (helloworld_settings.php)</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;">$data['enabled_button_link'] = "helloworld_settings.php";</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;">$data['button_caption_text'] = "Hello World Settings";</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;">hook_special("main_menu_button", $data);</ins></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>/* Include my hello-world.php file at *this* location (specified by hook id found in the Soholaunch source code) */</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>/* Include my hello-world.php file at *this* location (specified by hook id found in the Soholaunch source code) */</div></td></tr>
</table>Cameron Allenhttp://wiki.soholaunch.com/index.php?title=Creating_a_basic_plugin&diff=5373&oldid=prevCameron Allen: /* Optional: Plugin icon */2013-10-18T23:17:51Z<p><span class="autocomment">Optional: Plugin icon</span></p>
<table class='diff diff-contentalign-left'>
<col class='diff-marker' />
<col class='diff-content' />
<col class='diff-marker' />
<col class='diff-content' />
<tr valign='top'>
<td colspan='2' style="background-color: white; color:black;">←Older revision</td>
<td colspan='2' style="background-color: white; color:black;">Revision as of 23:17, 18 October 2013</td>
</tr><tr><td colspan="2" class="diff-lineno">Line 58:</td>
<td colspan="2" class="diff-lineno">Line 58:</td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>If you'd like your plugin to have it's own icon displayed next to it's name in the Plugin Manager (instead of the default puzzle piece graphic), include the image file in your plugin folder, and add a line like this to your install_manifest.php...</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>If you'd like your plugin to have it's own icon displayed next to it's name in the Plugin Manager (instead of the default puzzle piece graphic), include the image file in your plugin folder, and add a line like this to your install_manifest.php...</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  $plugin_icon = "my_plugin_icon.gif"</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  $plugin_icon = "my_plugin_icon.gif"</div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;">====Optional: Plugin Options Link====</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;">This adds a link to your plugin's settings page. The .php file should be inside your plugin directory.</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;">$plugin_options_link="my_plugins_settings.php";</ins></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>==Recap: This is what your plugin folder should look like==</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>==Recap: This is what your plugin folder should look like==</div></td></tr>
</table>Cameron Allenhttp://wiki.soholaunch.com/index.php?title=Creating_a_basic_plugin&diff=5372&oldid=prevSoho: /* Introduction */2013-10-17T23:19:13Z<p><span class="autocomment">Introduction</span></p>
<table class='diff diff-contentalign-left'>
<col class='diff-marker' />
<col class='diff-content' />
<col class='diff-marker' />
<col class='diff-content' />
<tr valign='top'>
<td colspan='2' style="background-color: white; color:black;">←Older revision</td>
<td colspan='2' style="background-color: white; color:black;">Revision as of 23:19, 17 October 2013</td>
</tr><tr><td colspan="2" class="diff-lineno">Line 2:</td>
<td colspan="2" class="diff-lineno">Line 2:</td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>This tutorial will walk you through the creation of a basic plugin that opens a javascript alert box with the text "Hello World" in it on every page of your website (annoying, I know, but at least you'll know it's working).</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>This tutorial will walk you through the creation of a basic plugin that opens a javascript alert box with the text "Hello World" in it on every page of your website (annoying, I know, but at least you'll know it's working).</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div>'''[http://soholaunch.com/media/hello-world.zip <del class="diffchange diffchange-inline">download </del>the example plugin]'''</div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>'''[http://soholaunch.com/media/hello-world.zip <ins class="diffchange diffchange-inline">Download </ins>the example plugin]'''</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>'''You'll need...'''</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>'''You'll need...'''</div></td></tr>
</table>Sohohttp://wiki.soholaunch.com/index.php?title=Creating_a_basic_plugin&diff=5371&oldid=prevSoho: /* Introduction */2013-10-17T23:19:03Z<p><span class="autocomment">Introduction</span></p>
<table class='diff diff-contentalign-left'>
<col class='diff-marker' />
<col class='diff-content' />
<col class='diff-marker' />
<col class='diff-content' />
<tr valign='top'>
<td colspan='2' style="background-color: white; color:black;">←Older revision</td>
<td colspan='2' style="background-color: white; color:black;">Revision as of 23:19, 17 October 2013</td>
</tr><tr><td colspan="2" class="diff-lineno">Line 2:</td>
<td colspan="2" class="diff-lineno">Line 2:</td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>This tutorial will walk you through the creation of a basic plugin that opens a javascript alert box with the text "Hello World" in it on every page of your website (annoying, I know, but at least you'll know it's working).</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>This tutorial will walk you through the creation of a basic plugin that opens a javascript alert box with the text "Hello World" in it on every page of your website (annoying, I know, but at least you'll know it's working).</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div><del class="diffchange diffchange-inline">'''Download the example plugin:</del>''' [http://soholaunch.com/media/hello-world.zip download the example plugin]</div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>'''[http://soholaunch.com/media/hello-world.zip download the example plugin]<ins class="diffchange diffchange-inline">'''</ins></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>'''You'll need...'''</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>'''You'll need...'''</div></td></tr>
</table>Sohohttp://wiki.soholaunch.com/index.php?title=Creating_a_basic_plugin&diff=5370&oldid=prevSoho: /* Introduction */2013-10-17T23:18:38Z<p><span class="autocomment">Introduction</span></p>
<table class='diff diff-contentalign-left'>
<col class='diff-marker' />
<col class='diff-content' />
<col class='diff-marker' />
<col class='diff-content' />
<tr valign='top'>
<td colspan='2' style="background-color: white; color:black;">←Older revision</td>
<td colspan='2' style="background-color: white; color:black;">Revision as of 23:18, 17 October 2013</td>
</tr><tr><td colspan="2" class="diff-lineno">Line 2:</td>
<td colspan="2" class="diff-lineno">Line 2:</td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>This tutorial will walk you through the creation of a basic plugin that opens a javascript alert box with the text "Hello World" in it on every page of your website (annoying, I know, but at least you'll know it's working).</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>This tutorial will walk you through the creation of a basic plugin that opens a javascript alert box with the text "Hello World" in it on every page of your website (annoying, I know, but at least you'll know it's working).</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div><del class="diffchange diffchange-inline">Link to *download </del>the example plugin:<del class="diffchange diffchange-inline">* </del>[http://soholaunch.com/media/hello-world.zip download the example plugin]</div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline">'''Download </ins>the example plugin:<ins class="diffchange diffchange-inline">''' </ins>[http://soholaunch.com/media/hello-world.zip download the example plugin]</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>'''You'll need...'''</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>'''You'll need...'''</div></td></tr>
</table>Sohohttp://wiki.soholaunch.com/index.php?title=Creating_a_basic_plugin&diff=5369&oldid=prevSoho: /* Introduction */2013-10-17T23:18:23Z<p><span class="autocomment">Introduction</span></p>
<table class='diff diff-contentalign-left'>
<col class='diff-marker' />
<col class='diff-content' />
<col class='diff-marker' />
<col class='diff-content' />
<tr valign='top'>
<td colspan='2' style="background-color: white; color:black;">←Older revision</td>
<td colspan='2' style="background-color: white; color:black;">Revision as of 23:18, 17 October 2013</td>
</tr><tr><td colspan="2" class="diff-lineno">Line 2:</td>
<td colspan="2" class="diff-lineno">Line 2:</td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>This tutorial will walk you through the creation of a basic plugin that opens a javascript alert box with the text "Hello World" in it on every page of your website (annoying, I know, but at least you'll know it's working).</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>This tutorial will walk you through the creation of a basic plugin that opens a javascript alert box with the text "Hello World" in it on every page of your website (annoying, I know, but at least you'll know it's working).</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div>*[http://soholaunch.com/media/hello-world.zip download the example plugin]<del class="diffchange diffchange-inline">*</del></div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline">Link to *download the example plugin:</ins>* [http://soholaunch.com/media/hello-world.zip download the example plugin]</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>'''You'll need...'''</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>'''You'll need...'''</div></td></tr>
</table>Sohohttp://wiki.soholaunch.com/index.php?title=Creating_a_basic_plugin&diff=5368&oldid=prevSoho: /* Introduction */2013-10-17T23:17:49Z<p><span class="autocomment">Introduction</span></p>
<table class='diff diff-contentalign-left'>
<col class='diff-marker' />
<col class='diff-content' />
<col class='diff-marker' />
<col class='diff-content' />
<tr valign='top'>
<td colspan='2' style="background-color: white; color:black;">←Older revision</td>
<td colspan='2' style="background-color: white; color:black;">Revision as of 23:17, 17 October 2013</td>
</tr><tr><td colspan="2" class="diff-lineno">Line 1:</td>
<td colspan="2" class="diff-lineno">Line 1:</td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>==Introduction==</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>==Introduction==</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>This tutorial will walk you through the creation of a basic plugin that opens a javascript alert box with the text "Hello World" in it on every page of your website (annoying, I know, but at least you'll know it's working).</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>This tutorial will walk you through the creation of a basic plugin that opens a javascript alert box with the text "Hello World" in it on every page of your website (annoying, I know, but at least you'll know it's working).</div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;">*[http://soholaunch.com/media/hello-world.zip download the example plugin]*</ins></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>'''You'll need...'''</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>'''You'll need...'''</div></td></tr>
</table>Sohohttp://wiki.soholaunch.com/index.php?title=Creating_a_basic_plugin&diff=5367&oldid=prevSoho at 23:03, 17 October 20132013-10-17T23:03:17Z<p></p>
<table class='diff diff-contentalign-left'>
<col class='diff-marker' />
<col class='diff-content' />
<col class='diff-marker' />
<col class='diff-content' />
<tr valign='top'>
<td colspan='2' style="background-color: white; color:black;">←Older revision</td>
<td colspan='2' style="background-color: white; color:black;">Revision as of 23:03, 17 October 2013</td>
</tr><tr><td colspan="2" class="diff-lineno">Line 66:</td>
<td colspan="2" class="diff-lineno">Line 66:</td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  main_menu-helloworld.php</pre></div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  main_menu-helloworld.php</pre></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div>Using winzip, winrar, or other <del class="diffchange diffchange-inline">simliar </del>archive app, zip-up your hello-world folder. In Windows, you'd right-click on <del class="diffchange diffchange-inline">your </del>hello-world folder and click "Add to archive..."</div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>Using winzip, winrar, or other <ins class="diffchange diffchange-inline">similar </ins>archive app, zip-up your <ins class="diffchange diffchange-inline">''</ins>hello-world<ins class="diffchange diffchange-inline">'' </ins>folder <ins class="diffchange diffchange-inline">(the folder itself, not just the contents)</ins>. In Windows, you'd right-click on <ins class="diffchange diffchange-inline">the ''</ins>hello-world<ins class="diffchange diffchange-inline">'' </ins>folder and click "Add to archive..."</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>For purposes of example, name your .zip file *hello-world.zip*</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>For purposes of example, name your .zip file *hello-world.zip*</div></td></tr>
</table>Sohohttp://wiki.soholaunch.com/index.php?title=Creating_a_basic_plugin&diff=5366&oldid=prevSoho at 22:58, 17 October 20132013-10-17T22:58:29Z<p></p>
<table class='diff diff-contentalign-left'>
<col class='diff-marker' />
<col class='diff-content' />
<col class='diff-marker' />
<col class='diff-content' />
<tr valign='top'>
<td colspan='2' style="background-color: white; color:black;">←Older revision</td>
<td colspan='2' style="background-color: white; color:black;">Revision as of 22:58, 17 October 2013</td>
</tr><tr><td colspan="2" class="diff-lineno">Line 10:</td>
<td colspan="2" class="diff-lineno">Line 10:</td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>==Create a folder for your plugin==</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>==Create a folder for your plugin==</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div>Create a folder on your computer called <del class="diffchange diffchange-inline">"</del>hello-world<del class="diffchange diffchange-inline">"</del>. All of your plugin's files will go in this folder.</div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>Create a folder on your computer called <ins class="diffchange diffchange-inline">''</ins>hello-world<ins class="diffchange diffchange-inline">''</ins>. All of your plugin's files will go in this folder.</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>==Find the hook you want to attach your custom file to==</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>==Find the hook you want to attach your custom file to==</div></td></tr>
<tr><td colspan="2" class="diff-lineno">Line 23:</td>
<td colspan="2" class="diff-lineno">Line 23:</td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>==Create your include file==</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>==Create your include file==</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div>In your hello-world folder, create a file called hello-world.php (note: actual filename doesn't matter). This file will contain add a javascript alert to the $template_footer variable's contents. The $template_footer variable contains all of the website html from the page content downward (so all content that gets swapped-in for #content#, as well as the template html that follows #content# in the template file).</div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>In your <ins class="diffchange diffchange-inline">''</ins>hello-world<ins class="diffchange diffchange-inline">'' </ins>folder, create a file called <ins class="diffchange diffchange-inline">''</ins>hello-world.php<ins class="diffchange diffchange-inline">'' </ins>(note: actual filename doesn't matter). This file will contain add a javascript alert to the <ins class="diffchange diffchange-inline">''</ins>$template_footer<ins class="diffchange diffchange-inline">'' </ins>variable's contents. The <ins class="diffchange diffchange-inline">''</ins>$template_footer<ins class="diffchange diffchange-inline">'' </ins>variable contains all of the website html from the page content downward (so all content that gets swapped-in for #content#, as well as the template html that follows #content# in the template file).</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>Contents of hello-world.php...</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>Contents of hello-world.php...</div></td></tr>
<tr><td colspan="2" class="diff-lineno">Line 31:</td>
<td colspan="2" class="diff-lineno">Line 31:</td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>==Create an install_manifest.php for your plugin==</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>==Create an install_manifest.php for your plugin==</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div>The install_manifest.php is the configuration file for your plugin. Every Soholaunch plugin has an install_manifest.php. This file is read by Soholaunch when the user installs the plugin. It tells Soholaunch how to display your plugin (title, author, etc), and where to hook its files into<del class="diffchange diffchange-inline">. "install_manifest.php"</del>.  </div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>The <ins class="diffchange diffchange-inline">''</ins>install_manifest.php<ins class="diffchange diffchange-inline">'' </ins>is the configuration file for your plugin. Every Soholaunch plugin has an <ins class="diffchange diffchange-inline">''</ins>install_manifest.php<ins class="diffchange diffchange-inline">''</ins>. This file is read by Soholaunch when the user installs the plugin. It tells Soholaunch how to display your plugin (title, author, etc), and where to hook its files into.</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div>There are two types of content in any given install_manifest.php:</div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>There are two types of content in any given <ins class="diffchange diffchange-inline">''</ins>install_manifest.php<ins class="diffchange diffchange-inline">''</ins>:</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>#'''Information''' - plugin title, author, etc</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>#'''Information''' - plugin title, author, etc</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>#'''Instructions''' - "hook me in here, here, and here"</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>#'''Instructions''' - "hook me in here, here, and here"</div></td></tr>
<tr><td colspan="2" class="diff-lineno">Line 39:</td>
<td colspan="2" class="diff-lineno">Line 39:</td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>Here's what our install_manifest.php is going to look like...</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>Here's what our install_manifest.php is going to look like...</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div><pre><?php</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div><pre><?php</div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"># This should match your plugin's folder name</ins></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>$plugin_folder = "hello-world";</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>$plugin_folder = "hello-world";</div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"># These are just for display to the user, you can define them however you see fit (html allowed)</ins></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>$plugin_title = "Hello World";</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>$plugin_title = "Hello World";</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>$plugin_version = "2.0";</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>$plugin_version = "2.0";</div></td></tr>
</table>Sohohttp://wiki.soholaunch.com/index.php?title=Creating_a_basic_plugin&diff=5365&oldid=prevSoho at 22:51, 17 October 20132013-10-17T22:51:51Z<p></p>
<table class='diff diff-contentalign-left'>
<col class='diff-marker' />
<col class='diff-content' />
<col class='diff-marker' />
<col class='diff-content' />
<tr valign='top'>
<td colspan='2' style="background-color: white; color:black;">←Older revision</td>
<td colspan='2' style="background-color: white; color:black;">Revision as of 22:51, 17 October 2013</td>
</tr><tr><td colspan="2" class="diff-lineno">Line 54:</td>
<td colspan="2" class="diff-lineno">Line 54:</td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  $plugin_icon = "my_plugin_icon.gif"</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  $plugin_icon = "my_plugin_icon.gif"</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div>==<del class="diffchange diffchange-inline">Zip </del>your plugin folder==</div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>==<ins class="diffchange diffchange-inline">Recap: This is what </ins>your plugin folder <ins class="diffchange diffchange-inline">should look like</ins>==</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div>At this point your plugin is essentially done.  </div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>At this point your plugin is essentially done.</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>Your plugin folder should look like this now...</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>Your plugin folder should look like this now...</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div><del class="diffchange diffchange-inline">HELLO_WORLD</del>/</div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline"><pre>hello-world</ins>/</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div><del class="diffchange diffchange-inline">*</del>install_manifest.php</div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline"> </ins>install_manifest.php</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div><del class="diffchange diffchange-inline">*</del>main_menu-helloworld.php</div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline"> </ins>main_menu-helloworld.php<ins class="diffchange diffchange-inline"></pre></ins></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div>Using winzip, winrar, or other simliar archive app, zip-up your <del class="diffchange diffchange-inline">HELLO_WORLD </del>folder. <del class="diffchange diffchange-inline">So for example if you've got zip options on your right-click menu in </del>Windows, you'd right-click on your <del class="diffchange diffchange-inline">HELLO_WORLD </del>folder and click "Add to archive..."<del class="diffchange diffchange-inline">.</del></div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>Using winzip, winrar, or other simliar archive app, zip-up your <ins class="diffchange diffchange-inline">hello-world </ins>folder. <ins class="diffchange diffchange-inline">In </ins>Windows, you'd right-click on your <ins class="diffchange diffchange-inline">hello-world </ins>folder and click "Add to archive..."</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div>For purposes of example, name your .zip file <del class="diffchange diffchange-inline">hello_world_plugin</del>-<del class="diffchange diffchange-inline">v1</del>.zip</div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>For purposes of example, name your .zip file <ins class="diffchange diffchange-inline">*hello</ins>-<ins class="diffchange diffchange-inline">world</ins>.zip<ins class="diffchange diffchange-inline">*</ins></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div>==<del class="diffchange diffchange-inline">Good to go!</del>==</div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>==<ins class="diffchange diffchange-inline">You're ready</ins>==</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div>Your plugin is finished and ready to rock. Log-in to <del class="diffchange diffchange-inline">Pro Edition </del>and upload/install your <del class="diffchange diffchange-inline">hello_world_plugin</del>-<del class="diffchange diffchange-inline">v1</del>.zip via the Plugin Manager.</div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>Your plugin is finished and ready to rock. Log-in to <ins class="diffchange diffchange-inline">''/sohoadmin'' </ins>and upload/install your <ins class="diffchange diffchange-inline">hello</ins>-<ins class="diffchange diffchange-inline">world</ins>.zip via the Plugin Manager.</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div>Then <del class="diffchange diffchange-inline">check out the main menu.</del></div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>Then <ins class="diffchange diffchange-inline">view your website</ins>, and you <ins class="diffchange diffchange-inline">should see </ins>the <ins class="diffchange diffchange-inline">"Hello</ins>, <ins class="diffchange diffchange-inline">World" javascript alert</ins>.</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div> </div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div></div></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div> </div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div></div></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div><del class="diffchange diffchange-inline">==Notes/Afterwards==</del></div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div></div></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div><del class="diffchange diffchange-inline">*Considering that we just wanted to add a line of text</del>, <del class="diffchange diffchange-inline">using the [[Hook_overwrite|hook_overwrite]] method to replace the entire main_menu.php file with our own copy was more than a little excessive. Once you get comfortable with the basics, you'll be using [[hook_replace]] for this kind of thing. It's also usually better to use [[hook_replace]] over hook_overwrite because it tends to be ''much'' more forward-compatible </del>and <del class="diffchange diffchange-inline">software update-friendly.</del></div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div></div></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div> </div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div></div></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div><del class="diffchange diffchange-inline">===sample_module.php===</del></div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div></div></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div><del class="diffchange diffchange-inline">If </del>you<del class="diffchange diffchange-inline">'re going to create a management module for your plugin, a great place to start is by making a copy of </del>the <del class="diffchange diffchange-inline">following file (added in v4.9 r36)... </del></div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div></div></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div><del class="diffchange diffchange-inline"> '''sohoadmin/program/modules/sample_module.php'''</del></div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div></div></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div> </div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div></div></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div><del class="diffchange diffchange-inline">With this file you already have the basic structure of a Soholaunch feature module. A quick way to start building your module is to make a copy of this file</del>, <del class="diffchange diffchange-inline">rename it as (i.e.) mymodule.php, then stick a link to sohoadmin/program/modules/mymodule.php somewhere on the Main Menu (by hacking sohoadmin/program/main_menu.php) so you can access it as you're developing it. Just don't run Software Updates while you're working on it via this method though or you'll lose your main menu hack</del>.</div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>[[Category:Plugins]]</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>[[Category:Plugins]]</div></td></tr>
</table>Soho