. * */ /* Name: Content Slug: content Category: content Url: https://www.vvveb.com Description: Add text at the beginning and end of a post Author: givanz Version: 0.1 Thumb: content.svg Author url: https://www.vvveb.com Settings: /admin/index.php?module=plugins/content/settings */ use Vvveb\System\Event as Event; if (! defined('V_VERSION')) { die('Invalid request!'); } class ContentPlugin { function admin() { //add admin menu item } function app() { Event::on('Vvveb\Component\Post', 'results', __CLASS__, function ($results = false) { if ($results) { $options = Vvveb\getSetting('content-plugin', ['start', 'end']); $results['content'] = ($options['start'] ?? '') . $results['content']; $results['content'] .= $options['end'] ?? ''; } return [$results]; }); } function __construct() { if (APP == 'admin') { $this->admin(); } else { if (APP == 'app') { $this->app(); } } } } $contentPlugin = new ContentPlugin();