예제 #1
0
 private function _build()
 {
     // setup metadata
     $osd = new stdClass();
     $osd->blog_url = get_option('siteurl');
     $osd->search_param = '?s=' . self::OSD_SEARCHTERM_PARAMS;
     $osd->blog_name = get_option('blogname');
     $osd->blog_desc = get_option('blogdescription');
     $osd->blog_favicon = wpi_get_favicon_url();
     $osd->blog_html_type = get_option('html_type');
     $osd->language = get_hreflang();
     $this->osd = $osd;
     $this->_setContent();
     unset($osd);
 }
예제 #2
0
 function metaLink()
 {
     global $wp_query;
     $m = array();
     $m[] = array('rel' => 'schema.DC', 'href' => 'http://purl.org/dc/elements/1.1/');
     $m[] = array('rel' => 'schema.DCTERMS', 'href' => 'http://purl.org/dc/terms/');
     $m[] = array('rel' => 'schema.foaf', 'href' => 'http://xmlns.com/foaf/0.1/');
     $m[] = array('rel' => 'transformation', 'href' => 'http://www.w3.org/2000/06/dc-extract/dc-extract.xsl');
     $m[] = array('rel' => 'transformation', 'href' => 'http://www.w3.org/2003/12/rdf-in-xhtml-xslts/grokCC.xsl');
     $claimid = wpi_option('claimid');
     if ($claimid && !empty($claimid)) {
         $m[] = array('rel' => 'openid.server', 'href' => 'http://openid.claimid.com/server');
         $m[] = array('rel' => 'openid.delegate', 'href' => 'http://openid.claimid.com/' . $claimid);
     }
     if (file_exists(WP_ROOT . 'my-pavatar.png')) {
         $m[] = array('rel' => 'pavatar', 'href' => WPI_URL . 'my-pavatar.png', 'title' => WPI_BLOG_NAME);
     }
     if (file_exists(WP_ROOT . DIRSEP . 'labels.rdf')) {
         $m[] = array('rel' => 'meta', 'href' => WPI_URL . '/labels.rdf', 'type' => 'application/rdf+xml');
     }
     $m[] = array('rel' => 'foaf-maker', 'href' => WPI_URL . '/#' . self::bodyID(), 'rev' => 'foaf-homepage foaf-made');
     // favicon
     $favicon_url = wpi_get_favicon_url();
     $m[] = array('rel' => 'shortcut icon', 'href' => $favicon_url, 'type' => 'image/vnd.microsoft.icon');
     $m[] = array('rel' => 'icon', 'href' => $favicon_url, 'type' => 'image/x-ico');
     $m[] = array('rel' => 'alternate', 'href' => get_bloginfo('rss_url'), 'type' => 'application/rss+xml', 'title' => WPI_BLOG_NAME . ''s RSS 0.92 Feed', 'rev' => 'syndication:rss');
     $m[] = array('rel' => 'alternate', 'href' => get_bloginfo('rss2_url'), 'type' => 'application/rss+xml', 'title' => WPI_BLOG_NAME . ''s RSS 2.0 Feed', 'rev' => 'syndication:rss2');
     $m[] = array('rel' => 'alternate', 'href' => get_bloginfo('atom_url'), 'type' => 'application/rss+xml', 'title' => WPI_BLOG_NAME . ''s Atom Feed', 'rev' => 'syndication:atom');
     $m[] = array('rel' => 'alternate', 'href' => get_bloginfo('rdf_url'), 'type' => 'application/rss+xml', 'title' => WPI_BLOG_NAME . ''s RDF Feed', 'rev' => 'syndication:rdf');
     $m[] = array('rel' => 'alternate', 'href' => get_bloginfo('comments_rss2_url'), 'type' => 'application/rss+xml', 'title' => WPI_BLOG_NAME . ''s comments RSS 2.0 Feed', 'rev' => 'syndication:rdf');
     $m[] = array('rel' => 'pingback', 'href' => get_bloginfo('pingback_url'));
     $m[] = array('rel' => 'start', 'href' => rel(WPI_URL . '/#' . self::bodyID()));
     // prefetch
     if ($wp_query->is_singular) {
         list($href, $title) = $prop = wpi_get_prev_post_link();
         if ($prop) {
             $href = rel($href);
         } else {
             $ref = wp_get_referer();
             $href = !empty($ref) ? $ref : WPI_URL_SLASHIT;
             $title = 'Previous referrer ' . WPI_BLOG_NAME;
         }
         $m[] = array('rel' => 'prev', 'href' => $href, 'title' => $title);
         list($href, $title) = $prop = wpi_get_next_post_link();
         if ($prop && !$wp_query->is_attachment) {
             $m[] = array('rel' => 'next', 'href' => rel($href), 'title' => $title);
         }
     }
     $m[] = array('rel' => 'copyright', 'href' => rel(WPI_URL . '/#copyright'));
     //
     if (has_count($m)) {
         foreach ($m as $attribs) {
             echo "\t" . _t('link', '', $attribs);
         }
         unset($m, $attribs);
     }
     echo "\t" . $this->osdLink();
     // #12 query (+1)
     //wp_get_archives(array( 'type' => 'monthly','format' => 'link'));
 }