• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP inserttable函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中inserttable函数的典型用法代码示例。如果您正苦于以下问题:PHP inserttable函数的具体用法?PHP inserttable怎么用?PHP inserttable使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了inserttable函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: wz_record

function wz_record($get)
{
    global $_SGLOBAL, $_SC;
    reset($get);
    foreach ($get as $k => $v) {
        if ($k == 'wxid') {
            $wxid = getstr($get[$k]);
        }
        if ($k == 'token') {
            $token = getstr($get[$k]);
        }
        if ($k == 'mid') {
            $mid = intval($get[$k]) ? intval($get[$k]) : 0;
        }
        if ($k == 'wxid' || $k == 'token' || $k == 'mid') {
            unset($get[$k]);
            continue;
        } else {
            $get[$k] = getstr($get[$k]);
        }
        $get[$k] = getstr($get[$k]);
    }
    $query = json_encode($get);
    $arr = array('token_id' => $_SGLOBAL['supe_token_id'], 'query' => $query, 'ip' => getonlineip(), 'user_agent' => $_SERVER["HTTP_USER_AGENT"], 'wxid' => $wxid, 'token' => $token, 'mid' => $mid, 'addtime' => $_SGLOBAL['timestamp']);
    $record_id = inserttable(tname('wz_record'), $arr, 1);
    return $record_id;
}
开发者ID:hugolong,项目名称:weixiao,代码行数:27,代码来源:function_weizhan.php


示例2: getjokes

function getjokes($num)
{
    for ($i = 2; $i <= $num; $i++) {
        $curl = curl_init();
        curl_setopt($curl, CURLOPT_URL, 'http://www.haha365.com/er_joke/index_' . $i . '.htm');
        curl_setopt($curl, CURLOPT_HEADER, 0);
        curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($curl, CURLOPT_TIMEOUT, 4);
        $data = curl_exec($curl);
        curl_close($curl);
        if ($data == null) {
            continue;
        }
        while (strstr($data, '<div id="endtext">')) {
            $index = strpos($data, '<div id="endtext">');
            $index2 = strpos($data, '</div>', $index);
            $len = strlen('<div id="endtext">');
            $joke = substr($data, $index + $len, $index2 - $index - $len);
            $joke = str_replace('&ldquo;', '"', $joke);
            $joke = str_replace('&rdquo;', '"', $joke);
            $joke = str_replace('¡¡', '', $joke);
            $joke = str_replace('&hellip;', '...', $joke);
            $joke = str_replace('<br />', '', $joke);
            $joke = str_replace("<p>", '"', $joke);
            $joke = str_replace("</p>", '"', $joke);
            $joke = trim($joke);
            $data = substr($data, $index2);
            $joke = iconv("gb2312", "utf-8", $joke);
            echo $joke . "\n\n";
            inserttable($joke, "å„¿ç");
        }
    }
}
开发者ID:roryliu,项目名称:icoding,代码行数:33,代码来源:getjokes.php


示例3: active_rightbottom_sitemail

function active_rightbottom_sitemail()
{
    if ($_POST) {
        $sid = MooGetGPC('msg_sid', 'integer', 'P');
        if (empty($_POST['msg_sid']) && !empty($_POST['msg_username'])) {
            $username = MooGetGPC('msg_username', 'string', 'P');
            $sql = "SELECT uid FROM {$GLOBALS['dbTablePre']}admin_user WHERE username='{$username}'";
            $admin_user = $GLOBALS['_MooClass']['MooMySQL']->getOne($sql);
            if (empty($admin_user)) {
                salert('此用户不存在');
                exit;
            }
            $sid = $admin_user['uid'];
        }
        $data['sid'] = $sid;
        $data['title'] = "{$GLOBALS['adminid']}号客服:" . MooGetGPC('msg_title', 'string', 'P');
        $data['content'] = MooGetGPC('msg_content', 'string', 'P');
        $data['awoketime'] = time() + 120;
        $data['dateline'] = time();
        $data['send_id'] = $GLOBALS['adminid'];
        inserttable('admin_remark', $data);
        salert('发送成功');
        exit;
    }
    $group_list = get_group_type();
    require adminTemplate('other_rightbottom_sitemail');
}
开发者ID:noikiy,项目名称:zays,代码行数:27,代码来源:other_rightbottom.php


示例4: auth_add

function auth_add($ownertype, $ownerid, $domain, $did, $auth, $level, $iscancel)
{
    $arr = array('ownertype' => base_protect($ownertype), 'ownerid' => (int) $ownerid, 'domain' => base_protect($domain), 'did' => (int) $did, 'auth' => base_protect($auth), 'level' => (int) $level, 'iscancel' => (int) $iscancel);
    $arr['grantat'] = date('Y-m-d H:i:s');
    $arr['grantby'] = $_SESSION['twt_uid'];
    $flag = inserttable('authmap', $arr);
    return $flag;
}
开发者ID:jjvein,项目名称:my_php_framework,代码行数:8,代码来源:auth.func.php


示例5: active_activity_add

function active_activity_add()
{
    $data = array();
    if (!empty($_POST)) {
        $data['title'] = trim(MooGetGPC('title', 'string', 'P'));
        if (empty($data['title'])) {
            MooMessageAdmin('请活动主题', 'index.php?action=active_activity&h=add');
            exit;
        }
        $data['type'] = MooGetGPC('type', 'integer', 'P');
        $data['price'] = MooGetGPC('price', 'integer', 'P');
        $data['price_online'] = MooGetGPC('price_online', 'integer', 'P');
        $data['starttime'] = MooGetGPC('starttime', 'string', 'P');
        if (empty($data['starttime'])) {
            MooMessageAdmin('请填写活动的报名开始时间', 'index.php?action=active_activity&h=add');
            exit;
        }
        $data['starttime'] = strtotime($data['starttime'] . ' 0:0:0');
        $data['endtime'] = MooGetGPC('endtime', 'string', 'P');
        if (empty($data['endtime'])) {
            MooMessageAdmin('请填写活动的报名结束时间', 'index.php?action=active_activity&h=add');
            exit;
        }
        $data['endtime'] = strtotime($data['endtime'] . ' 23:59:59');
        $data['opentime'] = MooGetGPC('opentime', 'array', 'P');
        if (empty($data['opentime']['day'])) {
            $data['opentime'] = 0;
        } else {
            $data['opentime'] = strtotime($data['opentime']['day'] . ' ' . $data['opentime']['hour'] . ':' . $data['opentime']['mintue'] . ':0');
        }
        $data['closetime'] = MooGetGPC('closetime', 'array', 'P');
        if (empty($data['closetime']['day'])) {
            $data['closetime'] = 0;
        } else {
            $data['closetime'] = strtotime($data['closetime']['day'] . ' ' . $data['closetime']['hour'] . ':' . $data['closetime']['mintue'] . ':0');
        }
        $data['issex'] = MooGetGPC('issex', 'string', 'P');
        $data['issex'] = $data['issex'] < 1 ? 100 : ($data['issex'] > 100 ? 100 : $data['issex']);
        $data['province'] = MooGetGPC('province', 'integer', 'P');
        $data['city'] = MooGetGPC('city', 'integer', 'P');
        $data['activity_img'] = 'module/activity/templates/default/images/activity_new/' . MooGetGPC('img', 'string', 'P');
        $data['href'] = 'index.php?n=activity&h=' . MooGetGPC('href', 'string', 'P');
        $data['place'] = htmlspecialchars(trim(MooGetGPC('place', 'string', 'P')));
        $data['profile'] = htmlspecialchars(trim(MooGetGPC('profile', 'string', 'P')));
        $data['introduction'] = htmlspecialchars(trim(MooGetGPC('introduction', 'string', 'P')));
        $data['regtime'] = time();
        $data['adminid'] = $GLOBALS['adminid'];
        $id = inserttable('activity', $data, true);
        if (empty($id)) {
            MooMessageAdmin('活动添加失败,请联系技术支持,或者重新填写表单项', 'index.php?action=active_activity&h=add');
            exit;
        } else {
            MooMessageAdmin('活动添加成功', 'index.php?action=active_activity&h=add');
            exit;
        }
    }
    require adminTemplate('active_activity_detail');
}
开发者ID:noikiy,项目名称:zays,代码行数:58,代码来源:active_activity.php


示例6: post

 function post($uId, $message, $clientIdentify, $ip = '')
 {
     $fields = array('uid' => $uId, 'message' => $message, 'from' => $clientIdentify, 'dateline' => time());
     if ($ip) {
         $fields['ip'] = $ip;
     }
     $result = inserttable('doing', $fields, 1);
     return new APIResponse($result);
 }
开发者ID:shiyake,项目名称:php-ihome,代码行数:9,代码来源:MiniBlog.php


示例7: addComment

function addComment($type, $id)
{
    global $_MooClass, $dbTablePre, $user_arr;
    $content = Text2Html(MooGetGPC('content', 'string', 'P'));
    $temp = mb_convert_encoding($content, 'gbk', 'utf-8');
    if ($content == '' || isset($temp[220])) {
        return false;
    }
    $arr_in = array('type' => $type, 'id' => $id, 'uid' => $user_arr['uid'], 'username' => $user_arr['nickname'], 'dateline' => time(), 'ischeck' => 0, 'comment' => $content);
    return inserttable('comment', $arr_in, 1);
}
开发者ID:noikiy,项目名称:zays,代码行数:11,代码来源:function.php


示例8: add

 /**
  * 添加信息
  *
  * @param unknown_type $garray
  * @return unknown
  */
 function add($dataarray)
 {
     if (is_array($dataarray)) {
         $oid = inserttable($this->table, $dataarray, 1);
         if (is_numeric($oid)) {
             return $oid;
         } else {
             return lang('insert_data_error');
         }
     }
     return lang('datatype_error');
 }
开发者ID:dalinhuang,项目名称:c2my,代码行数:18,代码来源:table.class.php


示例9: cron_config

function cron_config()
{
    global $_SGLOBAL;
    //下次执行cron时间
    $query = $_SGLOBAL['db']->query("SELECT nextrun FROM " . tname('cron') . " WHERE available>'0' ORDER BY nextrun LIMIT 1");
    $nextrun = $_SGLOBAL['db']->result($query, 0);
    if (empty($nextrun)) {
        $nextrun = 0;
    }
    //更新config
    inserttable('config', array('var' => 'cronnextrun', 'datavalue' => $nextrun), 0, true);
    include_once S_ROOT . './source/function_cache.php';
    config_cache(false);
}
开发者ID:NaturalWill,项目名称:UCQA,代码行数:14,代码来源:function_cron.php


示例10: email_reg

function email_reg($email, $backurl = '')
{
    global $_SGLOBAL, $_SC;
    $email_reg['email'] = $email;
    $email_reg['ip'] = getonlineip(1);
    $email_reg['salt'] = random(6);
    $email_reg['hash'] = substr(md5(md5($email) . $email_reg['salt']), 8, 7);
    $email_reg['addtime'] = $_SGLOBAL['timestamp'];
    $email_reg['used'] = 0;
    $email_reg['backurl'] = $backurl;
    $id = inserttable(tname("open_email_reg"), $email_reg, 1, 1);
    $h = $email_reg['hash'];
    return $_SC['site_host'] . "/?r=" . $h;
}
开发者ID:hugolong,项目名称:weixiao,代码行数:14,代码来源:register.php


示例11: add

	function add($uId, $appId, $appName, $privacy, $allowSideNav, $allowFeed, $allowProfileLink,  $defaultBoxType, $defaultMYML, $defaultProfileLink, $version, $displayMethod, $displayOrder = null) {
		$sql = sprintf('SELECT appid FROM %s WHERE uid = %d AND appid = %d', $GLOBALS['tablepre'].'userapp', $uId, $appId);
		$query = $GLOBALS['db']->query($sql);
		$row = $GLOBALS['db']->fetch_array($query);
		if($row['appid']) {
			$errCode = '170';
			$errMessage = 'Application has been already added';
			return new APIErrorResponse($errCode, $errMessage);
		}

		switch($privacy) {
			case 'public':
				$privacy = 0;
				break;
			case 'friends':
				$privacy = 1;
				break;
			case 'me':
				$privacy = 3;
				break;
			case 'none':
				$privacy = 5;
				break;
			default:
				$privacy = 0;
		}

		$narrow = ($defaultBoxType == 'narrow') ? 1 : 0;
		$fields = array(
			'appid' => $appId,
			'appname' => $appName,
			'uid' => $uId,
			'privacy' => $privacy,
			'allowsidenav' => $allowSideNav,
			'allowfeed' => $allowFeed,
			'allowprofilelink' => $allowProfileLink,
			'narrow' => $narrow,
			'profilelink' => $defaultProfileLink,
			'myml' => $defaultMYML
		);
		if($displayOrder !== null) {
			$fields['displayOrder'] = $displayOrder;
		}
		$result = inserttable('userapp', $fields, 1);

		$displayMethod = ($displayMethod == 'iframe') ? 1 : 0;
		$this->refreshApplication($appId, $appName, $version, $displayMethod, $narrow, null, null);
		return new APIResponse($result);
	}
开发者ID:BGCX262,项目名称:zyyhong-svn-to-git,代码行数:49,代码来源:UserApplication.php


示例12: insertsession

function insertsession($setarr)
{
    global $_SGLOBAL, $_SCONFIG;
    $_SCONFIG['onlinehold'] = intval($_SCONFIG['onlinehold']);
    if ($_SCONFIG['onlinehold'] < 300) {
        $_SCONFIG['onlinehold'] = 300;
    }
    $_SGLOBAL['db']->query("DELETE FROM " . tname('session') . " WHERE uid='{$setarr['uid']}' OR lastactivity<'" . ($_SGLOBAL['timestamp'] - $_SCONFIG['onlinehold']) . "'");
    //添加在线
    $ip = getonlineip(1);
    $setarr['lastactivity'] = $_SGLOBAL['timestamp'];
    $setarr['ip'] = $ip;
    inserttable('session', $setarr, 0, true, 1);
    //更新用户
    updatetable('space', array('lastlogin' => $_SGLOBAL['timestamp'], 'ip' => $ip), array('uid' => $setarr['uid']), 1);
}
开发者ID:xiaoxiaoleo,项目名称:ngintek,代码行数:16,代码来源:function_space.php


示例13: send

 function send($uId, $recipientIds, $appId, $requestName, $myml, $type)
 {
     global $_SGLOBAL;
     include_once S_ROOT . './source/function_cp.php';
     $now = time();
     $result = array();
     $type = $type == 'request' ? 1 : 0;
     $fields = array('typename' => $requestName, 'appid' => $appId, 'type' => $type, 'fromuid' => $uId, 'dateline' => $now);
     foreach ($recipientIds as $key => $val) {
         $hash = crc32($appId . $val . $now . rand(0, 1000));
         $hash = sprintf('%u', $hash);
         $fields['touid'] = intval($val);
         $fields['hash'] = $hash;
         $fields['myml'] = str_replace('{{MyReqHash}}', $hash, $myml);
         $result[] = inserttable('myinvite', $fields, 1);
     }
     return new APIResponse($result);
 }
开发者ID:xiaoxiaoleo,项目名称:ngintek,代码行数:18,代码来源:Request.php


示例14: system_adminteam_addteam

function system_adminteam_addteam()
{
    if ($_POST) {
        $manage_list = MooGetGPC('grouparr', 'string', 'P');
        if ($manage_list) {
            $manage_list = array_unique($manage_list);
            $arr['manage_list'] = implode(',', $manage_list);
        }
        $arr['manage_name'] = MooGetGPC('manage_name', 'string', 'P');
        $arr['manage_desc'] = MooGetGPC('manage_desc', 'string', 'P');
        $arr['leader_uid'] = MooGetGPC('team_leader', 'string', 'P');
        $arr['type'] = 2;
        inserttable('admin_manage', $arr);
        salert('添加成功');
        exit;
    }
    require_once adminTemplate('adminteam_addteam');
}
开发者ID:noikiy,项目名称:zays,代码行数:18,代码来源:system_adminteam.php


示例15: system_adminmanage_addgroup

function system_adminmanage_addgroup()
{
    if ($_POST) {
        $manage_list = MooGetGPC('userlist', 'string', 'P');
        if ($manage_list) {
            $manage_list = array_unique($manage_list);
            $arr['manage_list'] = implode(',', $manage_list);
        }
        $arr['manage_name'] = MooGetGPC('manage_name', 'string', 'P');
        $arr['manage_desc'] = MooGetGPC('manage_desc', 'string', 'P');
        $arr['manage_type'] = MooGetGPC('manage_type', 'integer', 'P');
        $arr['type'] = 1;
        $arr['dateline'] = time();
        inserttable('admin_manage', $arr);
        salert('添加成功');
        exit;
    }
    require_once adminTemplate('adminmanage_addgroup');
}
开发者ID:noikiy,项目名称:zays,代码行数:19,代码来源:system_adminmanage.php


示例16: add

 public function add($uId, $appId, $appName, $privacy, $allowSideNav, $allowFeed, $allowProfileLink, $defaultBoxType, $defaultMYML, $defaultProfileLink, $version, $displayMethod, $displayOrder = null)
 {
     $db_prefix = getDbPrefix();
     $is_installed = doQuery("SELECT `appid` FROM {$db_prefix}myop_userapp WHERE `uid` = {$uId} AND `appid` = {$appId}");
     if ($is_installed) {
         $errCode = '170';
         $errMessage = 'Application has been already added';
         return new APIErrorResponse($errCode, $errMessage);
     }
     switch ($privacy) {
         case 'public':
             $privacy = 0;
             break;
         case 'friends':
             $privacy = 1;
             break;
         case 'me':
             $privacy = 3;
             break;
         case 'none':
             $privacy = 5;
             break;
         default:
             $privacy = 0;
     }
     $narrow = $defaultBoxType == 'narrow' ? 1 : 0;
     $setarr = array('uid' => $uId, 'appid' => $appId, 'appname' => $appName, 'privacy' => $privacy, 'allowsidenav' => $allowSideNav, 'allowfeed' => $allowFeed, 'allowprofilelink' => $allowProfileLink, 'narrow' => $narrow);
     if ($displayOrder !== null) {
         $setarr['displayorder'] = $displayOrder;
     }
     inserttable('myop_userapp', $setarr);
     $fields = array('uid' => $uId, 'appid' => $appId, 'profilelink' => $defaultProfileLink, 'myml' => $defaultMYML);
     $result = inserttable('myop_userappfield', $fields, 1);
     /* TODO: 更新用户、增加积分
     		//获取指定动作能获得多少积分
     		$reward = getreward('installapp', 0, $uId, $appId, 0);
     		$_SGLOBAL['db']->query("UPDATE ".tname('space')." SET updatetime='$_SGLOBAL[timestamp]', credit=credit+$reward[credit], experience=experience+$reward[experience] WHERE uid='$uId'");
     		*/
     $displayMethod = $displayMethod == 'iframe' ? 1 : 0;
     $this->refreshApplication($appId, $appName, $version, $displayMethod, $narrow, null, null);
     return new APIResponse($result);
 }
开发者ID:laiello,项目名称:thinksns-2,代码行数:42,代码来源:UserApplication.class.php


示例17: add

 function add($uId, $appId, $appName, $privacy, $allowSideNav, $allowFeed, $allowProfileLink, $defaultBoxType, $defaultMYML, $defaultProfileLink, $version, $displayMethod, $displayOrder = null)
 {
     global $_SGLOBAL;
     $sql = sprintf('SELECT appid FROM %s WHERE uid = %d AND appid = %d', tname('userapp'), $uId, $appId);
     $query = $_SGLOBAL['db']->query($sql);
     $row = $_SGLOBAL['db']->fetch_array($query);
     if ($row['appid']) {
         $errCode = '170';
         $errMessage = 'Application has been already added';
         return new APIErrorResponse($errCode, $errMessage);
     }
     switch ($privacy) {
         case 'public':
             $privacy = 0;
             break;
         case 'friends':
             $privacy = 1;
             break;
         case 'me':
             $privacy = 3;
             break;
         case 'none':
             $privacy = 5;
             break;
         default:
             $privacy = 0;
     }
     $narrow = $defaultBoxType == 'narrow' ? 1 : 0;
     $setarr = array('uid' => $uId, 'appid' => $appId, 'appname' => $appName, 'privacy' => $privacy, 'allowsidenav' => $allowSideNav, 'allowfeed' => $allowFeed, 'allowprofilelink' => $allowProfileLink, 'narrow' => $narrow);
     if ($displayOrder !== null) {
         $setarr['displayorder'] = $displayOrder;
     }
     inserttable('userapp', $setarr);
     $fields = array('uid' => $uId, 'appid' => $appId, 'profilelink' => $defaultProfileLink, 'myml' => $defaultMYML);
     $result = inserttable('userappfield', $fields, 1);
     $reward = getreward('installapp', 0, $uId, $appId, 0);
     // update  user
     $_SGLOBAL['db']->query("UPDATE " . tname('space') . " SET updatetime='{$_SGLOBAL['timestamp']}', credit=credit+{$reward['credit']}, experience=experience+{$reward['experience']} WHERE uid='{$uId}'");
     $displayMethod = $displayMethod == 'iframe' ? 1 : 0;
     $this->refreshApplication($appId, $appName, $version, $displayMethod, $narrow, null, null);
     return new APIResponse($result);
 }
开发者ID:v998,项目名称:discuzx-en,代码行数:42,代码来源:UserApplication.php


示例18: send

 function send($uId, $recipientIds, $appId, $requestName, $myml, $type)
 {
     $db_prefix = getDbPrefix();
     $now = time();
     $result = array();
     $type = $type == 'request' ? '1' : '0';
     $fields = array('typename' => $requestName, 'appid' => $appId, 'type' => $type, 'fromuid' => $uId, 'dateline' => $now);
     foreach ($recipientIds as $key => $val) {
         $myml = str_replace('space.php?', U('home/Space/index') . '&', $myml);
         $myml = str_replace('userapp.php', MYOP_URL . '/userapp.php', $myml);
         $hash = crc32($appId . $val . $now . rand(0, 1000));
         $hash = sprintf('%u', $hash);
         $fields['touid'] = intval($val);
         $fields['hash'] = $hash;
         $fields['myml'] = str_replace('{{MyReqHash}}', $hash, $myml);
         $result[] = inserttable('myop_myinvite', $fields, 1);
         //TODO: 更新统计
         //doQuery("UPDATE ".tname('space')." SET myinvitenum=myinvitenum+1 WHERE `uid`='{$fields['touid']}'");
     }
     return new APIResponse($result);
 }
开发者ID:laiello,项目名称:thinksns-2,代码行数:21,代码来源:Request.class.php


示例19: update

 /**
  * 更新用户的积分
  *
  * @param integer $uId 用户Id
  * @param integer $credits 积分值
  * @param integer $appId 应用Id
  * @param string $note 操作记录
  * @return integer 更新后的用户积分
  */
 function update($uId, $credits, $appId, $note)
 {
     global $_SGLOBAL;
     $where = '';
     $type = 1;
     if ($credits < 0) {
         $where = ' AND credit >= ' . abs($credits);
         $type = 0;
     }
     $sql = sprintf('UPDATE %s SET credit = credit + %d WHERE uid=%d %s', tname('space'), $credits, $uId, $where);
     $result = $_SGLOBAL['db']->query($sql);
     if ($_SGLOBAL['db']->affected_rows() < 1) {
         $errCode = 180;
         $errMessage = 'No Credits Enough';
         return new APIErrorResponse($errCode, $errMessage);
     }
     $fields = array('uid' => $uId, 'appid' => $appId, 'type' => $type, 'credit' => abs($credits), 'note' => $note, 'dateline' => time());
     $result = inserttable('appcreditlog', $fields, 1);
     $query = $_SGLOBAL['db']->query('SELECT credit FROM ' . tname('space') . ' WHERE uid =' . $uId);
     $row = $_SGLOBAL['db']->fetch_array($query);
     return new APIResponse($row['credit']);
 }
开发者ID:NaturalWill,项目名称:UCQA,代码行数:31,代码来源:Credit.php


示例20: createalbum

/**
 * 創建相冊
 * @param
 * @return 相冊id
 */
function createalbum($shopid = 0, $catid = 0, $uid = 0, $username = '', $subject = '', $description = '')
{
    global $_G, $_SGLOBAL;
    $arr_data = array();
    //id
    foreach (array('shopid', 'catid', 'uid') as $value) {
        ${$value} = intval(${$value});
    }
    //字符串
    foreach (array('subject', 'description') as $value) {
        ${$value} = trim(strip_tags(${$value}));
    }
    //判斷必填,設置插入數據庫的數據
    foreach (array('shopid', 'catid', 'uid', 'username', 'subject') as $value) {
        if (empty(${$value})) {
            cpmsg($value . '_not_selected', '', '', '', true, true);
        }
        $arr_data[$value] = ${$value};
    }
    $arr_data['description'] = $description;
    if ($_SGLOBAL['panelinfo']['group']['verifyalbum'] && !pkperm('isadmin')) {
        $arr_data['grade'] = 0;
    } else {
        $arr_data['grade'] = 3;
    }
    $arr_data['dateline'] = $_G['timestamp'];
    $albumid = inserttable('albumitems', $arr_data, 1);
    if (!$albumid) {
        cpmsg('album_creat_error', '', '', '', true, true);
    }
    //相冊屬性
    if (!empty($_POST['attr_ids'])) {
        require_once B_ROOT . "./batch.attribute.php";
        setattributesettings($catid, $albumid, $_POST['attr_ids']);
    }
    return $albumid;
}
开发者ID:pan289091315,项目名称:Discuz,代码行数:42,代码来源:album.func.php



注:本文中的inserttable函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP inserttask函数代码示例发布时间:2022-05-15
下一篇:
PHP insertsession函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap