当前位置:网站首页>Zblog determines whether a plug-in installs the enabled built-in function code

Zblog determines whether a plug-in installs the enabled built-in function code

2022-06-24 16:48:00 Shell house railing - Wenxi

Development Zblog When the subject is , Occasionally, a function depends on a plug-in , such as , The image upload function relies on... For most themes Ueditor Editor , and Ueditor The editor is in ZBlog Is in the form of a plug-in , Can be deleted by the user , If it is deleted, the uploading function of the theme image will be affected , Therefore, you need to determine whether the plug-in is installed in the topic , To prompt the user to install or give different setting schemes .

Correlation function

zblog The function used to determine whether the plug-in is installed

$zbp->LoadApp('plugin', 'plugin ID')->isloaded

Zblog Function used to determine whether the plug-in is enabled in

$zbp->CheckPlugin('plugin ID')

Tips :【plugin ID】 It can be found in the configuration file of the plug-in plugin.xml Found in , Such as UEditor Medium “UEditor” The plug-in ID.

Examples of use

1、 Judge UEditor Whether the editor plug-in is installed

if($zbp->LoadApp('plugin', 'UEditor')->isloaded){
	echo 'UEditor Editor plug-in installed ';}
	else{
	echo 'UEditor The editor plug-in has not been installed ';}

2、 Judge UEditor Whether the editor plug-in is enabled

if($zbp->CheckPlugin('UEditor')){
	echo 'UEditor Editor plug-in enabled ';}
	else{
	echo 'UEditor The editor plug-in has not been enabled ';}

Function position :zb_system/function/lib/zblogphp.php

原网站

版权声明
本文为[Shell house railing - Wenxi]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/175/202206241644369356.html