Skip to content

Instantly share code, notes, and snippets.

@speedmax
Created August 7, 2009 12:54
Show Gist options
  • Save speedmax/163882 to your computer and use it in GitHub Desktop.
Save speedmax/163882 to your computer and use it in GitHub Desktop.
<?php
//--------------------------------------- Preperation
require('includes/h2o.php');
require('includes/config.php');
require('includes/functions.php');
db_connect($dbhost, $dbuser, $dbpass, $dbname);
// Start: Get settings
$result = mysql_query("SELECT * FROM settings");
while($row = mysql_fetch_assoc($result)){
$settings[$row['settings_name']] = $row['settings_value'];
}
// End: Get settings
$h2o = new h2o('templates/archive.html');
//--------------------------------------- Main Script
$site_name = $settings['site_name'];
# Fetch category
$result = mysql_query("SELECT * FROM categories");
while($row = mysql_fetch_assoc($result)){
$list_categories[] = $row;
}
# render
echo $h2o->render(compact('list_categories', 'site_name'));
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment