Jump to content

bytesize

Members
  • Posts

    56
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

bytesize's Achievements

Member

Member (2/5)

0

Reputation

  1. If jquery 1.3 is used with this code a single click works, which is what I want, but if jquery 1.4 or higher is used a double click is required. Can anyone tell me what is causing the double click? <head> <style type="text/css"> .interactionLinksDiv a { font-size: 12px; font-family: Geneva, sans-serif; font-weight: normal; } .interactionLinksDiv a:hover { font-size:12px; text-decoration: underline; } .interactContainers { display:none; margin-top: 4px; } </style> <script type="text/javascript"> function toggleInteractContainers(x) { if ($('#'+x).is(":hidden")) { $('#'+x).slideDown(200); } else { $('#'+x).hide(); } $('.interactContainers').hide(); } </script> </head> <body> <?php $interactionBox = '<div class="interactionLinksDiv"> <a href="#" onclick="return false" onmousedown="toggleInteractContainers(\'add_friend\');">Add <b>Joey</b> to Friends</a> </div>'; echo $interactionBox; ?> <div class="interactContainers" id="add_friend"> Friend <b>Joey</b>? <a href="#" onclick="return false" onmousedown="toggleInteractContainers('add_friend');" title="Close">Later</a> </div> </body> </html>
  2. I can't figure out how to make - textarea[name=send[mc_comment]] - work. When I add text to send[mc_comment] it only works on the first post comment and the other post comments are empty! Can anyone help me with this? a, b, c, d, e work as they should. $curpost = postid in the database. <script type="text/javascript"> var commentUrl = "views/layouts/comments.php"; function mainComment(a,b,c,d,e,f) { var f = $("textarea[name=send[mc_comment]]").val(); var page = (d); $("#"+page).text("Please wait...").show(); $.post(commentUrl,{user:a, friend:b, postid:c, where:d, which:e, send:f},function(data){$("#"+page).html(data).show().fadeOut(1000)}) } </script> <form action="" method='POST'> <textarea name='send[mc_comment]'></textarea> <a href='#' onclick="return false" onmousedown="javascript:mainComment('<?php echo $usercode; ?>', '<?php echo $othermember; ?>', '<?php echo $curpost; ?>', '<?php echo 'add'.$curpost; ?>', '<?php echo $comment; ?>');">Yes</a> </form>
  3. Jessica, thank you for your help, you pointed me in the right direction. It took a little bit of work on the php side, but I got it to work!
  4. Yes, the page is being redirected in the controller. Thanks for your help. I will continue working on this until I figure it out.
  5. <script type="text/javascript"> function toggleInteractContainers(x) { if ($('#'+x).is(":hidden")) { $('#'+x).slideDown(200); } else { $('#'+x).hide(); } $('.interactContainers').hide(); } </script> <?php $interactionBox = '<div class="interactionLinksDiv"> <a href="#" onclick="return false" onmousedown="javascript:toggleInteractContainers(\''.$show['wb_memberid'].'\');">Send Request</a> </div>'; echo $interactionBox; ?> <div class="interactContainers" id="<?php echo $show['wb_memberid']; ?>"> <a href="users/add?add=<?php echo $show['code']; ?>">Yes</a> <a href="#" onclick="return false" onmousedown="javascript:toggleInteractContainers('<?php echo $show['wb_memberid']; ?>');" title="Close">No</a> </div> When scrolled down to the "Yes" link and it is clicked, the page jumps up to the top of the browser. If "No" is clicked, the page does not move, which is the effect I'm looking for. How can I stop the page from jumping to the top? I have tried using "#", onclick, and onmousedown within the "Yes" href to no avail. Anyone?
  6. $user = current_user('code'); $query = sprintf("SELECT * FROM responds JOIN questions ON questions.q_id=responds.question_id JOIN users ON questions.q_questionby=users.code WHERE responds.re_respondby='%s' AND questions.q_questionby=users.code ORDER BY questions.question", mysql_real_escape_string($user)); $result = mysql_query($query); $exists = mysql_num_rows($result); while($row = mysql_fetch_array($result)) { if($user!=$row['code']) { echo $row["question"]; } } Thank you for responding to my question. This is the display output. The numbers represent the question id. 6 Proin id lorem nunc, eget scelerisque lectus. Nulla quis nisi accumsan leo rhoncus elementum.… 6 Proin id lorem nunc, eget scelerisque lectus. Nulla quis nisi accumsan leo rhoncus elementum.… 16 Eget diam mi. Nam sed lectus vel metus elementum varius. Curabitur tincidunt faucibus neque… 3 Diam libero iaculis a gravida ac elementum ac dolor. In hac habitasse platea dictumst. Nulla tem… 3 Diam libero iaculis a gravida ac elementum ac dolor. In hac habitasse platea dictumst. Nulla tem… 20 Cras aliquam odio a metus varius eget dictum ipsum accumsan. Maecenas justo dui, aliquam… 20 Cras aliquam odio a metus varius eget dictum ipsum accumsan. Maecenas justo dui, aliquam… As you can see, the question is being display more than once for questions with more than one answer. The $user variable is showing all my answers in responds.re_respondby='%s' How can I show only one question?
  7. <?php $user = current_user('code'); $query = sprintf("SELECT * FROM responds JOIN questions ON questions.q_id=responds.question_id JOIN users ON questions.q_questionby=users.code WHERE responds.re_respondby='%s' AND questions.q_questionby=users.code ORDER BY responds.re_id", mysql_real_escape_string($user)); $result = mysql_query($query); $exists = mysql_num_rows($result); ?> If I have more than one answer per question, the same question will display multiple times depending on how many answers there are for that question. Example question: How can I do this if I'm doing that? Let's say there are 10 answers to that question. 3 of those answers are mine. That question will display 3 times instead of once. Can this be done in the query?
  8. The users table seems to be the missing link.
  9. sasa, That did it, it works great. @ silkfire, I recreated your table and query and it worked for me, but would not work with the other code. Thank you both very much, I really appreciate your help.
  10. This is my php. <?php $username = 'Joe'; $query = "SELECT f_userid, friendwith FROM friends WHERE f_userid <> '$username' AND f_userid NOT IN (SELECT friendwith FROM friends WHERE friendwith <> '$username')"; $result = mysql_query($query); while($row = mysql_fetch_array($result)) { echo $row['f_userid']."<br/>"; echo $row['friendwith']."<br/>"; } ?> This is what I get when I echo the $query. SELECT f_userid, friendwith FROM friends WHERE f_userid <> 'Joe' AND f_userid NOT IN (SELECT friendwith FROM friends WHERE friendwith <> 'Joe') Nothing echos out for $row['f_userid'] or $row['friendwith']. If I change the query to: SELECT f_userid, friendwith FROM friends WHERE f_userid = 'Joe' AND f_userid NOT IN (SELECT friendwith FROM friends WHERE friendwith <> 'Joe') $row['f_userid'] and $row['friendwith'] echo out content form table friends using the query with =.
  11. You can use this table example. I'm trying to isolate Fred and Tom because Joe has not made friends with them. f_userid Fred Tom Henry Bill Joe Joe friendwith Joe Joe Joe Joe Henry Bill
  12. Table friends f_userid Fred Tom Henry Bill Julie Wally Joe Joe friendwith Joe Joe Joe Joe Joe Joe Julie Wally This what your table should look like. Joe is in both columns because Joe friended Julie and Wally but not the others. I get the same query you get when it echos out on my page. This is why I'm having trouble with the query.
  13. I copied your query and nothing happens because f_userid and friendwith both contain Joe. Doesn't <> represent not equal to? SELECT f_userid, friendwith FROM friends WHERE f_userid <> 'Joe' AND f_userid NOT IN (SELECT friendwith FROM friends WHERE friendwith <> 'Joe') When I echo the query, I get the query with Joe.
  14. f_userid and friendwith columns are both equal to Joe in different rows depending on who is friends with who.
  15. Yes, I only need table friends, but table users is needed to display the images of those that are not friends with f_userid. I can add table users after solving friends table. Still not working. SELECT f_userid, friendwith FROM friends WHERE f_userid <> 'Joe' AND f_userid NOT IN (SELECT friendwith FROM friends WHERE friendwith <> 'Joe')
×
×
  • 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.