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

PHP tname函数代码示例

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

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



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

示例1: UpdateSql

function UpdateSql($data, $table, $where, $strict = false)
{
    $f = '';
    $field = array();
    if ($strict) {
        $fieldrows = $GLOBALS['db']->fetch_first("select * from " . tname($table));
        $field = array_keys($fieldrows);
    }
    foreach ($data as $key => $val) {
        if ($strict) {
            if (in_array($key, $field)) {
                $d = $i > 0 ? ',' : '';
                $f .= $d . "`" . $key . "`=" . "'" . global_addslashes(trim($val)) . "'";
                $i++;
            }
        } else {
            $d = $i > 0 ? ',' : '';
            $f .= $d . "`" . $key . "`=" . "'" . global_addslashes(trim($val)) . "'";
            $i++;
        }
    }
    $sql = "update " . tname($table) . " set ";
    $sql .= $f . " where 1 " . $where;
    return $sql;
}
开发者ID:Tolecen,项目名称:YouthFundWebSite,代码行数:25,代码来源:sql.inc.php


示例2: setFlag

	function setFlag($applications, $flag) {
		global $_SGLOBAL;

		$flag = ($flag == 'disabled') ? -1 : ($flag == 'default' ? 1 : 0);
		$appIds = array();
		if ($applications && is_array($applications)) {
			foreach($applications as $application) {
				$this->refreshApplication($application['appId'], $application['appName'], null, null, null, $flag, null);
				$appIds[] = $application['appId'];
			}
		}

		if ($flag == -1) {
			$sql = sprintf('DELETE FROM %s WHERE icon IN (%s)', tname('feed'), simplode($appIds));
			$_SGLOBAL['db']->query($sql);

			$sql = sprintf('DELETE FROM %s WHERE appid IN (%s)', tname('userapp'), simplode($appIds));
			$_SGLOBAL['db']->query($sql);

			$sql = sprintf('DELETE FROM %s WHERE appid IN (%s)', tname('userappfield'), simplode($appIds));
			$_SGLOBAL['db']->query($sql);

			$sql = sprintf('DELETE FROM %s WHERE appid IN (%s)', tname('myinvite'), simplode($appIds));
			$_SGLOBAL['db']->query($sql);

			$sql = sprintf('DELETE FROM %s WHERE type IN (%s)', tname('notification'), simplode($appIds));
			$_SGLOBAL['db']->query($sql);
		}

		$result = true;
		return new APIResponse($result);
	}
开发者ID:BGCX262,项目名称:zyyhong-svn-to-git,代码行数:32,代码来源:Application.php


示例3: get_ad

function get_ad($adid)
{
    global $_SGLOBAL;
    $query = $_SGLOBAL['db']->query("SELECT * FROM " . tname('ad4dev') . " WHERE id={$adid}");
    $ad = $_SGLOBAL['db']->fetch_array($query);
    return $ad;
}
开发者ID:shiyake,项目名称:php-ihome,代码行数:7,代码来源:dev_manage.php


示例4: get_shop_nav

 /**
  * 商舖的自定義導航
  *
  * @param int $shopid 商舖 ID
  */
 function get_shop_nav($shopid)
 {
     global $_G, $_SGLOBAL, $_BCACHE, $_SBLOCK;
     $nav_default = $this->get_shop_nav_default($shopid);
     $_SGLOBAL['shop_nav'] = array();
     $_BCACHE->cachesql('shopnav', 'SELECT * FROM ' . tname('nav') . " WHERE (type=\\'sys\\' OR type=\\'shop\\') AND shopid='{$shopid}' AND displayorder>-1 ORDER BY displayorder ASC", 0, 0, 10, 0, 'detail', 'nav', $shopid);
     foreach ($_SBLOCK['shopnav'] as $value) {
         if ($value['available'] == 1) {
             $value['target'] = $value['target'] ? ' target=\'_blank\'' : '';
             $value['style'] = ' style=\'' . pktitlestyle($value['highlight']) . '\'';
             $value['url'] = $nav_default[$value['flag']]['url'];
             $_SGLOBAL['shop_nav'][$value['flag']] = $value;
             unset($nav_default[$value['flag']]);
         } else {
             unset($nav_default[$value['flag']]);
         }
     }
     foreach ($nav_default as $key => $value) {
         if (!isset($rowitems[$key])) {
             $_SGLOBAL['shop_nav'][$key] = $value;
         }
         $_SGLOBAL['shop_nav'][$key]['url'] = $value['url'];
     }
     return $_SGLOBAL['shop_nav'];
 }
开发者ID:pan289091315,项目名称:Discuz,代码行数:30,代码来源:nav.class.php


示例5: getrss

function getrss($catid)
{
    global $_SGLOBAL, $_SCONFIG;
    $rssarr = array();
    $attacharr = array();
    if (empty($_SCONFIG['rssnum'])) {
        $_SCONFIG['rssnum'] = 10;
    }
    $sql = "SELECT si.itemid, si.uid, si.username, si.subject, sn.*, si.dateline, c.name FROM " . tname('spaceitems') . " si INNER JOIN " . tname('categories') . " c ON si.catid = c.catid LEFT JOIN " . tname('spacenews') . " sn ON si.itemid = sn.itemid WHERE si.type='news' ";
    if (!empty($catid)) {
        $sql .= " AND si.catid='{$catid}' ";
    }
    $sql .= " ORDER BY si.dateline DESC LIMIT 100";
    $query = $_SGLOBAL['db']->query($sql);
    while ($items = $_SGLOBAL['db']->fetch_array($query)) {
        $othermsgarr = array();
        $items['message'] = cutstr($items['message'], 255, 1);
        if (!empty($othermsgarr)) {
            $items['message'] = implode('<br>', $othermsgarr) . '<br>' . $items['message'];
        }
        if (!empty($items['hash'])) {
            $attacharr[] = trim($items['hash']);
        }
        $rssarr[$items['itemid']] = $items;
    }
    return $rssarr;
}
开发者ID:hongz1125,项目名称:devil,代码行数:27,代码来源:rss.php


示例6: get

	function get($uId, $num) {
		global $_SGLOBAL;
		$result = array();
		$query = $_SGLOBAL['db']->query("SELECT * FROM ".tname('feed')." WHERE uid='$uId' ORDER BY dateline DESC LIMIT 0,$num");
		while($value = $_SGLOBAL['db']->fetch_array($query)) {
			$result[] = array(
				'appId' => $value['appid'],
				'created' => $value['dateline'],
				'type' => $value['icon'],
				'titleTemplate' => $value['title_template'],
				'titleData' => $value['title_data'],
				'bodyTemplate' => $value['body_template'],
				'bodyData' => $value['body_data'],
				'bodyGeneral' => $value['body_general'],
				'image1' => $value['image_1'],
				'image1Link' => $value['image_1_link'],
				'image2' => $value['image_2'],
				'image2Link' => $value['image_2_link'],
				'image3' => $value['image_3'],
				'image3Link' => $value['image_3_link'],
				'image4' => $value['image_4'],
				'image4Link' => $value['image_4_link'],
				'targetIds' => $value['target_ids'],
				'privacy' => $value['friend']==0?'public':($value['friend']==1?'friends':'someFriends')
			);
		}
		return new APIResponse($result);
	}
开发者ID:BGCX262,项目名称:zyyhong-svn-to-git,代码行数:28,代码来源:NewsFeed.php


示例7: get_uid

function get_uid($type, $msg)
{
    global $_SGLOBAL;
    if ($type == 1) {
        $str = explode(",", $msg);
        //print_r($str);
        $collegeid = $str[0];
        $startyear = $str[1];
        $wheresql = "collegeid = '{$collegeid}' and startyear = {$startyear}";
        //print($wheresql);
    } else {
        if ($type == 2) {
            $str = explode(",", $msg);
            $name = $str[0];
            $bir = $str[1];
            $wheresql = "realname = '{$name}' and birthday = {$bir}";
        }
    }
    $query = $_SGLOBAL['db']->query("SELECT * FROM " . tname('baseprofile') . " where " . $wheresql);
    if ($value = $_SGLOBAL['db']->fetch_array($query)) {
        $uid = $value[uid];
        if ($value[uid] == null) {
            $uid = 'no uid';
        }
    } else {
        $uid = 'no person';
    }
    return $uid;
}
开发者ID:shiyake,项目名称:php-ihome,代码行数:29,代码来源:getuid.php


示例8: getAstrosData

function getAstrosData()
{
    $mysql = new SaeMysql();
    $sql0 = "SELECT * FROM `" . tname("astro") . "` LIMIT 12";
    $astros = $mysql->getData($sql0);
    return $astros;
}
开发者ID:vangogogo,项目名称:justsns,代码行数:7,代码来源:astro_common.php


示例9: gettask

function gettask()
{
    global $space, $_SGLOBAL;
    $task = array();
    if (!@(include_once S_ROOT . './data/data_task.php')) {
        include_once S_ROOT . './source/function_cache.php';
        task_cache();
    }
    if ($_SGLOBAL['task']) {
        $usertasks = array();
        $query = $_SGLOBAL['db']->query("SELECT * FROM " . tname('usertask') . " WHERE uid='{$_SGLOBAL['supe_uid']}'");
        while ($value = $_SGLOBAL['db']->fetch_array($query)) {
            $usertasks[$value['taskid']] = $value;
        }
        //需要执行的任务
        foreach ($_SGLOBAL['task'] as $value) {
            if ($value['starttime'] <= $_SGLOBAL['timestamp'] && (empty($usertasks[$value['taskid']]) || $value['nexttime'] && $_SGLOBAL['timestamp'] - $usertasks[$value['taskid']]['dateline'] >= $value['nexttime'])) {
                $value['image'] = empty($value['image']) ? 'image/task.gif' : $value['image'];
                $task = $value;
                break;
            }
        }
    }
    return $task;
}
开发者ID:xiaoxiaoleo,项目名称:ngintek,代码行数:25,代码来源:function_space.php


示例10: get_service

function get_service($serid)
{
    global $_SGLOBAL;
    $query = $_SGLOBAL['db']->query("SELECT * FROM " . tname('apps') . " WHERE id={$serid}");
    $service = $_SGLOBAL['db']->fetch_array($query);
    return $service;
}
开发者ID:shiyake,项目名称:php-ihome,代码行数:7,代码来源:dev_service.php


示例11: send

	function send($uId, $recipientIds, $appId, $notification) {
		global $_SGLOBAL;

		//过滤黑名单中的用户
		$blacklist = $result = array();

		// 允许匿名发送
		if ($uId) {
			$query = $_SGLOBAL['db']->query("SELECT * FROM ".tname('blacklist')."  WHERE uid IN ('".implode("','", $recipientIds)."') AND buid='$uId'");
			while($value = $_SGLOBAL['db']->fetch_array($query)) {
				$blacklist[$value['uid']] = $value['uid'];
			}
		}

		include_once(S_ROOT.'./source/function_cp.php');
		foreach($recipientIds as $recipientId) {
			$val = intval($recipientId);
			if($val && empty($blacklist[$val])) {
				$result[$val] = notification_add($val, $appId, $notification, 1);
			} else {
				$result[$recipientId] = null;
			}
		}
		return new APIResponse($result);
	}
开发者ID:BGCX262,项目名称:zyyhong-svn-to-git,代码行数:25,代码来源:Notifications.php


示例12: main_action

 function main_action()
 {
     global $db, $session;
     $uid = $session->get('adminid');
     //得到个人信息
     $userinfo = $db->fetch_first('select * from ' . tname('admin') . ' where uid=' . $uid);
     include ROOT_PATH . '/views/admin/adminframe.php';
 }
开发者ID:Tolecen,项目名称:YouthFundWebSite,代码行数:8,代码来源:admin.php


示例13: update

 /**
  * 更新用户的积分
  *
  * @param integer $uId 用户Id
  * @param integer $credits 积分值
  * @return integer 更新后的用户积分
  */
 function update($uId, $credits)
 {
     global $_SGLOBAL;
     $sql = sprintf('UPDATE %s SET credit = credit + %d WHERE uid=%d', tname('space'), $credits, $uId);
     $result = $_SGLOBAL['db']->query($sql);
     $query = $_SGLOBAL['db']->query('SELECT credit FROM ' . tname('space') . ' WHERE uid =' . $uId);
     $row = $_SGLOBAL['db']->fetch_array($query);
     return new APIResponse($row['credit']);
 }
开发者ID:xiaoxiaoleo,项目名称:ngintek,代码行数:16,代码来源:Credit.php


示例14: areFriends

	function areFriends($uId1, $uId2) {
		global $_SGLOBAL;
		$query = $_SGLOBAL['db']->query("SELECT uid FROM ".tname('friend')."  WHERE uid='$uId1' AND fuid='$uId2' AND status='1'");
		$result = false;
		if($friend = $_SGLOBAL['db']->fetch_array($query)) {
			$result = true;
		}
		return new APIResponse($result);
	}
开发者ID:BGCX262,项目名称:zyyhong-svn-to-git,代码行数:9,代码来源:Friends.php


示例15: deletedoings

function deletedoings($ids)
{
    global $_SGLOBAL;
    $_SGLOBAL['db']->query("DELETE FROM " . tname('doing') . " WHERE doid IN (" . simplode($ids) . ")");
    //删除评论
    $_SGLOBAL['db']->query("DELETE FROM " . tname('docomment') . " WHERE doid IN (" . simplode($ids) . ")");
    //删除feed
    $_SGLOBAL['db']->query("DELETE FROM " . tname('feed') . " WHERE id IN (" . simplode($ids) . ") AND idtype='doid'");
    return true;
}
开发者ID:shiyake,项目名称:php-ihome,代码行数:10,代码来源:do_deletenews.php


示例16: get

 function get($uIds)
 {
     global $_SGLOBAL;
     $result = array();
     $query = $_SGLOBAL['db']->query("SELECT * FROM " . tname('friend') . "  WHERE uid IN ('" . implode("','", $uIds) . "') AND status='1'");
     while ($friend = $_SGLOBAL['db']->fetch_array($query)) {
         $result[$friend['uid']][] = $friend['fuid'];
     }
     return new APIResponse($result);
 }
开发者ID:xiaoxiaoleo,项目名称:ngintek,代码行数:10,代码来源:Friends.php


示例17: saveProject_action

 function saveProject_action()
 {
     global $db;
     $projectName = $_POST['projectName'];
     $projectType = $_POST['projectType'];
     $projectUser = $_POST['projectUser'];
     $mobile = $_POST['mobile'];
     $weichart = $_POST['weichart'];
     $email = $_POST['email'];
     $company = $_POST['company'];
     $industry = $_POST['industry'];
     $rzjd = $_POST['rzjd'];
     $rzje = $_POST['rzje'];
     $tdgm = $_POST['tdgm'];
     // 高管职位
     $ggzws = $_POST['ggzws'];
     // 高管名称
     $ggmcs = $_POST['ggmcs'];
     // 营业执照图片
     $fjImageArr = $_POST['fjImageArr'];
     // 产品图片
     $cptpImageArr = $_POST['cptpImageArr'];
     // 二维码
     $cpewmImageArr = $_POST['cpewmImageArr'];
     // 商业计划书、战略规划
     $syjhImageArr = $_POST['syjhImageArr'];
     if ($projectType == 0) {
         $projectTypeName = "社会项目";
     } else {
         $projectTypeName = "高校项目";
     }
     $db->query("insert into " . tname('project') . "(project_name,project_type,project_type_id,project_user,project_user_phone,project_user_email,project_user_weixin,project_company,project_company_type,project_company_financ_p,project_company_financ,project_company_team,created_time) values ('" . $projectName . "','" . $projectTypeName . "','" . $projectType . "','" . $projectUser . "','" . $mobile . "','" . $email . "','" . $weichart . "','" . $company . "','" . $industry . "','" . $rzjd . "','" . $rzje . "','" . $tdgm . "','" . time() . "')");
     $project_id = $db->insert_id();
     // 插入营业执照图片
     foreach ($fjImageArr as $fjImage) {
         $db->query("insert into " . tname('project_bl') . "(project_id,file_id,created_time) values ('" . $project_id . "','" . $fjImage . "','" . time() . "')");
     }
     // 插入产品图片
     foreach ($cptpImageArr as $cptpImage) {
         $db->query("insert into " . tname('project_product') . "(project_id,file_id,created_time) values ('" . $project_id . "','" . $cptpImage . "','" . time() . "')");
     }
     // 插入二维码
     foreach ($cpewmImageArr as $cpewmImage) {
         $db->query("insert into " . tname('project_qr') . "(project_id,file_id,created_time) values ('" . $project_id . "','" . $cpewmImage . "','" . time() . "')");
     }
     // 插入商业计划书、战略规划
     foreach ($syjhImageArr as $syjhImage) {
         $db->query("insert into " . tname('project_plan') . "(project_id,file_id,created_time) values ('" . $project_id . "','" . $syjhImage . "','" . time() . "')");
     }
     for ($i = 0; $i < count($ggzws); $i++) {
         $db->query("insert into " . tname('project_gg') . "(project_id,gg_mc,gg_zw,created_time) values ('" . $project_id . "','" . $ggmcs[$i] . "','" . $ggzws[$i] . "','" . time() . "')");
     }
     $pro['ret'] = 0;
     echo json_encode($pro);
 }
开发者ID:Tolecen,项目名称:YouthFundWebSite,代码行数:55,代码来源:project.class.php


示例18: updateviewnum

function updateviewnum($itemid)
{
    global $_SGLOBAL;
    $logfile = S_ROOT . './log/viewcount.log';
    if (@($fp = fopen($logfile, 'a+'))) {
        fwrite($fp, $itemid . "\n");
        fclose($fp);
        @chmod($logfile, 0777);
    } else {
        $_SGLOBAL['db']->query('UPDATE ' . tname('spaceitems') . ' SET viewnum=viewnum+1 WHERE itemid=\'' . $itemid . '\'');
    }
}
开发者ID:hongz1125,项目名称:devil,代码行数:12,代码来源:news.func.php


示例19: get

 function get($uId, $num)
 {
     global $_SGLOBAL;
     $sql = 'SELECT * FROM %s WHERE uid = %d LIMIT %d';
     $sql = sprintf($sql, tname('doing'), $uId, $num);
     $query = $_SGLOBAL['db']->query($sql);
     $result = array();
     while ($doing = $_SGLOBAL['db']->fetch_array($query)) {
         $result[] = array('created' => $doing['dateline'], 'message' => $doing['message'], 'ip' => $doing['ip'], 'clientIdentify' => $doing['from']);
     }
     return new APIResponse($result);
 }
开发者ID:shiyake,项目名称:php-ihome,代码行数:12,代码来源:MiniBlog.php


示例20: config_cache

function config_cache($updatedata = true)
{
    global $_SGLOBAL;
    $_SCONFIG = array();
    $query = $_SGLOBAL['db']->query('SELECT * FROM ' . tname('config'));
    while ($value = $_SGLOBAL['db']->fetch_array($query)) {
        if ($value['var'] == 'privacy') {
            $value['datavalue'] = empty($value['datavalue']) ? array() : unserialize($value['datavalue']);
        }
        $_SCONFIG[$value['var']] = $value['datavalue'];
    }
    cache_write('config', '_SCONFIG', $_SCONFIG);
}
开发者ID:hugolong,项目名称:weixiao,代码行数:13,代码来源:function_cache.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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