<?php /** * Morfy Githubser Plugin. * * (c) Moncho Varela / Nakome <*****@*****.**> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ // add javascript file Action::add('theme_footer', function () { echo '<script type="text/javascript" src="' . Url::getBase() . '/plugins/githubser/githubser.js"></script>'; }); // add Shortcode {Githubser name="nakome"} ShortCode::add('Githubser', function ($a) { extract($a); $name = $name ? $name : ''; return '<section> <script type="text/javascript">var githubUsername = "******";</script> <div id="githubUser"></div> </section>'; });
<?php /** * Youtube for Fansoro CMS * Based on https://togetherjs.com/#tryitout-section. * * @author Moncho Varela * * @version 1.0.0 * * @license MIT */ Action::add('theme_footer', function () { echo '<script type="text/javascript" src="' . Url::getBase() . '/plugins/channel/assets/channel-dist.js"></script>'; }); ShortCode::add('Channel', function ($attr) { extract($attr); //{Channel name="nakome" limit="50"} $name = isset($name) ? $name : Config::get('plugins.channel.username'); $limit = isset($limit) ? $limit : 1; $quality = isset($quality) ? $quality : 'false'; $quantity = isset($quantity) ? $quantity : 8; // template factory $template = Template::factory(PLUGINS_PATH . '/' . Config::get('plugins.channel.name') . '/templates/'); $template->setOptions(['strip' => false]); return $template->fetch('gallery.tpl', ['name' => $name, 'limit' => $limit, 'quality' => $quality, 'quantity' => $quantity, 'apikey' => Config::get('plugins.channel.apikey')]); });
<?php /** * TogetherJS for Fansoro CMS * Based on https://togetherjs.com/#tryitout-section. * * @author Moncho Varela * * @version 1.0.0 * * @license MIT */ Action::add('theme_footer', 'script'); ShortCode::add('TogetherJS', 'short'); /** * Description: add javascript link on footer. */ function script() { echo '<script type="text/javascript"> var tg = document.querySelector("#start-togetherjs"); TogetherJSConfig_on = { ready: function () { // configuration var t = TogetherJS._defaultConfiguration; t.getUserName = "******"; t.getUserAvatar = "' . Config::get('plugins.togetherjs.getUserAvatar') . '"; t.sitename = "' . Config::get('plugins.togetherjs.sitename') . '"; t.enableAnalytics = "' . Config::get('plugins.togetherjs.enableAnalytics') . '"; t.analyticsCode = "' . Config::get('plugins.togetherjs.analyticsCode') . '";