/[drupal]/drupal/index.php
ViewVC logotype

Contents of /drupal/index.php

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.1 - (show annotations) (download) (as text)
Thu May 18 19:51:59 2000 UTC (9 years, 6 months ago) by dries
Branch: MAIN
File MIME type: text/x-php
Initial revision
1 <?PHP
2
3 include "functions.inc";
4
5 ### Log valid referers:
6 if (($url) && (strstr(getenv("HTTP_REFERER"), $url))) {
7 addRefer($url);
8 }
9
10
11 include "theme.inc";
12 $theme->header();
13
14 dbconnect();
15
16 if (isset($cookie[3])) $number = $cookie[3]; else $number = 10;
17
18 $result = mysql_query("SELECT * FROM stories ORDER BY sid DESC LIMIT $number");
19
20 while ($story = mysql_fetch_object($result)) {
21
22 ### Compose more-link:
23 $morelink = "[ ";
24 if ($story->article) {
25 $morelink .= "<A HREF=\"article.php?sid=$story->sid";
26 if (isset($cookie[4])) { $morelink .= "&mode=$cookie[4]"; } else { $morelink .= "&mode=threaded"; }
27 if (isset($cookie[5])) { $morelink .= "&order=$cookie[5]"; } else { $morelink .= "&order=0"; }
28 $bytes = strlen($story->article);
29 $morelink .= "\"><FONT COLOR=\"$theme->hlcolor2\"><B>read more</B></FONT></A> | $bytes bytes in body | ";
30 }
31
32 $query = mysql_query("SELECT sid FROM comments WHERE sid = $story->sid");
33 if (!$query) { $count = 0; } else { $count = mysql_num_rows($query); }
34
35 $morelink .= "<A HREF=\"article.php?sid=$story->sid";
36 if (isset($cookie[4])) { $morelink .= "&mode=$cookie[4]"; } else { $morelink .= "&mode=threaded"; }
37 if (isset($cookie[5])) { $morelink .= "&order=$cookie[5]"; } else { $morelink .= "&order=0"; }
38 if (isset($cookie[6])) { $morelink .= "&thold=$cookie[6]"; } else { $morelink .= "&thold=0"; }
39 $morelink .= "\"><FONT COLOR=\"$theme->hlcolor2\">$count comments</FONT></A> ]";
40
41 $theme->abstract($story->aid, $story->informant, $story->time, stripslashes($story->subject), stripslashes($story->abstract), stripslashes($story->comments), $story->category, $story->department, $morelink);
42 }
43
44 mysql_free_result($result);
45
46 $theme->footer();
47
48 ?>

  ViewVC Help
Powered by ViewVC 1.1.2