Commit Graph

61 Commits (bf300292da6971c944a2ec38125ab53e28ca62f3)

Author SHA1 Message Date
Dries Buytaert 9966696dd6 * Small bugfixes and minor updates. 2000-06-25 16:53:56 +00:00
Dries Buytaert 0f5a60e109 IMPORANT - IMPORTANT - :)
=========================

Wulp.  I did a major upgrade by (a) breaking a lot of stuff and (b) by
re-doing those things in a much better way.  I redesigned the stories
and submissions SQL tables, the way they work and the way they co-
operate together.

In addition, I changed the way parameters are passed to
$theme->abstract() and $theme->article().  Instead of passing a
sh!tload of parameters that only cluttered the code and required too
much pre-processing on the engine-side, we now pass a singly object
$story.  $story has more variables then the paramaters we used to pass,
so it allows for better theming (if you feel like it).

I'm not finished yet but I decided to upload my changes so you can
start patching and updating your themes: PLEASE update your themes
ASAP!  I don't plan making heavy changes like this again, so don't
get intimiated. ;)  You mainly have to update article() and abstract()
as well as a minor update of footer():

article(), abstract():
----------------------
 - use the $story object - see my theme!
 - the morelink can now be themed.  Currently you can use the function
   morelink_bytes() in function.inc to `render' the old morelink.  The
   idea is to make a morelink_words() or morelink_lines() sooner or
   later because "188 bytes in body" is not half as clear as "52 words
   in body".  Clearly, "52 words" is much more informative. ;-)

footer():
---------
 - in the article-part, you need to update the displayRelatedLinks():
   instead of passing it $sid, you need to pass it $story (after you
   globaled $story).

Everything should display correct on the following pages:
 - main page
 - article page (follow a `read more | xxx bytes in bdoy | x comments' link)
 - submission queue
Check if they work with your theme: they should as they work fine for
me (theme `Dries') ...  If you got stuck, just look at my theme or ask
for a hand on the list!


Hopefully you can update your themes asap.  Thanks in advance.
2000-06-21 15:41:20 +00:00
Dries Buytaert 8a7690af57 Wheep! Wheep! Major performance optimization for index.php: we reduced the
number of SQL on the mainpage with factor 10 and shortened the code with 4
lines.  There is only *one* optimized SQL query left, being:

$result = db_query("SELECT stories.*, COUNT(comments.sid) AS comments FROM
stories LEFT JOIN comments ON stories.sid = comments.sid WHERE
stories.status = 1 AND stories.time <= $date GROUP BY stories.sid ORDER BY
stories.sid DESC LIMIT $number");

 Note: we use a LEFT JOIN to retrieve the number of comments associated
       with each story.  By retrieving this data now, we elimate a *lot*
       of individual queries that would otherwise be required inside the
       while-loop.  If there is no matching record for the right table in
       the ON-part of the LEFT JOIN, a row with all columns set to NULL
       is used for the right table.  This is required, as not every story
       has a counterpart in the comments table (at a given time).
2000-06-21 11:03:54 +00:00
Dries Buytaert 76f305571c * Changed a few things to make development easier without breaking things
to the outside world.  It's a first step towards improving the submission
  queue.

* More important (to the theme babies): instead of passing individual
  parameters I'm considering to pass an object.
    $theme->abstract($story->aid, $story->informant, $story->time,
     stripslashes($story->subject), stripslashes($story->abstract),
     stripslashes($story->comments), $story->category, $story->department,
     $morelink);
  would become:
    $theme->abstract($story);
  What do you guys think about pushing this trough?  It would be much better
  and would give extra `power' to the themes.
2000-06-16 11:00:57 +00:00
Dries Buytaert 07118dbd48 * Improved calendar.class.php speed-wise: did some inline caching to make
rendering a calendar less expensive.
* Added a function displayCalendar($theme, $active_date) to functions.inc.
* Adjusted index.php so it would support URIs formated like
  "?date=$unix_timestamp".
* Integrated the calendar in my personal theme: themes/Dries/theme.class.
  If you want to include the calendar in your theme, check the code in my
  $theme->footer(): global $date and call displayCalendar($theme, $date).

Check the main page at http://beta.drop.org/ with theme 'Dries' to see it
yourself!
2000-06-03 11:39:07 +00:00
Kjartan Mannes 92a0d43be9 Hopefully this will not break anything *prays*
;)
2000-06-02 18:36:15 +00:00
Kjartan Mannes 61584ea057 Fixed a typo 2000-05-20 00:38:26 +00:00
Kjartan Mannes e6998fd322 Wheeeeee... I think I finally figured this out :P 2000-05-19 23:33:15 +00:00
Dries Buytaert 02d673dc5e Just testing (and bored too). 2000-05-19 11:24:43 +00:00
Kjartan Mannes c678127f72 I got bored *G* 2000-05-19 11:20:58 +00:00
Dries Buytaert 008612ad49 Imported sources 2000-05-18 19:51:59 +00:00