Jump to content

JonnySnip3r

Members
  • Posts

    87
  • Joined

  • Last visited

Everything posted by JonnySnip3r

  1. Hey guys not sure what this is called but does anyone have more information on it. Ok when you visit a part of a site or a profile or what ever?? :S:S and you redirect them to login how can u then send them back to where they was when they have logged in? hope someone can help.
  2. $query = mysql_query("SELECT * FROM comments_messages WHERE message_reply_to_member_id = '$my_id'"); while($row = mysql_fetch_assoc($query)){ $message_id = $row['message_id']; $message_reply_to_id = $row['message_reply_to_member_id']; $message_from_member_id = $row['message_from_member_id']; $message_title = $row['message_title']; $message_contents = $row['message_contents']; $message_time_date = $row['message_time_date']; $member_image = $row['member_image']; $message_reported = $row['message_reported']; echo "<div class='commentHome'>"; echo "<img src='profile/images/$member_image' alt='member profile picture' />"; echo "<h3>$message_title <small><i>$message_time_date</i> (from: <strong>". get_member_name_from_member_id($message_from_member_id) ."</strong> )</small></h3>"; echo "<p>". rec_message_bad_word_filter($message_contents) ."</p>"; echo "<div id='box'>"; echo "<br />"; echo "<form method='post' action=''>"; echo "<input type='text' name='comment' placeholder='quick reply...' onclick=\"$.jGrowl('Enter your reply to this message. e.g: Hey, Dude!', { header: 'Reply Field' });\" href=\"javascript:void(0);\"/>"; echo "<input type='hidden' name='member_id_to' value='$message_from_member_id'/>"; echo "<input type='hidden' name='title' value='$message_title'/>"; echo "</form>"; echo "</div>"; echo "</div>"; } $query = mysql_query("SELECT * FROM comments_messages WHERE message_from_member_id = '$my_id'"); while($row = mysql_fetch_assoc($query)){ $message_id = $row['message_id']; $message_reply_to_id = $row['message_reply_to_member_id']; $message_from_member_id = $row['message_from_member_id']; $message_title = $row['message_title']; $message_contents = $row['message_contents']; $message_time_date = $row['message_time_date']; $member_image = $row['member_image']; $message_reported = $row['message_reported']; $message_reported_to = $row['message_reported_to]; echo "<div class='commentHome2'>"; echo "<img src='profile/images/$member_image' alt='member profile picture' />"; echo "<h3>$message_title <small><i>$message_time_date</i> (from: me)</small></h3>"; echo "<p>". rec_message_bad_word_filter($message_contents) ."</p>"; echo "<p class='rec_by'>"; /* echo "<a href=\"#\" id=\"$message_id\" class=\"delbutton\"> <img src='profile/icons/delete.png' alt='delete' title='Delete this Comment' /></a>";*/ echo "</p>"; echo "</div>"; } I know its messy and theres tons of tidying up to do
  3. hey dude you need to look into .htaccess and friendly urls a quick google search will get you some more information or take a look at the link below: http://www.9lessons.info/2009/11/pretty-urls-with-htaccess-file.html
  4. Hey guys i have been making a comment and reply script. When the user makes a post and others reply they appear below. However when another person makes a post and a reply is made to that they mess up it has the comments at the top and the replys at the bottom. DOes anyone know how i could order these? Or is there a tutorial online. Hope someone can help. Thanks
  5. Hey guys i am making a php application and i have a feature where it allows members to upload images. If there a way to secure a folder to only be allowed access when a member is logged in and not someone accessing the folder and downloading images. Stuped question i know would it be better to store the images in the database as BLOB? but then again could make the database big. Thanks
  6. Hey guys i have a bad word cleanser function: function bad_word_cleanser($string){ // Words to filter $bad_words = array("blast", "bitch"); // Replace words with $clean_words = array("[apple]","[banana]"); for($i = 0; $i < sizeof($bad_words); $i++){ srand((double)microtime()*1000000); $rand_key = (rand()%sizeof($clean_words)); $string = eregi_replace($bad_words[$i], $clean_words[$rand_key], $string); } return $string; } it checks to see if any bad words are used and then chooses a random clean word to replace it with. any suggestions on how i could have this pick up the amount of words it has used and then have the ability to email the user if more than say 6 words are used. i have tried i just cant get it to work. Hope someone can help. Thanks!
  7. Hey guys was wondering if someone could help with this. I am currently learning jQuery at a snail pace due to me learning another language anyway i have put together a little thing where it shows an image when you hover over it the image fades out and another image fades in. Is there a way i can have it fade on hover to another image and then when i move my mouse away it changes back to the previous image? I could do this with css however i want the fade effect. Thanks here is my on hover script below. <script type="text/javascript"> $('#logo_fade').hover(function() { $('#logo_fade').fadeOut('slow', function() { $('#logo_fadeIn').fadeIn('slow', function() { }); }); }); </script>
  8. Thanks dude well i have all day now so hopefully will manage to get it working haha
  9. Hey guys im making a comment system where members can type a message to another member and then the other member can log in from their account and see the comment and then post a message and visa versa. Anyways i have been trying different wayts but cant think or get it to work correctly so could someone point me in the right direction of a database structure? that way i could work from that and finish this brain swelling thing haha. Thanks guys below is my current structure. message_id tinyint(4) No None auto_increment message_to_member_id tinyint(4) No None message_from_member_id tinyint(4) No None message_title varchar(128) latin1_swedish_ci No None message_content text latin1_swedish_ci No None message_time_date varchar(128) latin1_swedish_ci No None member_image varchar(128) latin1_swedish_ci No None message_reported tinyint(4) No None message_reply tinyint(4) No None message_reply_id i have a function i created where u pass in the member_id and it spits out the name hope someone can help thanks!
  10. No one helped =[ anyways i came up with this any suggestions or would it be done like this, im newish to php (is there only so many times i can get away with that?). SO any improvements would be great!! function convert_string_to_image($string){ switch($string){ case "": $string = "<img src=\"profile/icons/emoticon_smile.png\" alt=\"smile_face\" />"; break; case ""; $string = "<img src=\"profile/icons/emoticon_grin.png\" alt=\"smile_grin\" />"; break; case ""; $string = "<img src=\"profile/icons/emoticon_tongue.png\" alt=\"smile_tongue\" />"; break; } return $string; } i didnt add a default in because if it cant find it then it will just show the text =]
  11. Hey guys was wondering if someone could help me. Ok i have a set of images smile_face.png, sad_face.png, cry_face.png etc. etc. these are 16px by 16px not that it matters. Is there a pre-built function that can convert say , , etc. to these images? So in the text box it will see these as text however when the user posts it will convert them to images? Thanks
  12. Well i managed to resolve the problem myself and incase anyone is left scratching their heads i will paste in the code below on how i did this. $(function() { $(".delbutton").click(function(){ //Save the link in a variable called element var element = $(this); //Find the id of the link that was clicked var del_id = element.attr("id"); //Built a url to send var info = 'id=' + del_id; if(confirm("Are you sure you want to remove this comment?")){ $.ajax({ type: "POST", url: "delete_member_comment.php", data: info, success: function(){ } }); and the php side of things <?php session_start(); if(isset($_SESSION['authenticated'])){ if(isset($_POST['id'])){ $id = intval($_POST['id']); if(!intval($id)){ return false; header("Location: index.php"); exit(); }else{ require_once 'includes/config.php'; $query = "DELETE FROM comments WHERE id = '$id'"; if(!mysql_query($query)){ return false; header("Location: index.php"); exit(); }else{ return true; } } }else{ header("Location: index.php"); exit(); } }else{ header("Location: index.php"); exit(); } ?>
  13. Well if you want something light weight and so personal why not create one yourself get yourself some coffee and sit down for the weekend hammering it out. If you cant make one yourself id suggest wordpress as its everything you wanted or give me a heads up and i will sort you a personal one out
  14. hey dude do you not keep backups of your projects state every now and again? also i had the same problem however my server didnt support paypals IPN (Instant Payment Notification) but you said that it was working so cant be that. Just go over your script and make sure that there are no errors i sometimes do the same and then realise that it was a stupid ; causing the error haha
  15. Hey guys im new to jQuery so hope some one can help. I can manage to get the fading to work on an element, however i was wondering if someone could help me. I have a comments section with an icon when the user clicks the icon it deletes the post. Is there away that i can give some feedback to jquery and if the post deleted then the div will fade, and also to stop the page refreshing. So like asynchronously call a php script. Below is some code... <a href='delete_member_comment.php?delete_id=$id'> <img src='profile/icons/comment_delete.png' alt='Delete this Comment' title='Delete this Comment' /> </a> and my delete script: <?php if(isset($_GET['delete_id'])){ $post_to_delete = intval($_GET['delete_id']); if(!(intval($post_to_delete))){ header("Location: index.php"); exit(); }else{ require_once 'includes/config.php'; $query = "DELETE FROM taggitt WHERE id='$post_to_delete'"; if(!mysql_query($query)){ header("Location: index.php?message=DeleteFailed"); exit(); }else{ header("Location: index.php?message=DeleteSuccess"); exit(); } } }else{ header("Location: index.php"); exit(); } ?> maybe i could echo "success" and then it call the jquery script after im not sure new to jquery haha hope some one can help though!
  16. Hey guys i have been making a website and i have hit a road block and hope someone can please help. Ok i have been making a signup page eassy however i have incorporated a messaging system into my website i have 2 tables so far one named members and one named pmessage (where the personal messages are held) the way i associate these tables with one another is in my pmessage i have a column named member_id which matched the id in the members table (hope this seems ok only way i couldt think) now i have a problem here is my sql code when a member registers. $register = mysql_query("INSERT INTO members (id,username,password,firstname,lastname,location,aboutme,profilepicture,age,private) VALUES ('','$username','$password','','','','','','','')"); as you can see i insert username and password everything else is null they can full this out in the profile area (hope this seems ok) i am pretty new to php. anyways how would i go about inserting whatever auto incremented id from the members table into the non auto increment member_id in the pmessages table? hope i explained that ok. anyways if i was to do it separately here is the code for that. $register_pmessages = mysql_query("INSERT INTO pmessages (id,member_id,title,message) VALUES ('','','','')"); really hope someone can help, and thanks!!
  17. Yeah column haha thank you very much dude helped allot i tried something similar but i forgot the brackets haha thank you again!!
  18. Hey guys n gals hope someone can help me with this, anyways i managed (through the help of phpmyadmin) to construct a working search query here it is. SELECT * FROM users WHERE username LIKE '%$search_user%' ok the thing is how would i get it to search more than one table? i have tried several ways and cant seem to get it to work i would like it not just to search username but firstname and lastname aswell. Thanks
  19. Hey hope some one can help me with this as i have just recently ran into this problem. Ok here it is i have a comments section on my site and i have made it where users can sort through there comments by a drop down box, so they select the drop down box and its shows categorys then have commented in... php java c++ etc now it all appeard to be working when building but now if the user posts say into php twice its shows php php java c++ etc here is the statement i am using $query = "SELECT * FROM comments WHERE member = '$member'"; would i have to add a LIMIT but im not sure what to do now haha. hope someone can help thanks.
  20. Thank you very much dood!! helped allot and fast Cheers!
×
×
  • 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.