public static function activate() { $meg = Robots_Plugin::install(); Helper::addPanel(1, 'Robots/Logs.php', '蜘蛛日志', '查看蜘蛛日志', 'administrator'); Typecho_Plugin::factory('Widget_Archive')->header = array('Robots_Plugin', 'isbot'); return _t($meg); }
/** * 激活插件方法,如果激活失败,直接抛出异常 * * @access public * @return void * @throws Typecho_Plugin_Exception */ public static function activate() { Helper::addPanel(1, 'Xiami/panel.php', _t('虾米音乐同步预览'), _t('虾米音乐同步预览'), 'administrator'); Typecho_Plugin::factory('Widget_Archive')->header = array('Xiami_Plugin', 'headerScript'); Typecho_Plugin::factory('Widget_Archive')->footer = array('Xiami_Plugin', 'footerScript'); return _t('请在插件设置里设置参数') . $error; }
public static function activate() { $msg = Access_Plugin::install(); Helper::addPanel(1, self::$panel, 'Access控制台', 'Access插件控制台', 'subscriber'); Typecho_Plugin::factory('Widget_Archive')->header = array('Access_Plugin', 'start'); return _t($msg); }
/** * 激活插件方法,如果激活失败,直接抛出异常 * * @access public * @return void * @throws Typecho_Plugin_Exception */ public static function activate() { $info = DomainTheme_Plugin::install(); Helper::addPanel(1, 'DomainTheme/manage-domaintheme.php', '域名模板', '管理域名模板', 'administrator'); Helper::addAction('DomainTheme-edit', 'DomainTheme_Action'); Typecho_Plugin::factory('Widget_Archive')->handleInit = array(__CLASS__, 'run'); return _t($info); }
/** * 激活插件方法,如果激活失败,直接抛出异常 * * @access public * @return void * @throws Typecho_Plugin_Exception */ public static function activate() { Typecho_Plugin::factory('admin/menu.php')->navBar = array('DevTool_Plugin', 'render'); Helper::addPanel(1, 'DevTool/index.php', self::NAME, self::NAME, 'administrator'); Helper::addRoute('dev-tool_index', __TYPECHO_ADMIN_DIR__ . 'dev-tool/index', 'DevTool_Action', 'index'); Helper::addRoute('dev-tool_options', __TYPECHO_ADMIN_DIR__ . 'dev-tool/options', 'DevTool_Action', 'options'); Helper::addRoute('dev-tool_post', __TYPECHO_ADMIN_DIR__ . 'dev-tool/post', 'DevTool_Action', 'post'); }
/** * 激活插件方法,如果激活失败,直接抛出异常 * * @access public * @return void * @throws Typecho_Plugin_Exception */ public static function activate() { if (!Typecho_Db_Adapter_Mysql::isAvailable() && !Typecho_Db_Adapter_Pdo_Mysql::isAvailable()) { throw new Typecho_Plugin_Exception(_t('没有找到任何可用的 Mysql 适配器')); } Helper::addPanel(1, 'EmlogToTypecho/panel.php', _t('从 Emlog 导入数据'), _t('从 Emlog 导入数据'), 'administrator'); Helper::addAction('emlog-to-typecho', 'EmlogToTypecho_Action'); return _t('请在插件设置里设置 Emlog 所在的数据库参数') . $error; }
/** * 激活插件方法,如果激活失败,直接抛出异常 * * @access public * @return void * @throws Typecho_Plugin_Exception */ public static function activate() { Typecho_Plugin::factory('admin/write-post.php')->richEditor = array('TinyMCE_Plugin', 'render'); Typecho_Plugin::factory('admin/write-page.php')->richEditor = array('TinyMCE_Plugin', 'render'); //去除段落 Typecho_Plugin::factory('Widget_Contents_Post_Edit')->write = array('TinyMCE_Plugin', 'filter'); Typecho_Plugin::factory('Widget_Contents_Page_Edit')->write = array('TinyMCE_Plugin', 'filter'); Helper::addPanel(0, 'TinyMCE/tiny_mce/langs.php', '', '', 'contributor'); }
/** * 激活插件方法,如果激活失败,直接抛出异常 * * @access public * @return void * @throws Typecho_Plugin_Exception */ public static function activate() { $info = self::login_log_install(); //插件注册 Helper::addPanel(3, 'LoginLimit/manage_log.php', '登录日志', '管理登录失败日志', 'administrator'); Helper::addAction('login_log', 'LoginLimit_Action'); Typecho_Plugin::factory('Widget_User')->login = array(__CLASS__, 'dologin'); Typecho_Plugin::factory('Widget_Login')->loginFail = array(__CLASS__, 'loginFail'); }
/** * 激活插件方法,如果激活失败,直接抛出异常 * * @access public * @return void * @throws Typecho_Plugin_Exception */ public static function activate() { $info = HuifengMembers_Plugin::membersInstall(); Helper::addPanel(3, 'HuifengMembers/manage-members.php', '会员列表', '管理会员列表', 'administrator'); Helper::addAction('huifeng-members-edit', 'HuifengMembers_Action'); Typecho_Plugin::factory('Widget_Abstract_Contents')->contentEx = array('HuifengMembers_Plugin', 'parse'); Typecho_Plugin::factory('Widget_Abstract_Contents')->excerptEx = array('HuifengMembers_Plugin', 'parse'); Typecho_Plugin::factory('Widget_Abstract_Comments')->contentEx = array('HuifengMembers_Plugin', 'parse'); return _t($info); }
/** * 激活插件方法,如果激活失败,直接抛出异常 * * @access public * @return void * @throws Typecho_Plugin_Exception */ public static function activate() { /* 创建投稿页面及投稿数据表 */ self::initPage(); $result = self::initTable(); /* 添加动作和面板 */ Helper::addAction('contribute', 'Contribute_Action'); Helper::addPanel(3, 'Contribute/panel.php', _t('投稿'), _t('管理投稿'), 'administrator'); return _t($result); }
/** * 激活插件方法,如果激活失败,直接抛出异常 * * @access public * @return void * @throws Typecho_Plugin_Exception */ public static function activate() { $meg = self::install(); Typecho_Plugin::factory('Widget_User')->___sinauthAuthorizeIcon = array('Sinauth_Plugin', 'authorizeIcon'); Helper::addAction('sinauthAuthorize', 'Sinauth_AuthorizeAction'); Helper::addRoute('sinauthAuthorize', '/sinauthAuthorize/', 'Sinauth_AuthorizeAction', 'action'); Helper::addRoute('sinauthCallback', '/sinauthCallback/', 'Sinauth_AuthorizeAction', 'callback'); Helper::addPanel(1, 'Sinauth/panel.php', 'Sinauth', 'Sinauth用户管理', 'administrator'); return _t($meg . '。请进行<a href="options-plugin.php?config=' . self::$pluginName . '">初始化设置</a>'); }
/** * 激活插件方法,如果激活失败,直接抛出异常 * * @access public * @return void * @throws Typecho_Plugin_Exception */ public static function activate() { $msg = self::install(); // Helper::addPanel(2, 'Notes/add-note.php', '写便签', '新建便签', 'administrator'); Helper::addPanel(3, 'Notes/manage-notes.php', '便签', '管理便签', 'administrator'); // Typecho_Plugin::factory('admin/menu.php')->navBar = array('HelloWorld_Plugin', 'render'); Helper::addAction('notes-manage', 'Notes_Action'); Helper::addRoute('share_note', '/share_note/[key]/', 'Notes_Action', 'shareNote'); return _t($meg); }
/** * 激活插件方法,如果激活失败,直接抛出异常 * * @access public * @return void * @throws Typecho_Plugin_Exception */ public static function activate() { $info = Links_Plugin::linksInstall(); Helper::addPanel(3, 'Links/manage-links.php', '友情链接', '管理友情链接', 'administrator'); Helper::addAction('links-edit', 'Links_Action'); Typecho_Plugin::factory('Widget_Abstract_Contents')->contentEx = array('Links_Plugin', 'parse'); Typecho_Plugin::factory('Widget_Abstract_Contents')->excerptEx = array('Links_Plugin', 'parse'); Typecho_Plugin::factory('Widget_Abstract_Comments')->contentEx = array('Links_Plugin', 'parse'); return _t($info); }
/** * 激活插件方法,如果激活失败,直接抛出异常 * * @access public * @return void * @throws Typecho_Plugin_Exception */ public static function activate() { if (false == self::isAvailable()) { throw new Typecho_Plugin_Exception(_t('对不起, 您的主机没有打开 allow_url_fopen 功能而且不支持 php-curl 扩展, 无法正常使用此功能')); } Typecho_Plugin::factory('Widget_Feedback')->finishComment = array('CommentToMail_Plugin', 'parseComment'); Typecho_Plugin::factory('Widget_Comments_Edit')->finishComment = array('CommentToMail_Plugin', 'parseComment'); Helper::addAction(self::$action, 'CommentToMail_Action'); Helper::addPanel(1, self::$panel, '评论邮件提醒', '评论邮件提醒控制台', 'administrator'); return _t('请设置邮箱信息,以使插件正常使用!'); }
public static function activate() { $msg = self::install(); //挂载发布文章和页面的接口 Typecho_Plugin::factory('Widget_Contents_Post_Edit')->finishPublish = array('BaiduSubmit_Action', 'send'); Typecho_Plugin::factory('Widget_Contents_Page_Edit')->finishPublish = array('BaiduSubmit_Action', 'send'); //添加网站地图功能 Helper::addRoute('baidu_sitemap', '/baidu_sitemap.xml', 'BaiduSubmit_Action', 'sitemap'); Helper::addPanel(1, 'BaiduSubmit/Logs.php', '百度结构化日志', '百度结构化日志', 'administrator'); Helper::addRoute('baidu_sitemap_advanced', __TYPECHO_ADMIN_DIR__ . 'baidu_sitemap/advanced', 'BaiduSubmit_Action', 'send_all'); return $msg . '请进入设置填写接口调用地址'; }
/** * 激活插件方法,如果激活失败,直接抛出异常 * * @access public * @return void * @throws Typecho_Plugin_Exception */ public static function activate() { $meg = MostCache_Plugin::install(); Typecho_Plugin::factory('index.php')->begin = array(self::$pluginName . '_Plugin', 'getCache'); Typecho_Plugin::factory('index.php')->end = array(self::$pluginName . '_Plugin', 'setCache'); Typecho_Plugin::factory('Widget_Feedback')->finishComment = array(self::$pluginName . '_Plugin', 'delCache'); Typecho_Plugin::factory('Widget_Contents_Page_Edit')->write = array(self::$pluginName . '_Plugin', 'delCache'); Typecho_Plugin::factory('Widget_Contents_Post_Edit')->write = array(self::$pluginName . '_Plugin', 'delCache'); Helper::addAction('mostcache', 'MostCache_Action'); Helper::addPanel(1, 'MostCache/panel.php', 'MostCache', 'MostCache缓存管理', 'administrator'); return _t($meg . '。请进行<a href="options-plugin.php?config=' . self::$pluginName . '">初始化设置</a>'); }
/** * 激活插件方法,如果激活失败,直接抛出异常 * * @access public * @return void * @throws Typecho_Plugin_Exception */ public static function activate() { if (!Typecho_Db_Adapter_Mysql::isAvailable() && !Typecho_Db_Adapter_Pdo_Mysql::isAvailable()) { throw new Typecho_Plugin_Exception(_t('没有找到任何可用的 Mysql 适配器')); } $error = NULL; if ((!is_dir(__TYPECHO_ROOT_DIR__ . '/usr/uploads/') || !is_writeable(__TYPECHO_ROOT_DIR__ . '/usr/uploads/')) && !is_writeable(__TYPECHO_ROOT_DIR__ . '/usr/')) { $error = '<br /><strong>' . _t('%s 目录不可写, 可能会导致附件转换不成功', __TYPECHO_ROOT_DIR__ . '/usr/uploads/') . '</strong>'; } Helper::addPanel(1, 'MagikeToTypecho/panel.php', _t('从Magike导入数据'), _t('从Magike导入数据'), 'administrator'); Helper::addAction('magike-to-typecho', 'MagikeToTypecho_Action'); return _t('请在插件设置里设置 Magike 所在的数据库参数') . $error; }
/** * 激活插件方法,如果激活失败,直接抛出异常 * * @access public * @return void * @throws Typecho_Plugin_Exception */ public static function activate() { //检查是否有curl扩展 if (!extension_loaded('curl')) { throw new Typecho_Plugin_Exception('缺少curl扩展支持.'); } //创建下载临时目录 $tempDir = __TYPECHO_ROOT_DIR__ . __TYPECHO_PLUGIN_DIR__ . self::$tempPath; !file_exists($tempDir) and !@mkdir($tempDir); //创建菜单和路由 Helper::addPanel(1, 'AppStore/market.php', '应用商店', '应用商店', 'administrator'); Helper::addRoute('app.store.market', __TYPECHO_ADMIN_DIR__ . 'app-store/market', 'AppStore_Action', 'market'); Helper::addRoute('app.store.install', __TYPECHO_ADMIN_DIR__ . 'app-store/install', 'AppStore_Action', 'install'); }
/** * 激活插件方法,如果激活失败,直接抛出异常 * * @access public * @return string * @throws Typecho_Plugin_Exception */ public static function activate() { $info = HighSlide_Plugin::galleryinstall(); Helper::addPanel(3, 'HighSlide/manage-gallery.php', _t('页面相册'), _t('配置页面相册 <span style="color:#999;">(HighSlide全功能版核心支持)</span>'), 'administrator'); Helper::addAction('gallery-edit', 'HighSlide_Action'); Typecho_Plugin::factory('Widget_Archive')->header = array('HighSlide_Plugin', 'headlink'); Typecho_Plugin::factory('Widget_Archive')->footer = array('HighSlide_Plugin', 'footlink'); Typecho_Plugin::factory('Widget_Abstract_Contents')->contentEx = array('HighSlide_Plugin', 'autohighslide'); Typecho_Plugin::factory('Widget_Abstract_Contents')->excerptEx = array('HighSlide_Plugin', 'autohighslide'); Typecho_Plugin::factory('admin/write-post.php')->bottom = array('HighSlide_Plugin', 'jshelper'); Typecho_Plugin::factory('admin/write-page.php')->bottom = array('HighSlide_Plugin', 'jshelper'); Typecho_Plugin::factory('admin/write-post.php')->option = array('HighSlide_Plugin', 'uploadpanel'); return _t($info); }
/** * 激活插件方法,如果激活失败,直接抛出异常 * * @access public * @return void * @throws Typecho_Plugin_Exception */ public static function activate() { // 接口 Typecho_Plugin::factory('接口')->navBar_20 = array('MyPlugin_Plugin', 'functionName'); // 添加菜单 Helper::addMenu('menuName'); // 添加面板, 1 为菜单索引位置, administrator 为进入面板的权限 Helper::addPanel(1, 'MyPlugin/panel.php', 'panelTitle', 'panelSubtitle', 'administrator'); // 添加动作 Helper::addAction('actionName', 'MyPlugin_ActionClassName'); // 添加路由 Helper::addRoute('routeName', '/myroute/route-path', 'MyPlugin_WidgetClassName', 'functionName'); // 激活时返回的信息 return _t('激活时返回的信息'); }
/** * 激活插件方法,如果激活失败,直接抛出异常 * * @access public * @return void * @throws Typecho_Plugin_Exception */ public static function activate() { if (!class_exists('ZipArchive')) { throw new Typecho_Plugin_Exception(_t('对不起, 您的服务器不支持 ZipArchive 类, 无法正常使用此插件')); } if (!is_writable(__TYPECHO_PLUGIN_DIR__)) { throw new Typecho_Plugin_Exception(_t('插件目录无写入权限, 无法正常使用此插件')); } if (!function_exists('file_put_contents') && !function_exists('fopen')) { throw new Typecho_Plugin_Exception(_t('file_put_contents、fopen函数被禁用, 无法正常使用此插件')); throw new Typecho_Plugin_Exception(_t('插件目录无写入权限, 无法正常使用此插件')); } Helper::addPanel(1, 'UploadPlugin/panel.php', _t('上传'), _t('在线插件管理'), 'administrator'); Helper::addAction('upload-plugin', 'UploadPlugin_Action'); }
/** * 激活插件方法,如果激活失败,直接抛出异常 * * @access public * @return void * @throws Typecho_Plugin_Exception */ public static function activate() { $db = Typecho_Db::get(); $golinks = $db->getPrefix() . 'golinks'; $adapter = $db->getAdapterName(); if ("Pdo_SQLite" === $adapter || "SQLite" === $adapter) { $db->query(" CREATE TABLE IF NOT EXISTS " . $golinks . " (\n id INTEGER PRIMARY KEY, \n key TEXT,\n target TEXT,\n count NUMERIC)"); } if ("Pdo_Mysql" === $adapter || "Mysql" === $adapter) { $db->query("CREATE TABLE IF NOT EXISTS " . $golinks . " (\n `id` int(8) NOT NULL AUTO_INCREMENT,\n `key` varchar(32) NOT NULL,\n `target` varchar(10000) NOT NULL,\n `count` int(8) DEFAULT '0',\n PRIMARY KEY (`id`)\n ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1"); } Helper::addAction('golinks', 'GoLinks_Action'); Helper::addRoute('go', '/go/[key]/', 'GoLinks_Action', 'golink'); Helper::addPanel(2, 'GoLinks/panel.php', '链接转换', '链接转换管理', 'administrator'); return '数据表 ' . $golinks . ' 创建成功, 插件已经成功激活!'; }
/** * 激活插件方法,如果激活失败,直接抛出异常 * * @access public * @return void * @throws Typecho_Plugin_Exception */ public static function activate() { try { Links_Plugin::linksInstall(); $err = '建立友情链接数据表,插件启用成功'; } catch (Typecho_Db_Exception $e) { $code = $e->getCode(); if (1050 == $code) { $err = '友情链接数据表已经存在,插件启用成功'; } else { return _t('友情链接插件启用失败'); } } Helper::addPanel(3, 'Links/manage-links.php', '友情链接', '', 'administrator'); Helper::addAction('links-edit', 'Links_Action'); return _t($err); }
/** * 激活duoshuo方法,如果激活失败,直接抛出异常 * * @access public * @return void * @throws Typecho_Plugin_Exception */ public static function activate() { try { Duoshuo_Plugin::duoshuoInstall(); $err = '建立多说信息数据表,duoshuo启用成功'; } catch (Typecho_Db_Exception $e) { $code = $e->getCode(); if (1050 == $code || 1062 == $code || 1060 == $code) { $err = '多说信息数据表数据表已经存在,duoshuo启用成功'; } else { return _t('多说实时同步duoshuo启用失败' . $code); } } Helper::addPanel(3, 'Duoshuo/manage-duoshuo.php', '多说评论', '多说评论管理', 'administrator'); Helper::addAction('duoshuo-edit', 'Duoshuo_Action'); Helper::addRoute('DuoShuoSync', '/DuoShuoSync', 'Duoshuo_Action', 'api'); Typecho_Plugin::factory('Widget_Feedback')->comment = array('Duoshuo_Plugin', 'comments_deny'); //关闭站内留言 return _t($err); }
/** * 激活插件方法,如果激活失败,直接抛出异常 * * @access public * @return void * @throws Typecho_Plugin_Exception */ public static function activate() { $tempDir = dirname(__FILE__) . self::$tempPath; $dataDir = dirname(__FILE__) . self::$dataPath; if (!file_exists($tempDir) and !@mkdir($tempDir)) { throw new Typecho_Plugin_Exception('无法创建临时目录.'); } if (!self::testWrite($tempDir)) { throw new Typecho_Plugin_Exception('.tmp目录没有写入的权限'); } if (!file_exists($dataDir) and !@mkdir($dataDir)) { throw new Typecho_Plugin_Exception('无法创建数据目录.'); } if (!self::testWrite($dataDir)) { throw new Typecho_Plugin_Exception('data目录没有写入的权限'); } Typecho_Plugin::factory('admin/menu.php')->navBar = array('TeStore_Plugin', 'render'); Helper::addPanel(1, 'TeStore/market.php', 'TE应用商店', 'TE应用商店', 'administrator'); Helper::addRoute('te-store_market', __TYPECHO_ADMIN_DIR__ . 'te-store/market', 'TeStore_Action', 'market'); Helper::addRoute('te-store_install', __TYPECHO_ADMIN_DIR__ . 'te-store/install', 'TeStore_Action', 'install'); Helper::addRoute('te-store_uninstall', __TYPECHO_ADMIN_DIR__ . 'te-store/uninstall', 'TeStore_Action', 'uninstall'); }
public static function activate() { Helper::addAction('OptimizeDB', 'OptimizeDB_Action'); Helper::addPanel(1, 'OptimizeDB/Panel.php', '数据库优化', '数据库优化面板', 'administrator'); return '数据库优化插件已经成功激活,请在【控制台->数据库优化】中使用!'; }
/** * 激活插件方法,如果激活失败,直接抛出异常 * * @access public * @return void * @throws Typecho_Plugin_Exception */ public static function activate() { Helper::addAction('typexport', 'TypExport_Action'); Helper::addPanel(1, 'TypExport/panel.php', _t('数据导出'), _t('数据导出'), 'administrator'); return _t('插件已经激活,请设置插件以正常使用!'); }
/** * 激活插件方法,如果激活失败,直接抛出异常 * * @access public * @return void * @throws Typecho_Plugin_Exception */ public static function activate() { Typecho_Plugin::factory('admin/write-post.php')->richEditor = array('UEditor_Plugin', 'render'); Typecho_Plugin::factory('admin/write-page.php')->richEditor = array('UEditor_Plugin', 'render'); Helper::addPanel(0, 'UEditor/ueditor/ueditor.config.js.php', '', '', 'contributor'); }
/** * 激活插件方法,如果激活失败,直接抛出异常 * * @access public * @return void * @throws Typecho_Plugin_Exception */ public static function activate() { Helper::addAction('dbmanager', 'DbManager_Action'); Helper::addPanel(1, 'DbManager/panel.php', _t('数据备份'), _t('数据备份'), 'administrator'); return _t('插件已经激活,请设置插件以正常使用!'); }
/** * 激活插件方法,如果激活失败,直接抛出异常 * * @access public * @return void * @throws Typecho_Plugin_Exception */ public static function activate() { Helper::addPanel(1, "TEDbBak/MainView.php", _t("数据库备份"), _t("数据库备份"), 'administrator'); Helper::addAction('kgsoft_dbbak', 'TEDbBak_Action'); Helper::addRoute('forbiddenUrl', '/usr/plugins/TEDbBak/bak/[str:string]', 'TEDbBak_Action', 'forbid', 'index_page'); }