Update on Wordpress sans Wordpress

I wanted to give an update (so soon?) on my progress on making the wordpress front end without wordpress. This is my third part day (because I work all day on other things) working on it, and today I decided to add a nice look to the main page. I've asked a few people and the general consensus is that my design skills are lacking. You can view what's been done so far here: http://core.ioreader.com/wwwroot/. Now, for the good stuff. Here are what a few of the current templates look like that make that page:


Caveat: there are a lot of divs there to accomplish those nice rounded corners + shadows that I wanted.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <link rel="stylesheet" type="text/css" media="screen" href="{/}css/reset.css" />

    <link rel="stylesheet" type="text/css" media="screen" href="{/}css/style.css" />


<div id="header">
    <v:component id="menu" />
    <h1><a href="{/}" title="{$blog_name}">{$blog_name}</a></h1>


<div class="t"><div><div></div></div></div>
<div id="content">

    <div class="dialog">
        <div id="main_content">
            <div id="content_left">
                <v:import id="main" />

            <div id="content_right">
                <v:component id="calendar" />
                <v:component id="categories" />

                <v:component id="archive" />
                <v:component id="blogroll" />
            <br style="clear:both;" />




This is the template that displays all of the posts on the main page.

<dl id="calendar">
        <table width="100%" class="cal_month" cellpadding="0" cellspacing="1">

                <th colspan="7">
                    <a href="{/$cal_year/$cal_month/}" title="Archives for {$cal_month_name}, {$cal_year}">{$cal_month_name}</a>
                    <a href="{/$cal_year/}" title="Archives for {$cal_year}">{$cal_year}</a>

                <v:repeat list="cal_day_titles" as="day">

            <v:repeat list="cal_weeks" as="week">
                <tr class="cal_week">

                    <v:repeat list="week.days" as="day">
                    <td class="<v:if var="day.month" eqvar="cal_month">cal_day<v:else />cal_day_off</v:if>">

                        <v:if var="day.link" eq="1"><a href="{/$day.year/$day.month/$day.day/}" title="View archives for this day">{$day.day}</a><v:else />{$day.day}</v:if>



SQL Queries

Okay, you get the point. Now, if you're a big wordpress person and are wondering what the SQL queries I am doing to accomplish all of this are, here all of them are:

--- Get all menu items
SELECT p.post_name, p.post_title FROM wp_posts p WHERE p.post_status='publish' AND p.post_type='page' ORDER BY p.menu_order ASC

--- Get only the options needed
SELECT * FROM wp_options WHERE option_name IN('posts_per_page','blogname','blogdescription') 

--- Get the front page posts
SELECT p.*, u.display_name AS author_name, u.ID as author_id, GROUP_CONCAT(ptc.category_id SEPARATOR ',') AS category_ids FROM wp_posts p, wp_users u, wp_post2cat ptc WHERE p.post_author=u.ID AND p.post_status='publish' AND p.post_type='post' AND ptc.post_id=p.ID GROUP BY p.ID ORDER BY p.ID DESC LIMIT 0, 10

--- Get posts to place into the calendar
SELECT DAY(post_date) AS day FROM wp_posts WHERE MONTH(post_date) = 7 AND YEAR(post_date) = 2007 GROUP BY DAY(post_date)

--- Get all top-level categories
SELECT * FROM wp_categories WHERE category_parent = 0 AND category_nicename <> 'blogroll' 

--- Get all sub-level categories
SELECT * FROM wp_categories WHERE category_parent > 0 

--- Get Blogroll links
SELECT * FROM wp_links WHERE link_visible='Y' ORDER BY link_name ASC

--- Get the archives
SELECT MONTH(post_date) as month_num, YEAR(post_date) AS year, COUNT(ID) AS num_posts FROM wp_posts WHERE post_status = 'publish' GROUP BY YEAR(post_date), MONTH(post_date) ORDER BY YEAR(post_date) DESC, MONTH(post_date) DESC

I think that's a good sum up of my progress thus far.