本文整理汇总了PHP中csubstr函数的典型用法代码示例。如果您正苦于以下问题:PHP csubstr函数的具体用法?PHP csubstr怎么用?PHP csubstr使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了csubstr函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: NewsProject
function NewsProject()
{
global $msql, $fsql;
$coltitle = $GLOBALS["PLUSVARS"]["coltitle"];
$target = $GLOBALS["PLUSVARS"]["target"];
$tempname = $GLOBALS["PLUSVARS"]["tempname"];
$cutword = $GLOBALS["PLUSVARS"]["cutword"];
//模版解释
$Temp = LoadTemp($tempname);
$TempArr = SplitTblTemp($Temp);
//循环开始
$var = array('coltitle' => $coltitle);
$str = ShowTplTemp($TempArr["start"], $var);
$msql->query("select * from {P}_news_proj order by id desc");
while ($msql->next_record()) {
$id = $msql->f("id");
$project = $msql->f("project");
$folder = $msql->f("folder");
if ($cutword != "0") {
$project = csubstr($project, 0, $cutword);
}
$link = ROOTPATH . "news/project/" . $folder . "/";
$var = array('link' => $link, 'project' => $project, 'target' => $target);
$str .= ShowTplTemp($TempArr["list"], $var);
}
$str .= $TempArr["end"];
return $str;
}
示例2: datagrid
function datagrid()
{
$array = array('b.status' => 1);
$name = I('name');
$page = I('page');
$rows = I('rows');
$islend = I('islend');
if (!is_numeric($rows)) {
$rows = 20;
}
if (!is_numeric($page)) {
$page = 1;
}
if (!empty($name)) {
$array['b.name'] = array('like', "%{$name}%");
}
if ($islend != '') {
$array['b.sorttype'] = $islend;
}
$count = $this->alias('b')->where($array)->count();
$list = $this->alias('b')->field('count(DISTINCT zc.id)zccount,if(b.sorttype=1,"已放款","未放款") sorttype,count(d.id) fpnum,
b.id,b.memo,b.name,sum(d.zcmoney)totalmoney,sum(leavemoney)leavemoney')->join('rule_record zc on zc.ruletype_id =b.id and zc.status=1', 'left')->join('rule_lend_record c on c.rulerecord_id=zc.id and c.status=1', 'left')->join('lend_record d on d.id=c.lendrecord_id', 'left')->limit(($page - 1) * $rows, $rows)->order('b.updatetime desc')->group('b.id')->where($array)->select();
foreach ($list as &$value) {
$value['memo'] = csubstr($value['memo'], 0, 10);
}
return array('rows' => $list, 'total' => $count, 'footer' => array());
}
示例3: PageTitleList
function PageTitleList()
{
global $fsql, $msql;
//插件设置
$coltitle = $GLOBALS["PLUSVARS"]["coltitle"];
$shownums = $GLOBALS["PLUSVARS"]["shownums"];
$cutword = $GLOBALS["PLUSVARS"]["cutword"];
$target = $GLOBALS["PLUSVARS"]["target"];
$groupid = $GLOBALS["PLUSVARS"]["groupid"];
$tempname = $GLOBALS["PLUSVARS"]["tempname"];
if ($groupid != 0 && $groupid != "") {
$fsql->query("select folder from {P}_page_group where id='{$groupid}'");
if ($fsql->next_record()) {
$folder = $fsql->f('folder');
}
} else {
$str = "NO GROUPID";
return $str;
}
//模版解释
$Temp = LoadTemp($tempname);
$TempArr = SplitTblTemp($Temp);
$var = array('coltitle' => $coltitle);
$str = ShowTplTemp($TempArr["start"], $var);
$fsql->query("select * from {P}_page where groupid='{$groupid}' order by xuhao limit 0,{$shownums}");
while ($fsql->next_record()) {
$id = $fsql->f('id');
$title = $fsql->f('title');
$url = $fsql->f('url');
$pagefolder = $fsql->f('pagefolder');
//链接,如果有跳转网址则优先跳转 20090503
if (strlen($url) > 1) {
if (substr($url, 0, 7) == "http://") {
$link = $url;
} else {
$link = ROOTPATH . $url;
}
} else {
//如果有独立页,优先独立页
if ($pagefolder != "" && file_exists(ROOTPATH . "page/" . $folder . "/" . $pagefolder . ".php")) {
$link = ROOTPATH . "page/" . $folder . "/" . $pagefolder . ".php";
} else {
if ($GLOBALS["CONF"]["CatchOpen"] == "1" && file_exists(ROOTPATH . "page/" . $folder . "/" . $id . ".html")) {
$link = ROOTPATH . "page/" . $folder . "/" . $id . ".html";
} else {
$link = ROOTPATH . "page/" . $folder . "/?" . $id . ".html";
}
}
}
if ($cutword != "0") {
$title = csubstr($title, 0, $cutword);
}
//模版标签解释
$var = array('title' => $title, 'link' => $link, 'target' => $target);
$str .= ShowTplTemp($TempArr["list"], $var);
}
$str .= $TempArr["end"];
return $str;
}
示例4: csubstr
protected function csubstr($string, $start, $length = FALSE, $safe_quotes = FALSE)
{
if (defined('STRICT_TYPES') && CAMEL_CASE == '1') {
return (string) self::parameters(['string' => DT::TEXT, 'start' => DT::UINT8, 'length' => [DT::UINT8, DT::BOOL], 'safe_quotes' => DT::BOOL])->call(__FUNCTION__)->with($string, $start, $length, $safe_quotes)->returning(DT::TEXT);
} else {
return (string) csubstr($string, $start, $length, $safe_quotes);
}
}
示例5: MemberComment
function MemberComment()
{
global $fsql, $tsql;
$tempname = $GLOBALS["PLUSVARS"]["tempname"];
$memberid = $_COOKIE["MEMBERID"];
$scl = " pid='0' and memberid='{$memberid}' ";
//模板解释
$Temp = LoadTemp($tempname);
$TempArr = SplitTblTemp($Temp);
$str = $TempArr["start"];
include ROOTPATH . "includes/pages.inc.php";
$pages = new pages();
$totalnums = TblCount("_comment", "id", $scl);
$pages->setvar(array("key" => $key));
$pages->set(20, $totalnums);
$pagelimit = $pages->limit();
$fsql->query("select * from {P}_comment where {$scl} order by uptime desc limit {$pagelimit}");
while ($fsql->next_record()) {
$id = $fsql->f('id');
$title = $fsql->f('title');
$iffb = $fsql->f('iffb');
$rid = $fsql->f('rid');
$catid = $fsql->f('catid');
$dtime = $fsql->f('dtime');
$uptime = $fsql->f('uptime');
$cl = $fsql->f('cl');
$lastname = $fsql->f('lastname');
$lastmemberid = $fsql->f('lastmemberid');
$backcount = $fsql->f('backcount');
$title = csubstr($title, 0, 23);
//是否今日新贴
if ($uptime > time() - 86400) {
$querycss = "binew";
} else {
$querycss = "bi";
}
$dtime = date("Y-m-d", $dtime);
$uptime = date("Y-m-d", $uptime);
if ($GLOBALS["CONF"]["CatchOpen"] == "1" && file_exists(ROOTPATH . "comment/html/" . $id . ".html")) {
$link = ROOTPATH . "comment/html/" . $id . ".html";
} else {
$link = ROOTPATH . "comment/html/?" . $id . ".html";
}
//回复者网址
if ($lastmemberid == "-1") {
$lastmemberurl = "#";
} else {
$lastmemberurl = ROOTPATH . "member/home.php?mid=" . $lastmemberid;
}
$var = array('id' => $id, 'title' => $title, 'dtime' => $dtime, 'uptime' => $uptime, 'backcount' => $backcount, 'querycss' => $querycss, 'cl' => $cl, 'link' => $link, 'lastname' => $lastname, 'lastmemberurl' => $lastmemberurl, 'face' => $face);
$str .= ShowTplTemp($TempArr["list"], $var);
}
$pagesinfo = $pages->ShowNow();
$var = array('showpages' => $pages->output(1), 'pagestotal' => $pagesinfo["total"], 'pagesnow' => $pagesinfo["now"], 'pagesshownum' => $pagesinfo["shownum"], 'pagesfrom' => $pagesinfo["from"], 'pagesto' => $pagesinfo["to"], 'totalnums' => $totalnums);
$str .= ShowTplTemp($TempArr["end"], $var);
return $str;
}
示例6: JobList
function JobList()
{
global $fsql, $msql;
$shownums = $GLOBALS["PLUSVARS"]["shownums"];
$cutword = $GLOBALS["PLUSVARS"]["cutword"];
$target = $GLOBALS["PLUSVARS"]["target"];
$tempname = $GLOBALS["PLUSVARS"]["tempname"];
//模版解释
$Temp = LoadTemp($tempname);
$TempArr = SplitTblTemp($Temp);
$str = $TempArr["start"];
$fsql->query("select * from {P}_job where iffb='1' and jobstat='1' order by uptime desc limit 0,{$shownums}");
while ($fsql->next_record()) {
$id = $fsql->f('id');
$jobname = $fsql->f('jobname');
$jobtype = $fsql->f('jobtype');
$experience = $fsql->f('experience');
$education = $fsql->f('education');
$langneed = $fsql->f('langneed');
$langlevel = $fsql->f('langlevel');
$pnums = $fsql->f('pnums');
$jobaddr = $fsql->f('jobaddr');
$jobintro = $fsql->f('jobintro');
$jobrequest = $fsql->f('jobrequest');
$jobstat = $fsql->f('jobstat');
$contact = $fsql->f('contact');
$tel = $fsql->f('tel');
$email = $fsql->f('email');
$dtime = $fsql->f('dtime');
$uptime = $fsql->f('uptime');
$dtime = date("Y-m-d", $dtime);
$uptime = date("Y-m-d", $uptime);
if ($GLOBALS["CONF"]["CatchOpen"] == "1" && file_exists(ROOTPATH . "job/html/" . $id . ".html")) {
$link = ROOTPATH . "job/html/" . $id . ".html";
} else {
$link = ROOTPATH . "job/html/?" . $id . ".html";
}
if ($cutword != "0") {
$jobname = csubstr($jobname, 0, $cutword);
}
//模版标签解释
$var = array('jobid' => $id, 'jobname' => $jobname, 'dtime' => $dtime, 'uptime' => $uptime, 'jobtype' => $jobtype, 'experience' => $experience, 'education' => $education, 'langneed' => $langneed, 'langlevel' => $langlevel, 'pnums' => $pnums, 'jobaddr' => $jobaddr, 'jobintro' => $jobintro, 'jobrequest' => $jobrequest, 'link' => $link, 'target' => $target, 'contact' => $contact, 'tel' => $tel, 'email' => $email);
$str .= ShowTplTemp($TempArr["list"], $var);
}
$str .= $TempArr["end"];
return $str;
}
示例7: MemberNotice
function MemberNotice()
{
global $fsql;
$coltitle = $GLOBALS["PLUSVARS"]["coltitle"];
$tempname = $GLOBALS["PLUSVARS"]["tempname"];
$shownums = $GLOBALS["PLUSVARS"]["shownums"];
$cutword = $GLOBALS["PLUSVARS"]["cutword"];
$target = $GLOBALS["PLUSVARS"]["target"];
$membertypeid = $_COOKIE["MEMBERTYPEID"];
if ($membertypeid == "") {
return "";
}
$scl = " membertypeid='{$membertypeid}' or membertypeid='0' ";
//模版解释
$Temp = LoadTemp($tempname);
$TempArr = SplitTblTemp($Temp);
$str = $TempArr["start"];
$fsql->query("select * from {P}_member_notice where {$scl} order by dtime desc limit 0,{$shownums}");
while ($fsql->next_record()) {
$id = $fsql->f('id');
$title = $fsql->f('title');
$dtime = $fsql->f('dtime');
$ifnew = $fsql->f('ifnew');
$ifred = $fsql->f('ifred');
$cl = $fsql->f('cl');
$link = ROOTPATH . "member/member_notice.php?id=" . $id;
$dtime = date("Y-m-d", $dtime);
if ($ifnew == "1") {
$bold = " style='font-weight:bold' ";
} else {
$bold = "";
}
if ($ifred == "1") {
$red = " style='color:#ff0000' ";
} else {
$red = "";
}
if ($cutword != "0") {
$title = csubstr($title, 0, $cutword);
}
$var = array('title' => $title, 'dtime' => $dtime, 'red' => $red, 'cl' => $cl, 'link' => $link, 'target' => $target, 'bold' => $bold);
$str .= ShowTplTemp($TempArr["list"], $var);
}
$str .= $TempArr["end"];
return $str;
}
示例8: sms
public function sms($params)
{
$module = $params['module'];
$url = "";
if ($params['params']) {
$url = $this->OAuth2Url($this->buildUrl($params), $this->_base_config['APP']['sms']['agentid']);
}
$postData = array();
switch ($params['module']) {
case "email":
$content = $url != "" ? $params['content'] . ("\n<a href='" . $url . "'>") . _("ÔĶÁÓʼþ") . "</a>" : $params['content'];
$postData = array("touser" => $this->cUser($params['user']), "toparty" => $this->cDept($params['dept']), "msgtype" => "text", "agentid" => $this->_base_config['APP']['sms']['agentid'], "text" => array("content" => $content), "safe" => "0");
break;
case "news":
$picurl = "";
include_once "oa.news.php";
//( );
$News = new News();
$row = $News->getById("SUBJECT,CONTENT,ATTACHMENT_ID,ATTACHMENT_NAME,TO_ID,USER_ID,SUMMARY", $params['params']);
$picurl = $News->getFirstImage("news", $row['ATTACHMENT_ID'], $row['ATTACHMENT_NAME']);
$description = $row['SUMMARY'] == "" ? csubstr(strip_tags($this->cContent($row['CONTENT'])), 0, 30, TRUE, 1) . "..." : strip_tags($this->cContent($row['SUMMARY']));
if ($picurl != "") {
$picurl = $this->buildAttachUrl("http://" . BASE_URL . $picurl, $this->_base_config['APP']['sms']['agentid']);
}
$postData = array("touser" => $this->cUser($row['USER_ID'], $row['TO_ID']), "toparty" => $row['TO_ID'] == "ALL_DEPT" ? "" : $this->cDept($row['TO_ID']), "msgtype" => "news", "agentid" => $this->_base_config['APP']['sms']['agentid'], "news" => array("articles" => array(array("title" => strip_tags($row['SUBJECT']), "description" => $description, "url" => $url, "picurl" => $picurl))));
//parent::logs("test",$url);
break;
case "notify":
$picurl = "";
include_once "oa.notify.php";
//( );
$Notify = new Notify();
$row = $Notify->getById("SUBJECT,CONTENT,ATTACHMENT_ID,ATTACHMENT_NAME,TO_ID,USER_ID,SUMMARY", $params['params']);
$picurl = $Notify->getFirstImage("notify", $row['ATTACHMENT_ID'], $row['ATTACHMENT_NAME']);
$description = $row['SUMMARY'] == "" ? csubstr(strip_tags($this->cContent($row['CONTENT'])), 0, 30, TRUE, 1) . "..." : strip_tags($this->cContent($row['SUMMARY']));
if ($picurl != "") {
$picurl = $this->buildAttachUrl("http://" . BASE_URL . $picurl, $this->_base_config['APP']['sms']['agentid']);
}
$postData = array("touser" => $this->cUser($row['USER_ID'], $row['TO_ID']), "toparty" => $row['TO_ID'] == "ALL_DEPT" ? "" : $this->cDept($row['TO_ID']), "msgtype" => "news", "agentid" => $this->_base_config['APP']['sms']['agentid'], "news" => array("articles" => array(array("title" => strip_tags($row['SUBJECT']), "description" => $description, "url" => $url, "picurl" => $picurl))));
//parent::logs("test",$url);
break;
default:
$postData = array("touser" => $this->cUser($params['user']), "toparty" => $this->cDept($params['dept']), "msgtype" => "text", "agentid" => $this->_base_config['APP']['sms']['agentid'], "text" => array("content" => $params['content']), "safe" => "0");
}
$rs = $this->postData($this->url['send'], $postData);
}
示例9: get_recent_comments_thumb
function get_recent_comments_thumb($args)
{
global $wpdb, $comments, $comment, $wp_version;
extract($args, EXTR_SKIP);
$themePath = get_bloginfo('template_url');
$imageLink = '<h2>Recent Comments</h2>';
$options = get_option('widget_recent_comments');
$title = empty($options['title']) ? __($imageLink) : apply_filters('widget_title', $options['title']);
if ($number < 1) {
$number = 1;
} else {
if ($number > 15) {
$number = 15;
}
}
if (!$format) {
$format = '%2$s';
}
if (!($comments = wp_cache_get('recent_comments', 'widget'))) {
$comments = $wpdb->get_results("SELECT * FROM {$wpdb->comments} WHERE comment_approved = '1' ORDER BY comment_date_gmt DESC LIMIT {$number}");
wp_cache_add('recent_comments', $comments, 'widget');
}
echo $before_widget;
echo $before_title . $title . $after_title;
if ($comments) {
foreach ((array) $comments as $comment) {
if ($thumb_img == 1) {
if (has_post_thumbnail($comment->comment_post_ID)) {
setup_postdata($comment);
if (version_compare($wp_version, '2.9', '>=')) {
$gallery_img = get_the_post_thumbnail($comment->comment_post_ID, 'homepage-thumb', array('class' => 'thumbnail'));
$gallery_thumb_img = get_the_post_thumbnail($comment->comment_post_ID, array(70, 40));
} else {
$gallery_img_src = get_post_meta($comment->comment_post_ID, 'featured', true);
$gallery_img = '<img src="' . $gallery_img_src . '" class="thumbnail" />';
}
} else {
$gallery_img = '<img src="' . get_bloginfo('template_url') . '/images/no_image.gif" class="thumbnail" />';
}
} else {
$gallery_img = '';
}
echo '<div class="sidebar_post"><div class="entry"><a href="' . get_comment_link($comment->comment_ID) . '">' . $gallery_img . '</a><dl id="recentcomments">';
echo '<dt>' . sprintf(__('%1$s'), get_comment_author_link(), '</dt>');
echo '<dd class="recentcomments">' . sprintf(__('%2$s'), get_comment_author_link(), '<a href="' . get_comment_link($comment->comment_ID) . '">' . csubstr(get_the_title($comment->comment_post_ID), 40) . '</a>') . '</dd>';
echo '</dl></div></div>';
}
}
echo $after_widget;
}
示例10: getContent
/**
* 根据获取到的关键字搜索路由表进行匹配
* @return xml $content 处理后的数据
* @param string $keyword 关键字
*/
private function getContent($keyword)
{
$routeObj = D('WechatRoute');
$arrMap = array('user_id' => $this->user_id, 'keyword' => $keyword);
$routeInfo = $routeObj->where($arrMap)->find();
if (empty($routeInfo)) {
$arrMap['keyword'] = array('eq', csubstr($keyword, 0, 2));
$routeInfo = $routeObj->where($arrMap)->find();
}
//如果无匹配,则直接退出
if (empty($routeInfo)) {
$noneMap = array('keyword' => '默认', 'user_id' => $this->user_id);
$routeInfo = $routeObj->where($noneMap)->find();
}
if (empty($routeInfo)) {
exit;
}
return $this->getPush($routeInfo['obj_type'], $routeInfo['obj_id'], $keyword);
}
示例11: get_short
function get_short($str, $len, $ending = "...")
{
$tempstr = csubstr($str, 0, $len);
if ($str != $tempstr) {
$tempstr .= $ending;
}
return $tempstr;
}
示例12: PhotoCarousel
function PhotoCarousel()
{
global $fsql, $msql;
$coltitle = $GLOBALS["PLUSVARS"]["coltitle"];
$showtj = $GLOBALS["PLUSVARS"]["showtj"];
$cutword = $GLOBALS["PLUSVARS"]["cutword"];
$cutbody = $GLOBALS["PLUSVARS"]["cutbody"];
$target = $GLOBALS["PLUSVARS"]["target"];
$catid = $GLOBALS["PLUSVARS"]["catid"];
$projid = $GLOBALS["PLUSVARS"]["projid"];
$tags = $GLOBALS["PLUSVARS"]["tags"];
$tempname = $GLOBALS["PLUSVARS"]["tempname"];
$tempcolor = $GLOBALS["PLUSVARS"]["tempcolor"];
//本插件固定3张图片
$shownums = 6;
//默认条件
$scl = " iffb='1' and catid!='0' ";
if ($showtj != "" && $showtj != "0") {
$scl .= " and tj='1' ";
}
//显示分类规则:如果后台不指定分类,则显示当前所在分类,否则不限分类
if ($catid != 0 && $catid != "") {
$catid = fmpath($catid);
$scl .= " and catpath regexp '{$catid}' ";
}
//匹配专题
if ($projid != 0 && $projid != "") {
$projid = fmpath($projid);
$scl .= " and proj regexp '{$projid}' ";
}
//判断匹配标签
if ($tags != "") {
$tags = $tags . ",";
$scl .= " and tags regexp '{$tags}' ";
}
//模版解释
$Temp = LoadTemp($tempname);
$TempArr = SplitTblTemp($Temp);
$var = array('coltitle' => $coltitle, 'tempcolor' => $tempcolor);
$str = ShowTplTemp($TempArr["start"], $var);
$fsql->query("select * from {P}_photo_con where {$scl} order by uptime desc limit 0,{$shownums}");
while ($fsql->next_record()) {
$id = $fsql->f('id');
$title = $fsql->f('title');
$catpath = $fsql->f('catpath');
$dtime = $fsql->f('dtime');
$nowcatid = $fsql->f('catid');
$ifnew = $fsql->f('ifnew');
$ifred = $fsql->f('ifred');
$ifbold = $fsql->f('ifbold');
$author = $fsql->f('author');
$source = $fsql->f('source');
$cl = $fsql->f('cl');
$src[] = $fsql->f('src');
$memo = $fsql->f('memo');
if ($GLOBALS["CONF"]["CatchOpen"] == "1" && file_exists(ROOTPATH . "photo/html/" . $id . ".html")) {
$link[] = ROOTPATH . "photo/html/" . $id . ".html";
} else {
$link[] = ROOTPATH . "photo/html/?" . $id . ".html";
}
if ($cutword != "0") {
$title = csubstr($title, 0, $cutword);
}
if ($cutbody != "0") {
$memo = csubstr($memo, 0, $cutbody);
}
//if($src==""){$src="photo/pics/nopic.gif";}
}
//模版标签解释
$var = array('src1' => ROOTPATH . $src[0], 'src2' => ROOTPATH . $src[1], 'src3' => ROOTPATH . $src[2], 'src4' => ROOTPATH . $src[3], 'src5' => ROOTPATH . $src[4], 'src6' => ROOTPATH . $src[5], 'link1' => ROOTPATH . $link[0], 'link2' => ROOTPATH . $link[1], 'link3' => ROOTPATH . $link[2], 'link4' => ROOTPATH . $link[3], 'link5' => ROOTPATH . $link[4], 'link6' => ROOTPATH . $link[5]);
$str .= ShowTplTemp($TempArr["list"], $var);
$str .= $TempArr["end"];
return $str;
}
示例13: array
echo $l['title'];
?>
</a></div>
</div>
</td>
<td style="vertical-align: top;" class="pdl">
<h2><a href="<?php
echo $this->getUrl('image', "view", array(id => $l['article_id']));
?>
" ><?php
echo csubstr(strip_tags($l['title']), 0, 25, 'utf-8', true);
?>
</a></h2>
<p class="info">
<?php
echo csubstr(strip_tags($l['description']), 0, 220, 'utf-8', true);
?>
<?php
//能销售
if ($l['cansale'] == 1) {
?>
<div class="buyitem"><span class="fl">价格:<?php
echo $l['price'];
?>
</span>
<span class="fr"><input type="button" class="ui-state-default ui" onclick="addToShopingcart(<?php
echo $l['article_id'];
?>
)" value="加入购物车"/> </span>
</div>
示例14: sprintf
if ($SMS2_REMIND1 == "on") {
$SMS_CONTENT = sprintf(_("OA公告,来自%s标题:%s"), $USER_NAME, $SUBJECT);
if ($SUMMARY) {
$SMS_CONTENT .= _("内容简介:") . $SUMMARY;
}
if ($USER_ID_STR != "") {
send_mobile_sms_user($SEND_TIME, $_SESSION['LOGIN_USER_ID'], $USER_ID_STR, $SMS_CONTENT, 1);
}
}
include_once "inc/itask/itask.php";
mobile_push_notification(userid2uid($USER_ID_STR), $_SESSION['LOGIN_USER_NAME'] . _(":") . _("请查看公告通知") . _("标题:") . csubstr($SUBJECT, 0, 20), "notify");
$WX_OPTIONS = array("module" => "notify", "module_action" => "notify.read", "user" => $USER_ID_STR, "content" => $_SESSION['LOGIN_USER_NAME'] . _(":") . _("请查看公告通知") . _("标题:") . csubstr($SUBJECT, 0, 20), "params" => array("NOTIFY_ID" => $NOTIFY_ID));
wxqy_sms($WX_OPTIONS);
}
if ($PUBLISH == "2") {
$SMS_CONTENT = _("请审批公告通知!") . "\n" . _("标题:") . csubstr($SUBJECT, 0, 100);
if (compare_date($BEGIN_DATE1, $CUR_DATE) == 1) {
$SEND_TIME = $BEGIN_DATE1;
}
$REMIND_URL = "1:notify/auditing/unaudited.php";
if ($SMS_REMIND == "on" && $AUDITER != "" && $AUDITER != $_SESSION['LOGIN_USER_ID']) {
send_sms($SEND_TIME, $_SESSION['LOGIN_USER_ID'], $AUDITER, 1, $SMS_CONTENT, $REMIND_URL);
}
if ($SMS2_REMIND == "on") {
$SMS_CONTENT = sprintf(_("请审批OA公告,来自%s"), $_SESSION['LOGIN_USER_NAME'] . ":" . $SUBJECT);
if ($SUMMARY) {
$SMS_CONTENT .= _("内容简介:") . $SUMMARY;
}
if ($AUDITER != "" && $AUDITER != $_SESSION['LOGIN_USER_ID']) {
send_mobile_sms_user($SEND_TIME, $_SESSION['LOGIN_USER_ID'], $AUDITER, $SMS_CONTENT, 1);
}
示例15: NewsComment
function NewsComment()
{
global $fsql, $tsql, $strGuest;
$coltitle = $GLOBALS["PLUSVARS"]["coltitle"];
$shownums = $GLOBALS["PLUSVARS"]["shownums"];
$cutword = $GLOBALS["PLUSVARS"]["cutword"];
$cutbody = $GLOBALS["PLUSVARS"]["cutbody"];
$target = $GLOBALS["PLUSVARS"]["target"];
$tempname = $GLOBALS["PLUSVARS"]["tempname"];
//获取地址栏参数
if (strstr($_SERVER["QUERY_STRING"], ".html")) {
$idArr = explode(".html", $_SERVER["QUERY_STRING"]);
$newsid = $idArr[0];
} elseif (isset($_GET["id"]) && $_GET["id"] != "") {
$newsid = $_GET["id"];
}
$newsid = htmlspecialchars($newsid);
$scl = " iffb='1' and catid='1' and pid='0' and rid='{$newsid}' ";
$moreurl = ROOTPATH . "comment/class/index.php?catid=1&rid=" . $newsid;
//模版解释
$Temp = LoadTemp($tempname);
$TempArr = SplitTblTemp($Temp);
$var = array('coltitle' => $coltitle, 'moreurl' => $moreurl);
$str = ShowTplTemp($TempArr["start"], $var);
$fsql->query("select * from {P}_comment where {$scl} order by dtime desc limit 0,{$shownums}");
while ($fsql->next_record()) {
$id = $fsql->f('id');
$rid = $fsql->f('rid');
$memberid = $fsql->f('memberid');
$title = $fsql->f('title');
$body = $fsql->f('body');
$pj1 = $fsql->f('pj1');
$dtime = $fsql->f('dtime');
$uptime = $fsql->f('uptime');
$cl = $fsql->f('cl');
$lastname = $fsql->f('lastname');
$body = strip_tags($body);
$tsql->query("select count(id) from {P}_comment where pid='{$id}' and iffb='1'");
if ($tsql->next_record()) {
$count = $tsql->f('count(id)');
}
//是否匿名
if ($memberid == "-1") {
$pname = $strGuest;
$nowface = "1";
$memberurl = "#";
} else {
$tsql->query("select * from {P}_member where memberid='{$memberid}'");
if ($tsql->next_record()) {
$pname = $tsql->f("pname");
$nowface = $tsql->f("nowface");
}
$memberurl = ROOTPATH . "member/home.php?mid=" . $memberid;
}
$dtime = date("Y-m-d", $dtime);
if ($cutword != "0") {
$title = csubstr($title, 0, $cutword);
}
if ($cutbody != "0") {
$body = csubstr($body, 0, $cutbody) . " ...";
}
$link = ROOTPATH . "comment/html/?" . $id . ".html";
$face = ROOTPATH . "member/face/" . $nowface . ".gif";
$pjstr = pstarnums($pj1, ROOTPATH);
$var = array('commentid' => $id, 'title' => $title, 'dtime' => $dtime, 'pname' => $pname, 'body' => $body, 'count' => $count, 'cl' => $cl, 'link' => $link, 'lastname' => $lastname, 'face' => $face, 'pjstr' => $pjstr, 'memberurl' => $memberurl, 'target' => $target);
$str .= ShowTplTemp($TempArr["list"], $var);
}
//获取标题
$tsql->query("select title from {P}_news_con where id='{$newsid}'");
if ($tsql->next_record()) {
$title = $tsql->f("title");
}
$var = array('title' => $title, 'commentcatid' => "1", 'rid' => $newsid, 'pid' => '');
$str .= ShowTplTemp($TempArr["end"], $var);
return $str;
}