123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108 |
- <?php
- if (!defined('STATUSNET')) {
- exit(1);
- }
- class AwesomenessPlugin extends Plugin
- {
- const PLUGIN_VERSION = '0.0.42';
- public function onPluginVersion(array &$versions)
- {
- $versions[] = array(
- 'name' => 'Awesomeness',
- 'version' => self::PLUGIN_VERSION,
- 'author' => 'Jeroen De Dauw',
- 'homepage' => 'https://git.gnu.io/gnu/gnu-social/tree/master/plugins/Awesomeness',
-
- 'rawdescription' => _m('The Awesomeness plugin adds additional awesomeness ' .
- 'to a StatusNet installation.'
- )
- );
- return true;
- }
-
- function onEndShowSections(Action $action)
- {
- $action->elementStart('div', array('id' => 'cornify_section',
- 'class' => 'section'));
- $action->raw(
- <<<EOT
- <a href="http://www.cornify.com" onclick="cornify_add();return false;">
- <img src="http://www.cornify.com/assets/cornify.gif" width="61" height="16" border="0" alt="Cornify" />
- </a>
- <script type="text/javascript">(function() {
- var js = document.createElement('script');
- js.type = 'text/javascript';
- js.async = true;
- js.src = 'http://www.cornify.com/js/cornify.js';
- (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(js);
- })();</script>
- EOT
- );
- $action->elementEnd('div');
- }
-
- function onStartSaveNewNoticeWeb($action, $user, &$content, &$options)
- {
- $content = htmlspecialchars($content);
- $options['rendered'] = preg_replace("/(^|\s|-)((?:awesome|awesomeness)[\?!\.\,]?)(\s|$)/i", " <b>$2</b> ", $content);
- }
- }
|