已掉线,重新登录

首页 > 绿虎论坛 > 历史版块 > 编程 > PHP > 讨论/求助

标题: 就是不会写@…

作者: @Ta

时间: 2015-08-27

点击: 3820

不会就是不会…
悲哀…

[隐藏样式|查看源码]


『回复列表(8|显示机器人聊天)』

1. 老衲刚从六道佩恩那里学得秘术(神罗天征),特地赶来一试威力,从现在开始,让凡人们感受痛苦吧。。。。神罗天征 ,不好意思 查克拉不够吓到各位虎友了。 ---来自Nokia A8850
(/@Ta/2015-08-27 09:37//)

2. @冰封网
(/@Ta/2015-08-27 09:38//)

3. preg_replace("/@(.*),/iUs","<a href="">@\\1</a>",$xx);
(/@Ta/2015-08-27 09:52//)

4. @晨梦,这个是我论坛程序的 @ 功能 写的比较简单  look 
if (preg_match('/@/', $nr))
{
$ei = explode('@', $nr);
$num = count($ei);
$num = $num - 1;
for ($i = 1; $i <= $num; $i++) {
$eii = explode(',', $ei[$i]);
$row=$DB->select('*','user',"WHERE user='".$eii['0']."'")->fetchALL();//查询 @ 的用户 如果存在则发送通知信息
$row=$row['0'];
if(is_array($row))
{
$DB->insert('tongzhi',array('kan'=>'0','tzlx'=>'aitetzhf','user'=>$user,'nr'=>$nr,'sj'=>$date,'to'=>$eii['0'],'tzid'=>$tzid,'bkid'=>'','htid'=>''));
}
}
}
(/@Ta/2015-08-27 10:49//)

5. @小男生,第八行那个*是被屏蔽了还是原本就是那样的???
(/@Ta/2015-08-27 11:24//)

6. @小男生,大概有点思路了,,,去实践看看…
(/@Ta/2015-08-27 12:01//)

7.
<?php 
session_start();
$bt="回复帖子";
include("../top.php");
include("../conn.php");
include_once("../function.php");
$sid = sqlstr($_COOKIE['dl']);
$uin=mysql_fetch_array(mysql_query("select * from user where sid='$sid'"));
$id=$uin['id'];
$nick=$uin['nick'];
if(!$uin){
header("Location:../login.php");
exit;
}
$tid=sqlstr($_GET['tid']);
$hftime=time();
$text=htmlspecialchars($_POST["hftxt"]);
$txt=sqlstr(nl2br($text));
$txt1=sqlstr(nl2br($zt));

if(preg_match('/@/',$text)){
$ei = explode('@',$text);
$num = count($ei);
$num = $num - 1;
for ($i = 1; $i <= $num; $i++) {
$eii = explode(',', $ei[$i]);
$row=$DB->select('*','user',"WHERE nick='".$eii['0']."'")->fetchALL();
$row=$row['0'];
if(is_array($row))
{
$DB->insert('ait',array('atid'=>'','kan'=>'0','nick'=>$nick,'nr'=>$nr,'time'=>$hftime,'fnick'=>$eii['0'],'tzid'=>$tid));
}
}
}
if($txt==Null){
echo '<br/><font color="red">很无语啊:</font><br/>你什么都不写,你想表达什么呢?写一点吧。<br/><br/><br/>';
}elseif(mb_strlen($txt,'utf-8')>50){
echo "回复字数不能大于50哦,唯爱时光装不下啦~ <br/><br/><br/>";
}else{
if($_SESSION['hf']!=$txt){
$_SESSION['hf']="${txt}";
mysql_query("INSERT INTO hf(hid,hftxt,uid,tid,hftime) VALUES ('','$text','$id','$tid','$hftime')");
$hf="UPDATE tie SET hf=hf+1 WHERE tid='$tid'";
mysql_query($hf,$conn);
header("Location:read.php?tid=$tid");
exit;
}else{
echo "<br/><br/><font color='red'>不可重复回复。</font><br/> <br/><a href='index.php'>返回首页</a><br/><br/> ";
}
}

?>

<?php
include('../foot.php');
foot_staring();
?>

@小男生,这个在@人后就卡机了,在这个页面不动,但是不@人就能够正常跳转,哪里需要改一改???
(/@Ta/2015-08-27 12:22//)

8. @晨梦,第8行的那个原本就是那样 那个是查询 @ 的用户  我用的是老虎的数据库操作类
(/@Ta/2015-08-27 13:47//)

回复需要登录

7月18日 07:35 星期五

本站由hu60wap6驱动

备案号: 京ICP备18041936号-1