Menu

#6 Enhanced latest threads block

open
nobody
None
5
2005-07-10
2005-07-10
rck
No

It now includes poster of the latest post & number of
replies, like found in pnphpBB. see also
http://www.kiesler.at/article196.html

I've included the diff of class/Runtime.php

Discussion

  • rck

    rck - 2005-07-10

    diff of class/Runtime.php

     
  • Shaun Murray

    Shaun Murray - 2005-07-11

    Logged In: YES
    user_id=722742

    Could you change it so it doesn't use a complex SELECT statement and
    instead use the sqlselect() functions?

    That ensures at least some database independence. I've not tested your
    sql statement on anything but it's a biggy so may possible not work on
    dbs other than MySQL.

    Don's original statement wasn't just simple because he was lazy, it was
    simple and correctly used the core db functions.

    Also, it's getting so large now that we should really template the block
    that we stick the latest posts in so that bits can be switched on/off as
    needed by a design.

     
  • rck

    rck - 2005-07-11

    Logged In: YES
    user_id=1035762

    my statement is highly optimized for MySQL. Making it work
    with th e SQLStatement would require a couple of sacrifices.
    One being a count(*) for every thread shown to count the
    number of replies to it.

    I could try to do a two-faced approach. One generic, slow
    one. And the existing one.

    Templating seems to be a good idea but will take away speed
    as well. I guess, the "compatible" mode would use the
    generic select approach as well as templates.

    Let's start coding... I'll be back ;-)

     
  • rck

    rck - 2005-07-11

    Logged In: YES
    user_id=1035762

    Ha! I though to complicated once again. I overlooked the
    replies attribute and calculated the replies myself.

    Well, look at this attempt. It still contains a bit of
    "mysql-propritaty code", but it isn't active. The difference
    between the generic and the mysql-propritary approach: the
    later shows the name of the latest posting while the former
    shows the name of the thread (=the first posting).

    and I'm using a template now, too.

     
  • rck

    rck - 2005-07-11

    hack, attempt #2

     
  • rck

    rck - 2005-07-11

    the template file for attempt #2

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.