SourceForge has been redesigned. Learn more.
Close

Various bugs/issues

Help
sksource
2010-03-17
2013-03-27
  • sksource

    sksource - 2010-03-17

    Here are a few items which just don't work…

    1) I can not see any form of "smack talk" on my site.  Where does this show and should it be showing all the time or only after I close submissions?

    2) The number of participants on the front page is blank.  This worked in the pre-forked version.

    3) When I go to the admin area and go to (Re)configure the site - none of the data that's already been entered gets repopulated in the UI.  This is very frustrating.

    4) Blog posts just don't work via the UI.  I have to always just enter one with a single title, subtitle, and entry.  Then go into phpmyadmin and edit the entry by hand.

     
  • sksource

    sksource - 2010-03-17

    I fixed #2, in sidebar.php change

            $query = "SELECT COUNT(email) FROM `users`";
            $participants = mysql_query($query,$db);
            $participants = @mysql_fetch_array($participants);
    

    to

            $query = "SELECT COUNT(DISTINCT email) FROM `brackets`";
            $participants = mysql_query($query,$db);
            $participants = @mysql_fetch_array($participants);
    

    I'd recommend putting this in the next release. 

    Other items still are b0rked.

     
  • cnyballer

    cnyballer - 2010-03-17

    #1 Smacktalk - you'll be able to use that once the brackets are closed

    #2 I don't see that issue, works for me

    #3 Agreed

    #4 Blog posts work for me via the UI

     
  • sksource

    sksource - 2010-03-17

    Valvo - thx

    I see the smacktalk in my test site since I've locked down submissions

    #2 - I don't see how?  The code references a "users" table, which doesn't appear to exist in the schema for the latest version.  The change which I showed above did resolve it for me, but I'm not sure how it would be working otherwise?

    #4 - Blog Posts - The problem is that if any of the fields contain an apostrophe ('), the post will never be entered into the DB.  If your post doesn't contain a ', then it'll save and publish.  Apparently, this is another example of improperly escaping apostrophes.

     
  • cnyballer

    cnyballer - 2010-03-17

    #2 Ah, I see what you mean now.  The "Participant" is blank .  Thanks for the fix for that!

     
  • Botag

    Botag - 2010-03-18

    @sksource, I think the intent of the participants count was to count the number of brackets, not the number of distinct users. The number of brackets is more useful, because that determines the size of the pot of money. On my site, this is working correctly. It is counting and displaying the number of brackets.

     
  • sksource

    sksource - 2010-03-18

    @botagrox:

    I respectfully disagree - what you are refering to is "Total Brackets".  Site stats contain 2 specific data points that I'm refering to - "Participants" and "Total Brackets".  In the original, pre-forked version - this worked as expected.  Participants would count the distinct number of participants, and total brackets would do a row count of all the brackets submitted.  For example, in my pool I allow people to submit up to 2 brackets.  Some submit 1, some submit 2.  However, the number of participants in my case will never equal the number of "Total Brackets". 

    If you simply look at your front page, you'll see what I mean.  Also, if you look at the code, you'll see that it's trying to reference a count in the "users" table, which doesn't even exist in the schema.

    So - Why would we have a count of "participants" and a count of "total brackets" that would tell you the same stat?  Also, like I said, in the pre-fork version this is how it worked.

    If you look at the code from MMM 1.5, you can definitely see this was the intent (and it actually worked):

            
    //OLD MMM 1.5 Prefork Stat Code
    <h2>Site Stats </h2>
            <?php
            //calculate some stats
            $query = "SELECT COUNT(id) FROM `brackets` WHERE paid < 2";
            $entries = mysql_query($query,$db);
            $entries = @mysql_fetch_array($entries);
            $query = "SELECT COUNT(DISTINCT email) AS NumberOfPlayers FROM `brackets`";
            $participants = mysql_query($query,$db);
            $participants = @mysql_fetch_array($participants);
            ?>
            <ul>
                <li id="stats"> Participants: <?php echo $participants[0]; ?></li>
                    <li id="stats"> Brackets: <?php echo $entries[0]; ?></li>
    

    Again - I would have to say it's a bug.

     
  • Botag

    Botag - 2010-03-18

    I'll have to look at this. My tournament is still open and the only thing listed is total brackets. I'll update as appropriate in SVN.

     
  • sksource

    sksource - 2010-03-18

    botagrox: Thanks.  FYI - mine is still open too, but this stat should work regardless if you've closed bracket submissions or not.  Luckily, it's simple fix :)

     
  • John Holder

    John Holder - 2010-03-18

    botagrox has checked it in, I've updated my install.  I probably won't do a release for this alone, unless there is demand.

     
  • John Holder

    John Holder - 2010-03-18

    Re #3 - agreed, it's frustrating.  We'll have to change the install.htm into a php file and add the required sql fetches etc.

    Re #4 - yup, you're right.  You can use &rsquo; as a workaround for an apostrophe for now.

     

Log in to post a comment.