User Menu
Keywords
|
Plugins > SpecialSpecial pages in WikyBlog are likely the easiest way to create a plugin. Getting StartedTo get started you'll need the following.
Hello World (1.1)links.php<?php $specialLinks['Hello']['script'] = 'hello.php'; $specialLinks['Hello']['header'] = 'Hello Special'; hello.php<?php message('Hello World'); See Plugin 1.1.helloSpecial Then install your new plugin from the "Manage Plugins" script found in the administrator's control panel. Once installed, you'll see a new link in the user control panel for your plugin. Hello With Tabs (1.2)As you probably noticed, the previous script only ouputs a message and doesn't make use of the tabbed interface. To make use of this feature, we'll need to access a few global objects: $page and $pageOwner.
links.php<?php $specialLinks['Hello']['script'] = 'hello.php'; $specialLinks['Hello']['header'] = 'Hello Special'; hello.php<?php global $page,$pageOwner,$wbPluginSpace; $contentUri = $page->regLink('Hello World', '/Special/'.$pageOwner['username'].'/'.$wbPluginSpace.'/Hello'); ob_start(); echo 'Hello World'; $page->contentB[$contentUri] = wb::get_clean(); Notes
See Plugin 1.2.helloSpecial Multiple Tabs (1.3)Here's an example of multiple tabs. Notice that the $page->regLinks values not only have different indexes, but also different values. We've also added the label values to the links.php file. links.php<?php $specialLinks['Hello']['script'] = 'hello.php'; $specialLinks['Hello']['header'] = 'Hello Special'; $specialLinks['Hello']['label'] = '1.3 Hello'; $specialLinks['Hello2']['script'] = 'hello.php'; $specialLinks['Hello2']['header'] = 'Hello Special'; $specialLinks['Hello2']['label'] = '1.3 Hello2'; hello.php<?php global $page,$pageOwner,$wbPluginSpace; // First Hello $contentUri = $page->regLink('Hello World', '/Special/'.$pageOwner['username'].'/'.$wbPluginSpace.'/Hello'); ob_start(); echo 'Hello World'; echo ' - '; echo wbLinks::special($wbPluginSpace.'/Hello2','Hello World2'); $page->contentB[$contentUri] = wb::get_clean(); // Second Hello $contentUri = $page->regLink('Hello World2', '/Special/'.$pageOwner['username'].'/'.$wbPluginSpace.'/Hello2'); ob_start(); echo wbLinks::special($wbPluginSpace.'/Hello','Hello World'); echo ' - '; echo 'Hello World2'; $page->contentB[$contentUri] = wb::get_clean(); Notes
See Plugin 1.3.helloSpecial |