How to restrict to the post in the topic, only type 2 Smile? I am tried with this function, which is in the [ if (nose>2) ]in chat.php, but not work ..Is there any idea how to do this? Here's how I tried ..
else if($action=="post")
{
if (istrashed(getuid_sid($sid))){
echo "<card id=\"main\" title=\"HAPPY\">";
echo "<p align=\"center\">";
echo "Blokada pisanja od strane moderatora!<br/><br/>";
echo "<a href=\"index.php?action=main&sid=$sid\">HAPPY</a>";
echo "</p>";
echo "</card>";
echo "</wml>";
exit();
}
$tid = $_POST["tid"];
$tfid = mysql_fetch_array(mysql_query("SELECT fid FROM ibwf_topics WHERE id='".$tid."'"));
if(!canaccess(getuid_sid($sid), $tfid[0]))
{
echo "<card id=\"main\" title=\"HAPPY\">";
echo "<p align=\"center\">";
echo "Nemate saglasnost da vidite ovaj Forum!<br/><br/>";
echo "<a href=\"index.php?action=main&sid=$sid\">HAPPY</a>";
echo "</p>";
echo "</card>";
echo "</wml>";
exit();
}
$reptxt = $_POST["reptxt"];
$qut = $_POST["qut"];
addonline(getuid_sid($sid),"<b>Replika</b>","");
echo "<card id=\"main\" title=\"HAPPY Forum\">";
echo "<p align=\"center\">";
$crdate = time();
$fid = getfid($tid);
//$uid = getuid_sid($sid);
$res = false;
$closed = mysql_fetch_array(mysql_query("SELECT closed FROM ibwf_topics WHERE id='".$tid."'"));
$postinfo = $reptxt;
$number = strlen($postinfo);
if(($closed[0]!='1')||(ismod($uid)))
{
$lpost = mysql_fetch_array(mysql_query("SELECT dtpost FROM ibwf_posts WHERE uid='".$uid."' ORDER BY dtpost DESC LIMIT 1"));
global $post_af;
$antiflood = time()-$lpost[0];
if($antiflood>$post_af)
{
if(trim($reptxt)!="")
{
$res = mysql_query("INSERT INTO ibwf_posts SET text='".$reptxt."', tid='".$tid."', uid='".$uid."', dtpost='".$crdate."', quote='".$qut."'");
}
if($res)
{
if($nos>2){
$usts = mysql_fetch_array(mysql_query("SELECT posts, plusses FROM ibwf_users WHERE id='".$uid."'"));
$ups = $usts[0]+1;
$upl = $usts[1]+1;
mysql_query("UPDATE ibwf_users SET posts='".$ups."', plusses='".$upl."' WHERE id='".$uid."'");
mysql_query("UPDATE ibwf_topics SET lastpost='".$crdate."' WHERE id='".$tid."'");
$unop = mysql_fetch_array(mysql_query("SELECT posts FROM ibwf_users WHERE id='".$uid."'"));
$chs = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_chonline"));
echo " <center> <a href=\"chat.php?rid=100&sid=$sid\">HAPPY KVIZ</a>($chs[0])<br/><br/></center>";
echo "Prisutni su : <a href=\"index.php?action=online&sid=$sid\">".ge tnumonline()."</a><br/>";
echo "<img src=\"http://coding-talk.com/images/ok.gif\" alt=\"O\"/> <br/>Uspešno ste upisali vaš <b>$unop[0]</b>. Komentar";
echo "<br/><br/><a href=\"index.php?action=viewtpc&sid=$sid&t id=$tid&go=last\">";
echo "Pogledaj temu</a>";
else{
$nos = substr_count($text,"<img src=");
echo "<img src=\"http://coding-talk.com/images/notok.gif\" alt=\"X\"/><b> Forum sistem: Dozvoljeno je samo 2 smajlija po poruci</b>";
}
}else{
echo "<img src=\"http://coding-talk.com/images/notok.gif\" alt=\"X\"/>Nemoguce postovati poruku!";
}
}
else{
$af = $post_af -$antiflood;
echo "<img src=\"http://coding-talk.com/images/notok.gif\" alt=\"X\"/>Antiflood Kontrola: $af";
}
}
else{
echo "<img src=\"http://coding-talk.com/images/notok.gif\" alt=\"X\"/>Tema zatvorena za pisanje!";
}
$fname = getfname($fid);
echo "<br/><br/><a href=\"index.php?action=viewfrm&sid=$sid&f id=$fid\">";
echo "$fname</a><br/>";
echo "<a href=\"index.php?action=main&sid=$sid\"><img src=\"http://coding-talk.com/images/home.gif\" alt=\"*\"/>";
echo "HAPPY</a>";
echo "</p>";
echo "</card>";
}
{
if (istrashed(getuid_sid($sid))){
echo "<card id=\"main\" title=\"HAPPY\">";
echo "<p align=\"center\">";
echo "Blokada pisanja od strane moderatora!<br/><br/>";
echo "<a href=\"index.php?action=main&sid=$sid\">HAPPY</a>";
echo "</p>";
echo "</card>";
echo "</wml>";
exit();
}
$tid = $_POST["tid"];
$tfid = mysql_fetch_array(mysql_query("SELECT fid FROM ibwf_topics WHERE id='".$tid."'"));
if(!canaccess(getuid_sid($sid), $tfid[0]))
{
echo "<card id=\"main\" title=\"HAPPY\">";
echo "<p align=\"center\">";
echo "Nemate saglasnost da vidite ovaj Forum!<br/><br/>";
echo "<a href=\"index.php?action=main&sid=$sid\">HAPPY</a>";
echo "</p>";
echo "</card>";
echo "</wml>";
exit();
}
$reptxt = $_POST["reptxt"];
$qut = $_POST["qut"];
addonline(getuid_sid($sid),"<b>Replika</b>","");
echo "<card id=\"main\" title=\"HAPPY Forum\">";
echo "<p align=\"center\">";
$crdate = time();
$fid = getfid($tid);
//$uid = getuid_sid($sid);
$res = false;
$closed = mysql_fetch_array(mysql_query("SELECT closed FROM ibwf_topics WHERE id='".$tid."'"));
$postinfo = $reptxt;
$number = strlen($postinfo);
if(($closed[0]!='1')||(ismod($uid)))
{
$lpost = mysql_fetch_array(mysql_query("SELECT dtpost FROM ibwf_posts WHERE uid='".$uid."' ORDER BY dtpost DESC LIMIT 1"));
global $post_af;
$antiflood = time()-$lpost[0];
if($antiflood>$post_af)
{
if(trim($reptxt)!="")
{
$res = mysql_query("INSERT INTO ibwf_posts SET text='".$reptxt."', tid='".$tid."', uid='".$uid."', dtpost='".$crdate."', quote='".$qut."'");
}
if($res)
{
if($nos>2){
$usts = mysql_fetch_array(mysql_query("SELECT posts, plusses FROM ibwf_users WHERE id='".$uid."'"));
$ups = $usts[0]+1;
$upl = $usts[1]+1;
mysql_query("UPDATE ibwf_users SET posts='".$ups."', plusses='".$upl."' WHERE id='".$uid."'");
mysql_query("UPDATE ibwf_topics SET lastpost='".$crdate."' WHERE id='".$tid."'");
$unop = mysql_fetch_array(mysql_query("SELECT posts FROM ibwf_users WHERE id='".$uid."'"));
$chs = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_chonline"));
echo " <center> <a href=\"chat.php?rid=100&sid=$sid\">HAPPY KVIZ</a>($chs[0])<br/><br/></center>";
echo "Prisutni su : <a href=\"index.php?action=online&sid=$sid\">".ge tnumonline()."</a><br/>";
echo "<img src=\"http://coding-talk.com/images/ok.gif\" alt=\"O\"/> <br/>Uspešno ste upisali vaš <b>$unop[0]</b>. Komentar";
echo "<br/><br/><a href=\"index.php?action=viewtpc&sid=$sid&t id=$tid&go=last\">";
echo "Pogledaj temu</a>";
else{
$nos = substr_count($text,"<img src=");
echo "<img src=\"http://coding-talk.com/images/notok.gif\" alt=\"X\"/><b> Forum sistem: Dozvoljeno je samo 2 smajlija po poruci</b>";
}
}else{
echo "<img src=\"http://coding-talk.com/images/notok.gif\" alt=\"X\"/>Nemoguce postovati poruku!";
}
}
else{
$af = $post_af -$antiflood;
echo "<img src=\"http://coding-talk.com/images/notok.gif\" alt=\"X\"/>Antiflood Kontrola: $af";
}
}
else{
echo "<img src=\"http://coding-talk.com/images/notok.gif\" alt=\"X\"/>Tema zatvorena za pisanje!";
}
$fname = getfname($fid);
echo "<br/><br/><a href=\"index.php?action=viewfrm&sid=$sid&f id=$fid\">";
echo "$fname</a><br/>";
echo "<a href=\"index.php?action=main&sid=$sid\"><img src=\"http://coding-talk.com/images/home.gif\" alt=\"*\"/>";
echo "HAPPY</a>";
echo "</p>";
echo "</card>";
}
Comment