Web Analytics Made Easy -
StatCounter reply comments to multiple usernames - CodingForum

Announcement

Collapse
No announcement yet.

reply comments to multiple usernames

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

  • reply comments to multiple usernames

    Hi i am working on a comment module where i need to display in my text area which user I am replying to.
    Check out the attached screenshot.
    If I click the REPLY button next to user 'nopicguy, It should insert @nopicguy followed or preceeded by a line break in the text area below.
    If I click the REPLY button next to user 'airtest', it should insert @airtest followed or preceeded by a line break and so on.
    Now right now the reply button just takes you to the text area.

    Below is the code snippet of the module. If anybody requires the complete section code, I can PM you. Thanks in advance..
    Code:
    Posted: 
    <?php echo date("F j, Y",$comment_date); ?>&nbsp;&nbsp;&bull;&nbsp;&nbsp;<?php echo date("h:i A",$comment_date); ?>
    <?php echo $comment_message;?>
    <?php if($comment_userid==$loggedinuserid || $ismoderator=="YES") 
    { ?>
       <div class="comment-report"> 
       <form action="" name="deleteform<?php echo $commentid; ?>" method="post"><input type='hidden' name='do' value='deletecomment'><input type='hidden' value='<?php echo $commentid; ?>' name='delete_comment_id'>
          <a href="javascript:void(0)" onClick="document.deleteform<?php echo $commentid; ?>.submit();"><strong>Delete</strong>
          </a> 
       </form>
       </div>
    	 <?php 
    	 } ?>
         <a rel="nofollow" href="javascript:void(0)" onclick="window.open('<?php echo $root_url."reportthis.php?url=".urlencode("http://".$_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"]); ?>', 'mywindow','location=1,status=1,scrollbars=1, width=400,height=300'); return false;">
    	     <img src="<?php echo $root_url; ?>images/report-button.png" align="top" border="0">
         </a>&nbsp;
    	 <a rel="nofollow" href="#addcomment"><img src="<?php echo $root_url; ?>images/reply-button.png" align="top" border="0">
    	 </a>
    	  
    	   <?php if($loggedin=="YES") 
    	   { ?>
    	   <?php echo "<input type='image' src='".$root_url."images/submitcomment-button.png' value='Submit' name='comment_create'>"; ?><?php 
    	   } ?>
      
      
     //Takes you to the text area 
     <a name="addcomment"></a>
    <form class='form' action='' method='post' name='edit' class='nomarginform'>
     POST A COMMENT
      <?php if($loggedin=="YES") { ?>
       
      <?php } ?>
       
        <?php if($loggedin=="YES") { ?><textarea class='comment-input-textarea-loggedin' name='comments_content'></textarea><div class='clearboth'></div><?php } ?>
        <?php if($loggedin=="YES") { ?><div class='comment-submit-holder'><div class='comment-submit'><?php echo "<input type='image' src='".$root_url."images/submitcomment-button.png' value='Submit' name='comment_create'>"; ?>
      
      <input type='hidden' name='comment_create' value='YES'>
      <input type='hidden' name='thread_comment_id' value='<?php echo $thread_comment_id; ?>'>
     </div>
    </form>
    Attached Files

  • #2
    So you're wanting the text area to be populated with the names of the people you click on, when you click on them? That is something that you need Javascript for my friend take your question there.

    My javascript is rusty, but it should just be a case of getElementbyId() and then update the text with the name they clicked. But they'll be able to answer you fully
    Useful function to retrieve difference in times
    The best PHP resource
    A good PHP FAQ
    PLEASE remember to wrap your code in [PHP] tags.
    PHP Code:
    // Replace this
    if(isset($_POST['submitButton']))
    // With this
    if(!empty($_POST))
    // Then check for values/forms. Some IE versions don't send the submit button 
    Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live.

    Comment

    Working...
    X
    😀
    🥰
    🤢
    😎
    😡
    👍
    👎