Jump to content

requinix

Administrators
  • Content Count

    11,333
  • Joined

  • Last visited

  • Days Won

    221

Everything posted by requinix

  1. You have a query there already. It returns a count. If you don't want a count and you want data instead then change the query to suit...
  2. If I had MySQL on hand to test with then I would test whether the DATE format allows values like "0000-00-120" (120 days). If not then you can just use a regular text type. Combined with DATE_ADD or +INTERVAL you should be able to add that interval to your date values inside queries. That's if you need to do the date math in SQL. If it was just PHP then I'd still test the DATE format for its convenience, but otherwise you can use a standard interval format like "P120D" and PHP's date functions.
  3. If it's for passwords, password_hash and friends. If it's other purposes, the hash extension (assuming you want something other than MD5 or SHA1).
  4. Regexes cannot modify the text that they capture. You'll need to find another method.
  5. It wasn't 😛 Yours doesn't work properly for the year 2000.
  6. Storing the emails in the database does not mean copying them. It means that is the source of emails. There is no IMAP server anymore. There is nothing to delete. Attachments are not separate files. They're part of the email message itself. ...I'm not sure you actually understand what you're talking about anymore.
  7. If you're fine with your client being the only means to access emails then sure, go ahead and store them in a database. The process depends on your mail server, but generally they have some sort of plugin that would be relevant - run a script when a message arrives, something like that. If not, or if you don't have control over your mail server, then stick with PHP. You can cache email content in the database in order to reduce the bandwidth between PHP and the IMAP server, but you should still be querying it for basic information (eg, message lists) in case that's modified by some other mail client.
  8. Create a view for yourself that shows threads and the initial posts. It'll make life easier. Though I'm really skeptical that XenForo doesn't have a way to get that information sort of finding the first post for a given thread ID - after all, since there is an ID in the first place, surely there is some source generating that ID, right? Once you have the view the query to find users is trivial.
  9. I'd go with 'l' and 'j'. And you could use them both at once to check for "Friday 13".
  10. Yup. Personally I would also be tracking the nodes as members of the chart itself, but that's besides the point. Sounds too complicated. Speaking of complicated, you could create a NodeCollection object that offers iteration by category and series. The series and category objects then use that collection instead of managing their nodes manually. I'm leaning towards this. Having links on both ends makes it harder to move things around, as you have to remember to update both links, but it's not too unreasonable to do so. Meh. If the id isn't set then there's no operations to clear it, but instead it adds operations to check the value. More lines of code for no net benefit. The nodes must be cloned because they can/should only belong to one chart. No cloning means you are reusing them in two places. Same reason you have to clone the series and categories.
  11. Here's how Apache and PHP handle a request. Basically. 1. Browser sends a request to Apache. It has lots of information but all we care about is the URI (URL) that it wants. Such as "/topic/309212-apache22-with-php52-nothing-returned-from-php-on-xp/". 2. Apache takes that URL and figures out what file it corresponds to. There's a lot that can happen here, but what matters here is that Apache found a (in this case) .html file. 3a. Now it has to decide what to do with the file. Are there any modules configured that want to deal with .html files? No. Additionally, .html probably means the "text/html" type. Are there any modules to deal with text/html? No. Apache dumps the file out to the browser. 3b. Say it was a .php file instead. There are a couple ways to configure PHP but let's pick the file extension one. Any modules for .php? Yes: mod_php. Apache tells mod_php to do whatever it wants to do. 3c. The other method is very similar: nothing to handle .php, however Apache knows the file as application/x-php (or something) and there is a module (mod_php) to handle that. Apache doesn't care about what's in the file. It cares about what type of file it is, either by extension or by type. Your setup is presumably using the .php extension (or application/x-php-something type) because that's what normal people do. Thus Apache does not know your .html files should go through PHP. Thus what you need to do is actually tell Apache that you want .html (aka text/html) files to go through mod_php, and you do that by tweaking your current "set up PHP in Apache" configuration, which may be by extension or by type, to include HTML files.
  12. Here's my report: I don't see any problems in that output.
  13. And the problem is... that it's not replacing anything? Metacharacters like \e do not work in single-quoted strings.
  14. The most likely thing to have gone wrong is that you expect Apache to run .html files through PHP when basically nobody does that anymore. You have to edit the standard Apache+PHP setup so that it does what you want.
  15. Okay. What (PHP code) do you have now and what problem are you having with it?
  16. A deep copy/clone is when you clone an object and all the other objects "in" it. What you are doing now, where your __clone also clones the series and categories in it. A shallow copy is when you don't do that. You must clone nodes. You have to. Can't avoid that. So anything you come up with that doesn't clone the nodes will not work correctly. Cloning the nodes according to the series won't let you update the category. Cloning the nodes according to the categories won't let you update the series. So come up with another method: one that lets you discover all the nodes and update their series and category correctly. Hint: as you clone the series and categories, keep track of what which objects are taking the place of which old objects...
  17. What do you have now and what problem are you having with it?
  18. First, you need-- actually no, it can wait until you discover it for yourself. convertBash() takes a string line of output as an argument and returns a new string with HTML markup. fread() reads from the process and returns a string line of output. So instead of echoing the line of output, you run that line through convertBash and echo what it returns.
  19. Black is \e[1;30m where \e is a control character, like \n, and not literally a backslash + 'e'.
  20. You're missing that the escape sequence starts with a \033 (aka \e). And that's not a literal backslash, so if you add it into your $dictionary then you'll need to switch to double-quoted strings too.
  21. It's extremely unlikely that a Windows update broke this. Something else happened.
×
×
  • 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.