Exemple #1
0
 function keyword_sel($res, $cont)
 {
     $keyword_result = array();
     $ee = 0;
     foreach ($res as $row) {
         $keyword = explode("|", delhtml(trimall($row['con'])));
         $sel_sign = $this->sel_word($keyword, $cont);
         //有匹配数据时
         if ($sel_sign) {
             $keyword_result[$ee]['id'] = $row['id'];
             $keyword_result[$ee]['title'] = $row['title'];
             $keyword_result[$ee]['url'] = $row['url'];
             $keyword_result[$ee]['con'] = $row['con'];
             $keyword_result[$ee]['intr'] = $row['intr'];
             $ee++;
         } else {
             //无匹配数据时下一个数组中对应的关键字
             $sel_sign = $this->sel_word($keyword, $cont);
         }
     }
     return $keyword_result;
 }
Exemple #2
0
 function GetWeiboContentLength($weiboContent, $title, $type)
 {
     switch ($type) {
         case "1":
             $max = 125 * 2;
             break;
         case "2":
             $max = 125 * 2;
             break;
         case "3":
             $max = 115 * 2;
             break;
         default:
             $max = 138 * 2;
             break;
     }
     $encode = 'gb2312';
     // 英国出游三条路线让你感受“醉人”的英国圣诞节又将和大家不期而至了,对于今年刚到英国留学留学的同学来说,这绝对是一个出游的好机会。一般大学圣诞
     $str_num = mb_strlen($weiboContent, $encode);
     // return cutstr(delhtml(($title)),($max-$str_num));
     // return $max."%%%".$str_num."####".($max-$str_num)."****";
     // return csubstr_end(delhtml($title),0,($max-$str_num),"gbk");
     return csubstr_end(delhtml(trimall($title)), 0, $max - $str_num, "gb2312");
     // return csubstr_end(delhtml(trimall($title)),($max-$str_num));
 }
Exemple #3
0
$ChannelId = 1;
if ($ChannelId) {
    if (!file_exists(ONEZ_ROOT . './onezdata/cache/channel/' . $ChannelId . '.php')) {
        exit('Channel Error!');
    } else {
        Channel($ChannelId);
    }
}
switch ($action = char_cv("action", "get")) {
    case "send":
        mkdirs(ONEZ_ROOT . './onezdata/online');
        @touch(ONEZ_ROOT . './onezdata/online/' . $userid);
        $touser = Char_Cv('touser');
        $content = Char_Cv('msg');
        $content = oiconv('utf-8', 'gbk', $content);
        $content = delhtml($content);
        $content = str_replace("\r\n", '[br]', $content);
        $content = str_replace("\n", '[br]', $content);
        if ($setting['badwords']) {
            $A = $B = array();
            foreach (explode("\n", $setting['badwords']) as $v) {
                $v = Trim($v);
                if ($v) {
                    $A[] = $v;
                    $B[] = '*';
                }
            }
            if ($A) {
                $content = str_replace($A, $B, $content);
            }
        }
                        </thead>
                        <tbody>
                        <?php 
foreach ($reslist as $row) {
    ?>
                            <tr>
                                <td><?php 
    echo $row['id'];
    ?>
</td>
                                <td><?php 
    echo $row['title'];
    ?>
</td>
                                <td><?php 
    echo cutstr(delhtml($row['intr']), 80);
    ?>
</td>
                                <td><?php 
    echo $row['displayorder'];
    ?>
</td>
                                <td><?php 
    echo getstatusstr($row['status']);
    ?>
</td>

                                <td><a href="?mod=englandstyle&act=edit&tid=<?php 
    echo $row['tid'];
    ?>
&id=<?php