Bug Reports · Legacy archive

View UNVOTED Bug?

Started by Pieh Apr 12, 2011 25 posts Locked

  1. View UNVOTED Bug?

    #1

    A PHP Error was encountered

    Severity: Notice

    Message: Undefined variable: unvoted

    Filename: author/vauthor.php

    Line Number: 257



    A PHP Error was encountered

    Severity: Warning

    Message: Invalid argument supplied for foreach()

    Filename: author/vauthor.php

    Line Number: 257


    I see an UNVOTED tab on my author page, but clicking it yields those errors. IS this feature suppose to work yet? And why can't I see it on another author's page?
  2. Re: View UNVOTED Bug?

    #2
    I get the same error.
  3. Re: View UNVOTED Bug?

    #3
    I don't remember what it is supposed to do....or if it is suppose to be visible to anybody.

    I started coding it to show each author what they haven't voted on yet, but then realized it isn't just a quick call, I have to cull the voting data and combine it with the submissions to find what doesn't match and show it. Not sure how far I got in that though.

    Put it on my list to refix/finish.
  4. Re: View UNVOTED Bug?

    #4
    Done. BAM. A little left outer join action and...BAM.

    :)
  5. Re: View UNVOTED Bug?

    #5
    Oops. Still broke. This is what crashed the site last night. Have to find a more efficient query as it has to create some large temporary tables to develop the results. Is no bueno as it eats up all the memory and crashes the server. :)
  6. Re: View UNVOTED Bug?

    #6

    Have to find a more efficient query.


    If I'm understanding this correctly the idea is to allow a person to see what subs they haven;t voted on yet?

    How about changing this from a table list of everything you haven't voted on and simplify it?

    Have the script take stock of everything a person *has* voted on and then generate up to 10 random subs they haven't?

    This may make for less memory intensive generation (I'm pretty sure more subs exist one hasn't commented on then ones they have) and the short list would make it run faster and easier?
  7. Re: View UNVOTED Bug?

    #7
    Here is sort of what the issue is.

    There are 5685 submissions but the primary key is at 6312, which means there are 627 unused (deleted) spaces in the database that will never be filled, just they way it works. On top of that you have to account for those that the author has hidden. So if I just took the voted on and then grabbed some unvoted, there are probably a thousand blanks that could come up when it comes to displaying a random submission from what is left. You would still have to build a table of unvoted in order to choose one that will work that puts me back at collecting the unvoted.

    There are 46,375 comments/possible votes currently. I have to find the author comments with votes and match (or find those that don't match actually) against the 5685 submissions to actually see which submissions have not been voted on. There is where the large table size came from. Again, it would be smaller if I used what was voted on, but that leaves almost 1000 blank submissions that it has a chance to grab because nobody voted on what is not there. I am sort of forced grabbing the list of unvoted, I just did it poorly and can probably build an index on it as well to make it a little quicker.

  8. Re: View UNVOTED Bug?

    #8
    If I can help in any way, let me know.
  9. Re: View UNVOTED Bug?

    #9

    but that leaves almost 1000 blank submissions that it has a chance to grab because nobody voted on what is not there.


    Assuming these 1000 or so are "numbered/labeled" somehow would it be possible to easily create a one time script that registers them as already voted on by everyone? (Voted a 1 or whatever) Then they'd be removed from the call data base of un-voted entirely? (Setting it to exclude anything tagged as "in work" might also help reduce the number of blanks?)

    Failing that perhaps setting it to ignore subs that have a word count below x might be of use? (deleted subs would logically have a word count of zero?)

    Edit: Removing the subs with no votes at all from the result list might also solve the problem? (Given we already have the ability to view subs with no votes already afaik)
  10. Re: View UNVOTED Bug?

    #10
    Here's my attempt at trying to follow without the specifics:

    Would it make sense to do a query for subs filtered on public and excluding the user's own, then do a 'NOT IN' with a subquery that returns subs the user has commented on? That would save having to do an OUTER JOIN and skip the blanks.

    Or am I completely off base?
  11. Re: View UNVOTED Bug?

    #11
    Code Monkeys Unite!

    I thought I needed a left outer join but can't make it happy.

    In a nutshell, this one might be working but not sure yet, just released it. Waiting for the site to crash.

    SELECT `title`, `title_link`
    FROM (`lockmor_content` as a)
    LEFT OUTER JOIN `lockmor_comment` as b ON `a`.`content_id` `b`.`comment_parent`
    WHERE `a`.`author_id` '2'
    AND `b`.`comment_vote` > 1
    AND `a`.`show_content` = '1'
    LIMIT 20
  12. Re: View UNVOTED Bug?

    #12
    I could try a subquery, that is a thought I haven't messed with yet.

    (PS, I limited to subs not voted on is a continued experiment, not sure where I was going with that, trying to limit the returns. Also, the odd ' are from phpmyadmin. All the queries are currently visible at the bottom of the Citadel Profile page as they are in troubleshooting mode)
  13. Re: View UNVOTED Bug?

    #13
    I like your outside the box thinking Silveressa! Makes me contemplate!

    Word count would add a lot of extra work because I don't track that in a field. Unfortunately the blank 1000 are really just numbers that don't exist so they can't be marked in any way and I am not quite sure how a query would find them either, they simply aren't there. :) I probably could limit it to subs with no votes though, that is an interesting thought but there really aren't but a couple. Let me look really quick. Yeah, only like 3 in the entire Citadel so not very helpful. (will post them in sagely advice for love)

  14. Re: View UNVOTED Bug?

    #14
    This was my final answer:

    SELECT title, title_link
    FROM lockmor_content AS n
    LEFT JOIN (
    SELECT b.content_id
    FROM lockmor_comment AS bp
    JOIN lockmor_content AS b ON bp.comment_parent = b.content_id
    WHERE bp.comment_author =2
    AND bp.comment_vote
  15. Re: View UNVOTED Bug?

    #15
    What about using "ORDER BY RAND() LIMIT 100;" to randomize the result set?
  16. Re: View UNVOTED Bug?

    #16
    That would work but when I profiled it, it doubles the execution time by adding a temporary table to parse the random result set which also adds a chunk of memory usage just for that 1 query. Without random, it uses indexes really efficiently.

    Was going to start slow with it a little while and see if it is acceptable. Hoping people use browsing profiles to get the results vs. getting just random subs. If we *need* it I will add it though!
  17. Re: View UNVOTED Bug?

    #17
    View Unvoted on my profile page seems to be just showing a list of assorted old subs, mostly unvoted... probably just because they're old, but some I actually have voted on. I think that counts as a bug. Also, it would seem that the lists are similar (or the same) for each user, as the recent oldies Cheka dragged up are on my unvoted list.

    EDIT: Rereading the thread, seems like you intent wasn't random. Does that mean we are all suppose to see the same list? Regardless, I have voted on some of the ones showing up for me, even commented.
  18. Re: View UNVOTED Bug?

    #18
    Boils, still broke then.

    After midnight here and I have to get up in 5 hours so crashing. Looks like the accordion is broken on the profile pages too right now. Probably my jquery upgrade to make the search autocomplete work. Will fix that tomorrow as well.

    Sorry, will get this thing working!!
  19. Re: View UNVOTED Bug?

    #19
    And, no, each list of submissions should be unique to the user...insofar as what you haven't voted. The old ones, which are by default brought up first, might be similar for most everybody if they all didn't vote on them.

    Holding off on the random, ordered by input right now till I get it settled. Random doesn't give us troubleshooting stuff. So if you comment on one of them, does it disappear or stay there, that type of thing.
  20. Re: View UNVOTED Bug?

    #20
    Ones commented on stay there And one's commented on before the list was implemented are there. Right now, it is just a list of the first 100 submissions to the citadel, it seems.
  21. Re: View UNVOTED Bug?

    #21
    I downed it to 20 for now and took it out of some logic to see what happens. Confuses me since I don't seem to have these same issues....and there is no admin switches around it which would normally cause me to see something different.

    We will get there!! :)
  22. Re: View UNVOTED Bug?

    #22
    Well, now I can see my own submissions on my profile under unvoted... Seems to be ones I haven't commented on myself, if no uncommented then I have no idea what of my subs it is showing me. Still no tab on other author's pages.
  23. Re: View UNVOTED Bug?

    #23
    Found the bastard!!!

    Whether it works or not may be in questions, but you should be able to see it now at least.

    It should be "uncommented" at the moment. I also removed the vote switch from it.
  24. Re: View UNVOTED Bug?

    #24
    Of course, after I tell you (and myself) that I was going to bed, I find myself wide awake and wandering back here... And yes, it works as expected now. :D
  25. Re: View UNVOTED Bug?

    #25
    Hurray!

Bug Reports · All categories · Guildhall