Lightweight Drupal home page

I’ve cleaned up my code for MacMegasite’s new page by breaking it up into separate include files for the left & right sidebars. The entire code is less than 50 lines and uses only a single database query and no calls to Drupal code.

Here’s the full code, not including the style sheet and sidebar content:

<meta http-equiv=content-type content="text/html; charset=utf-8">
<style type="text/css" title="text/css">
@import url(INC/style.css);
<img src="INC/logo.gif" class=logo>

<div class="left">
<?php include "INC/" ?>

<div class="right">
<?php include "INC/" ?>

<table class=content>

$dbi = mysql_connect($host,$user,$pass);

$query = "select nid, title, teaser from node where status=1 and promote=1 order by nid desc limit 10";
$res = mysql_query($query,$dbi);
while (list($nid,$title,$teaser) = mysql_fetch_row($res)) {
   print "<tr><td>";
   print "<h1><a href='".$nid."'>".$title."</a></h1>\n";
   print $teaser;
   print "<hr width=75% align=center><br>\n</td></tr>\n";


One response to “Lightweight Drupal home page

  1. I'm really interested in the sidebar "breakouts" you've done. I've been banging my head against a wall trying to work out a hack to display only the left sidebar of my drupal site for smoother integration with a forum package. I'd appreciate your posting the steps/code you took/wrote to achive this.

    Kind regards,