~clint-fewbar/charms/oneiric/omgubuntu-wp/trunk

« back to all changes in this revision

Viewing changes to files/wordpress/wp-content/plugins/yet-another-related-posts-plugin/template-metabox.php

  • Committer: Marco Ceppi
  • Date: 2012-03-19 14:27:51 UTC
  • Revision ID: marco@ceppi.net-20120319142751-xvn4zfl0rq99r00p
First revision of OMG charm

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?php
 
2
global $yarpp;
 
3
 
 
4
$yarpp->cache->enforce($reference_ID, false); // enforce the cache, but don't force it
 
5
 
 
6
if ($yarpp->debug) {
 
7
        $keywords = $yarpp->cache->get_keywords($reference_ID);
 
8
        $output .= "<p>body keywords: {$keywords['body']}</p>";
 
9
        $output .= "<p>title keywords: {$keywords['title']}</p>";
 
10
}
 
11
 
 
12
$output .= '<p>'.__( 'These are the related entries for this entry. Updating this post may change these related posts.' , 'yarpp').'</p>';
 
13
 
 
14
if ($yarpp->debug) {
 
15
        $output .= "<p>last updated: ".$wpdb->get_var("select max(date) as updated from {$wpdb->prefix}yarpp_related_cache where reference_ID = '$reference_ID'")."</p>";
 
16
}
 
17
 
 
18
if (have_posts()) {
 
19
        $output .= '<style>#yarpp-related-posts ol li { list-style-type: decimal; }</style>';
 
20
        $output .= '<ol>';
 
21
        while (have_posts()) {
 
22
                the_post();
 
23
                $output .= "<li><a href='post.php?action=edit&post=" . get_the_ID() . "'>" . get_the_title() . "</a>";
 
24
                $output .= ' (' . round(get_the_score(),3) . ')';
 
25
                $output .= '</li>';
 
26
        }
 
27
        $output .= '</ol>';
 
28
        $output .= '<p>'.__( 'Whether all of these related entries are actually displayed and how they are displayed depends on your YARPP display options.' , 'yarpp').'</p>';
 
29
} else {
 
30
        $output .= '<p><em>'.__('No related posts.','yarpp').'</em></p>';
 
31
}