Jump to content

requinix

Administrators
  • Posts

    15,288
  • Joined

  • Last visited

  • Days Won

    436

Everything posted by requinix

  1. Don't allow multiple consecutive zeros, or do but reduce them, but do allow multiple consecutive zeros after a number? What? What are some examples of good and of bad values, and what makes them good or bad?
  2. Yeah, after disabling the main a { text-decoration:none } pages seem alright. Some oddities, like sometimes link text includes spaces so it looks like Home instead of Home, and unfortunately the rule is on a and not a[href] or a:link so it does catch some non-links (and besides, there are some non-links that have href=# so that's already an annoyance). And some minor things that probably don't matter have their own overrides. Something to think about. Meanwhile the user popup thing should be fine to do, doesn't seem like there will be any problem with it.
  3. It's not obvious that the username in the post has some sort of action, either. It's black in color with no underlines or styling. The "Posted" date is a link too - the link to go directly to a post. Frankly I don't like the overly unintrusive "this is a link but make sure the user can't tell by looking at it" approach currently common to web design - I know when I design something that has occasional links among lots of plain text, I underline to make it clear there's something there. off-topic edit: the "it's a link but you can't tell" reminds me of a '90s RPG series of games where you could talk with NPCs, and the way to "navigate" through dialog was to click on words. Like, the NPC would say "There's a box over in the corner", where "box" and "corner" would lead into the next response. But they weren't styled differently so you couldn't just scan the text for where to go next. Had to actually read and guess what to talk about. Still some of my favorite games ever, and occasionally I think about setting up DOSBox or a Windows 98 emulator to play them. then a few years later they remade them with a new engine in 3D... just wasn't the same...
  4. The change would be that clicking (with Javascript enabled) does the popup instead. At least. Preferably clicking with the popup visible goes to the page like normal.
  5. Changing it to pop up on click is fine with me. I'll look into it - it's an IPB thing to do stuff on hover, and I'm not sure there is built-in support for doing popups like that on click.
  6. You know that "some action" includes just moving the mouse away, right?
  7. The $params are filling the placeholders when the query gets executed. They need to match with what the query is trying to do. Just before you execute the query, dump out the contents of $params and the SQL query itself. Compare the two to make sure $params has the values the query needs it to have.
  8. Presumably "the query you just demonstrated" would be the query you had included in the post immediately before mine: SELECT players.deal_id, COUNT(players.deal_id) AS TotalPlayersByDeal, SUM(affiliate_deals.cpa) * COUNT(players.deal_id) AS affiliate_cpa_earnings FROM players INNER JOIN affiliate_deals ON affiliate_deals.affiliate_deal_id=players.deal_id WHERE players.affiliate_id=1 AND affiliate_deals.type = 'CPA' AND players.program_id=1 AND players.status=1 AND DATE(players.ftd_matched_Date) BETWEEN '2019-02-01' AND '2019-02-28' AND players.ftd_matched=1 OR players.affiliate_id=1 AND affiliate_deals.type = 'Hybrid' AND players.program_id=1 AND players.status=1 AND DATE(players.ftd_matched_Date) BETWEEN '2019-02-01' AND '2019-02-28' AND players.ftd_matched=1 GROUP BY players.deal_id, players.player_id
  9. Kinda hard to tell what code to add for the options or toppings or whatever if we can't see the code that adds the options or toppings or whatever.
  10. Ah, okay, found the bug. Check your $params array more closely. What each item inside will be. Compare with the query that tries to use it.
  11. Put your PDO into exception throwing mode and try again.
  12. 1. Look at PHP's filter functions. 2. No? The "link" is just text. Like any other text. 3. Now that you aren't encoding it, don't decode it. Yes, store it in your database (using proper procedures). Go ahead and implement it, then post what you did and we'll look over it.
  13. Yeah, except while you added the player_id grouping you removed it from the columns to return. So there's no point. Take the query you just demonstrated and remove the GROUP BY on player_id.
  14. https://www.lifewire.com/setfacl-linux-command-4093520 setfacl is your only option. If you cannot use it then you must give up on either the ownership or the permissions.
  15. Well no, there's still more to this that should be addressed. SELECT players.player_id, players.deal_id, affiliate_deals.cpa, COUNT(players.deal_id) AS TotalPlayersByDeal, SUM(affiliate_deals.cpa) * COUNT(players.deal_id) AS affiliate_cpa_earnings FROM players INNER JOIN affiliate_deals ON affiliate_deals.affiliate_deal_id=players.deal_id WHERE players.affiliate_id=1 AND affiliate_deals.type = 'CPA' AND players.program_id=1 AND players.status=1 AND DATE(players.ftd_matched_Date) BETWEEN '2019-02-01' AND '2019-02-28' AND players.ftd_matched=1 OR players.affiliate_id=1 AND affiliate_deals.type = 'Hybrid' AND players.program_id=1 AND players.status=1 AND DATE(players.ftd_matched_Date) BETWEEN '2019-02-01' AND '2019-02-28' AND players.ftd_matched=1 GROUP BY players.deal_id When GROUPing BY something, you should only be SELECTing that particular something. Or if it's unique to a table, you could get it and other columns from that table. You are grouping on the players.deal_id, which is not a unique column in the players table. AFAIK. That means it only makes sense to SELECT players.deal_id. In MySQL, if you try other columns then you'll get some almost random value from one of the rows that got grouped together; some other databases like PostgreSQL are strict about not letting you do this. You want the player_id, deal_id, and cpa. The deal_id is unique to affiliate_deals, I think, so if you GROUP BY deal_id (either in the players or affiliate_deals table, it's the same value) then you can also get the cpa, but you can't safely get the player_id. You need to GROUP BY players.deal_id /* aka affiliate_deals.affiliate_deal_id */, players.player_id That will very likely change some of your numbers, but even if you don't recognize that now it is changing for the better. Or if it isn't then it's pointing out a problem with this query you didn't know you had.
  16. Could you try a more specific question?
  17. It would be equivalent to SUM(affiliate_deals.cpa) * COUNT(players.deal_id)
  18. Where's your JOIN for the players table?
  19. It's more obvious than you think: INNER JOIN affiliate_deals ON affiliate_deals.program_id=players.program_id AND affiliate_deals.affiliate_deal_id=players.deal_id (I know you wanted to fill in some details, and that's great, but this is literally just a matter of adding the "AND...")
  20. It occurs to me that maybe you don't know you can combine multiple conditions into an ON clause. It's not just one single thing. It's a full expression. You can put whatever you want in there. I had capitalized that "AND" in my reply hoping maybe you would connect the dots...
  21. So... problem solved?
  22. So what you're saying is that rows in the players and affiliate_deals tables are related to each other if affiliate_deals.program_id = players.program_id AND affiliate_deals.affiliate_deal_id = players.deal_id?
  23. Try picking up React(js). Installing it, its requirements, and the typical packages necessary to work with it, totals something like 16k files and a few hundred MBs.
  24. I'm certainly not going to be the first person in line to say that Laravel is a good framework, I have to work with it every day and I hate it, but as far as MVC is concerned I think it does a fairly reasonable job of it. Sticking with the aircraft analogy, I see what I'm suggesting more like sitting in the copilot's seat: as long as one has the mentality of learning how stuff works rather than trying to shoe-horn their experience into it, seeing how a professional system does the job is a good thing. Yes, Laravel has a lot of crappy magic in it, debugging the internals is hell, and the few parts it does well are beyond the scope of learning MVC, but the point is not to copy and paste but to understand the principles. Like for MVC, routing goes through some configuration layer (routing), to a controller, to a view. If I had more experience with other larger frameworks then I'm sure I would rather recommend them. Have I mentioned I don't like Laravel? The real basics, like cutting down on procedural coding or improving code quality and reuse, can be learned anywhere, and I think doing that in a framework which already tries to urge you into it is as good a place as any. In fact using a framework is like the middle seat: you don't have the window to look out unless you're sly and you don't have the aisle to stretch out into, so you have to learn to stay within the boundaries established for you. Yes, that analogy was rather turbulent, but I've reached a cruising altitude with this aviation metaphor and I don't want to land while I still have fuel in the tank.
  25. A JOIN will find all combinations of rows that match your conditions. If you look at the results, every row has slightly different data - the player_id, stats_date, or type. Each of those rows fits your criteria, so if you don't want some of them then you need to adjust the conditions accordingly.
×
×
  • 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.