当前位置: 首页>>代码示例>>PHP>>正文


PHP check::csubstr方法代码示例

本文整理汇总了PHP中check::csubstr方法的典型用法代码示例。如果您正苦于以下问题:PHP check::csubstr方法的具体用法?PHP check::csubstr怎么用?PHP check::csubstr使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在check的用法示例。


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

示例1: unset

$strWhere = 'where ' . $strWhere;
$intStart = ($intPage - 1) * $objWebInit->arrGPage['page_size'];
$arrInfoList = check::getAPI($strModuleID, "getInfoList", "{$strWhere}^ ORDER BY topflag DESC,submit_date DESC^{$intStart}^{$arrGPage['page_size']}^id,title,clicktimes");
$intRows = $arrInfoList['COUNT_ROWS'];
unset($arrInfoList['COUNT_ROWS']);
//翻页跳转
if (!empty($arrLink)) {
    $strLink = implode('&', $arrLink);
}
$arrListPage = $objWebInit->makeInfoListPage($intRows, $strLink, $link_type = 2);
//print_r($arrListPage);
include_once 'include/title.php';
include_once 'include/head.php';
$intRowNum = ($intPage - 1) * $arrGPage['page_size'] + 1;
foreach ($arrInfoList as $k => $v) {
    $v['title'] = check::csubstr($v['title'], 0, $arrMHaw['list_charnum']);
    $myText = new HAW_text($intRowNum . ":");
    $myText->br = 0;
    $objHaw->add_text($myText);
    $myLink = new HAW_link($v['title'], "detail.php?id=" . $v['id'] . "&mod=" . $strModuleID . "&page=" . $intPage);
    $myLink->br = 0;
    $objHaw->add_link($myLink);
    $myText = new HAW_text(" (" . $v['clicktimes'] . ")");
    $objHaw->add_text($myText);
    $intRowNum++;
}
if (!empty($arrListPage['pagedown'])) {
    $myLink = new HAW_link('下页', "search.php?page=" . $arrListPage['pagedown']);
    $myLink->set_br(0);
    $objHaw->add_link($myLink);
}
开发者ID:TiMoChao,项目名称:xingfu,代码行数:31,代码来源:search.php

示例2: explode

 }
 if (strpos($_POST['type_id'], '|') !== false) {
     $arrTemp = explode('|', $_POST['type_id']);
     $_POST['type_id'] = $arrTemp[0];
     $_POST['type_roue_id'] = $arrTemp[1];
     if (empty($_POST['my_promotion'])) {
         $_POST['my_promotion'] = ceil($_POST['my_promotion'] * $arrTemp[2]);
     }
     if (empty($_POST['qq'])) {
         $_POST['qq'] = $arrTemp[3];
     }
 } else {
     $_POST['type_roue_id'] = ':' . $_POST['type_id'] . ':';
 }
 if ($_POST['summary'] == '') {
     $_POST['summary'] = check::csubstr(trim(str_replace(" ", " ", str_replace("\r\n", "", strip_tags($_POST['intro'])))), 0, $arrGWeb['db_summary_len']);
 }
 if ($_POST['title'] != '') {
     $_POST['title_md5'] = md5($_POST['title']);
 }
 if (is_array($_POST['photo'])) {
     $_POST['thumbnail'] = $_POST['photo'][0]['photo'];
 } else {
     $_POST['thumbnail'] = $_POST['photo'];
 }
 $_POST['photo'] = array_values($_POST['photo']);
 $_POST['video'] = array_values($_POST['video']);
 #自动拆字生成tag
 if (empty($_POST['tag'])) {
     $objSP = new SplitWord();
     $_POST['tag'] = $objSP->SplitRMM($_POST['title'], false);
开发者ID:TiMoChao,项目名称:lc_ad_first,代码行数:31,代码来源:modifyinfo.php

示例3: smarty_modifier_csubstr

/**
 * Smarty truncate modifier plugin
 *
 * Type:     modifier<br>
 * Name:     truncate<br>
 * Purpose:  Truncate a string to a certain length if necessary,
 *           optionally splitting in the middle of a word, and
 *           appending the $etc string or inserting $etc into the middle.
 * @link http://smarty.php.net/manual/en/language.modifier.truncate.php
 *          truncate (Smarty online manual)
 * @author   Monte Ohrt <monte at ohrt dot com>
 * @param string
 * @param integer
 * @param string
 * @param boolean
 * @param boolean
 * @return string
 */
function smarty_modifier_csubstr($string, $start = 0, $sublen = 12, $ellipsis = '', $code = 'UTF-8')
{
    return check::csubstr($string, $start, $sublen, $ellipsis, $code);
}
开发者ID:TiMoChao,项目名称:lc_ad_first,代码行数:22,代码来源:modifier.csubstr.php

示例4: archives

<?php

/**
 * 首页简介文件
 *
 * @author		Arthur(ArthurXF@gmail.com)
 * @copyright	(c) 2006 by bizeway.com
 * @version		$Id$
 * @package		ArthurXF
 * @subpackage	archives
 */
if (is_object($objWebInit)) {
    if (!isset($objarchives)) {
        include_once __WEB_ROOT . "/archives/class/archives.class.php";
        include_once __WEB_ROOT . "/archives/config/var.inc.php";
        $objarchives = new archives();
        $objarchives->setDBG($arrGPdoDB);
        if (is_object($objWebInit->db)) {
            $objarchives->db = $objWebInit->db;
        } else {
            $objarchives->db();
        }
    }
    $arrAbout = $objarchives->getInfo('about');
    $arrAbout['intro'] = check::csubstr(trim(str_replace("&nbsp;", " ", str_replace("\r\n", "", strip_tags($arrAbout['intro'])))), 0, 500);
    // 输出到模板
    $arrMOutput["smarty_assign"]['arrAbout'] = $arrAbout;
}
开发者ID:TiMoChao,项目名称:xingfu,代码行数:28,代码来源:top_index.php

示例5: QQWry

}
//提交新贴
if (!empty($_POST['intro'])) {
    $strIP = check::getip();
    if (!session_is_registered('user_id')) {
        $_POST['user_name'] = $strIP;
    } else {
        $_POST['user_name'] = $_SESSION['real_name'];
    }
    $objQQWry =& new QQWry();
    $objQQWry->qqwry($strIP);
    $strZone = iconv('GB2312', 'UTF-8' . '//TRANSLIT', $objQQWry->Country);
    $_POST['zone'] = $strZone;
    $_POST['reply'] = array();
    if ($_POST['summary'] == '') {
        $_POST['summary'] = check::csubstr(trim(str_replace("&nbsp;", " ", str_replace("\r\n", "", strip_tags($_POST['intro'])))), 0, 100);
    }
    if (!array_key_exists('title', $_POST)) {
        $_POST['title'] = $_POST['titleprefix'] . $_POST['longtitle'];
    }
    unset($_POST['titleprefix']);
    unset($_POST['longtitle']);
    if ($_POST['title'] != '') {
        $_POST['title_md5'] = md5($_POST['title']);
    }
    //判断文章信息
    $arrTemp = $objWebInit->getInfoList("where title_md5='{$_POST['title_md5']}' and user_id = '{$_SESSION['user_id']}' and type_id='{$_POST['type_id']}'", "", 0, 1);
    if ($arrTemp['COUNT_ROWS'] != 0) {
        check::AlertExit("错误:相同的信息请不要重复发布!需要刷新排列的话,请登录会员中心使用列表下方“提前”选项!", -1);
    }
    $objWebInit->saveInfo($_POST, 0);
开发者ID:TiMoChao,项目名称:lc_ad_first,代码行数:31,代码来源:postnew.php

示例6: print_r

 }
 //存入数据库
 if ($_GET['action'] == 'fetchall' || $_GET['action'] == 'fetch') {
     if (empty($arrGFetch[$_GET['id']]['module_id'])) {
         check::AlertExit('存入栏目必须选择!', -1);
     }
     if (in_array($arrGFetch[$_GET['id']]['module_id'], array('mcenter', 'account', 'certification', 'comments', 'friend', 'message', 'payment', 'usermoney', 'logs', 'archives', 'ads', 'links', 'phonelist', 'emaillist', 'keywords', 'user'))) {
         check::AlertExit('非法栏目!', -1);
     }
     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;
     }
 }
开发者ID:TiMoChao,项目名称:xingfu,代码行数:31,代码来源:fecth.php

示例7: WordPage

 /**
  * 支持utf8按照字数分页
  * @author	肖飞
  * @param	string $str		待处理字符串
  * @param	int $page		当前页面
  * @param	int $num		从第几页截断
  * @param	string $code	字符串编码
  * @return  string
  */
 static function WordPage($str, $num = 200, $page, $code = 'UTF-8')
 {
     $str = str_replace("&nbsp;", " ", strip_tags($str));
     $PageAll = mb_strlen($str, $code) / $num;
     $PageAll = ceil($PageAll);
     if ($page == "") {
         $page = 1;
     }
     $start = ($page - 1) * $num;
     $str = check::csubstr($str, $start, $num, '', $code);
     $arrData = array();
     $arrData['centent'] = $str;
     //echo $str.'<br />';
     if (1 <= $page && $page <= $PageAll) {
         if ($page < $PageAll) {
             $arrData['pagedown'] = $page + 1;
         }
         if ($page > 1) {
             $arrData['pageup'] = $page - 1;
         }
     }
     $arrData['pagenav'] = '第' . $page . '页/共' . $PageAll . '页';
     //echo '第'.$page.'页/共'.$PageAll.'页<br />';
     return $arrData;
 }
开发者ID:TiMoChao,项目名称:lc_ad_first,代码行数:34,代码来源:check.class.php


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