-
Posts
15,290 -
Joined
-
Last visited
-
Days Won
436
Everything posted by requinix
-
Link would be nice.
-
Need help with shortcodes that take a specific URL or input
requinix replied to gabby25's topic in PHP Coding Help
Well... according to the code, it does use $url twice. Is it duplicated because it's duplicated? -
In the days before mobile was big, making a site mobile-friendly was often a matter of taking an existing site and disabling some of the nuisance CSS rules - centered margins, fancy effects, etc. That technique may not produce professional-level results by today's standards, but it can still be quite effective in a pinch.
-
Oh, weekly? That's quite a while to be out of date, though: that's potentially seven whole days for something to be inaccurate. You can probably update daily. Yeah, go ahead and switch to a cronjob script. That single script will go through all of the pages, beginning to end, grabbing the data it needs. After every page, slow down by sleep()ing for at 1 second - that being a number more than the 60/100 = 0.6 seconds per request bottleneck that you have to stay above. Then have the script run daily. Like, midnight. Or some other non-peak time.
-
There are different approaches for this sort of problem, ranging from on-demand cached API calls to background cronjobs. How important is it that your data is up to date? Ideally everything would be updated immediately, naturally, but since you can't do that, how old can your data be before it becomes unacceptably old?
-
No. That <meta> tells a browser to request the page. cronjobs don't use browsers. This doesn't smell right. Why are you hitting the API so often? Why does it have to "loop through again" when it reaches the end?
-
More or less. When in doubt, check the documentation, and in the case of WordPress, any related hooks documentation. Note that wp_enqueue_script does not say anything about a script ID.
-
Because of the other 50% of the internet that isn't mobile?
-
This isn't even a thing you "learn how" to do. It's like saying you want to learn how to unscrew a bottle lid. The ID comes from a place. Find where that place is, change it for fun, and then move on with your life.
-
Is there a downside to releasing now?
-
Script IDs never matter. Why do you want to change it?
-
What? Sure you do: that second server you were planning to use. The one where the domains redirect to, and where you were going to redirect from. Take that, add a virtualhost for a catch-all domain (so any domain that doesn't match some other known site), then give it a redirect to go to destinationtarget.com/(requested domain). It's one configuration that handles the redirects for every single domain you throw at it - assuming you all want them to use the same pattern for the redirect. Then you change the DNS for the domains you want to redirect from such that they resolve to that second server. Browser will look up "domain1.com" or "domain2.com" or "domain3.com", all of them resolve to that second server, browser asks the server for the webpage at that domain, server responds with a redirect to destinationtarget.com. In fact, that "second server" can simply be whatever server hosts destinationtarget.com. I mean, this redirect business is very lightweight. It's not going to add any noticeable load to anything. So there. You have a server that hosts destinationtarget.com. Give it a new configuration for a catch-all domain that does the redirect I said, then update the domains to point to that server. And if you decide to handle some redirected domains differently then you don't have to update DNS for anything.
-
Isn't that more complicated than it needs to be? Point each domain's DNS to some web server you control and have it issue the redirects. One place for everything.
-
WordPress isn't what we in the software development industry would call "good" or "well-designed", but at the very least it should be capable of dealing with custom database tables. Worst case you can use another for loop: it's fast and easy, even if inefficient. Any additional amount of time you want to invest in this is up to you.
-
If you didn't need an actual number then this is pretty easy: if name_of_deceased_2 has a value then you have at least two people, else if name_of_deceased_1 has a value then you have one person, else there is nobody in the grave. Assuming you fill those fields in order. The simplest way to get a count would be to do another for loop, except this one counts when the name_of_deceased_N field is filled instead of outputting something. A bit wasteful, having to get those fields multiple times. The clean way is to get all those fields into one array variable, such as one that looks like array( array( "name_of_deceased" => name, "burial_date" => date, "clergy_name" => name ), ... ) One for loop to get all the data into a better format than you have now, adding people to the list if the name is set, then you can get the count() of people easily and foreach on it to display. The ideal way is to not need to have 15 fields to cover 5 people in a grave. Are there ever graves with more than five people? What will you do then - add more fields? Having to add them like that every time is a sign of bad database design. What should be set up is a single table that has four fields: a grave identifier, the person's name, the burial date, and the clergyman's name. Then you get all burials for the grave, there's no limit on how many you can cover, and getting counts is easy.
-
What's the question, exactly? How to get the number of people buried so that you can decide whether to say "person" or "people"? At what point in the code do you need this? Will it come before or after that "who's buried" stuff you posted?
-
But why redirect and then redirect again? Why not just have domain1.com redirect to the place you want instead of some other place you don't want?
-
Doesn't have to be. You can tell it to redirect however and wherever you want.
-
need help to set current GPS position in existing map
requinix replied to pmonstad's topic in Javascript Help
Not me, no. If you insist that you can't do it yourself then we have a place you can post your job offer, but frankly, if the problem is that your knowledge is "far too limited" then this would be a really good chance to try to do something about that. -
My first reaction would be "don't use syslog for regular logging". It's fine for important things, but miscellaneous info and error messages can get lost in the sea of other activity.
-
need help to set current GPS position in existing map
requinix replied to pmonstad's topic in Javascript Help
One step at a time. 1. Update the code so that you can place a marker at some coordinates. Don't bother trying to geolocate anything. Just hardcode some numbers in there. Make sure it can be placed sometime after the map has been already fully initialized and drawn. 2. Update the code so that you can move that marker to some new coordinates. Again, no geolocation, just hardcode another set of numbers. Start by putting the marker at the first location like before, then use setTimeout have the marker reposition somewhere else 30 seconds later. 3. Update the code so that you can get past the geolocation permission prompt to get the first position. Then use that first position to place the marker at its first location for real. 4. Update the code so that you can "watch" for geolocation changes. Just console.log or alert the new coordinates so you can see it working. 5. Update the code so that the geolocation changes will reposition the marker. IIRC you don't have to do any "get the location every 30 seconds" work because the browser can simply tell you when the position changes. -
What is the value of $first and $second?
-
Do you only need a hint in the right direction? You can get the first day of week #1 by asking strtotime for "January 2 last Monday". That works because a) If January 2 is on a Monday then "last Monday" will go back a week - which is what you want because Jan 1 would be Sunday and thus part of the previous week b) If January 2 is on Tuesday-Sunday (note that span is all within the same week) then "last Monday" will go to the previous Monday - which is going to be the same week that January 1 is because it is sometime between Monday-Saturday
-
How to format the data retreived from an sql query with php
requinix replied to affordit2's topic in PHP Coding Help
...using nl2br. -
That's not true, no. But your entire site should be over HTTPS anyway, so...