hi... help me to my code! if one of my member reply my topic the system is automaticaly pm me that this member is reply to my topic.. this is my code...
else if($do=="post")
{
echo "<head>";
echo "<title>Discussions-Post Reply</title>";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"$gsmstyle[0]\"/>";
echo "</head>";
$tid = safe(cleanInput($_POST["tid"]));
$tfid = mysql_fetch_array(mysql_query("SELECT fid FROM yeh_topics WHERE id='".$tid."'"));
if(!canaccess(getuid_sid($sid), $tfid[0]))
{
echo "<div align=\"center\"><div class=\"t2\">Error.!</div><br/>";
echo "You Don't Have A Permission To View The Contents Of This Forum<br/><br/>";
echo "<a href=\"index.php?do=forums&sid=$sid\">Forums</a> <a href=\"index.php?do=chat&sid=$sid\">Chatrooms</a> <a href=\"index.php?do=main&sid=$sid\">Home</a>";
echo "<div class=\"foot\">$mysite</div>";
echo "<br/>Page Took ";
$load = microtime();
print (number_format($load,2));
echo " Seconds";
echo "</div>";
echo "</body></html>";
exit();
}
if(chatpost(getuid_sid($sid))<200)
{
echo "<div align=\"center\"><div class=\"top\">Posting Reply</div><br/>";
echo "You Need 200 Chat Points Before You Can Post.<br/>";
echo "Go To Our Chatrooms And Start Posting Chat Messages To Earn Chat Points.<br/>";
echo "<br /><a href=\"index.php?do=viewtpc&sid=$sid&tid=$ tid\">Back</a> <a href=\"index.php?do=forums&sid=$sid\">Forums</a> <a href=\"index.php?do=chat&sid=$sid\">Chatrooms</a> <a href=\"index.php?do=main&sid=$sid\">Home</a>";
echo "<div class=\"foot\">$mysite</div>";
echo "<br/>Page Took ";
$load = microtime();
print (number_format($load,2));
echo " Seconds";
echo "</div>";
echo "</body>";
echo "</html>";
exit();
}
$reptxt = safe($_POST["reptxt"]);
$qut = safe(cleanInput($_POST["qut"]));
if(strlen($reptxt)<20)
{
echo "<div align=\"center\"><div class=\"t2\">Error.!</div><br/>";
echo "Topic Reply Cant Be Posted<br
/>Message Is Too Short, It Must Contain 20 Characters Above.<br/>Please <a href=\"index.php?do=viewtpc&sid=$sid&tid=$ tid\">Go Back</a> And Fix It..<br/><br/>";
echo "<a href=\"index.php?do=forums&sid=$sid\">Forums</a> <a href=\"index.php?do=chat&sid=$sid\">Chatrooms</a> <a href=\"index.php?do=main&sid=$sid\">Home</a>";
echo "<div class=\"foot\">$mysite</div>";
echo "<br/>Page Took ";
$load = microtime();
print (number_format($load,2));
echo " Seconds";
echo "</div>";
echo "</body></html>";
exit();
}
addonline(getuid_sid($sid),"Posting Topic Reply","index.php?do=viewtpc&tid=$tid");
echo "<div align=\"center\"><div class=\"top\">Posting Reply</div><br/>";
$crdate = time();
$fid = getfid($tid);
//$uid = getuid_sid($sid);
$res = false;
$closed = mysql_fetch_array(mysql_query("SELECT closed FROM yeh_topics WHERE id='".$tid."'"));
if(($closed[0]!='1')||(ismod($uid)))
{
$lpost = mysql_fetch_array(mysql_query("SELECT dtpost FROM yeh_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 yeh_posts SET text='".$reptxt."', tid='".$tid."', uid='".$uid."', dtpost='".$crdate."', quote='".$qut."'");
}
if($res)
{
$usts = mysql_fetch_array(mysql_query("SELECT posts, pera1 FROM yeh_users WHERE id='".$uid."'"));
$res2 = mysql_fetch_array(mysql_query("SELECT name, authorid FROM yeh_topics WHERE id='".$tid."'"));
$ups = $usts[0]+1;
$upl = $usts[1]+1;
mysql_query("UPDATE yeh_users SET posts='".$ups."', pera1='".$upl."' WHERE id='".$uid."'");
mysql_query("UPDATE yeh_topics SET lastpost='".$crdate."' WHERE id='".$tid."'");
echo "Message Posted Successfully";
echo "<br/><br/><a href=\"index.php?do=viewtpc&sid=$sid&tid=$ tid&go=last\">";
echo "View Topic</a>";
}else{
echo "Error Posting Message";
}
}else{
$af = $post_af -$antiflood;
echo "Antiflood Control: $af";
}
}else{
echo "Topic Is Closed For Posting";
}
$fname = getfname($fid);
echo "<br/><br/><a href=\"index.php?do=viewfrm&sid=$sid&fid=$ fid\">";
echo "$fname</a><br/>";
echo "<a href=\"index.php?do=forums&sid=$sid\">Forums</a> <a href=\"index.php?do=chat&sid=$sid\">Chatrooms</a> <a href=\"index.php?do=main&sid=$sid\">";
echo "Home</a>";
echo "<div class=\"foot\">$mysite</div>";
echo "<br/>Page Took ";
$load = microtime();
print (number_format($load,2));
echo " Seconds";
echo "</div>";
echo "</body>";
}
else if($do=="post")
{
echo "<head>";
echo "<title>Discussions-Post Reply</title>";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"$gsmstyle[0]\"/>";
echo "</head>";
$tid = safe(cleanInput($_POST["tid"]));
$tfid = mysql_fetch_array(mysql_query("SELECT fid FROM yeh_topics WHERE id='".$tid."'"));
if(!canaccess(getuid_sid($sid), $tfid[0]))
{
echo "<div align=\"center\"><div class=\"t2\">Error.!</div><br/>";
echo "You Don't Have A Permission To View The Contents Of This Forum<br/><br/>";
echo "<a href=\"index.php?do=forums&sid=$sid\">Forums</a> <a href=\"index.php?do=chat&sid=$sid\">Chatrooms</a> <a href=\"index.php?do=main&sid=$sid\">Home</a>";
echo "<div class=\"foot\">$mysite</div>";
echo "<br/>Page Took ";
$load = microtime();
print (number_format($load,2));
echo " Seconds";
echo "</div>";
echo "</body></html>";
exit();
}
if(chatpost(getuid_sid($sid))<200)
{
echo "<div align=\"center\"><div class=\"top\">Posting Reply</div><br/>";
echo "You Need 200 Chat Points Before You Can Post.<br/>";
echo "Go To Our Chatrooms And Start Posting Chat Messages To Earn Chat Points.<br/>";
echo "<br /><a href=\"index.php?do=viewtpc&sid=$sid&tid=$ tid\">Back</a> <a href=\"index.php?do=forums&sid=$sid\">Forums</a> <a href=\"index.php?do=chat&sid=$sid\">Chatrooms</a> <a href=\"index.php?do=main&sid=$sid\">Home</a>";
echo "<div class=\"foot\">$mysite</div>";
echo "<br/>Page Took ";
$load = microtime();
print (number_format($load,2));
echo " Seconds";
echo "</div>";
echo "</body>";
echo "</html>";
exit();
}
$reptxt = safe($_POST["reptxt"]);
$qut = safe(cleanInput($_POST["qut"]));
if(strlen($reptxt)<20)
{
echo "<div align=\"center\"><div class=\"t2\">Error.!</div><br/>";
echo "Topic Reply Cant Be Posted<br
/>Message Is Too Short, It Must Contain 20 Characters Above.<br/>Please <a href=\"index.php?do=viewtpc&sid=$sid&tid=$ tid\">Go Back</a> And Fix It..<br/><br/>";
echo "<a href=\"index.php?do=forums&sid=$sid\">Forums</a> <a href=\"index.php?do=chat&sid=$sid\">Chatrooms</a> <a href=\"index.php?do=main&sid=$sid\">Home</a>";
echo "<div class=\"foot\">$mysite</div>";
echo "<br/>Page Took ";
$load = microtime();
print (number_format($load,2));
echo " Seconds";
echo "</div>";
echo "</body></html>";
exit();
}
addonline(getuid_sid($sid),"Posting Topic Reply","index.php?do=viewtpc&tid=$tid");
echo "<div align=\"center\"><div class=\"top\">Posting Reply</div><br/>";
$crdate = time();
$fid = getfid($tid);
//$uid = getuid_sid($sid);
$res = false;
$closed = mysql_fetch_array(mysql_query("SELECT closed FROM yeh_topics WHERE id='".$tid."'"));
if(($closed[0]!='1')||(ismod($uid)))
{
$lpost = mysql_fetch_array(mysql_query("SELECT dtpost FROM yeh_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 yeh_posts SET text='".$reptxt."', tid='".$tid."', uid='".$uid."', dtpost='".$crdate."', quote='".$qut."'");
}
if($res)
{
$usts = mysql_fetch_array(mysql_query("SELECT posts, pera1 FROM yeh_users WHERE id='".$uid."'"));
$res2 = mysql_fetch_array(mysql_query("SELECT name, authorid FROM yeh_topics WHERE id='".$tid."'"));
$ups = $usts[0]+1;
$upl = $usts[1]+1;
mysql_query("UPDATE yeh_users SET posts='".$ups."', pera1='".$upl."' WHERE id='".$uid."'");
mysql_query("UPDATE yeh_topics SET lastpost='".$crdate."' WHERE id='".$tid."'");
echo "Message Posted Successfully";
echo "<br/><br/><a href=\"index.php?do=viewtpc&sid=$sid&tid=$ tid&go=last\">";
echo "View Topic</a>";
}else{
echo "Error Posting Message";
}
}else{
$af = $post_af -$antiflood;
echo "Antiflood Control: $af";
}
}else{
echo "Topic Is Closed For Posting";
}
$fname = getfname($fid);
echo "<br/><br/><a href=\"index.php?do=viewfrm&sid=$sid&fid=$ fid\">";
echo "$fname</a><br/>";
echo "<a href=\"index.php?do=forums&sid=$sid\">Forums</a> <a href=\"index.php?do=chat&sid=$sid\">Chatrooms</a> <a href=\"index.php?do=main&sid=$sid\">";
echo "Home</a>";
echo "<div class=\"foot\">$mysite</div>";
echo "<br/>Page Took ";
$load = microtime();
print (number_format($load,2));
echo " Seconds";
echo "</div>";
echo "</body>";
}
Comment