本文整理汇总了PHP中get_letter函数的典型用法代码示例。如果您正苦于以下问题:PHP get_letter函数的具体用法?PHP get_letter怎么用?PHP get_letter使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_letter函数的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: xmlmdb
public function xmlmdb($xml)
{
$collect = D('Xmlzy');
$array_url = $xml['url'];
$array_tpl = $xml['tpl'];
$xml_page = $xml['page'];
$list_class = $xml['listclass'];
$list_vod = $xml['listvod'];
//是否采集入库
if ($array_url['action']) {
$page = $array_url['page'];
echo '<style type="text/css">div{font-size:12px;color: #333333;margin:6px;}span{font-weight:bold;color:#FF0000}</style>';
echo '<div id="show"><div>当前采集任务<font color=green><strong>' . $page . '</strong></font>/<span class="green">' . $xml_page['pagecount'] . '</span>页,本页共需要采集数据<span>' . $xml_page['pagesize'] . '</span>个 ' . $array_tpl['httpurl'] . '</div>';
foreach ($list_vod as $key => $vod) {
$vod['addtime'] = time();
$vod['stars'] = 1;
$vod['letter'] = get_letter($vod['title']);
$vod['hits'] = mt_rand(0, C('web_admin_hits'));
$vod['score'] = mt_rand(1, C('web_admin_score'));
$vod['scoreer'] = mt_rand(1, C('web_admin_score'));
$vod['up'] = mt_rand(1, C('web_admin_updown'));
$vod['down'] = mt_rand(1, C('web_admin_updown'));
$vod['inputer'] = 'collect_' . $array_url['fid'];
//地址入库
echo '<div><span>' . ($key + 1) . '</span> [' . get_channel_name($vod['cid']) . '] ' . $vod['title'] . ' <font color=blue>';
echo $collect->xml_insert($vod, $array_url['pic']);
echo '</font></div>';
ob_flush();
flush();
}
if ('all' == $array_url['action'] || 'day' == $array_url['action']) {
if ($page < $xml_page['pagecount']) {
$jumpurl = str_replace('{!page!}', $page + 1, $array_tpl['pageurl']);
//缓存断点续采
F('_collect/xucai', $jumpurl);
//跳转到下一页
echo '<div><span>' . C('url_create_time') . '</span>秒后将自动采集下一页!<meta http-equiv="refresh" content=' . C('url_create_time') . ';url=' . $jumpurl . '></div>';
} else {
//清除断点续采
F('_collect/xucai', NULL);
echo '<div>所有采集任务已经完成,返回<a href="?s=Admin/Video/Show">[视频管理中心</a>],查看<a href="?s=Admin/Video/Show/status/-1">[相似未审核的影片</a>]!</div>';
}
} else {
echo '<div>所有采集任务已经完成,返回<a href="?s=Admin/Video/Show">[视频管理中心</a>],查看<a href="?s=Admin/Video/Show/status/-1">[相似未审核的影片</a>]!</div>';
}
} else {
$array_url['vodids'] = '';
$this->assign($array_url);
$this->assign($array_tpl);
$this->assign('list_class', $list_class);
$this->assign('list_vod', $list_vod);
$this->display('./views/admin/collect_show.html');
}
}
开发者ID:singhvicky,项目名称:pintrest,代码行数:54,代码来源:CollectAction.class.php
示例2: update
function update()
{
$name = $this->getActionName();
$model = D($name);
if (false === $model->create()) {
$this->error($model->getError());
}
// 更新数据
$model->__set('letter', get_letter($model->__get('emp_name')));
$list = $model->save();
if (false !== $list) {
//成功提示
$this->assign('jumpUrl', $this->_get_return_url());
$this->success('编辑成功!');
} else {
//错误提示
$this->error('编辑失败!');
}
}
开发者ID:uwitec,项目名称:semoa,代码行数:19,代码来源:UserAction.class.php
示例3: insert
function insert()
{
$ajax = $_POST['ajax'];
$model = D('FlowType');
if (false === $model->create()) {
$this->error($model->getError());
}
$model->__set('letter', get_letter($model->__get('name')));
//保存当前数据对象
$list = $model->add();
if ($list !== false) {
//保存成功
$this->assign('jumpUrl', $this->_get_return_url());
$this->success('新增成功!');
} else {
//失败提示
$this->error('新增失败!');
}
}
开发者ID:uwitec,项目名称:semoa,代码行数:19,代码来源:FlowtypeAction.class.php
示例4: _update
protected function _update()
{
$id = $_POST['id'];
$model = D("Customer");
if (false === $model->create()) {
$this->error($model->getError());
}
$model->letter = get_letter($model->name);
// 更新数据
$list = $model->save();
if (false !== $list) {
//成功提示
$this->assign('jumpUrl', get_return_url());
$this->success('编辑成功!');
} else {
//错误提示
$this->error('编辑失败!');
}
}
开发者ID:2ger,项目名称:trunk,代码行数:19,代码来源:CustomerAction.class.php
示例5: sync
private function sync()
{
$ldap_host = C("LDAP_SERVER");
//LDAP 服务器地址
$ldap_port = C("LDAP_PORT");
//LDAP 服务器端口号
$ldap_user = C("LDAP_USER");
//设定服务器用户名
$ldap_pwd = C("LDAP_PWD");
//设定服务器密码
$ldap_conn = ldap_connect($ldap_host, $ldap_port) or die("Can't connect to LDAP server");
ldap_set_option($ldap_conn, LDAP_OPT_PROTOCOL_VERSION, 3);
$r = ldap_bind($ldap_conn, $ldap_user, $ldap_pwd) or die(ldap_error($ldap_conn));
//与服务器绑定
$base_dn = "cn=users,dc=laxdn,dc=com,dc=cn";
//定义要进行查询的目录主键
$filter_val = "(ObjectClass=person)";
$attr = array("uid", "gecos", "mail", "uidNumber", "gidNumber", "departmentNumber", "apple-birthday", "mobile", "telephoneNumber", "employeeType", "title", "postalAddress", "shadowExpire");
$result = ldap_search($ldap_conn, $base_dn, $filter_val, $attr);
//执行查询
$entry = ldap_get_entries($ldap_conn, $result);
//获得查询结果
$emp_info = array();
$dept_list = M("Dept")->getField("name,id");
$rank_list = M("Rank")->getField("name,id");
$position_list = M("Position")->getField("name,id");
$role_list = M("Role")->getField("name,id");
// dump($entry);
foreach ($entry as $item) {
if (is_array($item)) {
$data['id'] = $item['uidnumber'][0];
$data['emp_no'] = $item['uid'][0];
$data['name'] = $item['gecos'][0];
$data['letter'] = get_letter($item['gecos'][0]);
$data['email'] = $item['mail'][0];
$is_del = $item['shadowexpire'][0];
if ($is_del == -1) {
$data['is_del'] = 0;
}
if ($is_del == 1) {
$data['is_del'] = 1;
}
$dept_name = $item['departmentnumber'][0];
$data['dept_id'] = $dept_list[$dept_name];
$birthday = $item['apple-birthday'][0];
$data['birthday'] = date("Y-m-d", strtotime($birthday));
$data['mobile_tel'] = $item['mobile'][0];
$data['office_tel'] = $item['telephonenumber'][0];
$data['rank_id'] = $rank_list[$item['employeetype'][0]];
$data['position_id'] = $position_list[$item['title'][0]];
D("Role")->del_role($data['id']);
//删除用户权限
D("Role")->set_role($data['id'], $role_list[$item["postaladdress"][0]]);
//用户权限初始化
$rs = M("User")->add($data);
if ($rs) {
$new++;
$data['mail_name'] = $item['gecos'][0];
$data['pop3svr'] = "pop.laxdn.com.cn";
$data['smtpsvr'] = "s.laxdn.com";
$data['mail_id'] = $item['uid'][0];
$rs_account = M("MailAccount")->add($data);
M("UserConfig")->add($data);
//用户配置信息初始化
} else {
$rs_save = M("User")->save($data);
if ($rs_save) {
$update++;
}
}
}
}
$this->assign("new", $new);
$this->assign("update", $update);
}
开发者ID:hongweipeng,项目名称:oa,代码行数:75,代码来源:LdapAction.class.php
示例6: update
function update()
{
$ajax = $_POST['ajax'];
$id = $_POST['id'];
$model = D("Contact");
if (false === $model->create()) {
$this->error($model->getError());
}
$model->__set('letter', get_letter($model->__get('name')));
// 更新数据
$list = $model->save();
if (false !== $list) {
//成功提示
$this->assign('jumpUrl', $this->_get_return_url());
$this->success('编辑成功!');
} else {
//错误提示
$this->error('编辑失败!');
}
}
开发者ID:yunsite,项目名称:smeoa,代码行数:20,代码来源:ContactAction.class.php
示例7: xml_insert
public function xml_insert($vod, $must)
{
if (empty($vod['vod_name']) || empty($vod['vod_url'])) {
return '影片名称或播放地址为空,不做处理!';
}
if (!$vod['vod_cid']) {
return '未匹配到对应栏目分类,不做处理!';
}
// 过滤常规字符
$vod['vod_actor'] = ff_xml_vodactor($vod['vod_actor']);
$vod['vod_director'] = ff_xml_vodactor($vod['vod_director']);
$vod['vod_name'] = ff_xml_vodname($vod['vod_name']);
$vod['letter'] = get_letter($vod['vod_name']);
// 入库开始(检测来源)
$array = $this->{$DBVod}->field('id,title,inputer,vodplay,playurl,serial')->where('reurl="' . $vod['vod_reurl'] . '"')->find();
if ($array) {
return $this->xml_update($vod, $array, $must);
}
// 检测影片名称是否相等(需防止同名的电影与电视冲突)
$array = $this->{$DBVod}->field('id,title,actor,title,inputer,vodplay,playurl')->where('title="' . $vod['vod_name'] . '" ')->find();
if ($array) {
//无主演 或 演员完全相等时 更新该影片
if (empty($vod['vod_actor']) || $array['vod_actor'] == $vod['vodactor']) {
return $this->xml_update($vod, $array, $must);
}
//有相同演员时更新该影片
$arr_actor_1 = explode(' ', $vod['vod_actor']);
$arr_actor_2 = explode(' ', ff_xml_vodactor($array['vod_actor']));
if (array_intersect($arr_actor_1, $arr_actor_2)) {
return $this->xml_update($vod, $array, $must);
}
}
// 相似条件判断
if (C('play_collect_name')) {
$length = ceil(strlen($vod['vod_name']) / 3) - intval(C('play_collect_name'));
if ($length > 1) {
$where['vod_name'] = array('like', msubstr($vod['vod_name'], 0, $length) . '%');
$array = $this->{$DBVod}->field('vod_name,vod_inputer')->where($where)->find();
if ($array) {
//主演完全相同则更新
if (!empty($array['vod_actor']) && !empty($vod['vod_actor'])) {
$arr_actor_1 = explode(' ', $vod['vod_actor']);
$arr_actor_2 = explode(' ', ff_xml_vodactor($array['vod_actor']));
if (!array_diff($arr_actor_1, $arr_actor_2) && !array_diff($arr_actor_2, $arr_actor_1)) {
//若差集为空
return $this->xml_update($vod, $array, $must);
}
}
//inputer不同(不是同一资源库)则标识为相似待审核
if (!in_array($vod['vod_inputer'], $array)) {
$vod['vod_status'] = -1;
}
}
}
}
//添加影片开始
unset($vod['vod_id']);
if (C('upload_http')) {
//下载远程图片
$down = D('Down');
$vod['picurl'] = $down->down_img($vod['vod_pic']);
} else {
$vod['picurl'] = $vod['vod_pic'];
}
$vod['addtime'] = time();
$vod['stars'] = 1;
$vod['title'] = $vod['vod_name'];
$vod['year'] = $vod['vod_year'];
$vod['actor'] = $vod['vod_actor'];
$vod['director'] = $vod['vod_director'];
$vod['reurl'] = $vod['vod_reurl'];
$vod['playurl'] = $vod['vod_url'];
$vod['area'] = $vod['vod_area'];
$vod['language'] = $vod['vod_language'];
$vod['vodplay'] = $vod['vod_play'];
$vod['cid'] = $vod['vod_cid'];
$vod['serial'] = $vod['vod_continu'];
//$vod['vod_gold'] = mt_rand(1,C('rand_gold'));
//$vod['vod_golder'] = mt_rand(1,C('rand_golder'));
$vod['up'] = mt_rand(1, C('rand_updown'));
$vod['down'] = mt_rand(1, C('rand_updown'));
$vod['hits'] = mt_rand(0, C('rand_hits'));
$vod['content'] = $vod['vod_content'];
//伪原创
$m = D('Admin.Wei');
$lists = $m->replacelists();
if ($lists) {
foreach ($lists as $v) {
$vod['content'] = str_replace($v['firstkey'], $v['endkey'], $_POST['content']);
}
}
//内链关键词替换
$lists = $m->lists();
if ($lists) {
foreach ($lists as $v) {
$vod['content'] = preg_replace('/(<a.*?>\\s*)(' . $v['name'] . ')(\\s*<\\/a>)/sui', '${2}', $vod['content']);
$vod['content'] = str_replace($v['name'], '<a href="' . $v['link'] . '" target="' . $v['target'] . '">' . $v['name'] . '</a>', $vod['content']);
}
}
if (C('play_collect')) {
//.........这里部分代码省略.........
开发者ID:skygunner,项目名称:ekucms,代码行数:101,代码来源:CaiModel.class.php
示例8: m_letter
public function m_letter()
{
return get_letter(trim($_POST['title']));
}
开发者ID:skygunner,项目名称:ekucms,代码行数:4,代码来源:VideoModel.class.php
示例9: import
public function import()
{
$save_path = get_save_path();
$opmode = $_POST["opmode"];
if ($opmode == "import") {
import("@.ORG.Util.UploadFile");
$upload = new UploadFile();
$upload->savePath = $save_path;
$upload->allowExts = array('xlsx');
$upload->saveRule = uniqid;
$upload->autoSub = false;
if (!$upload->upload()) {
$this->error($upload->getErrorMsg());
} else {
//取得成功上传的文件信息
$uploadList = $upload->getUploadFileInfo();
Vendor('Excel.PHPExcel');
//导入thinkphp第三方类库
$inputFileName = $save_path . $uploadList[0]["savename"];
$objPHPExcel = PHPExcel_IOFactory::load($inputFileName);
$sheetData = $objPHPExcel->getActiveSheet()->toArray(null, true, true, true);
$model = M("Vip");
for ($i = 2; $i <= count($sheetData); $i++) {
$data = array();
$data['name'] = $sheetData[$i]["A"];
$data['short'] = $sheetData[$i]["B"];
$data['letter'] = get_letter($sheetData[$i]["A"]);
$data['biz_license'] = $sheetData[$i]["C"];
$data['payment'] = $sheetData[$i]["D"];
$data['address'] = $sheetData[$i]["E"];
$data['salesman'] = $sheetData[$i]["F"];
$data['contact'] = $sheetData[$i]["G"];
$data['email'] = $sheetData[$i]["H"];
$data['office_tel'] = $sheetData[$i]["I"];
$data['mobile_tel'] = $sheetData[$i]["J"];
$data['fax'] = $sheetData[$i]["K"];
$data['im'] = $sheetData[$i]["L"];
$data['remark'] = $sheetData[$i]["M"];
$data['statu'] = 1;
$model->add($data);
}
//dump($sheetData);
if (file_exists($_SERVER["DOCUMENT_ROOT"] . "/" . $inputFileName)) {
unlink($_SERVER["DOCUMENT_ROOT"] . "/" . $inputFileName);
}
$this->assign('jumpUrl', get_return_url());
$this->success('导入成功!');
}
} else {
$this->display();
}
}
开发者ID:hongweipeng,项目名称:oa,代码行数:52,代码来源:VipAction.class.php
示例10: VideoSave
/**
* 入库保存
* @param array $html
* @param int $id
*/
function VideoSave(&$html, $nid, $id = '')
{
C('TOKEN_ON', false);
//关闭令牌验证
if (!empty($id)) {
//update
$data['cid'] = $html['cid'];
$data['serial'] = $html['serial'];
$data['playurl'] = $html['playurl'];
$data['addtime'] = time();
$data['reurl'] = $html['reurl'];
if ($this->VdoDB->create($data)) {
$sid = $this->VdoDB->where('id=' . $id)->data($data)->save();
if ($sid) {
return true;
}
$this->error = $this->VdoDB->getDBError();
return false;
} else {
$this->error = $this->VdoDB->getError();
return false;
}
} else {
//add
$html['addtime'] = time();
$html['stars'] = 1;
$html['letter'] = get_letter($html['title']);
$html['hits'] = mt_rand(0, C('web_admin_hits'));
$html['score'] = mt_rand(1, C('web_admin_score'));
$html['scoreer'] = mt_rand(1, C('web_admin_score'));
$html['up'] = mt_rand(1, C('web_admin_updown'));
$html['down'] = mt_rand(1, C('web_admin_updown'));
$html['inputer'] = 'custom_' . $nid;
if ($this->VdoDB->create($html)) {
$sid = $this->VdoDB->add($html);
if ($sid) {
return true;
}
$this->error = $this->VdoDB->getDBError();
return false;
} else {
$this->error = $this->VdoDB->getError();
return false;
}
}
}
开发者ID:singhvicky,项目名称:pintrest,代码行数:51,代码来源:CustomCollectModel.class.php
示例11: addusersite_action
function addusersite_action()
{
$uid = intval($_GET['uid']);
if ($uid) {
$userinfo = $this->user->GetOne('and uid=' . $uid);
$site = $this->site->GetOne('and sitename="' . $userinfo['sitename'] . '"');
if (!$site && $userinfo['sitename'] && $userinfo['siteurl']) {
$data['sitename'] = $userinfo['sitename'];
$data['siteurl'] = substr($userinfo['siteurl'], 0, 4) == 'http' ? trim($userinfo['siteurl']) : 'http://' . $userinfo['siteurl'];
$data['siteapi'] = substr($userinfo['siteapi'], 0, 4) == 'http' ? trim($userinfo['siteapi']) : 'http://' . $userinfo['siteapi'];
$data['cityid'] = Pinyin($userinfo['cityid']);
$data['pinyin'] = get_letter($data['sitename']);
if ($this->site->InsertData($data)) {
if ($userinfo['usertype'] == 'nulluser') {
$this->user->DeleteData('1 and uid=' . $uid);
} else {
$this->user->UpdateData(array('sitename' => $userinfo['sitename'] . '-已采纳'), 'and uid=' . $uid);
}
deletef('site');
exit('<SCRIPT LANGUAGE="JavaScript">
<!--
alert("网站添加成功");
//-->
</SCRIPT>');
} else {
exit('<SCRIPT LANGUAGE="JavaScript">
<!--
alert("网站添加失败");
//-->
</SCRIPT>');
}
} else {
exit('<SCRIPT LANGUAGE="JavaScript">
<!--
alert("已有此网站");
//-->
</SCRIPT>');
}
} else {
exit('<SCRIPT LANGUAGE="JavaScript">
<!--
alert("用户名为空");
//-->
</SCRIPT>');
}
}
开发者ID:BGCX261,项目名称:zidan-kaka-oneplusone-svn-to-git,代码行数:46,代码来源:admin.class.php
注:本文中的get_letter函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论