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


PHP parsesmiles函数代码示例

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


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

示例1: C

            echo UPLOAD_SITE_URL . '/' . ATTACH_AVATAR . DS . $v['comment_memberavatar'];
        } else {
            echo UPLOAD_SITE_URL . '/' . ATTACH_COMMON . DS . C('default_user_portrait');
        }
        ?>
" onload="javascript:DrawImage(this,30,30);"></a>
      <div class="detail">
        <p class="words"><a target="_blank" href="index.php?act=member_snshome&mid=<?php 
        echo $v['comment_memberid'];
        ?>
" class="name"><?php 
        echo $v['comment_membername'];
        ?>
</a><?php 
        echo $lang['nc_colon'];
        echo parsesmiles($v['comment_content']);
        ?>
</p>
        <p class="other">
          <?php 
        if ($_SESSION['member_id'] == $v['comment_memberid']) {
            ?>
          <span class="opt"><a href="javascript:void(0);" nc_type="comment_del" data-param='{"cid":"<?php 
            echo $v['comment_id'];
            ?>
"}'><?php 
            echo $lang['nc_delete'];
            ?>
</a></span>
          <?php 
        }
开发者ID:Maplecms,项目名称:shopnc-api,代码行数:31,代码来源:sns_commentlist.php

示例2: comment_saveOp

 /**
  * 评论保存
  **/
 public function comment_saveOp()
 {
     $data = array();
     $data['result'] = 'true';
     $comment_object_id = intval($_POST['comment_object_id']);
     $comment_type = $_POST['comment_type'];
     $model_name = '';
     $count_field = '';
     switch ($comment_type) {
         case 'article':
             $comment_type = self::ARTICLE;
             $model_name = 'cms_article';
             $count_field = 'article_comment_count';
             $comment_object_key = 'article_id';
             break;
         case 'picture':
             $comment_type = self::PICTURE;
             $model_name = 'cms_picture';
             $count_field = 'picture_comment_count';
             $comment_object_key = 'picture_id';
             break;
         default:
             $comment_type = 0;
             break;
     }
     if ($comment_object_id <= 0 || empty($comment_type) || empty($_POST['comment_message'])) {
         $data['result'] = 'false';
         $data['message'] = Language::get('wrong_argument');
         self::echo_json($data);
     }
     if (!empty($_SESSION['member_id'])) {
         $param = array();
         $param['comment_type'] = $comment_type;
         $param["comment_object_id"] = $comment_object_id;
         if (strtoupper(CHARSET) == 'GBK') {
             $param['comment_message'] = Language::getGBK(trim($_POST['comment_message']));
         } else {
             $param['comment_message'] = trim($_POST['comment_message']);
         }
         $param['comment_member_id'] = $_SESSION['member_id'];
         $param['comment_time'] = time();
         $model_comment = Model('cms_comment');
         if (!empty($_POST['comment_id'])) {
             $comment_detail = $model_comment->getOne(array('comment_id' => $_POST['comment_id']));
             if (empty($comment_detail['comment_quote'])) {
                 $param['comment_quote'] = $_POST['comment_id'];
             } else {
                 $param['comment_quote'] = $comment_detail['comment_quote'] . ',' . $_POST['comment_id'];
             }
         } else {
             $param['comment_quote'] = '';
         }
         $result = $model_comment->save($param);
         if ($result) {
             //评论计数加1
             $model = Model($model_name);
             $update = array();
             $update[$count_field] = array('exp', $count_field . '+1');
             $condition = array();
             $condition[$comment_object_key] = $comment_object_id;
             $model->modify($update, $condition);
             //返回信息
             $data['result'] = 'true';
             $data['message'] = Language::get('nc_common_save_succ');
             $data['member_name'] = $_SESSION['member_name'] . Language::get('nc_colon');
             $data['member_avatar'] = getMemberAvatar($_SESSION['member_avatar']);
             $data['member_link'] = SITEURL . DS . 'index.php?act=member_snshome&mid=' . $_SESSION['member_id'];
             $data['comment_message'] = parsesmiles(stripslashes($param['comment_message']));
             $data['comment_time'] = date('Y-m-d H:i:s', $param['comment_time']);
             $data['comment_id'] = $result;
         } else {
             $data['result'] = 'false';
             $data['message'] = Language::get('nc_common_save_fail');
         }
     } else {
         $data['result'] = 'false';
         $data['message'] = Language::get('no_login');
     }
     self::echo_json($data);
 }
开发者ID:noikiy,项目名称:haifenbao,代码行数:83,代码来源:comment.php

示例3: date

        ?>
                <a href="index.php?act=chat_log&op=chat_log&f_name=<?php 
        echo $val['f_name'];
        ?>
&t_name=<?php 
        echo $val['t_name'];
        ?>
&add_time_from=<?php 
        echo date("Y-m-d", $val['add_time']);
        ?>
&add_time_to=<?php 
        echo date("Y-m-d", $val['add_time']);
        ?>
">详情</a></dd>
          <dd class="content"><?php 
        echo parsesmiles($val['t_msg']);
        ?>
</dd>
        </dl>
      </li>
      <?php 
    }
    ?>
      <?php 
} else {
    ?>
      <div class="no_data"><?php 
    echo $lang['no_record'];
    ?>
</div>
      <?php 
开发者ID:dotku,项目名称:shopnc_cnnewyork,代码行数:31,代码来源:chat_msg_log.list.php

示例4: parsesmiles

            echo $v['from_member_name'];
            ?>
          <?php 
        } else {
            echo $v['from_member_name'];
        }
        ?>
</td>
        <td class="link2<?php 
        if ($v['message_open'] == 0) {
            ?>
 font_bold<?php 
        }
        ?>
 tl"><?php 
        echo parsesmiles($v['message_body']);
        ?>
</td>
        <td><?php 
        echo @date("Y-m-d H:i:s", $v['message_update_time']);
        ?>
</td>
        <td><?php 
        if ($output['drop_type'] == 'msg_list') {
            ?>
          <a href="index.php?act=home&op=showmsgcommon&drop_type=<?php 
            echo $output['drop_type'];
            ?>
&message_id=<?php 
            echo $v['message_id'];
            if ($v['message_parent_id'] > 0) {
开发者ID:bubargaininc,项目名称:oak_oak,代码行数:31,代码来源:message_box.php

示例5: savereplyOp

 /**
  * 短消息回复保存
  *
  * @param 
  * @return 
  */
 public function savereplyOp()
 {
     Language::read('member_home_message');
     //查询会员是否允许发送站内信
     $isallowsend = $this->allowSendMessage($_SESSION['member_id']);
     if (!$isallowsend) {
         if ($_GET['inajax'] == 1) {
             showDialog(Language::get('home_message_noallowsend'));
         } else {
             showMessage(Language::get('home_message_noallowsend'), 'index.php?act=home&op=message', 'html', 'error');
         }
     }
     if ($_POST['form_submit'] == 'ok') {
         $message_id = intval($_POST["message_id"]);
         if ($message_id <= 0) {
             showMessage(Language::get('wrong_argument'), 'index.php?act=home&op=message', 'html', 'error');
         }
         $obj_validate = new Validate();
         $obj_validate->validateparam = array(array("input" => $_POST["msg_content"], "require" => "true", "message" => Language::get('home_message_reply_content_null')));
         $error = $obj_validate->validate();
         if ($error != '') {
             if ($_GET['inajax'] == 1) {
                 showDialog(Language::get('error'));
             } else {
                 showMessage(Language::get('error') . $error, '', 'html', 'error');
             }
         }
         $model_message = Model('message');
         //查询站内信
         $param = array();
         $param['message_id'] = "{$message_id}";
         $param['no_message_state'] = "2";
         //未删除
         $message_info = $model_message->getRowMessage($param);
         if (empty($message_info)) {
             if ($_GET['inajax'] == 1) {
                 showDialog(Language::get('home_message_no_record'));
             } else {
                 showMessage(Language::get('home_message_no_record') . $error, '', 'html', 'error');
             }
         }
         //不能回复自己的站内信
         if ($message_info['from_member_id'] == $_SESSION['member_id']) {
             showMessage(Language::get('home_message_no_record'), '', 'html', 'error');
         }
         $insert_arr = array();
         if ($message_info['message_parent_id'] > 0) {
             $insert_arr['message_parent_id'] = $message_info['message_parent_id'];
         } else {
             $insert_arr['message_parent_id'] = $message_info['message_id'];
         }
         $insert_arr['from_member_id'] = $_SESSION['member_id'];
         $insert_arr['from_member_name'] = $_SESSION['member_name'];
         $insert_arr['member_id'] = $message_info['from_member_id'];
         $insert_arr['to_member_name'] = $message_info['from_member_name'];
         $insert_arr['msg_content'] = $_POST['msg_content'];
         $insert_state = $model_message->saveMessage($insert_arr);
         if ($insert_state) {
             //更新父类站内信更新时间
             $update_arr = array();
             $update_arr['message_update_time'] = time();
             $update_arr['message_open'] = 1;
             $model_message->updateCommonMessage($update_arr, array('message_id' => "{$insert_arr['message_parent_id']}"));
         }
         if ($_GET['inajax'] == 1) {
             $insert_arr['msg_id'] = $insert_state;
             if (strtoupper(CHARSET) == 'GBK') {
                 $insert_arr['msg_content'] = Language::getUTF8($insert_arr['msg_content']);
             }
             $insert_arr['msg_content'] = parsesmiles($insert_arr['msg_content']);
             $data = json_encode($insert_arr);
             $js = "replyMsgSuccess(" . $data . ")";
             showDialog(Language::get('home_message_send_success'), '', 'succ', $js);
         } else {
             showMessage(Language::get('home_message_send_success'), 'index.php?act=home&op=privatemsg');
         }
     } else {
         if ($_GET['inajax'] == 1) {
             showDialog(Language::get('home_message_reply_command_wrong'));
         } else {
             showMessage(Language::get('home_message_reply_command_wrong'), '', 'html', 'error');
         }
     }
 }
开发者ID:noikiy,项目名称:shopnc-minion,代码行数:90,代码来源:home.php

示例6: parsesmiles

              <?php 
        if ($_SESSION['store_id'] == $val['strace_storeid']) {
            ?>
              <span class="fd-handle"> <a href="javascript:void(0);" nc_type="sd_del" data-param='{"txtid":"<?php 
            echo $val['strace_id'];
            ?>
"}'><i class="icon-trash"></i><?php 
            echo $lang['nc_delete'];
            ?>
</a> </span>
              <?php 
        }
        ?>
            </dt>
            <dd> <?php 
        echo parsesmiles($val['strace_content']);
        ?>
 </dd>
            <dd> <span class="goods-time fl"><?php 
        echo date('Y-m-d H:i', $val['strace_time']);
        ?>
</span> <span class="fr"> <a href="javascript:void(0);" nc_type="sd_forwardbtn" data-param='{"txtid":"<?php 
        echo $val['strace_id'];
        ?>
"}'><?php 
        echo $lang['sns_forward'];
        ?>
</a>&nbsp;|&nbsp;<a href="javascript:void(0);" nc_type="sd_commentbtn" data-param='{"txtid":"<?php 
        echo $val['strace_id'];
        ?>
"}'><?php 
开发者ID:dotku,项目名称:shopnc_cnnewyork,代码行数:31,代码来源:store_snshome.php

示例7: parsesmiles

                        echo $lang['sns_original_comment'];
                        echo $v['trace_orgcommentcount'] > 0 ? "({$v['trace_orgcommentcount']})" : '';
                        ?>
</a></span> </div>
            <?php 
                    }
                    ?>
            <?php 
                }
                ?>
          </div>
          <?php 
            } else {
                ?>
          <?php 
                echo parsesmiles($v['trace_content']);
                ?>
          <?php 
            }
            ?>
          <?php 
        }
        ?>
        </dd>
        <dd>
          <span class="goods-time fl"><?php 
        echo date('Y-m-d H:i', $v['trace_addtime']);
        ?>
</span>
          <span class="fl ml10"><?php 
        echo snsShareFrom($v['trace_from']);
开发者ID:noikiy,项目名称:nc-1,代码行数:31,代码来源:sns_tracelist.php

示例8: elseif

        <?php 
            echo $v['from_member_name'];
            ?>
 <?php 
            echo $lang['home_message_speak'];
        } elseif ($output['drop_type'] == 'msg_system') {
            echo $v['from_member_name'];
        } else {
            echo $v['from_member_name'] . $lang['home_message_speak'];
        }
        echo $lang['nc_colon'];
        ?>
</dt>
      <dd>
        <p><?php 
        echo nl2br(parsesmiles($v['message_body']));
        ?>
</p>
        <p class="hint">(<?php 
        echo date("Y-m-d H:i", $v['message_time']);
        ?>
)</p>
      </dd>
    </dl>
    <?php 
    }
    ?>
    <?php 
}
?>
    <?php 
开发者ID:mengtaolin,项目名称:shopping,代码行数:31,代码来源:member_message.view.php

示例9: discuzcode

function discuzcode($message, $smileyoff, $bbcodeoff, $htmlon = 0, $allowsmilies = 1, $allowbbcode = 1, $allowimgcode = 1, $allowhtml = 0, $jammer = 0, $parsetype = '0', $authorid = '0', $allowmediacode = '0', $pid = 0, $lazyload = 0, $pdateline = 0, $first = 0)
{
    global $_G;
    static $authorreplyexist;
    if ($pid && strpos($message, '[/password]') !== FALSE) {
        if ($authorid != $_G['uid'] && !$_G['forum']['ismoderator']) {
            $message = preg_replace("/\\s?\\[password\\](.+?)\\[\\/password\\]\\s?/ie", "parsepassword('\\1', \$pid)", $message);
            if ($_G['forum_discuzcode']['passwordlock'][$pid]) {
                return '';
            }
        } else {
            $message = preg_replace("/\\s?\\[password\\](.+?)\\[\\/password\\]\\s?/ie", "", $message);
            $_G['forum_discuzcode']['passwordauthor'][$pid] = 1;
        }
    }
    if ($parsetype != 1 && !$bbcodeoff && $allowbbcode && (strpos($message, '[/code]') || strpos($message, '[/CODE]')) !== FALSE) {
        $message = preg_replace("/\\s?\\[code\\](.+?)\\[\\/code\\]\\s?/ies", "codedisp('\\1')", $message);
    }
    $msglower = strtolower($message);
    $htmlon = $htmlon && $allowhtml ? 1 : 0;
    if (!$htmlon) {
        $message = dhtmlspecialchars($message);
    } else {
        $message = preg_replace("/<script[^\\>]*?>(.*?)<\\/script>/i", '', $message);
    }
    if ($_G['setting']['plugins']['func'][HOOKTYPE]['discuzcode']) {
        $_G['discuzcodemessage'] =& $message;
        $param = func_get_args();
        hookscript('discuzcode', 'global', 'funcs', array('param' => $param, 'caller' => 'discuzcode'), 'discuzcode');
    }
    if (!$smileyoff && $allowsmilies) {
        $message = parsesmiles($message);
    }
    if ($_G['setting']['allowattachurl'] && strpos($msglower, 'attach://') !== FALSE) {
        $message = preg_replace("/attach:\\/\\/(\\d+)\\.?(\\w*)/ie", "parseattachurl('\\1', '\\2', 1)", $message);
    }
    if ($allowbbcode) {
        if (strpos($msglower, 'ed2k://') !== FALSE) {
            $message = preg_replace("/ed2k:\\/\\/(.+?)\\//e", "parseed2k('\\1')", $message);
        }
    }
    if (!$bbcodeoff && $allowbbcode) {
        if (strpos($msglower, '[/url]') !== FALSE) {
            $message = preg_replace("/\\[url(=((https?|ftp|gopher|news|telnet|rtsp|mms|callto|bctp|thunder|qqdl|synacast){1}:\\/\\/|www\\.|mailto:)?([^\r\n\\[\"']+?))?\\](.+?)\\[\\/url\\]/ies", "parseurl('\\1', '\\5', '\\2')", $message);
        }
        if (strpos($msglower, '[/email]') !== FALSE) {
            $message = preg_replace("/\\[email(=([a-z0-9\\-_.+]+)@([a-z0-9\\-_]+[.][a-z0-9\\-_.]+))?\\](.+?)\\[\\/email\\]/ies", "parseemail('\\1', '\\4')", $message);
        }
        $nest = 0;
        while (strpos($msglower, '[table') !== FALSE && strpos($msglower, '[/table]') !== FALSE) {
            $message = preg_replace("/\\[table(?:=(\\d{1,4}%?)(?:,([\\(\\)%,#\\w ]+))?)?\\]\\s*(.+?)\\s*\\[\\/table\\]/ies", "parsetable('\\1', '\\2', '\\3')", $message);
            if (++$nest > 4) {
                break;
            }
        }
        $message = str_replace(array('[/color]', '[/backcolor]', '[/size]', '[/font]', '[/align]', '[b]', '[/b]', '[s]', '[/s]', '[hr]', '[/p]', '[i=s]', '[i]', '[/i]', '[u]', '[/u]', '[list]', '[list=1]', '[list=a]', '[list=A]', "\r\n[*]", '[*]', '[/list]', '[indent]', '[/indent]', '[/float]'), array('</font>', '</font>', '</font>', '</font>', '</div>', '<strong>', '</strong>', '<strike>', '</strike>', '<hr class="l" />', '</p>', '<i class="pstatus">', '<i>', '</i>', '<u>', '</u>', '<ul>', '<ul type="1" class="litype_1">', '<ul type="a" class="litype_2">', '<ul type="A" class="litype_3">', '<li>', '<li>', '</ul>', '<blockquote>', '</blockquote>', '</span>'), preg_replace(array("/\\[color=([#\\w]+?)\\]/i", "/\\[color=((rgb|rgba)\\([\\d\\s,]+?\\))\\]/i", "/\\[backcolor=([#\\w]+?)\\]/i", "/\\[backcolor=((rgb|rgba)\\([\\d\\s,]+?\\))\\]/i", "/\\[size=(\\d{1,2}?)\\]/i", "/\\[size=(\\d{1,2}(\\.\\d{1,2}+)?(px|pt)+?)\\]/i", "/\\[font=([^\\[\\<]+?)\\]/i", "/\\[align=(left|center|right)\\]/i", "/\\[p=(\\d{1,2}|null), (\\d{1,2}|null), (left|center|right)\\]/i", "/\\[float=left\\]/i", "/\\[float=right\\]/i"), array("<font color=\"\\1\">", "<font style=\"color:\\1\">", "<font style=\"background-color:\\1\">", "<font style=\"background-color:\\1\">", "<font size=\"\\1\">", "<font style=\"font-size:\\1\">", "<font face=\"\\1\">", "<div align=\"\\1\">", "<p style=\"line-height:\\1px;text-indent:\\2em;text-align:\\3\">", "<span style=\"float:left;margin-right:5px\">", "<span style=\"float:right;margin-left:5px\">"), $message));
        if ($pid && !defined('IN_MOBILE')) {
            $message = preg_replace("/\\s?\\[postbg\\]\\s*([^\\[\\<\r\n;'\"\\?\\(\\)]+?)\\s*\\[\\/postbg\\]\\s?/ies", "parsepostbg('\\1', '{$pid}')", $message);
        } else {
            $message = preg_replace("/\\s?\\[postbg\\]\\s*([^\\[\\<\r\n;'\"\\?\\(\\)]+?)\\s*\\[\\/postbg\\]\\s?/is", "", $message);
        }
        if ($parsetype != 1) {
            if (strpos($msglower, '[/quote]') !== FALSE) {
                $message = preg_replace("/\\s?\\[quote\\][\n\r]*(.+?)[\n\r]*\\[\\/quote\\]\\s?/is", tpl_quote(), $message);
            }
            if (strpos($msglower, '[/free]') !== FALSE) {
                $message = preg_replace("/\\s*\\[free\\][\n\r]*(.+?)[\n\r]*\\[\\/free\\]\\s*/is", tpl_free(), $message);
            }
        }
        if (!defined('IN_MOBILE')) {
            if (strpos($msglower, '[/media]') !== FALSE) {
                $message = preg_replace("/\\[media=([\\w,]+)\\]\\s*([^\\[\\<\r\n]+?)\\s*\\[\\/media\\]/ies", $allowmediacode ? "parsemedia('\\1', '\\2')" : "bbcodeurl('\\2', '<a href=\"{url}\" target=\"_blank\">{url}</a>')", $message);
            }
            if (strpos($msglower, '[/audio]') !== FALSE) {
                $message = preg_replace("/\\[audio(=1)*\\]\\s*([^\\[\\<\r\n]+?)\\s*\\[\\/audio\\]/ies", $allowmediacode ? "parseaudio('\\2', 400)" : "bbcodeurl('\\2', '<a href=\"{url}\" target=\"_blank\">{url}</a>')", $message);
            }
            if (strpos($msglower, '[/flash]') !== FALSE) {
                $message = preg_replace("/\\[flash(=(\\d+),(\\d+))?\\]\\s*([^\\[\\<\r\n]+?)\\s*\\[\\/flash\\]/ies", $allowmediacode ? "parseflash('\\2', '\\3', '\\4');" : "bbcodeurl('\\4', '<a href=\"{url}\" target=\"_blank\">{url}</a>')", $message);
            }
        } else {
            if (strpos($msglower, '[/media]') !== FALSE) {
                $message = preg_replace("/\\[media=([\\w,]+)\\]\\s*([^\\[\\<\r\n]+?)\\s*\\[\\/media\\]/is", "[media]\\2[/media]", $message);
            }
            if (strpos($msglower, '[/audio]') !== FALSE) {
                $message = preg_replace("/\\[audio(=1)*\\]\\s*([^\\[\\<\r\n]+?)\\s*\\[\\/audio\\]/is", "[media]\\2[/media]", $message);
            }
            if (strpos($msglower, '[/flash]') !== FALSE) {
                $message = preg_replace("/\\[flash(=(\\d+),(\\d+))?\\]\\s*([^\\[\\<\r\n]+?)\\s*\\[\\/flash\\]/is", "[media]\\4[/media]", $message);
            }
        }
        if ($parsetype != 1 && $allowbbcode < 0 && isset($_G['cache']['bbcodes'][-$allowbbcode])) {
            $message = preg_replace($_G['cache']['bbcodes'][-$allowbbcode]['searcharray'], $_G['cache']['bbcodes'][-$allowbbcode]['replacearray'], $message);
        }
        if ($parsetype != 1 && strpos($msglower, '[/hide]') !== FALSE && $pid) {
            if ($_G['setting']['hideexpiration'] && $pdateline && (TIMESTAMP - $pdateline) / 86400 > $_G['setting']['hideexpiration']) {
                $message = preg_replace("/\\[hide[=]?(d\\d+)?[,]?(\\d+)?\\]\\s*(.*?)\\s*\\[\\/hide\\]/is", "\\3", $message);
                $msglower = strtolower($message);
            }
            if (strpos($msglower, '[hide=d') !== FALSE) {
                $message = preg_replace("/\\[hide=(d\\d+)?[,]?(\\d+)?\\]\\s*(.*?)\\s*\\[\\/hide\\]/ies", "expirehide('\\1','\\2','\\3', {$pdateline})", $message);
//.........这里部分代码省略.........
开发者ID:tang86,项目名称:discuz-utf8,代码行数:101,代码来源:function_discuzcode.php

示例10: foreach

        </tr>
      </thead>
      <tbody>
        <?php 
if (!empty($output['scomm_list']) && is_array($output['scomm_list'])) {
    ?>
        <?php 
    foreach ($output['scomm_list'] as $k => $v) {
        ?>
        <tr class="hover edit">
          <td class="w24"><input type="checkbox" name="sc_id[]" value="<?php 
        echo $v['scomm_id'];
        ?>
" class="checkitem"></td>
          <td><?php 
        echo parsesmiles($v['scomm_content']);
        ?>
</td>
          <td class="w150 align-center"><?php 
        echo $v['scomm_membername'];
        ?>
</td>
          <td class="w150 align-center"><?php 
        echo @date('Y-m-d H:i:s', $v['scomm_time']);
        ?>
</td>
          <td class="w150 align-center"><?php 
        echo $v['scomm_state'] == 0 ? $lang['admin_snstrace_statehide'] : $lang['admin_snstrace_stateshow'];
        ?>
</td>
          <td class="w150 align-center"><a href="javascript:void(0);" onclick="if(confirm('<?php 
开发者ID:dw250100785,项目名称:shopnc,代码行数:31,代码来源:sns_scomment.index.php

示例11: discuzcode

function discuzcode($message, $smileyoff, $bbcodeoff, $htmlon = 0, $allowsmilies = 1, $allowbbcode = 1, $allowimgcode = 1, $allowhtml = 0, $jammer = 0, $parsetype = '0', $authorid = '0', $allowmediacode = '0', $pid = 0)
{
    global $_G;
    static $authorreplyexist;
    if ($parsetype != 1 && !$bbcodeoff && $allowbbcode && (strpos($message, '[/code]') || strpos($message, '[/CODE]')) !== FALSE) {
        $message = preg_replace("/\\s?\\[code\\](.+?)\\[\\/code\\]\\s?/ies", "codedisp('\\1')", $message);
    }
    $msglower = strtolower($message);
    $htmlon = $htmlon && $allowhtml ? 1 : 0;
    if (!$htmlon) {
        $message = dhtmlspecialchars($message);
    }
    if (!$smileyoff && $allowsmilies) {
        $message = parsesmiles($message);
    }
    if ($_G['setting']['allowattachurl'] && strpos($msglower, 'attach://') !== FALSE) {
        $message = preg_replace("/attach:\\/\\/(\\d+)\\.?(\\w*)/ie", "parseattachurl('\\1', '\\2')", $message);
    }
    if ($allowbbcode) {
        if (strpos($msglower, 'ed2k://') !== FALSE) {
            $message = preg_replace("/ed2k:\\/\\/(.+?)\\//e", "parseed2k('\\1')", $message);
        }
    }
    if (!$bbcodeoff && $allowbbcode) {
        if (strpos($msglower, '[/url]') !== FALSE) {
            $message = preg_replace("/\\[url(=((https?|ftp|gopher|news|telnet|rtsp|mms|callto|bctp|thunder|synacast){1}:\\/\\/|www\\.|mailto:)?([^\\s\\[\"']+?))?\\](.+?)\\[\\/url\\]/ies", "parseurl('\\1', '\\5', '\\2')", $message);
        }
        if (strpos($msglower, '[/email]') !== FALSE) {
            $message = preg_replace("/\\[email(=([a-z0-9\\-_.+]+)@([a-z0-9\\-_]+[.][a-z0-9\\-_.]+))?\\](.+?)\\[\\/email\\]/ies", "parseemail('\\1', '\\4')", $message);
        }
        $nest = 0;
        while (strpos($msglower, '[table') !== FALSE && strpos($msglower, '[/table]') !== FALSE) {
            $message = preg_replace("/\\[table(?:=(\\d{1,4}%?)(?:,([\\(\\)%,#\\w ]+))?)?\\]\\s*(.+?)\\s*\\[\\/table\\]/ies", "parsetable('\\1', '\\2', '\\3')", $message);
            if (++$nest > 4) {
                break;
            }
        }
        $message = str_replace(array('[/color]', '[/size]', '[/font]', '[/align]', '[b]', '[/b]', '[s]', '[/s]', '[hr]', '[/p]', '[i=s]', '[i]', '[/i]', '[u]', '[/u]', '[list]', '[list=1]', '[list=a]', '[list=A]', "\r\n[*]", '[*]', '[/list]', '[indent]', '[/indent]', '[/float]'), array('</font>', '</font>', '</font>', '</p>', '<strong>', '</strong>', '<strike>', '</strike>', '<hr class="l" />', '</p>', '<i class="pstatus">', '<i>', '</i>', '<u>', '</u>', '<ul>', '<ul type="1" class="litype_1">', '<ul type="a" class="litype_2">', '<ul type="A" class="litype_3">', '<li>', '<li>', '</ul>', '<blockquote>', '</blockquote>', '</span>'), preg_replace(array("/\\[color=([#\\w]+?)\\]/i", "/\\[color=(rgb\\([\\d\\s,]+?\\))\\]/i", "/\\[size=(\\d{1,2}?)\\]/i", "/\\[size=(\\d{1,2}(\\.\\d{1,2}+)?(px|pt)+?)\\]/i", "/\\[font=([^\\[\\<]+?)\\]/i", "/\\[align=(left|center|right)\\]/i", "/\\[p=(\\d{1,2}|null), (\\d{1,2}), (left|center|right)\\]/i", "/\\[float=(left|right)\\]/i"), array("<font color=\"\\1\">", "<font style=\"color:\\1\">", "<font size=\"\\1\">", "<font style=\"font-size: \\1\">", "<font face=\"\\1 \">", "<p align=\"\\1\">", "<p style=\"line-height: \\1px; text-indent: \\2em; text-align: \\3;\">", "<span style=\"float: \\1;\">"), $message));
        if ($parsetype != 1) {
            if (strpos($msglower, '[/quote]') !== FALSE) {
                $message = preg_replace("/\\s?\\[quote\\][\n\r]*(.+?)[\n\r]*\\[\\/quote\\]\\s?/is", tpl_quote(), $message);
            }
            if (strpos($msglower, '[/free]') !== FALSE) {
                $message = preg_replace("/\\s*\\[free\\][\n\r]*(.+?)[\n\r]*\\[\\/free\\]\\s*/is", tpl_free(), $message);
            }
        }
        if (strpos($msglower, '[/media]') !== FALSE) {
            $message = preg_replace("/\\[media=([\\w,]+)\\]\\s*([^\\[\\<\r\n]+?)\\s*\\[\\/media\\]/ies", $allowmediacode ? "parsemedia('\\1', '\\2')" : "bbcodeurl('\\2', '<a href=\"{url}\" target=\"_blank\">{url}</a>')", $message);
        }
        if (strpos($msglower, '[/audio]') !== FALSE) {
            $message = preg_replace("/\\[audio(=1)*\\]\\s*([^\\[\\<\r\n]+?)\\s*\\[\\/audio\\]/ies", $allowmediacode ? "parseaudio('\\2', 400, '\\1')" : "bbcodeurl('\\2', '<a href=\"{url}\" target=\"_blank\">{url}</a>')", $message);
        }
        if (strpos($msglower, '[/flash]') !== FALSE) {
            $message = preg_replace("/\\[flash(=(\\d+),(\\d+))?\\]\\s*([^\\[\\<\r\n]+?)\\s*\\[\\/flash\\]/ies", $allowmediacode ? "parseflash('\\2', '\\3', '\\4');" : "bbcodeurl('\\4', '<a href=\"{url}\" target=\"_blank\">{url}</a>')", $message);
        }
        if ($parsetype != 1 && $allowbbcode < 0 && isset($_G['cache']['bbcodes'][-$allowbbcode])) {
            $message = preg_replace($_G['cache']['bbcodes'][-$allowbbcode]['searcharray'], $_G['cache']['bbcodes'][-$allowbbcode]['replacearray'], $message);
        }
        if ($parsetype != 1 && strpos($msglower, '[/hide]') !== FALSE && $pid) {
            if (strpos($msglower, '[hide]') !== FALSE) {
                if ($authorreplyexist === null) {
                    $posttable = getposttablebytid($_G['tid']);
                    $authorreplyexist = !$_G['forum']['ismoderator'] ? DB::result_first("SELECT pid FROM " . DB::table($posttable) . " WHERE tid='{$_G['tid']}' AND " . ($_G['uid'] ? "authorid='{$_G['uid']}'" : "authorid=0 AND useip='{$_G['clientip']}'") . " LIMIT 1") : TRUE;
                }
                if ($authorreplyexist) {
                    $message = preg_replace("/\\[hide\\]\\s*(.+?)\\s*\\[\\/hide\\]/is", tpl_hide_reply(), $message);
                } else {
                    $message = preg_replace("/\\[hide\\](.+?)\\[\\/hide\\]/is", tpl_hide_reply_hidden(), $message);
                    $message .= '<script type="text/javascript">replyreload += \',\' + ' . $pid . ';</script>';
                }
            }
            if (strpos($msglower, '[hide=') !== FALSE) {
                $message = preg_replace("/\\[hide=(\\d+)\\]\\s*(.+?)\\s*\\[\\/hide\\]/ies", "creditshide(\\1,'\\2', {$pid})", $message);
            }
        }
    }
    if (!$bbcodeoff) {
        if ($parsetype != 1 && strpos($msglower, '[swf]') !== FALSE) {
            $message = preg_replace("/\\[swf\\]\\s*([^\\[\\<\r\n]+?)\\s*\\[\\/swf\\]/ies", "bbcodeurl('\\1', ' <img src=\"'.STATICURL.'image/filetype/flash.gif\" align=\"absmiddle\" alt=\"\" /> <a href=\"{url}\" target=\"_blank\">Flash: {url}</a> ')", $message);
        }
        if (strpos($msglower, '[/img]') !== FALSE) {
            $message = preg_replace(array("/\\[img\\]\\s*([^\\[\\<\r\n]+?)\\s*\\[\\/img\\]/ies", "/\\[img=(\\d{1,4})[x|\\,](\\d{1,4})\\]\\s*([^\\[\\<\r\n]+?)\\s*\\[\\/img\\]/ies"), $allowimgcode ? array("bbcodeurl('\\1', '<img src=\"{url}\" onload=\"thumbImg(this)\" alt=\"\" />')", "parseimg('\\1', '\\2', '\\3')") : array("bbcodeurl('\\1', '<a href=\"{url}\" target=\"_blank\">{url}</a>')", "bbcodeurl('\\3', '<a href=\"{url}\" target=\"_blank\">{url}</a>')"), $message);
        }
    }
    for ($i = 0; $i <= $_G['forum_discuzcode']['pcodecount']; $i++) {
        $message = str_replace("[\tDISCUZ_CODE_{$i}\t]", $_G['forum_discuzcode']['codehtml'][$i], $message);
    }
    if (!empty($_G['gp_highlight'])) {
        $highlightarray = explode('+', $_G['gp_highlight']);
        $sppos = strrpos($message, chr(0) . chr(0) . chr(0));
        if ($sppos !== FALSE) {
            $specialextra = substr($message, $sppos + 3);
            $message = substr($message, 0, $sppos);
        }
        $message = preg_replace(array("/(^|>)([^<]+)(?=<|\$)/sUe", "/<highlight>(.*)<\\/highlight>/siU"), array("highlight('\\2', \$highlightarray, '\\1')", "<strong><font color=\"#FF0000\">\\1</font></strong>"), $message);
        if ($sppos !== FALSE) {
            $message = $message . chr(0) . chr(0) . chr(0) . $specialextra;
        }
    }
    unset($msglower);
//.........这里部分代码省略.........
开发者ID:v998,项目名称:discuzx-en,代码行数:101,代码来源:function_discuzcode.php

示例12: comment_saveOp

    /**
     * 评论保存
     **/
    public function comment_saveOp() {

        $data = array();
        $data['result'] = 'true';
        $comment_id = intval($_POST['comment_id']);
        $comment_type = self::get_channel_type($_GET['type']);
        if($comment_id <= 0 || empty($comment_type) || empty($_POST['comment_message']) || mb_strlen($_POST['comment_message']) > 140) {
            $data['result'] = 'false';
            $data['message'] = Language::get('wrong_argument');
            self::echo_json($data);
        }

        if(!empty($_SESSION['member_id'])) {
            $param = array();
            $param['comment_type'] = $comment_type['type_id']; 
            $param["comment_object_id"] = $comment_id;
            if (strtoupper(CHARSET) == 'GBK'){
                $param['comment_message'] = Language::getGBK(trim($_POST['comment_message']));
            } else {
                $param['comment_message'] = trim($_POST['comment_message']);
            }
            $param['comment_member_id'] = $_SESSION['member_id'];
            $param['comment_time'] = time();
            $model_comment = Model('micro_comment');
            $result = $model_comment->save($param);
            if($result) {

                //评论计数加1
                $model = Model("micro_{$_GET['type']}");
                $update = array();
                $update['comment_count'] = array('exp','comment_count+1');
                $condition = array();
                $condition[$comment_type['type_key']] = $comment_id;
                $model->table("micro_{$_GET['type']}")->where($condition)->update($update);

                //返回信息
                $data['result'] = 'true';
                $data['message'] = Language::get('nc_common_save_succ');
                $data['member_name'] = $_SESSION['member_name'].Language::get('nc_colon');
                $data['member_avatar'] = getMemberAvatar($_SESSION['member_avatar']);
                $data['member_link'] = MICROSHOP_SITE_URL.'/index.php?act=home&member_id='.$_SESSION['member_id'];
                $data['comment_message'] = parsesmiles(stripslashes($param['comment_message']));
                $data['comment_time'] = date('Y-m-d H:i:s',$param['comment_time']);
                $data['comment_id'] = $result; 

                //分享内容
                if(isset($_POST['share_app_items'])) {
                    $condition = array();
                    $condition[$comment_type['type_key']] = $_POST['comment_id'];
                    if($_GET['type'] == 'store') {
                        $info = $model->getOneWithStoreInfo($condition);
                    } else {
                        $info = $model->getOne($condition);
                    }
                    $info['commend_message'] = $param['comment_message'];
                    $info['type'] = $_GET['type'];
                    $info['url'] = MICROSHOP_SITE_URL.DS."index.php?act={$_GET['type']}&op=detail&{$_GET['type']}_id=".$_POST['comment_id'].'#widgetcommenttitle';
                    self::share_app_publish('comment',$info);
                }
            } else {
                $data['result'] = 'false';
                $data['message'] = Language::get('nc_common_save_fail');
            }
        } else {
            $data['result'] = 'false';
            $data['message'] = Language::get('no_login');
        }
        self::echo_json($data);
    }
开发者ID:noikiy,项目名称:ejia,代码行数:72,代码来源:comment.php

示例13: parsesmiles

&id=<?php 
                echo $output['traceinfo']['trace_originalid'];
                ?>
" target="_blank"><?php 
                echo $lang['sns_original_comment'];
                echo $output['traceinfo']['trace_orgcommentcount'] > 0 ? "({$output['traceinfo']['trace_orgcommentcount']})" : '';
                ?>
</a></span> </div>
        <?php 
            }
            ?>
        <?php 
        } else {
            ?>
        <?php 
            echo parsesmiles($output['traceinfo']['trace_content']);
            ?>
        <?php 
        }
        ?>
        <?php 
    }
    ?>
      </dd>
      <dd>
        <span class="goods-time fl"><?php 
    echo date('Y-m-d h:i', $output['traceinfo']['trace_addtime']);
    ?>
</span>
          <span class="fl ml10"><?php 
    echo snsShareFrom($output['traceinfo']['trace_from']);
开发者ID:uwitec,项目名称:xbshop,代码行数:31,代码来源:sns_traceinfo.php

示例14: parsesmiles

        } else {
            ?>
                        <a href="<?php 
            echo $cms_url . DS . 'index.php?act=' . $output['type_array'][$value['comment_type']]['key'] . '&op=' . $output['type_array'][$value['comment_type']]['key'] . '_detail&' . $output['type_array'][$value['comment_type']]['key'] . '_id=' . $value['comment_object_id'];
            ?>
" target="_blank">
                            <?php 
            echo $value['comment_object_id'];
            ?>
                        </a>
                        <?php 
        }
        ?>
                    </td>
                    <td><?php 
        echo parsesmiles($value['comment_message']);
        ?>
</td>
                    <td><a href="###" onclick="submit_delete(<?php 
        echo $value['comment_id'];
        ?>
)"><?php 
        echo $lang['nc_del'];
        ?>
</a></td>
                </tr>
                <?php 
    }
    ?>
                <?php 
} else {
开发者ID:Maplecms,项目名称:shopnc-yhmall,代码行数:31,代码来源:cms_comment.manage.php

示例15: dzzcode

function dzzcode($message, $allowat = 1, $allowsmilies = 1, $allowbbcode = 1, $allowmediacode = 1, $allowhtml = 0)
{
    global $_G;
    $msglower = strtolower($message);
    if (!$allowhtml) {
        $message = dhtmlspecialchars($message);
    } else {
        $message = preg_replace("/<script[^\\>]*?>(.*?)<\\/script>/i", '', $message);
    }
    if ($allowat) {
        if (strpos($msglower, '[/uid]') !== FALSE) {
            $message = preg_replace("/\\[uid=(\\d+)\\](.+?)\\[\\/uid\\]/ies", "parseat('\\1', '\\2' ,'uid')", $message);
        }
        if (strpos($msglower, '[/org]') !== FALSE) {
            $message = preg_replace("/\\[org=(\\d+)\\](.+?)\\[\\/org\\]/ies", "parseat('\\1', '\\2','gid')", $message);
        }
    }
    if ($allowsmilies) {
        $message = parsesmiles($message);
    }
    if ($allowbbcode) {
        if (strpos($msglower, 'ed2k://') !== FALSE) {
            $message = preg_replace("/ed2k:\\/\\/(.+?)\\//e", "parseed2k('\\1')", $message);
        }
    }
    if ($allowbbcode) {
        if (strpos($msglower, '[/url]') !== FALSE) {
            $message = preg_replace("/\\[url(=((https?|ftp|gopher|news|telnet|rtsp|mms|callto|bctp|thunder|qqdl|synacast){1}:\\/\\/|www\\.|mailto:)?([^\r\n\\[\"']+?))?\\](.+?)\\[\\/url\\]/ies", "parseurl('\\1', '\\5', '\\2')", $message);
        }
        if (strpos($msglower, '[/email]') !== FALSE) {
            $message = preg_replace("/\\[email(=([a-z0-9\\-_.+]+)@([a-z0-9\\-_]+[.][a-z0-9\\-_.]+))?\\](.+?)\\[\\/email\\]/ies", "parseemail('\\1', '\\4')", $message);
        }
        $nest = 0;
        while (strpos($msglower, '[table') !== FALSE && strpos($msglower, '[/table]') !== FALSE) {
            $message = preg_replace("/\\[table(?:=(\\d{1,4}%?)(?:,([\\(\\)%,#\\w ]+))?)?\\]\\s*(.+?)\\s*\\[\\/table\\]/ies", "parsetable('\\1', '\\2', '\\3')", $message);
            if (++$nest > 4) {
                break;
            }
        }
        //修复UBB标签不闭合造成的问题,理论上所有标签都可以以此方法处理
        $message = preg_replace(array("/\\[u\\](.+?)\\[\\/u\\]/i", "/\\[b\\](.+?)\\[\\/b\\]/i", "/\\[s\\](.+?)\\[\\/s\\]/i", "/\\[i\\](.+?)\\[\\/i\\]/i"), array("[uu]\\1[/uu]", "[bb]\\1[/bb]", "[ss]\\1[/ss]", "[ii]\\1[/ii]"), $message);
        $message = str_replace(array('[/color]', '[/backcolor]', '[/size]', '[/font]', '[/align]', '[bb]', '[/bb]', '[ss]', '[/ss]', '[hr]', '[/p]', '[i=s]', '[ii]', '[/ii]', '[uu]', '[/uu]', '[list]', '[list=1]', '[list=a]', '[list=A]', "\r\n[*]", '[*]', '[/list]', '[indent]', '[/indent]', '[/float]'), array('</font>', '</font>', '</font>', '</font>', '</div>', '<strong>', '</strong>', '<strike>', '</strike>', '<hr class="l" />', '</p>', '<i class="pstatus">', '<i>', '</i>', '<u>', '</u>', '<ul>', '<ul type="1" class="litype_1">', '<ul type="a" class="litype_2">', '<ul type="A" class="litype_3">', '<li>', '<li>', '</ul>', '<blockquote>', '</blockquote>', '</span>'), preg_replace(array("/\\[color=([#\\w]+?)\\]/i", "/\\[color=((rgb|rgba)\\([\\d\\s,]+?\\))\\]/i", "/\\[backcolor=([#\\w]+?)\\]/i", "/\\[backcolor=((rgb|rgba)\\([\\d\\s,]+?\\))\\]/i", "/\\[size=(\\d{1,2}?)\\]/i", "/\\[size=(\\d{1,2}(\\.\\d{1,2}+)?(px|pt)+?)\\]/i", "/\\[font=([^\\[\\<]+?)\\]/i", "/\\[align=(left|center|right)\\]/i", "/\\[p=(\\d{1,2}|null), (\\d{1,2}|null), (left|center|right)\\]/i", "/\\[float=left\\]/i", "/\\[float=right\\]/i"), array("<font color=\"\\1\">", "<font style=\"color:\\1\">", "<font style=\"background-color:\\1\">", "<font style=\"background-color:\\1\">", "<font size=\"\\1\">", "<font style=\"font-size:\\1\">", "<font face=\"\\1\">", "<div align=\"\\1\">", "<p style=\"line-height:\\1px;text-indent:\\2em;text-align:\\3\">", "<span style=\"float:left;margin-right:5px\">", "<span style=\"float:right;margin-left:5px\">"), $message));
        $message = preg_replace("/\\s?\\[postbg\\]\\s*([^\\[\\<\r\n;'\"\\?\\(\\)]+?)\\s*\\[\\/postbg\\]\\s?/is", "", $message);
        if ($allowmediacode) {
            if (!defined('IN_MOBILE')) {
                if (strpos($msglower, '[/media]') !== FALSE) {
                    $message = preg_replace("/\\[media=([\\w,]+)\\]\\s*([^\\[\\<\r\n]+?)\\s*\\[\\/media\\]/ies", $allowmediacode ? "parsemedia('\\1', '\\2')" : "bbcodeurl('\\2', '<a href=\"{url}\" target=\"_blank\">{url}</a>')", $message);
                }
                if (strpos($msglower, '[/audio]') !== FALSE) {
                    $message = preg_replace("/\\[audio(=1)*\\]\\s*([^\\[\\<\r\n]+?)\\s*\\[\\/audio\\]/ies", $allowmediacode ? "parseaudio('\\2', 400)" : "bbcodeurl('\\2', '<a href=\"{url}\" target=\"_blank\">{url}</a>')", $message);
                }
                if (strpos($msglower, '[/flash]') !== FALSE) {
                    $message = preg_replace("/\\[flash(=(\\d+),(\\d+))?\\]\\s*([^\\[\\<\r\n]+?)\\s*\\[\\/flash\\]/ies", $allowmediacode ? "parseflash('\\2', '\\3', '\\4');" : "bbcodeurl('\\4', '<a href=\"{url}\" target=\"_blank\">{url}</a>')", $message);
                }
            } else {
                if (strpos($msglower, '[/media]') !== FALSE) {
                    $message = preg_replace("/\\[media=([\\w,]+)\\]\\s*([^\\[\\<\r\n]+?)\\s*\\[\\/media\\]/is", "[media]\\2[/media]", $message);
                }
                if (strpos($msglower, '[/audio]') !== FALSE) {
                    $message = preg_replace("/\\[audio(=1)*\\]\\s*([^\\[\\<\r\n]+?)\\s*\\[\\/audio\\]/is", "[media]\\2[/media]", $message);
                }
                if (strpos($msglower, '[/flash]') !== FALSE) {
                    $message = preg_replace("/\\[flash(=(\\d+),(\\d+))?\\]\\s*([^\\[\\<\r\n]+?)\\s*\\[\\/flash\\]/is", "[media]\\4[/media]", $message);
                }
            }
        }
        $attrsrc = 'src';
        $allowimgcode = 1;
        if (strpos($msglower, '[/img]') !== FALSE) {
            $message = preg_replace(array("/\\[img\\]\\s*([^\\[\\<\r\n]+?)\\s*\\[\\/img\\]/ies", "/\\[img=(\\d{1,4})[x|\\,](\\d{1,4})\\]\\s*([^\\[\\<\r\n]+?)\\s*\\[\\/img\\]/ies"), $allowimgcode ? array("parseimg(0, 0, '\\1')", "parseimg('\\1', '\\2', '\\3')") : ($allowbbcode ? array(!defined('IN_MOBILE') ? "bbcodeurl('\\1', '<a href=\"{url}\" target=\"_blank\">{url}</a>')" : "bbcodeurl('\\1', '')", !defined('IN_MOBILE') ? "bbcodeurl('\\3', '<a href=\"{url}\" target=\"_blank\">{url}</a>')" : "bbcodeurl('\\3', '')") : array("bbcodeurl('\\1', '{url}')", "bbcodeurl('\\3', '{url}')")), $message);
        }
    }
    unset($msglower);
    return $allowhtml ? $message : nl2br(str_replace(array("\t", '   ', '  '), array('&nbsp; &nbsp; &nbsp; &nbsp; ', '&nbsp; &nbsp;', '&nbsp;&nbsp;'), $message));
}
开发者ID:druphliu,项目名称:dzzoffice,代码行数:75,代码来源:function_code.php


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