performance improved
This commit is contained in:
parent
8b619fc0f9
commit
eb062d5412
@ -14,19 +14,20 @@ foreach ($load_plugins as $key => $value) {
|
|||||||
unset($load_plugins[$key]);
|
unset($load_plugins[$key]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
foreach ($TAGs as $TAG) {
|
if (in_array(substr($text, 0, 1),$TAGs)) {
|
||||||
foreach ($load_plugins as $value) {
|
$TAG = substr($text, 0, 1);
|
||||||
$plugin_name = substr($value, strlen(PATH.'plugins'.DIRECTORY_SEPARATOR), -4);
|
}
|
||||||
if (preg_match("/^(".preg_quote($TAG, '/').$plugin_name."|".preg_quote($TAG, '/').$plugin_name.preg_quote('@').BOT_NAME.") (.*)$/", $text, $matches)) {
|
foreach ($load_plugins as $value) {
|
||||||
$plugin_text = $matches[2];
|
$plugin_name = substr($value, strlen(PATH.'plugins'.DIRECTORY_SEPARATOR), -4);
|
||||||
$plugin_sendto = $from;
|
if (preg_match("/^(".preg_quote($TAG, '/').$plugin_name."|".preg_quote($TAG, '/').$plugin_name.preg_quote('@').BOT_NAME.") (.*)$/", $text, $matches)) {
|
||||||
require_once $value;
|
$plugin_text = $matches[2];
|
||||||
break;
|
$plugin_sendto = $from;
|
||||||
}elseif ($TAG.$plugin_name == $text or $TAG.$plugin_name.'@'.BOT_NAME == $text) {
|
require_once $value;
|
||||||
$plugin_sendto = $from;
|
break;
|
||||||
$BOT->msg($plugin_sendto, "Missing argument(s)");
|
}elseif ($TAG.$plugin_name == $text or $TAG.$plugin_name.'@'.BOT_NAME == $text) {
|
||||||
break;
|
$plugin_sendto = $from;
|
||||||
}
|
$BOT->msg($plugin_sendto, "Missing argument(s)");
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
require_once PATH.'plugins'.DIRECTORY_SEPARATOR.'help.php';
|
require_once PATH.'plugins'.DIRECTORY_SEPARATOR.'help.php';
|
||||||
|
27
VAR_BOT.php
27
VAR_BOT.php
@ -14,19 +14,20 @@ foreach ($load_plugins as $key => $value) {
|
|||||||
unset($load_plugins[$key]);
|
unset($load_plugins[$key]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
foreach ($TAGs as $TAG) {
|
if (in_array(substr($text, 0, 1),$TAGs)) {
|
||||||
foreach ($load_plugins as $value) {
|
$TAG = substr($text, 0, 1);
|
||||||
$plugin_name = substr($value, strlen(PATH.'plugins'.DIRECTORY_SEPARATOR), -4);
|
}
|
||||||
if (preg_match("/^(".preg_quote($TAG, '/').$plugin_name."|".preg_quote($TAG, '/').$plugin_name.preg_quote('@').BOT_NAME.") (.*)$/", $text, $matches)) {
|
foreach ($load_plugins as $value) {
|
||||||
$plugin_text = $matches[2];
|
$plugin_name = substr($value, strlen(PATH.'plugins'.DIRECTORY_SEPARATOR), -4);
|
||||||
$plugin_sendto = $from;
|
if (preg_match("/^(".preg_quote($TAG, '/').$plugin_name."|".preg_quote($TAG, '/').$plugin_name.preg_quote('@').BOT_NAME.") (.*)$/", $text, $matches)) {
|
||||||
require_once $value;
|
$plugin_text = $matches[2];
|
||||||
break;
|
$plugin_sendto = $from;
|
||||||
}elseif ($TAG.$plugin_name == $text or $TAG.$plugin_name.'@'.BOT_NAME == $text) {
|
require_once $value;
|
||||||
$plugin_sendto = $from;
|
break;
|
||||||
$BOT->msg($plugin_sendto, "Missing argument(s)");
|
}elseif ($TAG.$plugin_name == $text or $TAG.$plugin_name.'@'.BOT_NAME == $text) {
|
||||||
break;
|
$plugin_sendto = $from;
|
||||||
}
|
$BOT->msg($plugin_sendto, "Missing argument(s)");
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
require_once PATH.'plugins'.DIRECTORY_SEPARATOR.'help.php';
|
require_once PATH.'plugins'.DIRECTORY_SEPARATOR.'help.php';
|
||||||
|
27
index.php
27
index.php
@ -14,19 +14,20 @@ foreach ($load_plugins as $key => $value) {
|
|||||||
unset($load_plugins[$key]);
|
unset($load_plugins[$key]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
foreach ($TAGs as $TAG) {
|
if (in_array(substr($text, 0, 1),$TAGs)) {
|
||||||
foreach ($load_plugins as $value) {
|
$TAG = substr($text, 0, 1);
|
||||||
$plugin_name = substr($value, strlen(PATH.'plugins'.DIRECTORY_SEPARATOR), -4);
|
}
|
||||||
if (preg_match("/^(".preg_quote($TAG, '/').$plugin_name."|".preg_quote($TAG, '/').$plugin_name.preg_quote('@').BOT_NAME.") (.*)$/", $text, $matches)) {
|
foreach ($load_plugins as $value) {
|
||||||
$plugin_text = $matches[2];
|
$plugin_name = substr($value, strlen(PATH.'plugins'.DIRECTORY_SEPARATOR), -4);
|
||||||
$plugin_sendto = $from;
|
if (preg_match("/^(".preg_quote($TAG, '/').$plugin_name."|".preg_quote($TAG, '/').$plugin_name.preg_quote('@').BOT_NAME.") (.*)$/", $text, $matches)) {
|
||||||
require_once $value;
|
$plugin_text = $matches[2];
|
||||||
break;
|
$plugin_sendto = $from;
|
||||||
}elseif ($TAG.$plugin_name == $text or $TAG.$plugin_name.'@'.BOT_NAME == $text) {
|
require_once $value;
|
||||||
$plugin_sendto = $from;
|
break;
|
||||||
$BOT->msg($plugin_sendto, "Missing argument(s)");
|
}elseif ($TAG.$plugin_name == $text or $TAG.$plugin_name.'@'.BOT_NAME == $text) {
|
||||||
break;
|
$plugin_sendto = $from;
|
||||||
}
|
$BOT->msg($plugin_sendto, "Missing argument(s)");
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
require_once PATH.'plugins'.DIRECTORY_SEPARATOR.'help.php';
|
require_once PATH.'plugins'.DIRECTORY_SEPARATOR.'help.php';
|
||||||
|
Loading…
Reference in New Issue
Block a user