Jump to content

grabenair

Member
  • Posts

    338
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by grabenair

  1. Thanks for looking Ben. I was just thinking once I used php to get the info from the data base I could use javascript to do the rest. Basically I just wanted to experiment with javascript. I am just now trying to learn it. But I will probably build it all in php like you said.
  2. Thanks Stefan, I do agree reuse, reuse. I have all kinds of code stipits in a folder that I reuse all the time, I just need to edit it a little. I did for get about sourceforge.net, I did try hot scripts. I need exactly what you built well almost. I did find a lot of star rating systems. But none that lets you rate other users. I do think that I could just add to some of them that I found to make them do what I want. My problem is that making a star rating system is pretty easy but I am kinda lost on how to apply it to users. I know I have to pull them from the data base. But that is all that I have. I will do some more studying on this. Also I can not decide if it would be easier with PHP or jQuery.
  3. Very good points LSW, I can not believe I did not think of that. I use my wife for one of those points all of the time, she is color blind.
  4. Follow Stephen's advice it worked for me. You can build a web site with only html and css. This is called a static site. This is where I start all of my ex-turns out. It can become over whelming to them if I start throwing them php. When you add PHP ect. you now have what you call a dynamic site. But again for people just starting out I stress follow Stephen's advice.
  5. Good day, I am trying to build a site quickly so I am using WP again. It is a personal site and I need to have a user reputation of some kind. What I am looking for is to give the ability to users of the site to rate other users with a few questions and then give points in response to the answers. This might help you understand what I am looking for, the site is a free trading site where you can come and trade anything from video games to movies or what ever you want. I would like to find a plug in that would let me configure it with a few questions like, was the cd scratched, did it arrive quickly among others and the give rating points. Kinda looking for something like when you go and click watch topic here on this site. PS sorry for the rambling been working on this for quite a few hours and my brain is getting fried. So with that good night all. PPS I know I will probably have to go and code it, but thought I would give it a try here first. Thank you
  6. Yes mam, I was just playing with the html and css and this got it to work that way. It would not work without an id. I do not know way.
  7. <!DOCTYPE html> <html> <head> <title>Page Title</title> <style> <!-- #content { width: 760px; } #right { width: 200px; margin-left:760px; } .center { margin: auto; } --> </style> </head> <body> <section id="content"> <p></p> <h2>PADI Courses</h2> <p>.</p> <h2></h2> <p></p> </section> <aside id="right"> <a href="http:</a> <a href="http><img class="center" src="img/padi.jpg" alt="earning" ></a> <a href="h/"><img class="center" src="img/rmp.png" alt="Re Park" ></a> </aside> </body> </html> Although I just used colored blocks in place of your imgs.
  8. I would hate to see you have to ghange the img size from what you want so here is what I did on a site to get them to line up. The site is http://www.masoncitymotox.com <div id="lfsidebar"> <h3>Sponsored By</h3> <img class="aligncenter size-full wp-image-21" src="http://midwestwebdesignstudio.com/masoncitymotox.com/wp-content/uploads/2012/05/amsoil1.jpg" alt="" width="120" height="30" /> <img class="aligncenter size-full wp-image-23" src="http://midwestwebdesignstudio.com/masoncitymotox.com/wp-content/uploads/2012/05/clarionInn1.jpg" alt="" width="90" height="86" /> <img class="aligncenter size-full wp-image-25" src="http://midwestwebdesignstudio.com/masoncitymotox.com/wp-content/uploads/2012/05/community1.jpg" alt="" width="120" height="38" /> <img class="aligncenter size-full wp-image-27" src="http://midwestwebdesignstudio.com/masoncitymotox.com/wp-content/uploads/2012/05/harley.jpg" alt="" width="120" height="74" /> <img class="aligncenter size-full wp-image-30" src="http://midwestwebdesignstudio.com/masoncitymotox.com/wp-content/uploads/2012/05/riverCity.jpg" alt="" width="120" height="79" /> </div> .aligncenter { display: block; margin-left: auto; margin-right: auto; } I know there is only one with a different width but it is all I had.
  9. I have had the same problem with the clear float. I think it is a html 5 issue although I am just guessing. I also have never had the problem until I started working with html 5. The html layout is the way I was taught to do it. What I was taught was to make the wrapper followed by the header then nav then content then aside. I just mentioned the height 100% thing because it was in the css when I viewed source. I mentioned the margin thing because you had margin: auto; in your css and I thought it might be causing some of your alignment issues. Yes I should not have put px behind the 0 because it is not needed and what if I was redoing someone else's code and they put % some where after I set it to 0 then I would be causing myself problems. Most importantly, yes I want to know if I am wrong. I come here mostly know to help people out. If I give bad or wrong advice I want to be corrected right away. You are right through through years, about 5 for me, I have found that there are most often a couple of ways to get the result that you are looking for. I find this a lot when I am working on a site with my friend who has 14 years experience. Sometimes he uses what I come up saying that does look better then other times not. Thank you for your feed back, I do take congestive criticism very well. This is way I have pm'ed you a couple of times and asked you to look at my stuff to get your opinion.
  10. I see you added the clear fix. It is in the wrong place. Sorry I should have been more clear. It needs to be right before the opening footer tag. I said you could fix the img position problem by wrapping them in a div. Sorry another my bad, you can do the same by giving the img a id and then setting the right margin until you get the img away from the border. I do apologize I was on phone with my ex-turn early while reading and typing, not at all far to you. <img src="img/facebook.gif" alt="Join us on Facebook" id="faceBookimg"> or something like that I think your html is also wrong, it should be: <section id="content"> Your stuff in your section left here </section> <aside id="right"> Your side bar stuff </aside> <div class="clear"></div> <footer> </footer> You will have to adjust your top margin on your footer now. Now your content and aside will work just like the old xhtml. Speaking of that, you probably know this but in html 5 you can still just use divs just like xhtml instead of all the section and aside stuff. You have your #wrapper set to 960px so lets do this: #content { background: url(img/green.png); width: 810px; height: 100%; //You can do a height but not necessary the content will set the height. padding: 35px; } Your side bar: #right{ width: 150px; float: right; } You might try to use set margin left 810px on sidebar to see if that works then you will not have to float it salving your float problem. I am not sure if you will have to take the wrapper border into account. When you are setting margin auto I find it works better like this: margin: 0px auto 0px auto; On your green background img, url(img/green.png), why not just set the color with you css instead of an img. This is just my personal opinion but I always set a top margin, 20p to 30px, instead of the bottom margin.
  11. Just my own personal opinion, I have DR4 and do not use it at all anymore. I bought it for Collage because I needed it for class. I find that as I learned to code that I can actually type out the code faster then I can use my mouse and click through DW. For a code editor I like notepad++ it is free. If you like the DW set up of things like root folders and such the free version of Komodo Edit works that way. Stuff like opening a php or html file like DW does. Again just my opinion.
  12. I would suggest not to use root-relative links at all.
  13. Try this for the float problem, right above your footer in your html put: <div class="clear"></div> and I know I do not have to tell you but for those who may not know the css: .clear { clear:both; } For the img problem wrap each of your imgs in a separate div and position the div. Hope this works it has for me in the past with about the same problem.
  14. 1- <META HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE"> This directive indicates cached information should not be used and instead requests should be forwarded to the origin server. 2- <meta http-equiv="expires" content="0"> Setting the content to "0" tells the browsers to always load the page from the web server. But you can also tell the browsers how long to leave a page in cache. Instead of "0" you write the date, including time, that you would like the page to be reloaded from the server. Note, the time should be in Greenwich Mean Time (GMT) and written in the format Day, dd Mon yyyy hh:mm:ss. Like this: <meta http-equiv="expires" content="Thu, 19 Oct 2000 00:00:00 GMT"> I got these two from a Google search I have not tried them.
  15. I have wrote a long explanation on use id or class but LSW is a lot better writer then I. So I am going to refer you two to his article. http://www.killersites.com/community/index.php?/topic/75-two-basic-css-mistakes/ Also it must have been ok for me to post the links that I did because Andrea did not zap me, please read. Seance I started web designing four years ago, I know not very long, every tutorial paid or free and books that I have read goes into this. IT is much better practice to us id's over classes. Only use classes if you need to. My intent is not to make Andrea or benjaminmorgan mad, I apologize to you both ahead of time if I have. My intent is to help newbies to writing css to use good practice to start off with because it is hard to change a bad habit.
  16. I have the easiest solution, any way this is what I do. I have a sub-domain called test. This is where I test code on my server.
  17. My advice if you do not know where to find the .htaccess file do not use that method. Try Andrea's way or just change the .htm or .html to .php also change the links from <href whatever .htm to .php I think this is what she was saying anyway, but I could be wrong.
  18. This has been touched on a few times. Sorry, but I am going to again. As a beginner it is easy to get caught making everything a class. This is bad practice. To avoid another real long rant on my part I am going to give you some reading on this subject. I hope this is ok? If not I am sure Andrea will zap me. w3schools has the basic http://www.w3schools.com/css/css_id_class.asp tizg has a good article http://www.tizag.com/cssT/cssid.php css-tricks has a very good article http://css-tricks.com/the-difference-between-id-and-class/
  19. I know this is a little old and you might have it fixed. But just in-case, this can be done on your contact form if you did not do any sanitizing. To stop someone from putting tags in your contact form you need to add the strip_tag something like this: function sanitize($data) { return htmlentities(strip_tags(mysql_real_escape_string($data))); } This will stop any tags that the user puts in the contact form to change the output. By this I mean something like. In your contact form someone put in the username, <script>alert('Hello');</script> instead of a username.
  20. Like LSW said a cms is much easier to teach a client to use. But remember to make a child theme. You do not have to, but if you update the theme you will loose all of your customization's. Even though you tell your client not to update anything that you will take care of it for them for free, they may not listen and do it anyway. I found this out the heard way. If you just make them an editor they want to know way they are not an admin. One thing I do in making my proposal if offer six months of free training and a life time of free site maintenance like updates. Then put in so much an hour after that if they need you to come and show them how to do something again. This little bit in your contract will save you some headaches later on. Do not worry about not being the best designer, I do not. A fellow web designer gave me some good advice on learning to design and here it is. 1-Just keep working at it it will come. 2-Go and look at the fortune 500 company's web sites and do what they did.
  21. this is my $update_data $update_data = array( 'first_name' => $_POST['first_name'], 'last_name' => $_POST['last_name'], 'email' => $_POST['email'], ); Here is what I am doing for now to fix it. I went and committed everything out dealing with the errors and am moving on. This is a big project for someone who has only done tutorials of php on just what are functions, if statements etcetera. When I learn a little more I will come back and visit this some more. I thought I was ready for this because I do a lot of wordpress sites and can figure out what php I need to change or remove to make the site do what I want. I was wrong. Being a old school Marine it is really hard for me to admit defeat but here goes.
  22. grabenair

    multiple errors

    When I click the update user on the site I get all of these errors. I am so lost and flustered. When I put the print_R($update); die(); I get these errorrs with the query commited out. Warning: array_walk() [function.array-walk]: The argument should be an array in /home/sassy/public_html/cms/core/functions/users.php on line 5 Warning: Invalid argument supplied for foreach() in /home/sassy/public_html/cms/core/functions/users.php on line 6 When I uncommit the query and take out print_r($update); ie();I get this error: Parse error: syntax error, unexpected T_VARIABLE in /home/sassy/public_html/cms/core/functions/users.php on line 19 If Ben is checking this, if you did not delete the pm the info is the same if that helps you. I have not changed it yet. <?php function update_user($update_data){ global $session_user_id; $update = array(); line 5=> array_walk($update_data, 'array_sanitize'); foreach($update_data as $field=>$data){ $update[] = '`' . $field . '` = \'' . $data . '\''; } print_r($update); die(); //mysql_query("UPDATE `users` SET " . implode(', `, $update) . " WHERE `user_id` = . $session_user_id") or die(mysql_error()); } function activate($email, $email_code){ $email = mysql_real_escape_string($email); $email_code = mysql_real_escape_string($email_code); line 19=> if (mysql_result(mysql_query("SELECT COUNT(`user_id`) FROM `users` WHERE `email` = '$email' AND `email_code` = '$email_code' AND `active` = 0"), 0) == 1){ mysql_query("UPDATE `users` SET `active` = 1 WHERE `email` = '$email'"); return true; }else{ return false; } } function change_password($user_id, $password){ $user_id = (int)$user_id; $password = md5($password); mysql_query("UPDATE `users` SET `password` = '$password' WHERE `user_id` = $user_id"); } function register_user($register_data){ array_walk($register_data, 'array_sanitize'); $register_data['password'] = md5($register_data['password']); $fields = '`' . implode('`, `', array_keys($register_data)) . '`'; $data = '\'' . implode('\', \'', $register_data) . '\''; mysql_query("INSERT INTO `users` ($fields) VALUES ($data)"); email($register_data['email'], 'Activate your account', "Hello " . $register_data['first_name'] . ",\n\nYou need to activate your account to login, please use the link bellow:\n\nhttp://www.midwestwebdesignstudio.com/cms/activate.php?email=" . $register_data['email'] . "&email_code=" . $register_data['email_code'] . "\n\nThank You The web site goes here " ); } function user_count() { return mysql_result(mysql_query("SELECT COUNT(`user_id`)FROM `users` WHERE `active` = 1"), 0); } function user_data($user_id) { $data = array(); $user_id = (int)$user_id; $func_num_args = func_num_args(); $func_get_args= func_get_args(); if ($func_num_args > 1){ unset($func_get_args[0]); $fields = '`' . implode('`, `', $func_get_args) . '`'; $data = mysql_fetch_assoc(mysql_query("SELECT $fields FROM `users` WHERE `user_id` = $user_id")); return $data; } } function logged_in() { return (isset($_SESSION['user_id'])) ? true : false; } function user_exists($username){ $username = sanitize($username); return (mysql_result(mysql_query("SELECT COUNT(`user_id`) FROM `users` WHERE `username` = '$username'"), 0) == 1) ? true : false; } function email_exists($email){ $email = sanitize($email); return (mysql_result(mysql_query("SELECT COUNT(`user_id`) FROM `users` WHERE `email` = '$email'"), 0) == 1) ? true : false; } function user_active($username){ $username = sanitize($username); return (mysql_result(mysql_query("SELECT COUNT(`user_id`) FROM `users` WHERE `username` = '$username' AND `active` = 1"), 0) == 1) ? true : false; } function user_id_from_username($username){ $username = sanitize ($username); return mysql_result(mysql_query("SELECT `user_id` FROM `users` WHERE `username` = '$username' "), 0, 'user_id'); } function login($username, $password) { $user_id = user_id_from_username($username); $username =sanitize($username); $password = md5($password); return(mysql_result(mysql_query("SELECT COUNT(`user_id`) FROM `users` WHERE `username` = '$username' AND `password` = '$password'"),0) ==1) ? $user_id : false; } ?>
  23. I did what Andrea said I built some fake sites. Made them a sub domain. Linked a screen shot to them in my portfolio. Only people that read the url will notice it. That helped me get my first two clients pro-bono. When they asked why I would build there sites for free, I told them I need more sites in my portfolio to attract more business.
  24. I also use wordpress a lot. I look for a template with the functionality that I need and then customize the, you know, out of it. As far as those pesky posters go on my site I just block there url.
  25. I thought I would put out a BIG thank you to everyone here. Especially Ben, Andrea and LSW and not forgetting everyone else, just to many names. For taking the time out of there busy schedule to help us all out. I myself try to remember to come here and do what I can to help. But sometimes I forget when I get real busy. All of the people here are so polite. By this I mean there are no responses like lol'd like I get from other forms, that I do not go to anymore. So again a real BIG THANK YOU to ALL!! A side not a special thanks to Ben who took a lot of time yesterday, a Sunday, to help me with my learning of php.
×
×
  • Create New...