Jump to content

kicken

Gurus
  • Posts

    4,704
  • Joined

  • Last visited

  • Days Won

    179

Everything posted by kicken

  1. It would help considerably if you actually provided a link to your project in your post, as well as perhaps details. People are not going to clicking around your profile to find the URL to your page. Instead they are going to do like I did the first time I viewed your post. "That's cool, wonder what it is he's doing. Maybe he'll post details later. *close tab*"
  2. If you have concurrent connections at any level you might run into issues with an fopen approach. You need to make sure you implement file locking to prevent multiple scripts from accessing the file at the same time. With a mysql approach you won't have to worry about the locking (assuming you do an UPDATE rather than SELECT+UPDATE combo). That will make it a bit easier to manage.
  3. Did you fix the query by adding parenthesis around your condidtions, as stated by PFMaBiSmAd? The way your WHERE is written if will be interepreted as: WHERE (titles.channel_id = '4' AND titles.status = 'Active' AND assets_entries.field_id = '84' AND matrix.col_id_3 > (DATE_FORMAT(NOW(), '%Y%m%d')) AND MONTH(matrix.col_id_3) = '{segment_4}') OR (MONTH(matrix.col_id_4) = '{segment_4}') In other words, either all those and conditions must be true, or the single condition on the end must be true in order to select a row. So you'll pull any rows where MONTH(matrix.col_id_4) = '{segment_4}' regardless of the state of all your other conditionals. I am assuming you want the two MONTH() conditions to be grouped together, in which case you have to enclose them both in a set of parenthesis: WHERE titles.channel_id = '4' AND titles.status = 'Active' AND assets_entries.field_id = '84' AND matrix.col_id_3 > (DATE_FORMAT(NOW(), '%Y%m%d')) AND (MONTH(matrix.col_id_3) = '{segment_4}' OR MONTH(matrix.col_id_4) = '{segment_4}') Written that way, then every row must match the first four conditions, as well as one of the two possible MONTH based conditions.
  4. Forgot the GROUP BY clause SELECT l.EventTime, c.CharName16, c.CurLevel, g.ID, g.Name FROM [sRO_VT_LOG].[dbo].[_LogEventChar] AS l INNER JOIN [sRO_VT_SHARD].[dbo].[_Char] AS c on c.CharID = l.CharID INNER JOIN [sRO_VT_SHARD].[dbo].[_Guild] AS g on g.ID = c.GuildID LEFT JOIN ( SELECT s.CharID, MAX(s.EventTime) as lastLogout FROM [sRO_VT_LOG].[dbo].[_LogEventChar] AS s WHERE s.EventID = 6 GROUP BY s.CharID ) as lastLogout on lastLogout.CharID = l.CharID WHERE l.EventID = 4 AND l.EventTime > lastLogout.lastLogout ORDER BY l.EventTime DESC
  5. Run them through strtolower first to make everything lowercase, then run them through ucfirst to make the first letter uppercase.
  6. Use number_format instead of round.
  7. Is this a VARCHAR field and not a DATE field? I'm going to assume so based on the way the question is written. If it is a date field though you could just compare directly to NOW(). The DATE_FORMAT field is not like PHP's date function. It takes %-style identifiers for the different part of the dates. The proper way to write that line would be like so: AND matrix.col_id_3 > (DATE_FORMAT(NOW(), '%Y%m%d'))
  8. Chrome has it's developer tools, which is basically what firebug is. I personally think chrome's are far easier to use than firebug is. It doesn't have anything like tamper data built-in, but there are other tools out there one could use to do that if necessary, such as Fiddler2. I don't generally find such an extension all that necessary in my work.
  9. Try a query like this one to get the online users list SELECT l.EventTime, c.CharName16, c.CurLevel, g.ID, g.Name FROM [sRO_VT_LOG].[dbo].[_LogEventChar] AS l INNER JOIN [sRO_VT_SHARD].[dbo].[_Char] AS c on c.CharID = l.CharID INNER JOIN [sRO_VT_SHARD].[dbo].[_Guild] AS g on g.ID = c.GuildID LEFT JOIN ( SELECT s.CharID, MAX(s.EventTime) as lastLogout FROM [sRO_VT_LOG].[dbo].[_LogEventChar] AS s WHERE s.EventID = 6 ) as lastLogout on lastLogout.CharID = l.CharID WHERE l.EventID = 4 AND l.EventTime > lastLogout.lastLogout ORDER BY l.EventTime DESC
  10. global level variables are not automatically available within functions. In order to import them you need to use the global keyword. It's preferable not to use globals though and instead pass them in as a parameter when you call a function (or construct your class).
  11. The toggle sticks, you don't have to do it every time. I don't anyway. I just toggled it off when replying in the test board and it's stayed off for every other post I've done since.
  12. If you don't care much about the wysiwyg stuff you can disable that part of the editor and it seems to work fine regarding preserving indentation. I can foresee a lot of messy posts from new users though if it messes things up by default.
  13. Your own article link agrees with .josh emphasis added. I've had on occasion in the past certain software that I like come out with a new version I don't like. Most of the time the existing software has been good enough so I continue to use it vs upgrade. I'd be rather upset if it just force-upgraded me into something I didn't want because they think they know better about what I need. As a somewhat current example, windows 8. I've tried it and I don't much care for it. I would be rather upset if MS just came along and auto-updated me to windows 8 without my consent. Sure, which is why MS has made leaps and bounds trying get IE caught up with the rest of the world. At this point they have caught up to the point that their produce is as good as anyone else's for the vast majority of people.
  14. You could just do: $search = str_pos(",{$numbers},", ',8,'); I'd probably go with the explode/in_array solution though, it's a bit more proper.
  15. It is indeed MS's fault. Why would you NOT have silent updates? MS makes as good as effort as any other place really in trying to get people to update. They push out their updates using an automatic update system which under a typical install will silently update all your stuff automatically. People who do not update don't because they either 1) Choose not to or 2) Are in an environment where they can't Unless you like living on the bleeding edge of new tech IE has been perfectly fine since version 8 generally. And if you are one of those people that wants to live on the bleeding edge then you're the one causing yourself problems, not MS or IE. That hasn't been true since Vista. HTML5 and a good chunk of CSS3 has not even been finalized yet. Why should MS expend a bunch of effort implementing stuff that may change? MS is just a little bit more conservative on what they choose to implement. If something is brand spanking new and changes every couple months they tend to leave it alone. Once it get more stable they will implement it. Again, if you want to be using these brand new not even standardized yet features, then don't complain when things either don't support them, or support an older/different spec. All that said, I am myself a fan of chrome and wish the whole world ran on it, but I also agree with .josh in that a lot of people are bashing IE these days when there is no good reason to be doing so anymore.
  16. Did you forget your opening <?php tag in the include file?
  17. The best you can do without involving a server plugin/php extension of some sort is to make the code hard to read by doing things like replacing the variable names with incomprehensible messes. Similar to most JS minifiers these days that replace variable names with single letters and remove all spaces and what not.
  18. There is no need for you to call opendir and closedir, those are only necessary if you are listing files in a folder. Your readfile() call is failing because it can't find the file. You need to include the path of the file there as well: readfile("admin/upload/$file");
  19. How about don't post all your code on one line? Maybe then you'll get some actual help.
  20. DateTime constructor does take a time string, same as strtotime() more or less. To use a timestamp you'd need to pass the string '@1234567'. What kind of a value does $KickOffMatches[2] contain?
  21. If you specify an ID, your function only returns a single-level array (one specific entry) with the column names as keys. Your small bit of code for the nav menu assumes that it will be a two-level array though (a list of entries). As a result when you try and foreach through it, your assigning a string value you your $entrynav (as in $entrynav="Some post title";) variable then trying to access $entrynav['title'] which is obviously not right since strings don't have keys. You need to either make your function always return a list of entries (even if it's a list of one) or add your $fulldisp check to the nav menu part as well.
  22. Lots of people post really simple reviews like 'They worked great' or 'Support was good' without any particular evidence to back it up, same goes for negative reviews. Why are you being a hater on this guy/Linode? He did actually post a reason why he likes linode ("Their support crew helped me set up a redundant private network, even though I was on their most basic plan at the time!" aka They have good support). I happen to agree that Linode is one of the best companies I have used. One of my Linodes was poorly configured once and started eating up disk IO like crazy causing other nodes on that host to slow down. Rather than them just shut it down like some places would they sent me a nice email asking me to please reconfigure it to not use so many resources. Aside from wishing I could get more for less $$ (who doesn't?), I've no complaints with linode. Their services has been great, their control panel is fantastic and very easy to use, I've had 100% uptime, and the two times I've needed to talk to support they have responded promptly and courteously.
  23. I mainly use vim for things like editing config files or quick edits on the server. For "real work" I use edit+ to either edit local copies (if it's a site in SVN) or edit remotely via SFTP (built into editor). Of all the commandline editors VIM is the one I prefer though. I know enough commands to do a pretty decent job. I also tend to get into a always state of typing :wq into everything if I've spent a day editing config files or something lol.
  24. They did an update some time ago, don't remember when exactly, that made the dns editor and domain management screens fairly nice to use, better than most other options I've seen anyway. The rest of their UI stuff is pretty crappy still. I've been kinda shopping around a bit for a place to transfer my domains to but haven't decided on any place yet.
  25. I see people saying 'That should be a core function!' way too often sometimes. It's like they wont be happy til every script can be written as <?php pleaseDoWhatIwantKThnxBai(); ?>
×
×
  • 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.