Jump to content

php_begins

Members
  • Posts

    259
  • Joined

  • Last visited

Everything posted by php_begins

  1. Ok its working as I wanted . its not working in IE 8 and firefox though...I tried using a setTimeout function to see if it makes any difference in IE and firefox. It does not even focus on the text area,let alone focus where I want it to.. <a onclick="lineBreak() + setComments('<?php print "@".$comment_username; ?>') + setTimeout(focusEnd(document.getElementById('comments_content')),200)
  2. ok it kind of works in other browsers except IE and firefox. Is it possible for the function to ignore line breaks? just focus on the last character it sees. if a word ends with a line break the focus would still be in the last character.
  3. Thanks, i am quite new to javascript. Can I pass that function with another function that I have used? or is there a different way of calling that? the focus part does not work on IE 8 though.. here is my code.. <script type="text/javascript"> function setComments(userID) { document.getElementById("comments_content").value = document.getElementById("comments_content").value + userID + "\n\n"; } </script> <a onclick="setComments('<?php print $comment_username; ?>') + focusEnd('comments_content')" href="#addcomment"> <img src="images/reply-button.png" align="top" border="0"> </a> <textarea class='comment-input-textarea-loggedin' id='comments_content' name='comments_content'></textarea>
  4. Does anyone know how to set focus to the last character of a textarea in javascript?
  5. hi I was working on comments module where i pull of the usernames and insert them into a text area when i click a button. Now I want the cursor to point to the end of the username everytime i click the button. I tried using the focus() property but it takes me to the beginning of the text area. here is my code so far: <script type="text/javascript"> function setComments(userID) { document.getElementById("comments_content").value = document.getElementById("comments_content").value + userID + "\n\n"; } </script> <a onclick="setComments('<?php print $comment_username; ?>') + document.edit.comments_content.focus()" href="#addcomment"> <img src="images/reply-button.png" align="top" border="0"> </a> <textarea class='comment-input-textarea-loggedin' id='comments_content' name='comments_content'></textarea>
  6. well i used a simple javascript function and it worked for me..it goes something like this: <script type="text/javascript"> function setComments(userID) { document.getElementById("comments_content").value = document.getElementById("comments_content").value + userID + "\n\n"; } </script> <a onclick="setComments('<?php print $comment_username; ?>')" rel="nofollow" href="#addcomment"><img src="<?php echo $root_url; ?>images/reply-button.png" align="top" border="0"></a> <?php if($loggedin=="YES") { ?><textarea class='comment-input-textarea-loggedin' id='comments_content' name='comments_content'></textarea></div><?php } ?>
  7. 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.. Posted: <?php echo date("F j, Y",$comment_date); ?> • <?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> <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>
  8. Hello, I am working on the comments text area section. When i post something followed by '<' symbol and do not close it with '>' it sees it as a empty set of characters and does not let me post it! for example <hello there. This is identified as empty when i hit the submit button. I know it might be due to strip_tags. Is there a way I can make it to work?
  9. Thanks, i didnt pay attention to the extra option..
  10. Hi, How can I display something from the database by stripping all the tags except the hyperlink(<a>) tag?
  11. thanks..i actually achieved it with css by using word-wrap:break-word;
  12. I tried that and it didnt work.. In CSS the width works only when you encounter a whitespace
  13. Hi.I have need to insert a line break after specific sequence of characters.. For example consider the following username, LONGLONGUSERNAME... I need a line break after 12 characters or till a specific width.
  14. Hi.I have need to insert a line break after specific sequence of characters.. For example consider the following username, LONGLONGUSERNAME... I need a line break after 12 characters or till a specific width. Can this be done in css or php?
  15. Hi, Is there a way to implement a follow this page Twitter API (Similar to Like this Page that facebook has).
  16. Thanks mgallforever :-) @teynon.. actually i am printing it in the url for searching purposes..so any blank space comes as %20!
  17. hello. I need some help here. I have dynamic variable that contains characters separated by blank spaces. I need to replace the blank space (%20) with a plus(+) sign) wherever it occurs. For example, my variable $label might contain $label=one word. when i echo $label it prints one%20word. I would like to print it as one+word. Thanks in advance
  18. thank you i got it! This is what I did.. $url = $rooturl."/".$label; Thanks a lot again!
  19. Thank you, that is very close to what I wanted. I need to hardcode the url as $url=$rooturl."/".$tagname; so when i click on tag1 it should take me to $rooturl."/"$tag1, when i click on tag2 it should take me to $rooturl."/"$tag2 and so on
  20. Here's what I am doing so far, $keywords = strip_tags($blog_query_results['keywords']); //Retrives the tags from the database echo wordwrap(stripslashes($keywords), 65, "<br>",true); // this prints tag1,tag2, and so on. While printing them I want to link tag1,tag2,tag3 to different URLS. Thanks.
  21. Hi I have tags in my database in a row called tags. They are separated by commas. For example, they are stored in the database as tag1,tag2,tag3. I want to retrieve them from the database and display them one by one separately.And before displaying each tag, I want to link it to a URL. I know we can use php explode function. But i m not sure how to go about it.
  22. I have trouble embedding a youtube url in a webpage! here is my code: <iframe class="youtube-player" type="text/html" width="100" height="100" src="<?php echo $ShowVideo; ?>"></iframe> it does displays the url fine in the view-source section. But the thumbicon does not show up in the web page. Any help would be appreciated
  23. sorry..i updated it but still without any luck.. <iframe class="youtube-player" type="text/html" width="100" height="100" src="<?php echo $ShowVideo; ?>"></iframe>
  24. I am sorry..i am not sure what i am supposed to do. Here's the 2 things i tried which didnt work: <iframe class="youtube-player" type="text/html" width="100 height="100" src="<?php echo $ShowVideo; ?>"</iframe> And <iframe class="youtube-player" type="text/html" width="640" height="385" src="http://www.youtube. com/embed/<?php echo $ShowVideo; ?>"> </iframe> Could u help me with the correct synatx.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.