Permalink
Browse files

Final commit (hopefully) for Reflection 1.1.

  • Loading branch information...
mdave committed May 15, 2009
1 parent 0249e33 commit d79ee3e732d47da6d1654a1e0e552aff5f7e8965
Showing with 1,420 additions and 475 deletions.
  1. +5 −10 404.php
  2. +10 −11 ajax_request.php → ajax_blog.php
  3. +48 −0 ajax_browse.php
  4. +131 −0 archive.php
  5. +12 −3 footer.php
  6. +320 −81 functions.php
  7. +15 −10 header.php
  8. BIN images/browse-load.gif
  9. +29 −31 index.php
  10. +130 −118 js/blog.js
  11. +149 −0 js/browser.js
  12. +0 −3 js/mootools-1.11.js
  13. +30 −0 js/mootools-1.2-more.js
  14. +349 −0 js/mootools-1.2.1-core.js
  15. +1 −1 js/mosaic.js
  16. +0 −76 mosaic.php
  17. +4 −5 page.php
  18. +187 −73 style.css
  19. +0 −53 yapb_filter.php
View
15 404.php
@@ -1,10 +1,9 @@
<?
/*
* 404.php
* -------
/**
* Error finding requested page. Output error page with links to most popular
* pages and also contact e-mail.
*
* @package Reflection
*/
// Grab header.
@@ -15,13 +14,9 @@
<div id="pagecontent">
<h1>Not Found</h1>
<p>Sorry, that page could not be found. Please <a href="mailto:<?bloginfo('admin_email');?>">contact me</a> if you tried to get here from a link on the site. Here's some popular links:</p>
<p>Sorry, that page could not be found.</p>
<ul>
<li><a href="/">Home Page</a></li>
<li><a href="/mosaic/">Mosaic</a></li>
<li><a href="/about/">About</a></li>
</div>
<p>Please <a href="mailto:<?bloginfo('admin_email');?>">contact me</a> if you tried to get here from a link on the site.</p>
<?
@@ -15,28 +15,27 @@
while(have_posts()) {
the_post();
include (TEMPLATEPATH . '/yapb_filter.php');
$next_post = get_next_post();
$prev_post = get_previous_post();
// Grab post information.
ob_start();
the_content();
$content = ob_get_clean();
$info = array(
'image_uri' => get_thumbnail(true),
'post_content' => $content,
'post_title' => $post->post_title,
'post_date' => get_the_time('jS F Y'),
'permalink' => get_permalink($post->ID),
'next_post' => $next_post ? $next_post->ID : 0,
'prev_post' => $prev_post ? $prev_post->ID : 0,
'image_uri' => get_thumbnail(true),
'post_content' => $content,
'post_title' => $post->post_title,
'post_date' => get_the_time('jS F Y'),
'permalink' => get_permalink($post->ID),
'next_post' => $next_post ? $next_post->ID : 0,
'prev_post' => $prev_post ? $prev_post->ID : 0,
'next_post_perm' => $next_post ? get_permalink($next_post->ID) : '',
'prev_post_perm' => $prev_post ? get_permalink($prev_post->ID) : '',
'comment_status' => $post->comment_status,
'comment_count' => $post->comment_count,
'exif' => get_exif(),
'comment_count' => $post->comment_count,
'exif' => get_exif(),
);
echo json_encode($info);
View
@@ -0,0 +1,48 @@
<?
require_once ('../../../wp-config.php');
$tag = (int)$_GET['tag'];
$cat = (int)$_GET['cat'];
$year = $_GET['year'] == 'All' ? 'All' : intval($_GET['year']);
$orderby = get_opt_or_default('mosaicdesc') ? 'DESC' : 'ASC';
if ($year && $year == 'All') {
query_posts('showposts=-1&order='.$orderby);
} elseif ($year) {
query_posts('year='.$year.'&showposts=-1&order='.$orderby);
} elseif ($cat) {
query_posts('cat='.$cat.'&showposts=-1&order='.$orderby);
} else {
$tag = get_tag($tag);
$slug = $tag->slug;
query_posts('tag='.$slug.'&showposts=-1&order='.$orderby);
}
$posts = array();
$tips = get_opt_or_default('mosaictips');
while(have_posts()) {
the_post();
if (($imageuri = square_thumb($post->ID)) === false)
continue;
$topush = array(
'image_uri' => str_replace("&amp;", "&", $imageuri),
'post_title' => $post->post_title,
'post_date' => get_the_time('jS F Y'),
'permalink' => get_permalink($post->ID)
);
if ($tips) {
$topush['comment_status'] = $post->comment_status;
$topush['comment_count'] = $post->comment_count;
}
array_push($posts, $topush);
}
echo json_encode($posts);
?>
View
@@ -0,0 +1,131 @@
<?php
/*
* Template Name: Archives
* Description: Allows users to browse through your archived posts by tag and date.
*/
$headinclude = '<script type="text/javascript" src="'.get_bloginfo('template_directory').'/js/browser.js"></script>
<script type="text/javascript">
Browse.templateDir = \''.get_bloginfo('template_directory').'\';
window.addEvent(\'load\', Browse.init.bind(Browse));
</script>';
// Get header.
include (TEMPLATEPATH . '/header.php');
// Determine what kind of archive we have.
$post = $posts[0];
$thisyear = is_year() ? get_the_time('Y') : false;
$thistag = is_tag() ? single_tag_title('', false) : false;
$thiscat = is_category() ? single_cat_title('', false) : false;
$all = !$thisyear && !$thistag;
$curtag = get_query_var('tag_id');
$curcat = get_query_var('cat_id');
$curstr = ' class="current"';
$postinfo = array();
$disptype = get_opt_or_default('archivedisp');
// Attempt to find permalink to correct page ID
$allid = $wpdb->get_var("SELECT p.ID FROM $wpdb->posts AS p, $wpdb->postmeta AS m
WHERE p.ID = m.post_id AND p.post_status='publish' AND m.meta_key='_wp_page_template' AND m.meta_value='archive.php'");
$alluri = '';
if ($allid)
$alluri = get_permalink($allid);
?>
<div id="pagecontent">
<table cellpadding="5" cellspacing="0" id="taxonomyTable">
<?php if ($disptype): ?>
<tr><th>By year</th><th style="text-align:right"><?=$disptype == 1 ? 'By tag' : 'By category'?></th></tr>
<?php else: ?>
<tr><th style="width:100%">By year</th></tr>
<?php endif; ?>
<tr>
<td id="yearCloud">
<?php
$post_years = $wpdb->get_results("SELECT YEAR(post_date) AS posty FROM " . $wpdb->prefix . "posts
WHERE post_status='publish' AND post_type='post' GROUP BY posty ORDER BY posty DESC;");
echo '<a href="'.$alluri.'"'.($all ? $curstr : '').'>All</a> ';
foreach ($post_years as $y)
echo '<a href="'.get_year_link($y->posty).'"'.($thisyear && $thisyear == $y->posty ? $curstr : '').'>'.$y->posty.'</a> ';
?>
</td>
<?php if ($disptype == 1): ?>
<td id="tagCloud">
<?php
if ($thistag !== false)
echo implode(' ', str_replace('tag-link-'.$curtag, 'tag-link-'.$curtag.' current', wp_tag_cloud('format=array')));
else
wp_tag_cloud('');
?>
</td>
<?php elseif ($disptype == 2): ?>
<td id="catCloud">
<?php
wp_list_categories();
?>
</td>
<?php endif;?>
</tr>
</table>
<div style="margin-top: 8px">
<b class="tagbox">
<b class="tagbox1"><b></b></b>
<b class="tagbox2"><b></b></b>
<b class="tagbox3"></b>
<b class="tagbox4"></b>
<b class="tagbox5"></b></b>
<div id="tagPics">
<div id="tagContainer">
<?php
// Grab all posts from the database in correct order.
$orderby = get_opt_or_default('mosaicdesc') ? 'DESC' : 'ASC';
if ($all)
query_posts('showposts=-1&orderby=date&order='.$orderby);
else
query_posts($query_string.'&orderby=date&order='.$orderby.'&showposts=-1');
// Begin The Loop.
if (have_posts()) : while (have_posts()) : the_post();
array_push($postinfo, array(
'post_title' => $post->post_title,
'post_date' => get_the_time('jS F Y'),
'comment_status' => $post->comment_status,
'comment_count' => $post->comment_count
));
echo '<a href="'.get_permalink($post->ID).'">';
echo '<img class="mosaic" src="'.square_thumb($post->ID).'" alt="thumb" />';
echo '</a>';
endwhile; endif;
?>
</div>
<img src="<?php bloginfo('template_directory'); ?>/images/browse-load.gif" id="tagProgress" alt="loading" />
</div>
<b class="tagbox">
<b class="tagbox5"></b>
<b class="tagbox4"></b>
<b class="tagbox3"></b>
<b class="tagbox2"><b></b></b>
<b class="tagbox1"><b></b></b></b>
</div>
<?php if (get_opt_or_default('mosaictips')): ?>
<script type="text/javascript">
Browse.initialPosts = <?php echo json_encode($postinfo);?>;
</script>
<?php endif; ?>
</div>
<?
// Get footer.
get_footer();
?>
View
@@ -1,10 +1,19 @@
</div>
<?php
// Deal with copyright settings
$copy = get_opt_or_default('copyright');
$year = ($yeartmp = get_opt_or_default('copyright_year')) ? $yeartmp : date('Y');
?>
<div id="footer">
Powered by <a href="http://wordpress.org/">WordPress <?php bloginfo('version');?></a>, <a href="http://xyloid.org/projects/reflection/">Reflection 1.1a</a>
and <a href="http://johannes.jarolim.com/yapb/">YAPB</a>: <a href="#">Entries (RSS)</a> and <a href="#">Comments (RSS)</a>.<br />
Powered by <a href="http://wordpress.org/">WordPress</a>, <a href="http://xyloid.org/projects/reflection/">Reflection <?=$vnum?></a>
and <a href="http://johannes.jarolim.com/yapb/">YAPB</a>: <a href="#">Entries (RSS)</a> - <a href="#">Comments (RSS)</a>.<br />
<?php if ($copy = get_option('reflection_copyright')):?>All images and content are copyright &copy; <?=$copy?> 2008.<?php endif;?>
<?php if ($copy):?>&copy; <?=$copy?> <?=$year?>.<?php endif;?>
</div>
</body>
Oops, something went wrong.

0 comments on commit d79ee3e

Please sign in to comment.