[help] to my code

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    [help] to my code

    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&amp;sid=$sid\">Forums</a> <a href=\"index.php?do=chat&amp;sid=$sid\">Chatrooms</a> <a href=\"index.php?do=main&amp;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&amp;sid=$sid&amp;tid=$ tid\">Back</a> <a href=\"index.php?do=forums&amp;sid=$sid\">Forums</a> <a href=\"index.php?do=chat&amp;sid=$sid\">Chatrooms</a> <a href=\"index.php?do=main&amp;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&amp;sid=$sid&amp;tid=$ tid\">Go Back</a> And Fix It..<br/><br/>";
    echo "<a href=\"index.php?do=forums&amp;sid=$sid\">Forums</a> <a href=\"index.php?do=chat&amp;sid=$sid\">Chatrooms</a> <a href=\"index.php?do=main&amp;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&amp;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&amp;sid=$sid&amp;tid=$ tid&amp;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&amp;sid=$sid&amp;fid=$ fid\">";
    echo "$fname</a><br/>";
    echo "<a href=\"index.php?do=forums&amp;sid=$sid\">Forums</a> <a href=\"index.php?do=chat&amp;sid=$sid\">Chatrooms</a> <a href=\"index.php?do=main&amp;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>";

    }

    #2
    Change the RED FONT to fit what you need

    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&amp;sid=$sid\">Forums</a> <a href=\"index.php?do=chat&amp;sid=$sid\">Chatrooms</a> <a href=\"index.php?do=main&amp;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&amp;sid=$sid&amp;tid=$ tid\">Back</a> <a href=\"index.php?do=forums&amp;sid=$sid\">Forums</a> <a href=\"index.php?do=chat&amp;sid=$sid\">Chatrooms</a> <a href=\"index.php?do=main&amp;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&amp;sid=$sid&amp;tid=$ tid\">Go Back</a> And Fix It..<br/><br/>";
    echo "<a href=\"index.php?do=forums&amp;sid=$sid\">Forums</a> <a href=\"index.php?do=chat&amp;sid=$sid\">Chatrooms</a> <a href=\"index.php?do=main&amp;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&amp;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."'");
    [COLOR="red"]autopm("YOUR_AUTO_PM_MESSAGE", $uid);[/COLOR]
    }
    
    
    
    
    
    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&amp;sid=$sid&amp;tid=$ tid&amp;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&amp;sid=$sid&amp;fid=$ fid\">";
    echo "$fname</a><br/>";
    echo "<a href=\"index.php?do=forums&amp;sid=$sid\">Forums</a> <a href=\"index.php?do=chat&amp;sid=$sid\">Chatrooms</a> <a href=\"index.php?do=main&amp;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>";
    
    }
    I mean the "YOUR_AUTO_PM_MESSAGE"
    By the way, always remember to use BBcode
    Did I help you?
    You can help me too
    Your donations will help me finance my studies.

    Comment


      #3
      Originally posted by kei_ki7 View Post
      I mean the "YOUR_AUTO_PM_MESSAGE"
      By the way, always remember to use BBcode
      what do u mean bro?

      Comment


        #4
        ur problem not clear to me,r u trying to stop pm notification? but i saw in ur code no pm notification system is available!!
        PHP Code:
        /* I don't know everything hehe */ 
        Find me on facebook

        Comment


          #5
          i dont undeerstand your question exactly ,,,,,,
          as i understand im replying .......
          PHP Code:
           if($res)
                {
                  
          $usts mysql_fetch_array(mysql_query("SELECT posts, plusses FROM ibwf_users WHERE id='".$uid."'"));
                  
          $res2 mysql_fetch_array(mysql_query("SELECT name, authorid FROM ibwf_topics WHERE id='".$tid."'"));
                
          $usr getnick_uid($uid);
                
          $tname htmlspecialchars($res2[0]);
                if((
          $res2[1]!=$uid)&&(automsgs($res2[1]))){
                
          $msg "Your Topic [topic=$tid]$tname"."[/topic] has been Replied to by $usr [br/][small][i]p.s: this is an automated pm[/i][/small]";
                
          autopm($msg$res2[1]);
                  }
                  
          $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."'"); 

          just make lil chage as i show here and it will b working ....

          Comment


            #6
            Originally posted by wasted05 View Post
            what do u mean bro?
            Just try this code.

            PHP 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&amp;sid=$sid\">Forums</a> <a href=\"index.php?do=chat&amp;sid=$sid\">Chatrooms</a> <a href=\"index.php?do=main&amp;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&amp;sid=$sid&amp;tid=$ tid\">Back</a> <a href=\"index.php?do=forums&amp;sid=$sid\">Forums</a> <a href=\"index.php?do=chat&amp;sid=$sid\">Chatrooms</a> <a href=\"index.php?do=main&amp;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&amp;sid=
            $sid&amp;tid=$ tid\">Go Back</a> And Fix It..<br/><br/>";
            echo 
            "<a href=\"index.php?do=forums&amp;sid=$sid\">Forums</a> <a href=\"index.php?do=chat&amp;sid=$sid\">Chatrooms</a> <a href=\"index.php?do=main&amp;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&amp;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."'");
            autopm("Change this message, this is the message that will sent whenever there is a member reply in your topic"$uid);
            }





            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&amp;sid=$sid&amp;tid=$ tid&amp;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&amp;sid=$sid&amp;fid=$ fid\">";
            echo 
            "$fname</a><br/>";
            echo 
            "<a href=\"index.php?do=forums&amp;sid=$sid\">Forums</a> <a href=\"index.php?do=chat&amp;sid=$sid\">Chatrooms</a> <a href=\"index.php?do=main&amp;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>";


            Did I help you?
            You can help me too
            Your donations will help me finance my studies.

            Comment


              #7
              @ kei_ki7

              i try to modify ur code.. your code is ok but the ones hu reply my topic automaticaly send it to one of may member reply on my topic... i dont have recieve any notification on my topic how can i fix that mate..



              (trim($reptxt)!="")
              {
              $res2 = mysql_fetch_array(mysql_query("SELECT name, authorid FROM cx_topics WHERE id='".$tid."'"));
              $res = mysql_query("INSERT INTO cx_posts SET text='".$reptxt."', tid='".$tid."', id='".$uid."', dtpost='".$crdate."', quote='".$qut."'");
              $usr = getnick_uid($uid);
              $tname = htmlspecialchars($res2[0]);

              autopm("Your Topic [topic=$tid]$tname"."[/topic] has been Replied by $usr [br/][red]Note: This is an automatic pm[/red]", $uid);
              }

              Comment


                #8
                thats what i said i dont understand what you exactly want ..... i give this according to what i understand .....
                if you tell me what exactly want then i can help i think ........

                Comment


                  #9
                  PHP Code:
                  (trim($reptxt)!="")
                  {
                  $res2 mysql_fetch_array(mysql_query("SELECT name, authorid FROM cx_topics WHERE id='".$tid."'"));
                  $res mysql_query("INSERT INTO cx_posts SET text='".$reptxt."', tid='".$tid."', id='".$uid."', dtpost='".$crdate."', quote='".$qut."'");
                  $usr getnick_uid($uid);
                  $tname htmlspecialchars($res2[0]);

                  autopm("Your Topic [topic=$tid]$tname"."[/topic] has been Replied by $usr [br/][red]Note: This is an automatic pm[/red]"$res2[1]);

                  I forgot to make uid as author. try this code.
                  Did I help you?
                  You can help me too
                  Your donations will help me finance my studies.

                  Comment


                    #10
                    Originally posted by kei_ki7 View Post
                    PHP Code:
                    (trim($reptxt)!="")
                    {
                    $res2 mysql_fetch_array(mysql_query("SELECT name, authorid FROM cx_topics WHERE id='".$tid."'"));
                    $res mysql_query("INSERT INTO cx_posts SET text='".$reptxt."', tid='".$tid."', id='".$uid."', dtpost='".$crdate."', quote='".$qut."'");
                    $usr getnick_uid($uid);
                    $tname htmlspecialchars($res2[0]);

                    autopm("Your Topic [topic=$tid]$tname"."[/topic] has been Replied by $usr [br/][red]Note: This is an automatic pm[/red]"$res2[1]);

                    I forgot to make uid as author. try this code.
                    there is an error if i reply the topic system says Error Posting Message

                    this is the code:






                    else if($do=="post")
                    {
                    echo "<head>";
                    echo "<title>Discussions-Post Reply</title>";
                    echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"$style[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&amp;sid=$sid\">Forums</a> <a href=\"index.php?do=chat&amp;sid=$sid\">Chatrooms</a> <a href=\"index.php?do=main&amp;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&amp;sid=$sid&amp;tid=$ tid\">Back</a> <a href=\"index.php?do=forums&amp;sid=$sid\">Forums</a> <a href=\"index.php?do=chat&amp;sid=$sid\">Chatrooms</a> <a href=\"index.php?do=main&amp;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&amp;sid=$sid&amp;tid=$ tid\">Go Back</a> And Fix It..<br/><br/>";
                    echo "<a href=\"index.php?do=forums&amp;sid=$sid\">Forums</a> <a href=\"index.php?do=chat&amp;sid=$sid\">Chatrooms</a> <a href=\"index.php?do=main&amp;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&amp;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)!="")
                    {
                    $res2 = mysql_fetch_array(mysql_query("SELECT name, authorid FROM yeh_topics WHERE id='".$tid."'"));
                    $res = mysql_query("INSERT INTO yeh_posts SET text='".$reptxt."', tid='".$tid."', id='".$uid."', dtpost='".$crdate."', quote='".$qut."'");
                    $usr = getnick_uid($uid);
                    $tname = htmlspecialchars($res2[0]);

                    autopm("Your Topic [topic=$tid]$tname"."[/topic] has been Replied by $usr [br/][red]Note: This is an automatic pm[/red]", $res2[1]);
                    }




                    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&amp;sid=$sid&amp;tid=$ tid&amp;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&amp;sid=$sid&amp;fid=$ fid\">";
                    echo "$fname</a><br/>";
                    echo "<a href=\"index.php?do=forums&amp;sid=$sid\">Forums</a> <a href=\"index.php?do=chat&amp;sid=$sid\">Chatrooms</a> <a href=\"index.php?do=main&amp;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>";

                    }






                    tnx kei and love 4 helping me...

                    Comment

                    Working...
                    X