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.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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 ;-)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
diff of class/Runtime.php
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.
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 ;-)
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.
hack, attempt #2
the template file for attempt #2