Jump to content

possien

Members
  • Posts

    80
  • Joined

  • Last visited

  • Days Won

    2

possien last won the day on April 5 2014

possien had the most liked content!

Contact Methods

  • Website URL
    https://sites.google.com/site/cochisebiz/

Profile Information

  • Gender
    Male
  • Location
    Arizona
  • Interests
    PHP Javascirpt CSS Flying Drones, RC Planes, Motorcycle racing

possien's Achievements

Member

Member (2/5)

4

Reputation

  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>
×
×
  • 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.