Jump to content


  • Posts

  • Joined

  • Last visited

  • Days Won


maxxd last won the day on May 6

maxxd had the most liked content!

About maxxd

Contact Methods

  • Website URL

Profile Information

  • Gender
    Not Telling
  • Location
    North Carolina

Recent Profile Visitors

17,351 profile views

maxxd's Achievements

Prolific Member

Prolific Member (5/5)




Community Answers

  1. You'll need to build an inner div, place it in the middle, column. Set the inner div to grid and style from there. <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Testing Grid</title> <style> *{ margin: 0; padding: 0; } body{ display: flex; justify-content: center; align-content: center; background: teal; } .outer-container{ background: lightcoral; margin: 0 auto; display: grid; grid-template-columns: 100px 1fr 100px; gap: 10px; justify-items: center; align-items: center; } .inner-container{ background: yellow; grid-column: 2 / 3; display: grid; grid-template-columns: repeat(2, 50%); grid-template-rows: auto; gap: 20px; } .block{ background-color: blue; padding: 20px; } </style> </head> <body> <section class="outer-container"> <div class="inner-container"> <div class="block"><img src="http://fpoimg.com/300x250?text=Preview" alt=""></div> <div class="block"><img src="http://fpoimg.com/300x250?text=Preview" alt=""></div> <div class="block"><img src="http://fpoimg.com/300x250?text=Preview" alt=""></div> <div class="block"><img src="http://fpoimg.com/300x250?text=Preview" alt=""></div> </div> </section> </body> </html> Pardon the eye-searing colors; I like to be able to see what I'm doing... Your mileage may vary with the widths you're using - I'm testing on a surface tablet so the screen is smaller.
  2. Unless there's a specific business reason to keep it, yeah. Programmatically it won't make a difference assuming you update any queries that currently try to select it.
  3. That's how I would set it up, yeah. The only other thing is I've seen using INT for price and storing all prices in the smallest unit of currency. I'm American (please don't judge me) and we use dollars and cents, so instead of 14.25 for a product save the data as 1425 then divide by 100 (100 cents per dollar). PHP and JavaScript can have some problems with floating-point calculations and rounding, especially when dividing or multiplying.
  4. So there are many things that should be improved on here, but the answer to your question is that your original query either failed or didn't return any results. Tell us what the error actually is. Having said that, there are some obvious things to do. First, make sure error reporting is turned on on your development machine so you can see when something goes wrong. Secondly, stop putting variables directly into your queries and use prepared statements. Finally, these two queries can easily be combined into one to save you resources and time.
  5. Not really sure what the purpose of productType is in this schema, but you're still attaching the price only to the product. If you fulfill an order in January, then raise the price on that product in March, when you run a historical report in August your accounting will be off. Track the price of the product at the time of the order in the orderItem table, then use that for all reporting.
  6. As Barand pointed out, each order only allows one product as of now; you'll need an order details table that tracks order number, product number, and product quantity. I'd also recommend tracking product price in the order details table as well, as this can fluctuate over time and you'll want an accurate historical record. I'd also recommend putting things like shipping address, as well as contact email and phone in a separate member order details table because people move, or order things to be shipped to different locations, etc. but I'm not sure if that's a concern for your current needs so take it with a grain of salt.
  7. I assume this is mysqli because insofar as I recall PDO doesn't have a `bind_result` method. Assuming I'm not off-base there, I'd recommend taking the plunge and switching to PDO if it's a possibility in your project - it's a much more fluent and easier to understand interface.
  8. If you're copying phpmailer.php into a directory manually you're not using the correct thing (or it's not being used correctly). PHPMailer is installed via composer and very well documented.
  9. Don't try to make the string yourself - javascript isn't actually expecting a string; it wants an encoded array or object. Given that, instead of concatenating a string and then finding a way to remove the final comma in order to return said string (let alone escaping and other things you'd need to deal with), make your life easier by building a simple PHP array in your while loop and then json_encode that array when you echo it. In javascript you can then JSON.parse() the returned value and use it.
  10. Beyond requinix's advice, https://github.com/barryvdh/laravel-debugbar is a popular package that helps with Laravel development.
  11. Highly recommend PHPMailer instead of native PHP mail(). It's much easier to use and offers robust debugging when you run into problems. I don't have direct experience (mostly because I haven't used native mail() in a long time) but PHPMailer is apparently more reliable as well.
  12. I'm not sure how WP handles the oEmbeds any more, but I'd say try firing your hook later. The third parameter to add_filter is a priority - set it to like 100 or something high. It's possible that somehow what you're doing is interfering with however WP handles oEmbeds in the content.
  13. If you're using webpack or a build process, you can uselet let jqueryui = require('jquery-ui'); That should give you access to the functionality through the jqueryui object.
  14. It sounds like you want to sort by geographical distance when searching address but by post ID when other fields are searched? If so there are a couple options - either you're doing the WP_Query call manually (the global $gmw_query variable makes me think this is the case) at which point check the search parameters and update the ORDER BY clause there. Or, this is hooked into a generic WP query at which point you'll want to use the posts_orderby hook to see if the post in question is a search and modify the ORDER BY clause appropriately.
  15. Hey y'all. I'm currently working on a project at work and it involves creating a package with assets. Laravel's ServiceProvider has the loadRoutesFrom() and loadViewsFrom() methods which are all well and good, but the only solution I can find in the documentation or code for syncing javascript, font, and style files from the package to the full Laravel install is to run the artisan publish command. This means I'd have to run the publish command every time I make a change which is clearly not a solution I'm excited about. My solution at the moment is to use a symlink from the compiled assets location in the package directory to the appropriate directories in the public webroot of the overriding install - all good and working except for one thing. When I use the mix() helper in my view to load the javascript files they can't be found [ie: <script src="{{ mix('packagename/js/main.js') }}"</script>] where packagename is the symlink; however, when I point directly to them it works perfectly [ie: <script src="packagename/js/mix.js"></script>]. The asset() helper function works just fine. My only concern with just linking directly is that now I can't use versioning in my mix build process, my tester has a computer that caches aggressively. TL;DR - has anyone come across a situation where Laravel's native mix() function can't traverse a symlink or is this something known in the php ecosystem that I've somehow never come across before?
  • 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.