How to not show clicked adoptables
Title sense make none
Alrighty so i've spent ages and I don't know how to do this. XD Hopefully someone can help :c I have a random adoptables page that shows 10 random adoptables for people to click. It's pretty much just the random adopt thing from stats.php but with a limit of 10 instead of 5. :B What I want is for that page to only show (random 10 of) the adoptables that user hasn't clicked that day instead of any adoptable. :meow: |
Well this can get a bit tricky, you will need to utilize the other table in the database called prefix_vote_voters. Before displaying the owned adoptables available to click, filter out those who have been fed on the same day by the same user as it shows in table prefix_vote_voters. The rest of adoptables shown on the page will be those who are to be fed.
|
:P Alrighty I don't know how to do that.
Thanks for the help. ^^ |
No worries, I will give you more details on how to accomplish this. Can you show me what you've done with the 10 random adoptables page? It would be easier for me to tell you what to do this way, otherwise Id have to write an arbitrary script and explain some concepts that may not make much sense to you.
|
Yup yup
Code:
<?php |
Well here is the modified version of your script. Lemme know if it works and I will see what I can do to help you:
PHP Code:
|
:smile: Yaaaaay it works. Thanks so much for the help. :D
Well sometimes it doesn't always show 10 even if there's over 10 left (one refresh it showed 9 then 10 again after) or it'll show random amounts below 10 (if I don't click anything then one refresh it might show 2 then 5 then 3 or something). |
Oh I see, remove the 'LIMIT 10' from sql query and it should work for you.
The script uses a counter to check if the number of random adoptables loaded hit 10 or not, so this sql query is redundant and needs to be modified. Lemme know what happens once you revise the sql query, if it fails to function normally I will take a deeper look into the code. |
Yaaaaay it's fixed. :D
Thank you <3 |
You are very welcome, glad I can be of any help.
Hall of Famer |
All times are GMT -5. The time now is 09:10 AM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.