public static function del_auth($auth_code, $cash_name) { global $kekezu; global $_lang; $auth_item_obj = new Keke_witkey_auth_item_class(); if (isset($auth_code)) { switch (is_array($auth_code)) { case "0": $auth_item = keke_auth_base_class::get_auth_item($auth_code); $auth_item['auth_small_ico'] and keke_file_class::del_file($auth_item['auth_small_ico']); $auth_item['auth_small_n_ico'] and keke_file_class::del_file($auth_item['auth_small_n_ico']); $auth_item['auth_big_ico'] and keke_file_class::del_file($auth_item['auth_big_ico']); $auth_item_obj->setWhere("auth_code='{$auth_code}'"); $res = $auth_item_obj->del_keke_witkey_auth_item(); $res and $kekezu->_cache_obj->del($cash_name); $res and kekezu::admin_system_log($_lang['delete_auth_item'] . $auth_item['auth_title']); if (file_exists(S_ROOT . "./auth/" . $auth_item['auth_dir'] . "/admin/uninstall_sql.php")) { require S_ROOT . "./auth/" . $auth_item['auth_dir'] . "/admin/uninstall_sql.php"; } $res and kekezu::admin_show_msg($_lang['auth_item_delete_success_notice'], 'index.php?do=auth&view=item_list', '3', '', 'success') or kekezu::admin_show_msg($_lang['auth_item_delete_fail'], 'index.php?do=auth&view=item_list', '3', '', 'error'); break; case "1": $auth_code_str = implode(",", $auth_code); if (sizeof($auth_code_str)) { $auth_item_obj->setWhere(" FIND_IN_SET(auth_code,'{$auth_code_str}')>0"); $res = $auth_item_obj->del_keke_witkey_auth_item(); $res and kekezu::admin_system_log($_lang['delete_auth_item'] . "{$auth_code_str}"); $res and kekezu::admin_show_msg($_lang['auth_item_mulit_delete_success'], 'index.php?do=auth&view=item_list', '3', '', 'success') or $res and kekezu::admin_show_msg($_lang['auth_item_mulit_delete_fail'], 'index.php?do=auth&view=item_list', '3', '', 'error'); } break; } } }
<?php defined('ADMIN_KEKE') or exit('Access Denied'); $page = max($page, 1); $limit = max($limit, 5); $url = 'index.php?do=' . $do . '&model_id=' . $model_id . '&view=edit&task_id=' . $task_id . '&op=' . $op; switch ($op) { case 'work': if ($ac && $work_id) { switch ($ac) { case 'del': db_factory::execute("update " . TABLEPRE . "witkey_task set work_num=work_num-1 where task_id =(select task_id from " . TABLEPRE . "witkey_task_work where work_id=" . intval($work_id) . ")"); $res = db_factory::execute(sprintf('delete from %switkey_task_work where work_id=%d', TABLEPRE, intval($work_id))); if ($res) { keke_file_class::del_obj_file(intval($work_id), 'work', true); db_factory::execute(sprintf(' delete from %switkey_comment where obj_id=%d', TABLEPRE, intval($work_id))); } $res and kekezu::echojson('', 1) or kekezu::echojson('', 0); die; break; case 'file': $taskfilelist = db_factory::get_one("select * from " . TABLEPRE . "witkey_task_work where work_id = " . intval($work_id)); $filelist = $taskfilelist[work_file]; $f_list = db_factory::query("select * from " . TABLEPRE . "witkey_file where file_id in ({$filelist})"); break; case 'comm': $c_list = db_factory::query(sprintf(' select a.content,a.on_time from %switkey_comment a left join %switkey_task_work b on a.obj_id=b.work_id where b.work_id=%d', TABLEPRE, TABLEPRE, $work_id)); break; } require keke_tpl_class::template('task/' . $model_info['model_dir'] . '/admin/tpl/task_edit_ext');
kekezu::admin_check_role(30); $link_obj = new Keke_witkey_link_class(); if ($link_id) { $link_info = $link_obj->setWhere('link_id=' . $link_id); $link_info = $link_obj->query_keke_witkey_link(); $link_info = $link_info[0]; strpos($link_info['link_pic'], "data/") !== FALSE and $mode = 2 or $mode = 1; } if ($sbt_edit) { $link_obj->setLink_type(1); $link_obj->setLink_name($txt_link_name); if ($showMode == 1) { $link_pic = $txt_link_pic; } elseif ($showMode == 2) { if ($_FILES[fle_link_pic][name]) { $link_pic = keke_file_class::upload_file("fle_link_pic"); } } if (!$link_pic) { $link_pic = 0; } $link_obj->setLink_pic($link_pic); $link_obj->setLink_url($txt_link_url); $link_obj->setLink_status(1); $link_obj->setListorder(intval($txt_listorder)); $link_obj->setOn_time(time()); if ($hdn_link_id) { $link_obj->setLink_id($hdn_link_id); $res = $link_obj->edit_keke_witkey_link(); if ($res) { kekezu::admin_system_log($_lang['links_edit'] . $hdn_link_id);
<?php define("IN_KEKE", TRUE); include '../app_comm.php'; require S_ROOT . 'update/file/kppw.php'; require S_ROOT . 'update/DbUtilities.php'; $DbUtilities = new DbUtilities(); $DbUtilities->dbUpdate($dbArr); foreach ($dbArr as $table => $fields) { $filepath = S_ROOT . 'update/sqldata/' . $table . '.php'; if (file_exists($filepath)) { require $filepath; } } unset($dbArr); unset($DbUtilities); $file_obj = new keke_file_class(); $file_obj->delete_files(S_ROOT . "/data/data_cache/"); $file_obj->delete_files(S_ROOT . "/data/tpl_c/"); header('Refresh: 3; url=../index.php?do=index'); echo '升级成功...<br />'; echo '页面跳转中...<br />';
$strOrder and $strUrl .= "&strOrder=" . strval($strOrder); if (isset($action)) { $intWorkId = intval($objId); if ($intWorkId) { switch ($action) { case "delWork": if ($worktype == 'bid') { $strTabName = "witkey_task_bid"; $strId = "bid_id"; } else { $strTabName = "witkey_task_work"; $strId = "work_id"; } $res = db_factory::execute(sprintf(" delete from %s" . $strTabName . " where {$strId}='%d'", TABLEPRE, $intWorkId)); db_factory::execute(sprintf(' delete from %switkey_comment where obj_id=%d and obj_type="work"', TABLEPRE, $intWorkId)); keke_file_class::del_obj_file($intWorkId, 'work', true); if ($res) { kekezu::show_msg('删除成功', $strUrl, NULL, NULL, 'ok'); } else { kekezu::show_msg('删除失败', NULL, NULL, NULL, 'error'); } break; } } else { kekezu::show_msg('删除失败', NULL, NULL, NULL, 'error'); } } $arrTaskNavs = TaskClass::getEnabledTaskModelList(); $arrListOrder = array('a.task_id desc' => '编号降序', 'a.task_id asc' => '编号升序', 'b.task_cash desc' => '金额降序', 'b.task_cash asc' => '金额升序'); $arrCashCoves = TaskClass::getTaskCashCove(); if ($intModelId) {
$password = md5($admin_password); $slt = randomkeys(6); // 随机码 $sec_code = get_password($password, $slt); if ($data_type == 'b') { // 演示版本,更新数据 $db->query("update `{$tablepre}witkey_member` set username = '******',password = '******',email = '{$admin_email}',rand_code='{$slt}' where uid = 1"); $db->query("update `{$tablepre}witkey_space` set username = '******',password = '******',email = '{$admin_email}',sec_code='{$sec_code}',group_id = 1,status = 1 where uid = 1"); } else { // 纯净版本、插入数据 $db->query("replace INTO `{$tablepre}witkey_member`(`uid`,`username`,`password`,`email`,`rand_code`) VALUES ('1', '{$admin_account}','{$password}','{$admin_email}','{$slt}')"); $db->query("replace INTO `{$tablepre}witkey_space` (`uid`,`username`,`password`,`email`,`sec_code`,`group_id`,`status`,`reg_time`) VALUES('1','{$admin_account}','{$password}','{$admin_email}','{$sec_code}','1','1','" . time() . "')"); $db->query("replace INTO `{$tablepre}witkey_shop`(`uid`,`username`,`shop_name`,`shop_status`,`shop_type`) VALUES ('1', '{$admin_account}','{$admin_account}','1','1')"); } $db->query("update `{$tablepre}witkey_basic_config` set v = '{$weburl}' where config_id=3"); $file_obj = new keke_file_class(); $file_obj->delete_files($data_cache_path); $file_obj->delete_files($tpl_cache_path); $pars = array('ac' => 'install', 'sitename' => '', 'siteurl' => $weburl, 'charset' => CHARSET, 'version' => KEKE_VERSION, 'release' => KEKE_RELEASE, 'os' => PHP_OS, 'php' => $_SERVER['SERVER_SOFTWARE'], 'mysql' => mysql_get_server_info(), 'browser' => urlencode($_SERVER['HTTP_USER_AGENT']), 'username' => urlencode($_SESSION['username']), 'email' => $admin_email, 'ip' => $_SERVER['SERVER_ADDR']); $data = http_build_query($pars); // sleep(3); echo "<script>window.location.replace('index.php?step=finish&{$data}');</script>"; break; // finally // finally case 'finish': $str = md5(random(100) . '_' . time()) . '_keke_install.lck'; @touch($lock_sign); // 设定lock sign文件的访问和修改时间 file_put_contents($lock_sign, $str); $version = $_SESSION['link'];
static function clearCache() { global $kekezu; $file_obj = new keke_file_class(); $res = $file_obj->delete_files(S_ROOT . "./data/data_cache/"); $res = $file_obj->delete_files(S_ROOT . './data/tpl_c/'); $kekezu->_cache_obj->flush(); return true; }
$pay_config['safekey'] = $fds['safekey']; $pay_config['account_name'] = $fds['account_name']; break; case 'chinabank': $pay_config['seller_id'] = $fds['seller_id']; $pay_config['safekey'] = $fds['safekey']; break; case 'paypal': $pay_config['account'] = $fds['account']; break; case 'tenpay': case 'yeepay': $pay_config['seller_id'] = $fds['seller_id']; $pay_config['safekey'] = $fds['safekey']; break; case 'alipay_trust': $pay_config['account'] = $fds['account']; $pay_config['seller_id'] = $fds['seller_id']; $pay_config['safekey'] = $fds['safekey']; break; } $pay_config['descript'] = $fds['descript']; $pay['config'] = serialize($pay_config); $res = $pay_api_obj->save($pay, $pk); kekezu::admin_system_log($_lang['config'] . $payname); $file_obj = new keke_file_class(); $file_obj->delete_files(S_ROOT . "./data/data_cache/"); unset($items); kekezu::admin_show_msg($_lang['submit'], 'index.php?do=config&view=pay&op=' . $type, 3, '', 'success'); } require $template_obj->template(ADMIN_DIRECTORY . '/tpl/admin_config_' . $view);
$trans_object = keke_report_class::get_transrights_obj(); $page and $page = intval($page) or $page = '1'; $page_size and $page_size = intval($page_size) or $page_size = "10"; $url = "index.php?do={$do}&view={$view}&report_status={$report_status}&obj={$obj}&ord={$ord}&page_size={$page_size}&page={$page}"; if ($ac) { switch ($ac) { case "del": if ($report_id) { $res = db_factory::execute(sprintf(" delete from %switkey_report where report_id='%d'", TABLEPRE, $report_id)); $res and kekezu::admin_show_msg($_lang['record_delete_success'], $url, "3", '', 'success') or kekezu::admin_show_msg($action_arr[$view] . $_lang['record_delete_fail'], $url, "3", '', 'warning'); } else { kekezu::admin_show_msg($_lang['choose_delete_operate'], $url, "3", '', 'warning'); } break; case "download": keke_file_class::file_down($filename, $filepath); break; } } elseif ($sbt_action) { $ckb and $dels = implode(",", $ckb) or $dels = array(); if (!empty($dels)) { $res = db_factory::execute(sprintf(" delete from %switkey_report where report_id in ('%s') ", TABLEPRE, $dels)); $res and kekezu::admin_show_msg($action_arr[$view] . $_lang['record_mulit_delete_success'], $url, "3", '', 'success') or kekezu::admin_show_msg($action_arr[$view] . $_lang['record_delete_fail'], $url, "3", '', 'warning'); } else { kekezu::admin_show_msg($_lang['choose_delete_operate'], $url, "3", '', 'warning'); } } else { $report_obj = new Keke_witkey_report_class(); $page_obj = $kekezu->_page_obj; $where = " report_type = '" . $action_arr[$view]['0'] . "'"; $report_id and $where .= " and report_id='{$report_id}'";
<?php defined('ADMIN_KEKE') or exit('Access Denied'); kekezu::admin_check_role(20); $file_obj = new keke_file_class(); $backup_patch = S_ROOT . './data/tpl_c/'; if (isset($sbt_edit)) { if ($ckb_obj_cache) { $res = $file_obj->delete_files(S_ROOT . "./data/data_cache/"); $msg = $_lang['object_cache_empty']; } if ($ckb_tpl_cache) { $res = $file_obj->delete_files($backup_patch); $msg .= $_lang['template_cache_empty']; } if (CACHE_TYPE != 'file' && IS_CACHE == 1) { $kekezu->_cache_obj->flush(); } if ($ajax && $ajax == 1) { kekezu::echojson('clear success', 1); } else { kekezu::admin_show_msg($msg, 'index.php?do=' . $do . '&view=' . $view, 2, '', 'success'); } } require $template_obj->template(ADMIN_DIRECTORY . '/tpl/admin_' . $do . '_' . $view);
$url = "index.php?do={$do}&view=list&type={$type}"; $fields = kekezu::escape($fields); $res = $art_obj->save($fields, $pk); $log_ac = array('edit' => $_lang['edit_art'], 'add' => $_lang['add_art']); if ($pk['art_id']) { kekezu::admin_system_log($log_ac['edit'] . ":" . $fields['art_title']); } else { kekezu::admin_system_log($log_ac['add'] . ":" . $fields['art_title']); } kekezu::admin_show_msg($_lang['operate_success'], $url, 3, '', 'success'); } if (isset($ac) && $ac == 'del') { if ($filepath) { $pk and db_factory::execute(" update " . TABLEPRE . "witkey_article set art_pic ='' where art_id = " . intval($pk)); $file_info = db_factory::get_one(" select * from " . TABLEPRE . "witkey_file where save_name = '.{$filepath}.'"); keke_file_class::del_att_file($file_info['file_id'], $file_info['save_name']); kekezu::echojson('', '1'); } } $cat_arr = array(); kekezu::get_tree($art_cat_arr, $cat_arr, 'option', $art_id, 'art_cat_id', 'art_cat_pid', 'cat_name'); require $template_obj->template(ADMIN_DIRECTORY . '/tpl/admin_' . $do . "_" . $view); function get_fid($path) { if (!path) { return false; } $querystring = substr(strstr($path, '?'), 1); parse_str($querystring, $query); return $query['fid']; }
static function exec_js($mode = 'set', $timer = 300) { $path = S_ROOT . "/data/data_cache/time_cache.php"; switch ($mode) { case "set": $str = '<?php ' . (time() + $timer) . ';'; return keke_file_class::write_file($path, $str); break; case "get": if (file_exists($path)) { $last_respons = mb_strcut(file_get_contents($path), 6, 10); } return intval($last_respons); break; } }
if ($sbt_action) { $type = 'ad_type_' . $ad_type; switch ($ad_type) { case "image": if ($_FILES['ad_type_image_file']['name']) { $file_path = keke_file_class::upload_file('ad_type_image_file', '', 1, 'ad/'); } else { $file_path = $ad_type_image_path; } break; case "flash": if ($flash_method == 'url') { $file_path = $ad_type_flash_url; } if ($flash_method == 'file' && $_FILES['ad_type_flash_file']['name']) { $file_path = keke_file_class::upload_file('ad_type_flash_file', '', 1, 'ad/'); } break; } $file_path && $ad_obj->setAd_file($file_path); $ad_name = $hdn_ad_name ? $hdn_ad_name : $ad_name; $ad_obj->setAd_name($ad_name); $start_time && $ad_obj->setStart_time(strtotime($start_time)); $end_time && $ad_obj->setEnd_time(strtotime($end_time)); $ad_obj->setAd_type($ad_type); $ad_obj->setAd_position($ad_position); $width = ${$type . '_width'}; $width && $ad_obj->setWidth($width); $height = ${$type . '_height'}; $height && $ad_obj->setHeight($height); $content = ${$type . '_content'};
<?php if ($action == 'delete') { $id = intval($id); if ($id) { $objFileT = keke_table_class::get_instance('witkey_file'); $fileInfo = $objFileT->get_table_info('file_id', $id); if ($fileInfo['uid'] == $gUid || !$fileInfo['uid']) { keke_file_class::del_file($fileInfo['save_name']); $objFileT->del('file_id', $id); echo json_encode(array('status' => 1)); die; } } die; } else { $___y = date('Y'); $___m = date('m'); $___d = date('d'); define('UPLOAD_RULE', "{$___y}/{$___m}/{$___d}/"); $fileFormat = explode('|', $kekezu->_sys_config['file_type']); $maxSize = intval($kekezu->_sys_config['max_size']) * 1024 * 1024; $pathDir = setUploadPath($fileType, $objType); //$bidId = $_POST['bid_id']; //$bidId = $_POST['bid_id'];//$someVar = $_POST['someKey']; $upload = new keke_upload_class(S_ROOT . $pathDir, $fileFormat, $maxSize); $savename = $upload->run($filename, 1); if (is_array($savename)) { $name = $savename[0]['name']; $path = $pathDir . $savename[0]['saveName']; if ($fileType == 'service') {
$msg = '删除失败'; if ($id) { $objFileT = keke_table_class::get_instance('witkey_file'); $fileInfo = $objFileT->get_table_info('file_id', $id); if ($fileInfo['uid'] == $gUid || !$fileInfo['uid']) { if (QN_UPLOAD_OPEN) { $kekezu->include_qiniu_file(); $qn = new QiniuClass(); $qn->delete($fileInfo['file_name']); } else { keke_file_class::del_file($fileInfo['save_name']); $intFileLen = strrpos($fileInfo['save_name'], '/'); $strFileName = substr($fileInfo['save_name'], intval($intFileLen + 1)); $strFileNamePre = substr($fileInfo['save_name'], 0, intval($intFileLen + 1)); file_exists($strFileNamePre . '100_' . $strFileName) and keke_file_class::del_file($strFileNamePre . '100_' . $strFileName); file_exists($strFileNamePre . '210_' . $strFileName) and keke_file_class::del_file($strFileNamePre . '210_' . $strFileName); } $res = $objFileT->del('file_id', $id); if ($res) { $status = 1; $msg = '删除成功'; } } } echo json_encode(array('status' => $status, 'msg' => $msg)); die; } else { $err = 0; if (QN_UPLOAD_OPEN) { $kekezu->include_qiniu_file(); $file = $_FILES[$filename]['name'];
public static function del_sign_task($task_id, $model) { global $_lang; $taskInfo = db_factory::get_one(sprintf("select * from %switkey_task where task_id='%d' and task_status in(0,1,8,9,10)", TABLEPRE, $task_id)); if ($taskInfo) { CustomClass::delExtDataByObjId($taskInfo['task_id'], $taskInfo['model_id']); } if ($model === 1) { $sql = sprintf("delete from %switkey_task_work where task_id='%d'", TABLEPRE, $task_id); } else { $sql = sprintf("delete from %switkey_task_bid where task_id ='%d'", TABLEPRE, $task_id); } db_factory::execute($sql); $file_sql = sprintf("select save_name from %switkey_file where task_id = '%d' ", TABLEPRE, $task_id); $files = db_factory::query($file_sql); foreach ($files as $v) { keke_file_class::del_file($v['save_name']); } db_factory::execute(sprintf("delete from %switkey_file where task_id ='%d' ", TABLEPRE, $task_id)); $del_title = db_factory::get_count(sprintf("select task_title from %switkey_task where task_id='%d'", TABLEPRE, $task_id)); kekezu::admin_system_log($_lang['delete_task'] . ":{$del_title}"); }
<?php defined('ADMIN_KEKE') or exit('Access Denied'); $report_info = keke_report_class::get_report_info($report_id); $report_info or kekezu::admin_show_msg($_lang['parameters_error_not_exist'] . $action_arr[$type][1] . $_lang['record'], "index.php?do=trans&view={$type}", 3, '', 'warning'); $user_info = kekezu::get_user_info($report_info['uid']); $to_userinfo = kekezu::get_user_info($report_info['to_uid']); $obj_info = keke_report_class::obj_info_init($report_info, $user_info); $ac == 'download' and keke_file_class::file_down($filename, $filepath); $url = "index.php?do={$do}&view={$type}"; if ($type == 'complaint') { if ($sbt_op) { $op_result[action] == 'pass' and $report_status = 4 or $report_status = 3; $url .= "&report_status={$report_status}"; $res = keke_report_class::sub_process_ts($report_info, $user_info, $to_userinfo, $op_result); $res and kekezu::admin_show_msg($_lang['operate_notice'], $url, "2", $_lang['process_success'], 'success') or kekezu::admin_show_msg($_lang['operate_notice'], $url, "2", $_lang['operate_over'], 'warning'); } else { $report_info = keke_report_class::get_report_info($report_id); } require keke_tpl_class::template(ADMIN_DIRECTORY . '/tpl/admin_trans_process'); } else { if (empty($obj_info) || empty($obj_info['model_id'])) { kekezu::admin_show_msg($_lang['friendly_notice'], $url, 3, $_lang['deal_object_del'], 'warning'); } $report_info = keke_report_class::get_report_info($report_id); $model_info = $kekezu->_model_list[$obj_info['model_id']]; $path = S_ROOT . $model_info['model_type'] . "/" . $model_info['model_dir'] . "/admin/admin_route.php"; require $path; }
<?php defined('ADMIN_KEKE') or exit('Access Denied'); kekezu::admin_check_role(18); $db_factory = new db_factory(); $file_obj = new keke_file_class(); $backup_patch = S_ROOT . './data/backup/'; $file_arr = $file_obj->get_dir_file_info($backup_patch); switch ($ac) { case 'restore': set_time_limit(0); ini_set('memory_limit', '1024M'); $file_sql = file_get_contents($backup_patch . $file_arr[$restore_name][name]); $file_sql = htmlspecialchars_decode($file_sql); $sql = str_replace("\r\n", "\n", $file_sql); $ret = array(); $num = 0; foreach (explode(";\n", trim($sql)) as $query) { $ret[$num] = ''; $queries = explode("\n", trim($query)); foreach ($queries as $query) { $ret[$num] .= isset($query[0]) && $query[0] == '#' || isset($query[1]) && isset($query[1]) && $query[0] . $query[1] == '--' ? '' : $query; } $num++; } foreach ($ret as $vvv) { empty($vvv) or $res *= db_factory::execute($vvv); } kekezu::admin_system_log($_lang['restore_database_operate_success'] . $file_arr[$restore_name][name]); kekezu::echojson($_lang['database_restore_success'], 1); break;
<?php defined('ADMIN_KEKE') or exit('Access Denied'); $task_obj = new Keke_witkey_task_class(); $user_obj = new Keke_witkey_space_class(); $file_obj = new keke_file_class(); $file_size = $file_obj->getdirsize(S_ROOT . '/data/uploads'); $file_size = intval($file_size / 1024 / 1024); $tables = db_factory::query("SHOW TABLE STATUS "); foreach ($tables as $table) { $dbsize += $table['Data_length'] + $table['Index_length']; } $dbsize = round($dbsize / 1024 / 1024, 2); if (DBTYPE == 'mysql') { $mysql_ver = mysql_get_server_info(); } else { $db = db_factory::init(); $mysql_ver = mysqli_get_server_info($db->_mydb->_link); } $sys_info['os'] = PHP_OS; $sys_info['ip'] = $_SERVER['SERVER_ADDR']; $sys_info['web_server'] = $_SERVER['SERVER_SOFTWARE']; $sys_info['php_ver'] = PHP_VERSION; $sys_info['mysql_ver'] = $mysql_ver; $sys_info['safe_mode'] = (bool) ini_get('safe_mode') ? $_LANG['yes'] : $_LANG['no']; $sys_info['safe_mode_gid'] = (bool) ini_get('safe_mode_gid') ? $_LANG['yes'] : $_LANG['no']; $sys_info['timezone'] = function_exists('date_default_timezone_set') ? date_default_timezone_set('Asia/Shanghai') : date_default_timezone_set('Asia/Shanghai'); $sys_info['max_filesize'] = ini_get('upload_max_filesize'); $sys_info['file_uploads'] = ini_get('file_uploads'); $model_list = kekezu::get_table_data('*', 'witkey_model', " model_type = 'task' and model_status='1'", 'listorder asc ', '', '', 'model_id', 3600); $shop_list = kekezu::get_table_data('*', 'witkey_model', " model_type = 'shop' and model_status='1'", 'listorder asc ', '', '', 'model_id', 3600);
} if (isset($sbt_edit)) { if ($hdn_case_id) { $case_obj->setCase_id($hdn_case_id); } else { if (case_obj_exists($fds['obj_id'], $case_type)) { $case_obj->setObj_id($fds['obj_id']); } } $case_obj->setObj_type($case_type); $case_obj->setCase_auther($fds['case_auther']); $case_obj->setCase_price($fds['case_price']); $case_obj->setCase_desc(kekezu::escape($fds['case_desc'])); $case_obj->setCase_title(kekezu::escape($fds['case_title'])); $case_obj->setOn_time(time()); $case_img = $hdn_case_img or $case_img = keke_file_class::upload_file("fle_case_img"); $case_obj->setCase_img($case_img); if ($hdn_case_id) { $res = $case_obj->edit_keke_witkey_case(); kekezu::admin_system_log($_lang['edit_case'] . ':' . $hdn_case_id); $res and kekezu::admin_show_msg($_lang['modify_case_success'], 'index.php?do=case&view=lise', 3, '', 'success') or kekezu::admin_show_msg($_lang['modify_case_fail'], 'index.php?do=case&view=lise', 3, '', 'warning'); } else { $res = $case_obj->create_keke_witkey_case(); kekezu::admin_system_log($_lang['add_case']); $res and kekezu::admin_show_msg($_lang['add_case_success'], 'index.php?do=case&view=lise', 3, '', 'success') or kekezu::admin_show_msg($_lang['add_case_fail'], 'index.php?do=case&view=add', 3, '', 'warning'); } } function case_obj_exists($id, $obj = 'task') { if ($obj == 'task') { $search_obj = db_factory::get_count(sprintf("select count(task_id) from %switkey_task where task_id='%d' ", TABLEPRE, $id));
<?php defined('ADMIN_KEKE') or exit('Access Denied'); kekezu::admin_check_role(28); $filepath = S_ROOT . './tpl/' . $tplname; $file_obj = new keke_file_class(); $tpllist = $file_obj->get_dir_file_info($filepath, true, true); arsort($tpllist); require_once $template_obj->template(ADMIN_DIRECTORY . '/tpl/admin_tpl_tpllist');
if ($txt_task_day) { $task_obj->setSub_time(strtotime($txt_task_day)); $task_obj->setEnd_time(strtotime($txt_task_day) + $task_config['choose_time'] * 24 * 3600); } $task_obj->setIndus_id($slt_indus_id); $task_obj->setTask_cash($task_cash); $task_obj->setReal_cash($task_cash * (1 - $task_info['profit_rate'] / 100)); $fds['task_cash_coverage'] and $task_obj->setTask_cash_coverage($fds['task_cash_coverage']); $fds['budget'] and $task_obj->setBudget($fds['budget']); $task_obj->setTask_desc($task_desc); $fields = kekezu::escape($fields); $task_obj->setSeo_title($fields['seo_title']); $task_obj->setSeo_keyword($fields['seo_keyword']); $task_obj->setSeo_desc($fields['seo_desc']); if ($_FILES['fle_task_pic']['name']) { $task_pic = keke_file_class::upload_file("fle_task_pic"); } else { $task_pic = $task_pic_path; } $task_obj->setTask_pic($task_pic); kekezu::admin_system_log($_lang['edit_task'] . ":{$task_title}"); $res = $task_obj->edit_keke_witkey_task(); $v_arr = array($_lang['admin_name'] => $myinfo_arr['username'], $_lang['time'] => date('Y-m-d H:i:s', time()), $_lang['model_name'] => $model_info['model_name'], $_lang['task_id'] => $task_info['task_id'], $_lang['task_title'] => $task_info['task_title']); keke_msg_class::notify_user($task_info['uid'], $task_info['username'], 'task_edit', $_lang['edit_task'], $v_arr, 1); } elseif ($sbt_act) { switch ($sbt_act) { case "freeze": $res = keke_task_config::task_freeze($task_id); break; case "unfreeze": $res = keke_task_config::task_unfreeze($task_id);
public function del_file($file_id) { $res = keke_file_class::del_att_file($file_id); $res and kekezu::echojson('', '1') or kekezu::echojson('', '0'); die; }
function fileFilter($path, $ext) { if (keke_file_class::get_file_type($path, $this->ext) == $ext) { return true; } else { return false; } }
public function wap_upload($f = 'uploadedfile', $work_id = 0) { $work_id and $type = "work" or $type = "task"; $path = keke_file_class::upload_file($f); $file_obj = new Keke_witkey_file_class(); $file_obj->setFile_name($_FILES[$f][name]); $file_obj->setTask_id($this->_task_id); $file_obj->setObj_type($type); $file_obj->setSave_name($path); $file_obj->setOn_time(time()); $file_obj->setUid($this->_uid); $file_obj->setUsername($this->_username); $file_obj->create_keke_witkey_file(); if ($path) { $fid = db_factory::get_count(sprintf(" select file_id from %switkey_file where save_name='%s'", TABLEPRE, $path)); if ($work_id) { db_factory::execute(sprintf("update %switkey_task_work set work_file='%d' where task_id='%d' and work_id='%d'", TABLEPRE, $fid, $this->_task_id, $work_id)); db_factory::execute(sprintf(" update %switkey_file set obj_type='work',task_id='%d',obj_id='%d' where file_id='%d'", TABLEPRE, $this->_task_id, $work_id, $fid)); } else { db_factory::execute(sprintf("update %switkey_task set task_file='%d' where task_id='%d'", TABLEPRE, $fid, $this->_task_id)); db_factory::execute(sprintf(" update %switkey_file set obj_type='task',task_id='%d' where file_id='%d'", TABLEPRE, $this->_task_id, $fid)); } kekezu::echojson('', 1); } else { kekezu::echojson(array('r' => 'Upload failed'), 0); } die; }
static function ad_show($code, $do = 'index', $is_slide = null) { global $_lang, $_K; $ad_target = db_factory::get_one(sprintf(" select * from %switkey_ad_target where code='%s' and is_allow=1", TABLEPRE, $code), 3600 * 24); if ($ad_target) { if (intval($is_slide)) { return self::get_adgroup_by_target($ad_target['target_id'], $ad_target['name'], $ad_target['ad_num']); } $sql = " select a.ad_id,a.ad_name,a.ad_file,a.ad_content,a.ad_url,a.width,a.height,\n\t\t\ta.ad_type,a.ad_position,a.on_time from %switkey_ad a left join %switkey_ad_target b on a.target_id=b.target_id\n\t\t\twhere b.code='%s' and a.is_allow='1' order by a.ad_id desc limit 0,%d"; $ad_info = db_factory::get_one(sprintf($sql, TABLEPRE, TABLEPRE, $code, $ad_target['ad_num']), true, $_K['timespan']); if ($ad_info) { $ad_str .= "<div class='adv'>"; switch ($ad_info['ad_type']) { case "flash": $ad_str .= keke_file_class::flash_codeout($ad_info['ad_file'], $ad_info['width'], $ad_info['height'], $ad_info['ad_url']); break; case "text": case "code": $ad_str .= "<a href='" . $ad_info['ad_url'] . "' target='_blank' title='" . $ad_info['ad_name'] . "'>" . kekezu::k_stripslashes($ad_info['ad_content']) . "</a>"; break; case "image": if ($ad_info['ad_file']) { //修改 2015-08-01 $ad_str .= "<a href='" . $ad_info['ad_url'] . "' target='_blank' title='" . $ad_info['ad_name'] . "'><img src='" . $ad_info['ad_file'] . "' width='" . $ad_info['width'] . "' class='lazy' data-original='" . $ad_info['ad_file'] . "' height='" . $ad_info['height'] . "' alt='" . $ad_info['ad_name'] . "' title='" . $ad_info['ad_name'] . "'></a>"; } else { $ad_str .= "<a href='" . $ad_info['ad_url'] . "' target='_blank' title='" . $ad_info['ad_name'] . "'><img src='" . $ad_info['ad_file'] . "'data-src='holder.js/950x50/#f8f8f8:#ddd/text:AD' width='" . $ad_info['width'] . "' height='" . $ad_info['height'] . "' alt='" . $ad_info['ad_name'] . "' title='" . $ad_info['ad_name'] . "'></a>"; } break; } self::update_ad($ad_info); $ad_str .= "</div>"; } } echo $ad_str; }
static function fsize($filepath) { return keke_file_class::getSize($filepath); }