Jump to content

requinix

Administrators
  • Content count

    10,478
  • Joined

  • Last visited

  • Days Won

    180

requinix last won the day on December 10

requinix had the most liked content!

Community Reputation

706 Excellent

About requinix

  • Rank
    Backwards Administrator

Profile Information

  • Gender
    Not Telling
  • Location
    America/Los_Angeles

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. requinix

    help with charge formula

    Have you tried any other changes, more than what you had initially attempted?
  2. requinix

    help with charge formula

    Earlier there is code that looks up each video to play and adds the amounts (or defaults) to get the total cost to the user to play the videos. You see it and how it works? It grabs each video according to the ID. Then you have code that credits the uploaders of the videos. It also grabs each video according to the ID. And just like how the earlier code was getting the value from it, you can get the value. And you can use that value (or the default) to calculate how much the uploader should get. Very much like how the earlier code did it. Give it a shot and post what you came up with if you have problems.
  3. requinix

    help with charge formula

    That's the thing. Currently that would not be the case. Because the amount they are credited is calculated as half of $video_cost which is the default price. If they set a higher amount, they still only get half of the default and the site gets the rest. If they set their video with a custom price of half the default price, they would get 100% of the cost and the site would get nothing. Again, half of the default price. You already have an example: the earlier code that was calculating the total for all the videos to play.
  4. requinix

    help with charge formula

    Yes, if you want to use a $video_play_price variable then it has to be defined somewhere. But don't. Remember how the "video get data" code got the price from $video if set or the default if not? You do the same thing when crediting the uploader. Which means that $uploader_amount variable isn't useful, as it doesn't account for the video price. To be clear, either (a) your existing code has a bug that the uploader only gets half the default video price and your site keeps the rest, or (b) it's not a bug because that's what is supposed to happen... but I doubt this because that would mean the uploader is setting a price for you that doesn't affect what they get. Anyways, if $video->video_play_price is set then it's the price set by the uploader, and if it's not set then the video amount is $video_cost. Do whatever you want with that value, like *0.5 if the uploader gets 50%.
  5. requinix

    help with charge formula

    Maybe it'll help if you can understand what the variables all represent. * $video_cost is the default price for videos, because some videos might have a different amount * $amout is the total cost to play the videos requested, and will use the video amount if there is one instead of the default $video_cost * $charge is how much the site makes (?) per video * $uploader_amount is supposed to be how much the uploader of each video to view gets for the view, and originally is the default video amount minus $charge Like Barand said, the next question is what you want the site to do, and that's a business question not a coding question.
  6. requinix

    Update MySQL table from 2 or 3 other tables

    Your description would probably make a lot more sense if we could see the table structures and some sample data.
  7. requinix

    fatal error: call to a member function

    It's the title: call to a member function on a non-object. The sad thing is that it should even point out the exact line where the problem is, which is just about as far as anyone can go to saying what the problem is without actually stating it.
  8. requinix

    fatal error: call to a member function

    I don't suppose you mis-copied the bit of code about where the error message comes from?
  9. requinix

    Setting deep object properties

    Oh, so the problem is that you don't know if ->a, ->b, or ->c are defined. I would deal with the data as an array and not an object, and array_replace_recursive.
  10. requinix

    Setting deep object properties

    Something cleaner? isset($config->a->b->c->x) || $config->a->b->c->x = 321; isset($config->a->b->c->y) || $config->a->b->c->y = 321; Remember that isset() also covers the case where the value exists but is null. It's cool to have something that can arbitrarily set properties, but make sure what you have to give up in return is worth it. Here, I don't think you're gaining nearly enough for the sacrifice in readability.
  11. requinix

    JS for radio button TEXT content

    Start by understanding what the code I posted is supposed to do. Then you need to change one place in it so that it works for you. Then you need to use it correctly.
  12. requinix

    JS for radio button TEXT content

    You can search the document for the corresponding label using document.querySelector("label[for='" + this.id + "']")
  13. requinix

    JS for radio button TEXT content

    I would put the text in an attribute on the input, like <input type="radio" name="group1" value="mommy" checked data-title="i want to see this: mommy hands"> i want to see this: mommy hands because I think what you need to do is slightly different from what you're trying to do. There's also aria-labelledby. For getting text on a label, use a <label> as the parentNode. <label><input type="radio" name="group1" value="mommy" checked> i want to see this: mommy hands</label> If the text isn't next to the radio button in the markup then use aria-labelledby and a <label> like <input id="group1_mommy" type="radio" name="group1" value="mommy" checked aria-labelledby="group1_mommy_label"> <label id="group1_mommy_label" for="group1_mommy">i want to see this: mommy hands</label>
  14. requinix

    mysqli affected rows not working with INSERT

    #define HTTPC_ERROR_READ_TIMEOUT (-11)
  15. requinix

    mysqli affected rows not working with INSERT

    What is the name of it? Where can it be viewed online?
×

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.