Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    Aug 2011
    Posts
    134
    Thanks
    20
    Thanked 0 Times in 0 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 Thumbnails Attached Thumbnails reply comments to multiple usernames-comment-module.png  

  • #2
    Senior Coder
    Join Date
    Jul 2011
    Posts
    1,226
    Thanks
    3
    Thanked 171 Times in 171 Posts
    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


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •