| | |
| | | * @param string $_hash nocache hash value |
| | | * @param bool $_nocache nocache flag |
| | | */ |
| | | public static function call(string $_name, Smarty_Internal_Template $_template, array $_params, string $_hash, bool $_nocache) { |
| | | public static function call($_name, Smarty_Internal_Template $_template, $_params, $_hash, $_nocache) { |
| | | if ($_nocache) { |
| | | $_function = "smarty_template_function_{$_name}_nocache"; |
| | | } else { |
| | |
| | | protected function _initialize() { |
| | | } |
| | | |
| | | function get_table_fields($tableName): array { |
| | | function get_table_fields($tableName) { |
| | | include(CONFIG_PATH . 'db.config.php'); |
| | | $mysqli = new mysqli($db_config['dbhost'], $db_config['dbuser'], $db_config['dbpass'], $db_config['dbname']); |
| | | $query = $mysqli->query("SHOW COLUMNS FROM $tableName"); |
| | |
| | | } |
| | | |
| | | |
| | | function insert_into($table, $data = array()): bool { |
| | | function insert_into($table, $data = array()) { |
| | | $value = array(); |
| | | $this->db->connect(); |
| | | include(PLUS_PATH . 'dbstruct.cache.php'); |
| | |
| | | * @param int $tm 跳转时间 |
| | | * @param string $type 1:后台操作 |
| | | */ |
| | | function ACT_layer_msg(string $msg = "操作已成功!", int $st = 9, string $url = '', int $tm = 2, string $type = '0') { |
| | | function ACT_layer_msg($msg = "操作已成功!", $st = 9, $url = '', $tm = 2, $type = '0') { |
| | | //解决ie9 $.get $.post 回调函数的返回值为undefine |
| | | header("Content-Type: text/html; charset=UTF-8"); |
| | | |
| | |
| | | * @param string $tm 时间 |
| | | * @param string $error |
| | | */ |
| | | function layer_msg(string $msg, string $st = '9', string $type = '0', string $url = '', string $tm = '2', string $error = '0') { |
| | | function layer_msg($msg, $st = '9', $type = '0', $url = '', $tm = '2', $error = '0') { |
| | | if ($type == '1') { |
| | | |
| | | $this->ACT_layer_msg($msg, $st, $url, $tm, $type); |
| | |
| | | $_GET['m'] = 'index'; |
| | | } |
| | | |
| | | $ModuleName = $_GET['m'] ?? ''; |
| | | $ModuleName = $_GET['m'] ?: ''; |
| | | if ($ModuleName == '') $ModuleName = 'index'; |
| | | //默认情况下,调用app/controller下与当前目录名相同的模块 |
| | | //如当前目录名为ask,则默认调用的是app/controller/ask/下的控制器 |
| | |
| | | |
| | | /* 抓取远程图片 */ |
| | | $list = array(); |
| | | $source = $_POST[$fieldName] ?? $_GET[$fieldName]; |
| | | $source = $_POST[$fieldName] ? $_GET[$fieldName]:""; |
| | | foreach ($source as $imgUrl) { |
| | | $item = new Uploader($imgUrl, $config, "remote"); |
| | | $info = $item->getFileInfo(); |