Ejemplo n.º 1
0
         if (is_file($strOldSFile)) {
             unlink($strOldSFile);
         }
         if (is_file($strOldBFile)) {
             unlink($strOldBFile);
         }
         if (is_file($strOldMFile)) {
             unlink($strOldMFile);
         }
         //unset($arrUserinfo['thumbnail']);
         $arrTemp['thumbnail'] = '';
         $arrTemp['user_id'] = $arrUserinfo['user_id'];
         $objWebInit->updateUser($arrTemp);
         //同步user表
         $arrTemp['recommendflag'] = 0;
         $strTemp = check::getAPIArray($arrTemp);
         check::getAPI('user', 'updateUser', $strTemp);
         check::WindowLocation("?action=edit&id=" . $userid . "");
     } else {
         check::AlertExit('删除失败!', -1);
     }
 }
 $arrTemp = array();
 foreach ($arrGMeta as $k => $v) {
     if ($k != 'index') {
         $arrTemp[$k]['r'] = $v['name'];
         $arrTemp[$k]['w'] = '写';
         $arrTemp[$k]['d'] = '删';
         $arrTemp[$k]['x'] = '执行';
     }
 }
Ejemplo n.º 2
0
 /**
  * 保存会员信息
  * @author	肖飞
  * @param	int $arrData    数组
  * @param	int $intModify    是否修改
  * @param	bool $isAlert    数组
  * @param	bool $isLastID    数组
  * @return  void
  */
 function saveInfo($arrData, $isModify = false, $isAlert = true, $isMcenter = false)
 {
     if ($isMcenter) {
         $strData = check::getAPIArray($arrData);
         if (!($intUserID = check::getAPI('mcenter', 'saveInfo', "{$strData}^{$isModify}^false"))) {
             if ($isAlert) {
                 check::AlertExit("与用户中心通讯失败,请稍后再试!", -1);
             }
             return 0;
         }
     }
     $arr = array();
     $arr = check::SqlInjection($this->saveTableFieldG($arrData, $isModify));
     if ($isModify == 0) {
         if (!empty($intUserID)) {
             $arr['user_id'] = $intUserID;
         }
         if ($this->insertUser($arr)) {
             if (!empty($intUserID)) {
                 return $intUserID;
             } else {
                 return $this->lastInsertIdG();
             }
         } else {
             if ($blAlert) {
                 check::Alert("新增失败");
             }
             return false;
         }
     } else {
         if ($this->updateUser($arr) !== false) {
             if ($isAlert) {
                 check::Alert("修改成功!");
             } else {
                 return true;
             }
         } else {
             if ($blAlert) {
                 check::Alert("修改失败");
             }
             return false;
         }
     }
 }
Ejemplo n.º 3
0
            }
            echo "<a href='{$val}' target=_blank>{$val}</a> &nbsp;&nbsp;&nbsp;&nbsp;<a href='javascript:history.go(-1);'>返回</a><pre>";
            print_r($arrSave);
            echo "</pre>";
            $arrSave['type_id'] = $arrGFetch[$_GET['id']]['type_id'];
            //if(!empty($arrSave['intro'])) $arrSave['summary'] = check::csubstr(trim(str_replace("&nbsp;"," ",str_replace("\r\n","",strip_tags($arrSave['intro'])))),0,250);
            if (!empty($arrSave['intro'])) {
                $arrSave['summary'] = check::csubstr(check::stripText($arrSave['intro']), 0, 250);
            }
            if (!empty($arrGFetch[$_GET['id']]['delimiter_df'])) {
                foreach ($arrGFetch[$_GET['id']]['delimiter_df'] as $k => $v) {
                    if (!empty($v[0])) {
                        $arrSave[$v[0]] = $v[1];
                    }
                }
            }
            $strData = check::getAPIArray($arrSave);
            check::getAPI($arrGFetch[$_GET['id']]['module_id'], 'saveInfo', "{$strData}^0^0");
            echo ' <font color="green">采集成功!</font><br />';
            if ($_GET['action'] == 'fetch') {
                exit;
            }
        }
    }
}
// 输出到模板
$arrMOutput["smarty_assign"]['strNav'] = '数据采集器';
$arrMOutput["smarty_assign"]['arrInfo'] = $arrData;
$arrMOutput["template_file"] = "admin.html";
$arrMOutput["smarty_assign"]['MAIN'] = $arrGSmarty['admin_main_dir'] . 'tools/fetch/index.htm';
$objWebInit->output($arrMOutput);
Ejemplo n.º 4
0
        check::AlertExit("错误:用户名已被注册!", -1);
    }
    //生日转换
    $_POST['birthday'] = date('Y-m-d', strtotime($_POST['year'] . '-' . $_POST['month'] . '-' . $_POST['day']));
    unset($_POST['year']);
    unset($_POST['month']);
    unset($_POST['day']);
    //会员密码处理
    if (!empty($arrGWeb['user_pass_type'])) {
        $_POST['password'] = check::strEncryption($_POST['password'], $arrGWeb['jamstr']);
    }
    $intID = $objWebInit->saveInfo($_POST, 0, false, true);
    if ($intID) {
        $arrData['user_id'] = $intID;
        $arrData['add_date'] = date('Y-m-d H:i:s');
        $strData = check::getAPIArray($arrData);
        check::getAPI('mcenter', 'updateUser', $strData);
    } else {
        check::AlertExit('注册失败', -1);
    }
    check::WindowLocation($arrGWeb['WEB_ROOT_pre'] . '/mcenter/admin/index.php');
}
$arrTemp = array();
foreach ($arrGMeta as $k => $v) {
    if ($k != 'index') {
        $arrTemp[$k] = $v['name'];
    }
}
// 输出到模板
$arrMOutput["template_file"] = "admin.html";
$arrMOutput["smarty_assign"]['arrGMeta'] = $arrTemp;
Ejemplo n.º 5
0
    $arrData['answer'] = $_POST['answer'];
    $arrData['sex'] = $_POST['sex'];
    $arrData['tel'] = $_POST['tel'];
    $arrData['province'] = $_POST['province'];
    $arrData['city'] = $_POST['city'];
    $arrData['area'] = $_POST['area'];
    $arrData['user_ip'] = check::getIP();
    $arrData['submit_date'] = date('Y-m-d H:i:s');
    $arrData['session_id'] = session_id();
    $intID = $objWebInit->saveInfo($arrData, 0, false, true);
    if ($intID) {
        $_SESSION['user_id'] = $intID;
        $_SESSION = array_merge($_SESSION, $arrData);
        $arrTemp['user_id'] = $intID;
        $arrTemp['add_date'] = date('Y-m-d H:i:s');
        $strData = check::getAPIArray($arrTemp);
        check::getAPI('mcenter', 'updateUser', $strData);
        echo "<script>alert('注册完成');window.location='{$arrGWeb['WEB_ROOT_pre']}/';</script>";
        exit;
    } else {
        check::AlertExit('注册失败', -1);
    }
}
$strTitle = $arrGWeb['name'] . '-注册';
$strDescription = $strTitle;
$strKeywords = $strTitle;
// 输出到模板
$arrMOutput['smarty_assign']['Title'] = $strTitle . ' - ' . $arrGWeb['name'];
$arrMOutput['smarty_assign']['Description'] = $strDescription . ' - ' . $arrGWeb['name'];
$arrMOutput['smarty_assign']['Keywords'] = $strKeywords . ' - ' . $arrGWeb['name'];
$arrMOutput["smarty_assign"]['arrGWeb']['css'][] = 'reg.css';
Ejemplo n.º 6
0
foreach ($arrModuleDirs as $k => $v) {
    if (!empty($v['cache']) && $v['cache'] == 1) {
        $arrInfoList[$k] = array('name' => $v['name']);
        if (is_file('../data/' . $k . '/' . $k . '_type.php')) {
            @(include '../data/' . $k . '/' . $k . '_type.php');
        }
        if (!empty($arrMType)) {
            foreach ($arrMType as $key => $val) {
                if (empty($val['type_link'])) {
                    $arrInfoList[$k]['type'][] = array('type_id' => $val['type_id'], 'name' => $val['type_title']);
                }
            }
        } else {
            $objWebInit->tablename1 = $arrGPdoDB['db_tablepre'] . $k . '_type';
            $arrType = check::getAPI($k, "getTypeList", "");
            $strType = check::getAPIArray($arrType);
            $arrMType = check::getAPI($k, "formatTypeList", "0^{$strType}^0");
            if (!empty($arrMType)) {
                foreach ($arrMType as $key => $val) {
                    if (empty($val['type_link'])) {
                        $arrInfoList[$k]['type'][] = array('type_id' => $val['type_id'], 'name' => $val['type_title']);
                    }
                }
            }
        }
    }
}
// 输出到模板
$arrMOutput["smarty_assign"]['arrInfoList'] = $arrInfoList;
$arrMOutput["smarty_assign"]['MAIN'] = $arrGSmarty['main_dir'] . 'index.html';
$objWebInit->output($arrMOutput);
Ejemplo n.º 7
0
        if (stripos($_POST['real_name'], $v) !== false) {
            check::AlertExit("输入的昵称包含非法字符!", -1);
        }
    }
    if (!is_numeric($_POST['mobile']) or strlen($_POST['mobile']) > 12) {
        check::AlertExit("电话必须为数字并且不能大于12!", -1);
    }
    if (!check::CheckPost($_POST['postcode'])) {
        check::AlertExit("邮编不符合要求", -1);
    }
    $arrUserTableData = array();
    $arrUserTableData['user_id'] = $_SESSION['user_id'];
    $arrUserTableData['nick_name'] = strip_tags($_POST['real_name']);
    //昵称用真实姓名代替
    $strDataInfo = check::getAPIArray($arrUserTableData);
    check::getAPI('user', 'updateUser', $strDataInfo);
    $_POST['user_id'] = $_SESSION['user_id'];
    foreach ($_POST as $key => $value) {
        $_SESSION[$key] = $value;
    }
    $_SESSION['nick_name'] = $_POST['real_name'];
    $_POST['nick_name'] = $_POST['real_name'];
    $strData = check::getAPIArray($_POST);
    check::getAPI('mcenter', 'updateUser', $strData);
    check::AlertExit('修改成功!', -1);
}
//输出到模板
$arrMOutput["smarty_assign"]['arrData'] = $arrInfo;
$arrMOutput["smarty_assign"]['arrGWeb']['css'][] = 'reg.css';
$arrMOutput["smarty_assign"]['MAIN'] = $arrGSmarty['main_dir'] . 'index.html';
$objWebInit->output($arrMOutput);
Ejemplo n.º 8
0
function count_referer($isSave = 1, $uid = null)
{
    global $arrGWeb;
    $objShared = System_SharedMemory::factory();
    if (empty($strVarName)) {
        $strVarName = $arrGWeb['install_date'] . 'referer';
    }
    $arrPayLog = json_decode($objShared->get($strVarName), TRUE);
    if ($isSave == 1) {
        $arrPayLog[$uid] = 1;
    } elseif ($isSave == 0) {
        if (!empty($arrPayLog) && array_key_exists($_SESSION['user_id'], $arrPayLog)) {
            $host = empty($_COOKIE['referer_host']) ? "5217u.com" : $_COOKIE['referer_host'];
            $time = date("Y-m-d");
            $referer = check::getAPI("referer", "getInfoWhere", "where host='{$host}' and time='{$time}'^*");
            if (empty($referer)) {
                $arr_referer = array();
                $arr_referer['time'] = $time;
                $arr_referer['host'] = $host;
                $arr_referer['buy_times'] = 1;
                $str_referer = check::getAPIArray($arr_referer);
                check::getAPI("referer", "saveInfo", "{$str_referer}^0^0");
            } else {
                $referer['buy_times'] += 1;
                $str_referer = check::getAPIArray($referer);
                check::getAPI("referer", "saveInfo", "{$str_referer}^1^0");
            }
            unset($arrPayLog[$_SESSION['user_id']]);
        }
    }
    $objShared->set($strVarName, json_encode($arrPayLog));
    return true;
}