Jump to content

requinix

Administrators
  • Posts

    15,227
  • Joined

  • Last visited

  • Days Won

    427

Everything posted by requinix

  1. That code sure looks unreadable in that shape, don't you think? Try replying with your code again, but use the Code <> button this time.
  2. What code have you written so far, what did it do, and what did you expect it to do?
  3. The preg* functions require delimiters around the regex. $resultOutput2 = preg_match_all('/gpononu.*\n.*?$/', $resultOutput1); Flags like /g (which doesn't exist in PHP because that's what preg_match_all does) and /m (which you'll want here) would be added after them.
  4. Don't write CSV lines yourself. Use fputcsv.
  5. Also, the warning is during compilation, which makes it a E_COMPILE_WARNING and not a regular runtime E_WARNING.
  6. error_reporting() won't help you if there is an error detected while parsing the file that the code is in. In this case, since there is no other file where you could put the function call, set the error reporting you want with a CLI option. You know what's even better though? Fixing the problem the warning is telling you about.
  7. Does it have to be in your results? It would be really easy to just write a tiny bit of code that uses 0 if there aren't any ratings of a particular star count.
  8. Those two lines assume that something exists in $cellt when it, apparently, does not. Hard to tell why or what's going on from just this code... Is everything behaving the way you expect it to, besides the notices?
  9. If they're separate from each other then why are you altering the line-height? And is this visible somewhere we can see for ourselves?
  10. Not sure what markup you have, but the simplest solution seems to be putting the two lines into their own elements and positioning those as you want.
  11. How about a screenshot/image of what "close in" means?
  12. Huh, it's actually doing the thing I thought it wasn't... Only thing left I can think of would be skipping E_DEPRECATED messages. set_error_handler("error_handler", E_ALL & ~E_DEPRECATED);
  13. Given how dumb Smarty wants to be about this, suppressing the error looks like the only option. And since they're already doing that, I suspect you have a custom error handler? What's the code for that?
  14. I'll give this one more try: 1. I've already mentioned that include() will return a boolean. Specifically, true if it was able to include the file and false if it was not. 2. You are using <?= tags instead of regular <?php. Remind yourself of what the special <?= form does. Do you know what happens when you combine those two together?
  15. Post a sample of one of the times you did an include() that did not have this "1" problem.
  16. Look closer at what you have here <?=include '../subscribe/sub_countdown.php'?> and compare it to the other times you've done something similar.
  17. <?=include '../subscribe/sub_countdown.php'?> include() returns a boolean.
  18. Do not translate things like keywords } Başka { // else fonksiyon aa(){ // function aa or CSS 60 piksel /* 60px */ görünürlük: gizli;görüntü: yok; /* visibility: hidden; image: none; */ or events dc.addEventListener("tıklayın", dd); // click You can write in Turkish names when you are the one creating them - names like for variables or functions.
  19. If you need a single array then you'll have to do away with the prices objects and re-bundle their data into arrays. array( 0 => array( "prd" => 2380, "id" => "173489", "price" => "65.00", "stores" => array( "store 1", "store 2" ) ) ) Unless your spreadsheet builder thing is a pain, you could take that 0 => array and re-key it to the prd as 2380 => array. Similar to before, you can then use the prd every time to insert-or-update into this larger array: insert when there is no existing [2380] yet, update with array[2380]["stores"][] = "store 2" when it does exist.
  20. Then that makes it a little easier. Figure out which of prid and id is the unique identifier - they probably aren't both equally unique because then why would there be two of them? - and use that for your array keys. You end up with arrays that look like $allPrices = [ // picking id, 173489 => prices { #2698 #container... } ]; $pricesToStores = [ 173489 => [ 'store 1', 'store 2' ] ]; That keeps the prices objects in one place, and using the prid/id as the keys in both places means you can easily look up which stores any one is associated with.
  21. 1. You need an array to put all the data you're receiving. $newArray isn't the greatest name but it'll work for the moment. 2. For each price item you receive from the API, check if you have it in that array already: if so then update its list of stores, otherwise add it. It looks like $Data is: an array of prices, where each price is a "prices" object, and that object has a private "container" array of the data. The problem here is that you can't (nor, in fact, should) add anything to that container array: it pollutes the concept of the "prices" object with data it doesn't know about. In your shoes, I think I would change the above approach to be: you have two arrays, one of all the prices with no store data, and another that tells you which prices are in which store. The new approach is: 1. You need the one array for all the data - let's say "$allPrices". You need a second array just to associate prices with stores - let's say "$pricesToStores". 2. For each price item you receive from the API, add it to $allPrices. Because there will be duplicates, don't add it blindly but instead index the array by the unique identifier; that'll be either the "prd" or the "id", I can't tell. 3. At the same time, add information to $pricesToStores for the price item and the store. They should be indexed by the prd/id as well, and the array values can be the set of stores it was found in. There's probably a small issue though: when two stores have the same item, is the data for those two items exactly the same? I think not. My guess is that the "prd" will be the same but the "id" will not (or vice versa). If you simply keep one of the prices in $allPrices then you lose what the other ones were, so perhaps you might need to retain all the prices together in a sub-array. But if you have to do that, does the price data mention which store it came from already? Because if it does then the $pricesToStores array is pointless. So after all that, a question: what does the price data look like for 2+ stores that have the "same" one?
  22. My guess: because you're relying on elements IDs instead of classes. Can only use an ID once per page.
  23. No. That's not possible. How much further down this rabbit hole are you going to go?
  24. Don't. It won't accomplish anything.
×
×
  • 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.