Jump to content

possien

Members
  • Posts

    80
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by possien

  1. I agree with everything after "proposing procedural masked by OOP", as mentioned there is a great deal to OOP and you have to start somewhere. I am sure in his CMS there would be several integrated classes and your description of the image class is spot on. You are correct in saying there is a great deal to OOP but the main point I was trying to make was group self-sustainable objects and as you indicated, in a reusable fashion.
  2. Generally I group related functions together in classes, for example you could create "class img_functions{...}" for your related functions to images. The same for db, send mail, time formats, etc. This allows you to create functions within the classes that actually help you use other functions within the class. Extending classes and other OOP related advantages. You can cut the number of includes by autoloading classes. In general you actually cut down the work required to generate pages. There are also name spaces that are useful if your code is incorporated in other php apps. You already have a good start with the use of functions. Check out the PHP manual on classes to give you an idea on what can be expanded and made easier and more helpful.
  3. I would approach it a little differently. Rather than just email the webmaster with the info and pic, I would want something more permanent and extensible. For example something like: The customer fills out the form and submits a picture file (modify the form The customer receives an acknowledgement email The image is uploaded to a file location (/customer_image/some_pic.jpg) Database is used to capture the form information plus the filename of the image. Webmaster gets notified (and others) of inquiry. Webmaster goes to the query page and can review all customer queries and images (have to build page for this) Webmaster can click on customer link and respond to query (email response form). This response is also put in the database so if someone else needs the info or review. Additional responses to the customer could be sent from the response page and entered into the db. This would allow a permanent record of customer queries and responses. It takes a bit of work to send attachments in emails and would require a function being built to handle the mime types for attachments or you can find a package that provides this. With the amount of work, I would rather go with what I have described above. Either way you should update your functions file to use mysqli instead of mysql or use PDO, mysql is obsolete.
  4. Can you post functions.php file? Are you using a database?
  5. possien

    Simple Frames

    You can play with this code and tweek it to meet your needs. There are better ways in HTML5 and CSS3 to do this but this will give you an idea of how it works. Basically you create divisions within sections by floating divisions left or right. The total width cannot exceed 100% . I.e., the margins + borders + plus division widths <= 100%. You can use px, em, etc. but the math is easier with % .If you use px or em the total width of the elements can't exceed the total of the body width. You have to clear the float after to display the next section correctly. There is a better way to clear them but this is just and example. The height of each section can be pre-determined for your header and footer but for your main div content it is generally determined by the content itself. <!DOCTYPE HTML> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>Layout</title> <style> body{width:90%} #header{background:#ddd;height:200px;border:2px solid blue;} #header-right{float:right;width:32%;background:#555;height:200px;} #header-left{float:left;} #main{background:#98AFC7} .div-25{width:24%; background:#333;margin:.5%;border:2px solid blue;float:left;height:500px;} .div-50{width:48%; background:#ccc;margin: .5% 0;border:2px solid blue;float:left;height:500px;} #footer{height:200px;border:2px solid blue;} .clear{clear:both} </style> </head> <body> <div id="header"> <div id="header-right"><p>some text</p></div> <div id="header-left"><h1>Header</h2></div> <div class="clear"></div> </div> <div id="main"> <div class="div-25"></div> <div class="div-50"></div> <div class="div-25"></div> <div class="clear"></div> <div id="footer"></div> </div> </body> </html>
  6. So if the input box changes you want it to clear the value of 'title' and start new. You would have to compare the value of the text box to the previous input but you are hard coding the url for query. Does the url change?
  7. Your last line of code will keep appending the content with the previous content. Try something like: $("#artist").html(title);
  8. By default display:inline-block aligns on the bottom border. It also looks different in different browsers. Just a suggestion, you could simplify your css and put it the head section or a css page. You have a fixed width so you don't need a max width. <!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <title></title> <style type="text/css"> #Item_Output_Container{width:1670px;background-color:white;margin-top:25px;} .item{border:solid 5px; display:inline-block;width:150px;height:150px; padding:10px;font-size:10px;vertical-align:top;} </style> </head> <body> <div id="Item_Output_Container"> <div class="item"> 4-20 X 1 PHILLIPS PAN HEAD 48-2 TRILOBE THREAD FORMING SCREW CASE HARDENED STEEL TRIVALENT ZINC, BAKE & WAX ROHS COMPLIANT </div> <div class="item"> 6-19 X 1 PHILLIPS PAN HEAD 48-2 TRILOBE THREAD FORMING SCREW CASE HARDENED STEEL TRIVALENT ZINC, BAKE & WAX ROHS COMPLIANT </div> <div class="item"> 6-19 X 1 UNSLOTTED INDENTED HEX WASHER HEAD 48-2 TRILOBE THREAD FORMING SCREW CASE HARDENED STEEL TRIVALENT ZINC, BAKE & WAX ROHS COMPLIANT </div> </div> </body> </html>
  9. Thats true, you can do a simple date difference and return an array containing year and month. (see the PHP manual). Not sure what he is trying to do.
  10. I think I understand now. If you have for example $month = 36, that would be 2 years and 12 months, the maximum you need. So you would need to find the years and months up to that value: $month= 25; function month($month){ if($month < 13) { $month = $month; $year = 0; } elseif($month < 25){ $month = $month-12; $year = 1; } elseif($month < 37 ){ $month = $month-24; $year = 2; } echo 'Month: '.$month.'<br>'; echo 'Year: '.$year; } month($month); So, is this what you are trying to do? You can add $year to the current or other date plus get the month. THis evaluates from the lowest to highest value of $month.
  11. If you are extracting month from date('m') it's never going to be greater than 12?
  12. Are you just trying to return $month plus 1 and if $month is 13 it becomes 1? $month = date('m'); function month($month){ $month = ++$month; if($month >12)$month = 1; return $month; } echo month($month);
  13. I found without providing height and width it opens a new tab but this opens a new window: <script type="text/javascript" > function myfunction(){ window.open("http://example.com","mywindow","menubar=1,resizable=1,width=650,height=550"); } </script> You can add or delete parameters to hide status bars, menus, etc. You can add a button or text like this to open the new window: <a onclick="myfunction()">New Site</a>
  14. Basically it is a an RSS or XML request for a specific location (i.e. http://weather.yahooapis.com/forecastrss?w=12794688) . NOAA also provides weather feeds. You can research how to process and format these feeds using javascript, json, and/or php. You can, for example, create a user form for different locations in a drop down menu to retrieve and process feed data for cities in your area. There a numerous ways you can do it and it is somewhat involved.
  15. You might want to encapsulate the span and p with a div. I put a calc function to p width also. I tried this and it seems to work: p { float:left; width: 100%; width: calc(100% - 6.5em); } p span { min-width: 6.5em; float: left; min-height: 7em; } .together{min-height:3em;} Something like this: <div class="together"> <p> <span>My Label</span> Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat </p> </div> <div class="together"> <p> <span>My Label</span> Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. </p> </div>
  16. You're probably right. HTML5 wasn't around when IE7 was created. Here is a helpful site for different versions: http://quirksmode.org. There are several tags and CSS selectors that don't work on IE7.
  17. You could also use this instead without a second function: <script type="text/javascript"> function enable(){ var Path = window.location.pathname; var Page = "somepage.html"//where you want them to go; message = "Proceed to Site"; if(confirm(message)) location.href = Page ; } </script>
  18. Sorry, a couple of typos. What I was trying to do is when they click the first button, the text and first button is replaced by a second button. The second button references a second function to do what you want. You can display a nav menu or redirect them to a start page or what ever. Again, you can replace the proceed button with a nav menu or other html. This code works: <!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <title></title> <script type="text/javascript"> function enable(){ var next = '<button type=\"button\" onclick=\"goToSite()\">Proceed to Site</button>'; document.getElementById("wpsp-text").innerHTML=next; } function goToSite(){ //code to go or do something when they click the Proceed to Site button; } </script> </head> <body> <div id="wpsp-text"> You are about to enter a website that may contain content of an adult nature. These pages are designed for ADULTS ONLY and may include pictures and materials that some viewers may find offensive. If you are under the age of 18, if such material offends you, or if it is illegal to view such material in your community, please click away from this site now.<br> <button type="button" onclick="enable()">I agree to the Terms</button> </div> </body> </html> You can use css to dress it up. You could also use Jquery which to me is a little easier. You can use Jquery to create a dialog box. You could also use alert boxes, etc.
  19. Create a function to allow them to continue on to the site or page you want. On your "Agree to Terms" put a button like this: <button type="button" onclick="enable()">I agree to the Terms</button> Then the enable() function would have code to either hide the terms and hide the agree button something like: var continue = "<button type=\"button\" onclick=\"goToSite()\">Proceed to Site</button>"; document.getElementById("id="wpsp-text").innerHTML=continue; Then in the goToSite() function you can either redirect to a URL using javascript or whatever you like.
  20. Why not have the "Continue" button dependent on the "Agree to terms" button. If they agree, then the continue button is shown else nothing.
  21. As Barand indicated, let your calculation take care of the fee. Getting the year from their input you could use something like: <?php $years = strtotime('-8 years'); $ref_date = date('Y', $years); echo '<br />'; echo $ref_date.'<br/>'; $date_left = 2000; //example date from the form echo $date_left. '<br />'; if($date_left > $ref_date){//if less than 8 years it must be 7 or less $membership = 10;}// if less than 8 else $membership = 20;//if more than 7 echo $membership; ?> Use the $membership as the fee.
  22. I have to agree with renatov. I was primarily working in telecom and internet jobs and used web development to create my own tools and progressed from there. I found non-profits and NGO organizations a very good place to start. I chose to target veterans organizations since I am one and developed a couple for free. Because of my background, veterans groups knew I could relate to their needs. Word of mouth spread and I have several clients now. Many keep me on to maintain their sites for a monthly fee. Most charitable groups (small ones) usually have a member or friend that do their website and it's usually a mess. Who wouldn't want a professionally created website for free. I took it a step further and created a back end app that tracks membership, finances, meetings, minutes, profiles etc. that could be used by all small organizations. I use it in all my new websites as a promotion. It took me about 3-4 months to put it together but has paid off nicely. I still build some free sites but most of these organizations pay me a reasonable fee. You mention Aspergers, how great would it be to build a site or forum for the many organizations that support that cause? And to have their site built by someone with Aspergers.
  23. I always try to go simple first. Yes, the display on small devices would be crammed up. Moo tools, Jquery, Bootstrap and others are nice but it's nicer to understand what the basic concepts are that are being employed and build from that point. A simple media query to collapse the columns based on screen width works well. I have used a variety of jscript tools and they add a lot of overhead and server calls. Consider using 3g or 4g devices and having to download 100-200k of js, fonts, and css where only a small portion is used to obtain a grid view. It may take too long to load and the user moves on.
  24. You could do something fairly simple with css and a MySql Database. You might create a #main div for the ad content and a div class for the ad itself in css something like: #main{-moz-column-count: 3; -webkit-column-count: 3; -webkit-column-gap: 2px; column-count: 3;​} .ads_class{border: 2px solid blue; /*a border around each ad*/ padding: 5px; /*A little padding within ads*/} Assuming you are taking your ads from a database, within your #main div, it might look something like: <?php while($ads = mysqli_fetch_array($result)){ //assuming your table might have image, title, price, and text $photo = "<img src=thumbnails/".$ads['image']." width='75px'/>"; $title = "<h3>".$ads['title']."<h3>"; $price = $ads['price']; $text = $ads['msg_date']; echo "<div class='ads_class'>"; echo $photo; echo $title; echo $text; echo "</div>"; } ?> This will give you three columns of ads. You could also remove the columns and create a fixed width for the .ad_class divs and float the divs to the left but the results would not evenly stack.
  25. You might try this: th { padding-top: 9px; font-weight: bold; vertical-align: middle; } .formheader { text-align: center; font-size:1.5em; } just create a class called .formheader. You forgot the semi-colon after the text-align: center . The th tag is a decendent of the table tag so you don't need to reference it in css. You are only styling the th.
×
×
  • 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.