function b_wp_contents_show($options)
{
    //	global $xoopsDB,$xoopsUser;
    //	global $tableoptions,$tableusers;
    //	global $id, $posts, $post, $day, $previousday, $newday;
    $id = 1;
    global $posts, $post, $day, $previousday, $newday;
    global $dateformat, $time_difference, $siteurl, $blogfilename;
    global $tablelinks, $tablelinkcategories;
    global $querystring_start, $querystring_equal, $querystring_separator, $month, $wpdb, $start_of_week;
    global $tableposts, $tablepost2cat, $tablecomments, $tablecategories;
    global $smilies_directory, $use_smilies, $wp_smiliessearch, $wp_smiliesreplace;
    global $wp_bbcode, $use_bbcode, $wp_gmcode, $use_gmcode, $use_htmltrans, $wp_htmltrans, $wp_htmltranswinuni;
    require_once dirname(__FILE__) . '/../wp-blog-header.php';
    $blog = 1;
    $block = array();
    $block['siteurl'] = $siteurl;
    foreach ($posts as $post) {
        $content = array();
        start_wp();
        $content['date'] = the_date('', '<h2>', '</h2>', false);
        $content['time'] = the_time('', false);
        $content['title'] = the_title('', '', false);
        $content['permlink'] = get_permalink();
        //
        ob_start();
        the_author();
        $content['author'] = ob_get_contents();
        ob_end_clean();
        //
        ob_start();
        the_category();
        $content['category'] = ob_get_contents();
        ob_end_clean();
        //
        ob_start();
        the_content();
        $content['body'] = ob_get_contents();
        ob_end_clean();
        //
        ob_start();
        link_pages('<br />Pages: ', '<br />', 'number');
        $content['linkpage'] = ob_get_contents();
        ob_end_clean();
        //
        ob_start();
        comments_popup_link('Comments (0)', 'Comments (1)', 'Comments (%)');
        $content['comments'] = ob_get_contents();
        ob_end_clean();
        //
        ob_start();
        trackback_rdf();
        $content['trackback'] = ob_get_contents();
        ob_end_clean();
        //
        $block['contents'][] = $content;
    }
    return $block;
}
Ejemplo n.º 2
0
 function addRdf()
 {
     if (is_single() || is_page()) {
         echo "\n<!--\n";
         trackback_rdf();
         echo "\n-->\n";
     }
 }
function b_wp_contents_show($options)
{
    global $xoopsDB, $xoopsUser, $wpdb, $siteurl;
    global $tableoptions, $tableposts, $tableusers, $tablecategories, $tablecomments, $tablepost2cat;
    global $querystring_start, $querystring_equal, $querystring_separator;
    global $id, $posts, $post, $day, $previousday, $dateformat, $newday;
    require_once dirname(__FILE__) . '/../wp-blog-header.php';
    $blog = 1;
    $block = array();
    $block['siteurl'] = $siteurl;
    foreach ($posts as $post) {
        $content = array();
        start_wp();
        $content['date'] = the_date('', '<h2>', '</h2>', false);
        $content['time'] = the_time('', false);
        $content['title'] = the_title('', '', false);
        $content['permlink'] = get_permalink();
        //
        ob_start();
        the_author();
        $content['author'] = ob_get_contents();
        ob_end_clean();
        //
        ob_start();
        the_category();
        $content['category'] = ob_get_contents();
        ob_end_clean();
        //
        ob_start();
        the_content();
        $content['body'] = ob_get_contents();
        ob_end_clean();
        //
        ob_start();
        link_pages('<br />Pages: ', '<br />', 'number');
        $content['linkpage'] = ob_get_contents();
        ob_end_clean();
        //
        ob_start();
        comments_popup_link('Comments (0)', 'Comments (1)', 'Comments (%)');
        $content['comments'] = ob_get_contents();
        ob_end_clean();
        //
        ob_start();
        trackback_rdf();
        $content['trackback'] = ob_get_contents();
        ob_end_clean();
        //
        $block['contents'][] = $content;
    }
    return $block;
}
Ejemplo n.º 4
0
/**
 * Echo post content.
 *
 * @since 1.0.0
 */
function beans_post_content()
{
    global $post;
    beans_open_markup_e('beans_post_content', 'div', array('class' => 'tm-article-content', 'itemprop' => 'text'));
    the_content();
    if (is_singular() && 'open' === get_option('default_ping_status') && post_type_supports($post->post_type, 'trackbacks')) {
        echo '<!--';
        trackback_rdf();
        echo '-->' . "\n";
    }
    beans_close_markup_e('beans_post_content', 'div');
}
Ejemplo n.º 5
0
function bfa_postinfo($postinfo_string)
{
    // one theme option needed below for nofollow trackback / RSS links yes/no
    global $bfa_ata, $post;
    /* replace date format escape placeholders(#) with the actual escpae
    	character (=backslashes). This function removes all backslashes from
    	post info strings to avoid issues with hosts that have magic_quotes_gpc ON.
    	But we want to keep the backslashes inside date items, because they are
    	needed to escape literal strings inside dates */
    $postinfo_string = str_replace("#", "\\", $postinfo_string);
    $postinfo = $postinfo_string;
    // Author public name
    if (strpos($postinfo_string, '%author%') !== FALSE) {
        ob_start();
        the_author();
        $author = ob_get_contents();
        ob_end_clean();
        $postinfo = str_replace("%author%", $author, $postinfo);
    }
    // Public name of Author who last modified a post, since WordPress 2.8.
    // Check first if function is available (= if this is WP 2.8+)
    if (function_exists('the_modified_author')) {
        if (strpos($postinfo_string, '%modified-author%') !== FALSE) {
            ob_start();
            the_modified_author();
            $modified_author = ob_get_contents();
            ob_end_clean();
            $postinfo = str_replace("%modified-author%", $modified_author, $postinfo);
        }
    }
    // Author about yourself
    if (strpos($postinfo_string, '%author-description%') !== FALSE) {
        ob_start();
        the_author_meta('description');
        $author_description = ob_get_contents();
        ob_end_clean();
        $postinfo = str_replace("%author-description%", $author_description, $postinfo);
    }
    // Author login name
    if (strpos($postinfo_string, '%author-login%') !== FALSE) {
        ob_start();
        the_author_meta('user_login');
        $author_login = ob_get_contents();
        ob_end_clean();
        $postinfo = str_replace("%author-login%", $author_login, $postinfo);
    }
    // Author first name
    if (strpos($postinfo_string, '%author-firstname%') !== FALSE) {
        ob_start();
        the_author_meta('first_name');
        $author_firstname = ob_get_contents();
        ob_end_clean();
        $postinfo = str_replace("%author-firstname%", $author_firstname, $postinfo);
    }
    // Author last name
    if (strpos($postinfo_string, '%author-lastname%') !== FALSE) {
        ob_start();
        the_author_meta('last_name');
        $author_lastname = ob_get_contents();
        ob_end_clean();
        $postinfo = str_replace("%author-lastname%", $author_lastname, $postinfo);
    }
    // Author nickname
    if (strpos($postinfo_string, '%author-nickname%') !== FALSE) {
        ob_start();
        the_author_meta('nickname');
        $author_nickname = ob_get_contents();
        ob_end_clean();
        $postinfo = str_replace("%author-nickname%", $author_nickname, $postinfo);
    }
    // Author ID
    if (strpos($postinfo_string, '%author-id%') !== FALSE) {
        ob_start();
        the_author_meta('ID');
        $author_ID = ob_get_contents();
        ob_end_clean();
        $postinfo = str_replace("%author-id%", $author_ID, $postinfo);
    }
    // Author email address, clear text in HTML source code
    if (strpos($postinfo_string, '%author-email-clear%') !== FALSE) {
        ob_start();
        the_author_meta('email');
        $author_email_clear = ob_get_contents();
        ob_end_clean();
        $postinfo = str_replace("%author-email-clear%", $author_email_clear, $postinfo);
    }
    // Author email address obfuscated
    if (strpos($postinfo_string, '%author-email%') !== FALSE) {
        $postinfo = str_replace("%author-email%", antispambot(get_the_author_email()), $postinfo);
    }
    // Author website URL
    if (strpos($postinfo_string, '%author-url%') !== FALSE) {
        ob_start();
        the_author_meta('url');
        $author_url = ob_get_contents();
        ob_end_clean();
        $postinfo = str_replace("%author-url%", $author_url, $postinfo);
    }
    // Author website link
    if (strpos($postinfo_string, '%author-link%') !== FALSE) {
        ob_start();
        the_author_link();
        $author_link = ob_get_contents();
        ob_end_clean();
        $postinfo = str_replace("%author-link%", $author_link, $postinfo);
    }
    // Author posts archive link
    if (strpos($postinfo_string, '%author-posts-link%') !== FALSE) {
        ob_start();
        the_author_posts_link();
        $author_posts_link = ob_get_contents();
        ob_end_clean();
        $postinfo = str_replace("%author-posts-link%", $author_posts_link, $postinfo);
    }
    //  LEGACY: %author-linked% replaced by %author-posts-link% in 3.3.2, but displays the same: Author posts archive link
    if (strpos($postinfo_string, '%author-linked%') !== FALSE) {
        ob_start();
        the_author_posts_link();
        $author_posts_link = ob_get_contents();
        ob_end_clean();
        $postinfo = str_replace("%author-linked%", $author_posts_link, $postinfo);
    }
    // Author post count
    if (strpos($postinfo_string, '%author-post-count%') !== FALSE) {
        ob_start();
        the_author_posts();
        $author_post_count = ob_get_contents();
        ob_end_clean();
        $postinfo = str_replace("%author-post-count%", $author_post_count, $postinfo);
    }
    // Author AOL Instant Messenger screenname
    if (strpos($postinfo_string, '%author-aim%') !== FALSE) {
        ob_start();
        the_author_meta('aim');
        $author_aim = ob_get_contents();
        ob_end_clean();
        $postinfo = str_replace("%author-aim%", $author_aim, $postinfo);
    }
    // Author Yahoo IM ID
    if (strpos($postinfo_string, '%author-yim%') !== FALSE) {
        ob_start();
        the_author_meta('yim');
        $author_yim = ob_get_contents();
        ob_end_clean();
        $postinfo = str_replace("%author-yim%", $author_yim, $postinfo);
    }
    // Date & Time
    if (strpos($postinfo_string, '%date(') !== FALSE) {
        $postinfo = preg_replace_callback("/%date\\((.*?)'(.*?)'(.*?)\\)%/is", "bfa_parse_date_callback", $postinfo);
    }
    // Date & Time, last modified
    if (strpos($postinfo_string, '%date-modified(') !== FALSE) {
        $postinfo = preg_replace_callback("/%date-modified\\((.*?)'(.*?)'(.*?)\\)%/is", "bfa_parse_date_modified_callback", $postinfo);
    }
    // Tags, linked - since WP 2.3
    if (strpos($postinfo_string, '%tags-linked') !== FALSE) {
        while (strpos($postinfo, '%tags-linked') !== FALSE) {
            $tag_link_options = preg_match("/(.*)%tags-linked\\('(.*?)'(.*?)'(.*?)'(.*?)'(.*?)'(.*)/i", $postinfo_string, $tag_link_matches);
            $tags_linked = get_the_tag_list($tag_link_matches[2], $tag_link_matches[4], $tag_link_matches[6]);
            $postinfo = preg_replace("/(.*)%tags-linked\\((.*?)\\)%(.*)/i", "\${1}" . $tags_linked . "\${3}", $postinfo);
        }
    }
    // Tags, linked. If post has no tags, categories are displayed instead -  since WP 2.3
    if (strpos($postinfo_string, '%tags-cats-linked') !== FALSE) {
        while (strpos($postinfo, '%tags-cats-linked') !== FALSE) {
            $tag_link_options = preg_match("/(.*)%tags-cats-linked\\('(.*?)'(.*?)'(.*?)'(.*?)'(.*?)'(.*)/i", $postinfo_string, $tag_link_matches);
            ob_start();
            the_tags($tag_link_matches[2], $tag_link_matches[4], $tag_link_matches[6]);
            $tags_cats_linked = ob_get_contents();
            ob_end_clean();
            $postinfo = preg_replace("/(.*)%tags-cats-linked\\((.*?)\\)%(.*)/i", "\${1}" . $tags_cats_linked . "\${3}", $postinfo);
        }
    }
    // Tags, not linked - since WP 2.3
    if (strpos($postinfo_string, '%tags(') !== FALSE) {
        while (strpos($postinfo, '%tags(') !== FALSE) {
            $tag_options = preg_match("/(.*)%tags\\('(.*?)'(.*?)'(.*?)'(.*?)'(.*?)'(.*)/i", $postinfo_string, $tag_matches);
            $posttags = get_the_tags();
            if ($posttags) {
                foreach ($posttags as $tag) {
                    $tag_list .= $tag->name . $tag_matches[4];
                }
                // remove last separator
                $tag_list = preg_replace("/" . $tag_matches[4] . "\$/mi", "", $tag_list);
                $tags = $tag_matches[2] . $tag_list . $tag_matches[6];
            } else {
                $tags = "";
            }
            $postinfo = preg_replace("/(.*)%tags\\((.*?)\\)%(.*)/i", "\${1}" . $tags . "\${3}", $postinfo);
        }
    }
    // 1st category
    if (strpos($postinfo_string, '%category%') !== FALSE) {
        $all_categories = get_the_category();
        $category = $all_categories[0]->cat_name;
        $category_notlinked = $category;
        $postinfo = str_replace("%category%", $category_notlinked, $postinfo);
    }
    // 1st category, linked
    if (strpos($postinfo_string, '%category-linked%') !== FALSE) {
        $all_categories = get_the_category();
        $category = $all_categories[0]->cat_name;
        $category_linked = '<a class="' . $category . '" href="' . get_category_link($all_categories[0]->cat_ID) . '">' . $category . '</a>';
        $postinfo = str_replace("%category-linked%", $category_linked, $postinfo);
    }
    // Categories, linked with class name added
    $categories_linked = '';
    if (strpos($postinfo_string, '%categories-linked') !== FALSE) {
        while (strpos($postinfo, '%categories-linked') !== FALSE) {
            $category_linked_separator = preg_match("/(.*)%categories-linked\\('(.*?)'\\)(.*)/i", $postinfo_string, $category_linked_matches);
            ob_start();
            $categories = get_the_category();
            $items_in_categories = count($categories);
            $output = '';
            $categories_count = $items_in_categories;
            if ($categories) {
                foreach ($categories as $category) {
                    $categories_count -= 1;
                    if ($categories_count) {
                        $seperator = $category_linked_matches[2];
                    } else {
                        $seperator = '';
                    }
                    $categories_linked .= '<a class="' . $category->slug . '" href="' . get_category_link($category->term_id) . '" title="' . esc_attr(sprintf(__("View all posts in %s"), $category->name)) . '">' . $category->cat_name . $seperator . '</a>';
                }
            }
            ob_end_clean();
            $postinfo = preg_replace("/(.*)%categories-linked\\((.*?)\\)%(.*)/i", "\${1}" . $categories_linked . "\${3}", $postinfo);
        }
    }
    // Categories, not linked
    if (strpos($postinfo_string, '%categories(') !== FALSE) {
        while (strpos($postinfo, '%categories(') !== FALSE) {
            $category_separator = preg_match("/(.*)%categories\\('(.*?)'\\)(.*)/i", $postinfo_string, $category_matches);
            $categories = "";
            foreach (get_the_category() as $category) {
                $categories .= $category->cat_name . $category_matches[2];
            }
            // remove last separator
            $categories = preg_replace("/" . $category_matches[2] . "\$/mi", "", $categories);
            $postinfo = preg_replace("/(.*)%categories\\((.*?)\\)%(.*)/i", "\${1}" . $categories . "\${3}", $postinfo);
        }
    }
    // Comment link
    if (strpos($postinfo_string, '%comments(') !== FALSE) {
        while (strpos($postinfo, '%comments(') !== FALSE) {
            $comment_options = preg_match("/(.*)%comments\\('(.*?)'(.*?)'(.*?)'(.*?)'(.*?)'(.*?)'(.*?)'(.*)/i", $postinfo_string, $comment_matches);
            if (!comments_open() and $comment_matches[8] == "dontshow") {
                $comment_link = '';
            } else {
                ob_start();
                comments_popup_link($comment_matches[2], $comment_matches[4], $comment_matches[6], 'comments-link', $comment_matches[8]);
                $comment_link = ob_get_contents();
                ob_end_clean();
            }
            if (!comments_open()) {
                if ($post->comment_count == 0) {
                    $comment_link = '<strong>' . $comment_matches[8] . '</strong>';
                } else {
                    $comment_link = $comment_link . ' - <strong>(' . $comment_matches[8] . ')</strong>';
                }
            }
            if (!comments_open() and $comment_matches[8] == "dontshow") {
                $comment_link = '';
            }
            $postinfo = preg_replace("/(.*)%comments\\((.*?)\\)%(.*)/i", "\${1}" . $comment_link . "\${3}", $postinfo);
        }
    }
    // Comments Feed link
    if (strpos($postinfo_string, '%comments-rss') !== FALSE) {
        while (strpos($postinfo, '%comments-rss') !== FALSE) {
            $comments_rss_link_text = preg_match("/(.*)%comments-rss\\('(.*?)'(.*)/i", $postinfo_string, $comments_rss_matches);
            ob_start();
            post_comments_feed_link($comments_rss_matches[2]);
            $comments_rss_link = ob_get_contents();
            ob_end_clean();
            // make link nofollow if set in theme options
            if ($bfa_ata['nofollow'] == "Yes") {
                $comments_rss_link = str_replace('href=', 'rel="nofollow" href=', $comments_rss_link);
            }
            $postinfo = preg_replace("/(.*)%comments-rss\\((.*?)\\)%(.*)/i", "\${1}" . $comments_rss_link . "\${3}", $postinfo);
        }
    }
    // Trackback URL
    if (strpos($postinfo_string, '%trackback%') !== FALSE) {
        $trackback_url = trackback_url(FALSE);
        $postinfo = str_replace("%trackback%", $trackback_url, $postinfo);
    }
    // Trackback Link
    if (strpos($postinfo_string, '%trackback-linked(') !== FALSE) {
        while (strpos($postinfo, '%trackback-linked(') !== FALSE) {
            $trackback_url = trackback_url(FALSE);
            $trackback_link_text = preg_match("/(.*)%trackback-linked\\('(.*?)'(.*)/i", $postinfo_string, $trackback_matches);
            $trackback_link = '<a href="' . $trackback_url . '">' . $trackback_matches[2] . '</a>';
            // make link nofollow if set in theme options
            if ($bfa_ata['nofollow'] == "Yes") {
                $trackback_link = str_replace('href=', 'rel="nofollow" href=', $trackback_link);
            }
            $postinfo = preg_replace("/(.*)%trackback-linked\\((.*?)\\)%(.*)/i", "\${1}" . $trackback_link . "\${3}", $postinfo);
        }
    }
    // Trackback RDF
    if (strpos($postinfo_string, '%trackback-rdf%') !== FALSE) {
        ob_start();
        trackback_rdf();
        $trackback_rdf = "<!-- " . ob_get_contents() . " -->";
        ob_end_clean();
        $postinfo = str_replace("%trackback-rdf%", $trackback_rdf, $postinfo);
    }
    // Permalink
    if (strpos($postinfo_string, '%permalink%') !== FALSE) {
        ob_start();
        the_permalink();
        $permalink = ob_get_contents();
        ob_end_clean();
        $postinfo = str_replace("%permalink%", $permalink, $postinfo);
    }
    // Post ID
    if (strpos($postinfo_string, '%post-id%') !== FALSE) {
        ob_start();
        the_ID();
        $post_id = ob_get_contents();
        ob_end_clean();
        $postinfo = str_replace("%post-id%", $post_id, $postinfo);
    }
    // Post Title
    if (strpos($postinfo_string, '%post-title%') !== FALSE) {
        ob_start();
        the_title();
        $post_title = ob_get_contents();
        ob_end_clean();
        $postinfo = str_replace("%post-title%", $post_title, $postinfo);
    }
    // Edit post
    if (strpos($postinfo_string, '%edit(') !== FALSE) {
        while (strpos($postinfo, '%edit(') !== FALSE) {
            $edit_options = preg_match("/(.*)%edit\\('(.*?)'(.*?)'(.*?)'(.*?)'(.*?)'(.*)/i", $postinfo_string, $edit_matches);
            ob_start();
            edit_post_link($edit_matches[4], $edit_matches[2], $edit_matches[6]);
            $edit_link = ob_get_contents();
            ob_end_clean();
            $postinfo = preg_replace("/(.*)%edit\\((.*?)\\)%(.*)/i", "\${1}" . $edit_link . "\${3}", $postinfo);
        }
    }
    // Print
    if (strpos($postinfo_string, '%print(') !== FALSE) {
        while (strpos($postinfo, '%print(') !== FALSE) {
            $print_text = preg_match("/(.*)%print\\('(.*?)'(.*)/i", $postinfo_string, $print_text_matches);
            $print_link = '<a href="javascript:window.print()">' . $print_text_matches[2] . '</a>';
            $postinfo = preg_replace("/(.*)%print\\((.*?)\\)%(.*)/i", "\${1}" . $print_link . "\${3}", $postinfo);
        }
    }
    // For the "WP-Email" plugin
    if (strpos($postinfo_string, '%wp-email%') !== FALSE) {
        $wp_email = function_exists('wp_email') ? email_link($email_post_text = '', $email_page_text = '', $echo = FALSE) : "";
        $postinfo = str_replace("%wp-email%", $wp_email, $postinfo);
    }
    // For the "WP-Print" plugin
    if (strpos($postinfo_string, '%wp-print%') !== FALSE) {
        $wp_print = function_exists('wp_print') ? print_link($print_post_text = '', $print_page_text = '', $echo = FALSE) : "";
        $postinfo = str_replace("%wp-print%", $wp_print, $postinfo);
    }
    // For the "WP-PostViews" plugin
    if (strpos($postinfo_string, '%wp-postviews%') !== FALSE) {
        $wp_postviews = function_exists('the_views') ? the_views($display = FALSE) : "";
        $postinfo = str_replace("%wp-postviews%", $wp_postviews, $postinfo);
    }
    // For the "WP-PostRatings" plugin
    if (strpos($postinfo_string, '%wp-postratings%') !== FALSE) {
        $wp_postratings = function_exists('the_ratings') ? the_ratings($start_tag = 'span', $custom_id = 0, $display = FALSE) : "";
        $postinfo = str_replace("%wp-postratings%", $wp_postratings, $postinfo);
    }
    // For the "Sociable" plugin
    if (strpos($postinfo_string, '%sociable%') !== FALSE) {
        ob_start();
        $sociable = (function_exists('sociable_html2') and function_exists(do_sociable())) ? do_sociable() : "";
        $sociable = ob_get_contents();
        ob_end_clean();
        $postinfo = str_replace("%sociable%", $sociable, $postinfo);
    }
    // For the "Share This" plugin
    if (strpos($postinfo_string, '%share-this%') !== FALSE) {
        ob_start();
        if (function_exists('sharethis_button')) {
            sharethis_button();
            $share_this = ob_get_contents();
        } else {
            $share_this = "";
        }
        ob_end_clean();
        $postinfo = str_replace("%share-this%", $share_this, $postinfo);
    }
    // Images
    if (strpos($postinfo_string, '<image(') !== FALSE) {
        $postinfo = preg_replace_callback("|<image\\((.*?)\\)>|", "bfa_image_files", $postinfo);
    }
    /* The meta = ALL custom fields:values, formatted by Wordpress as
    	unordered list <ul><li>..</li><li>..</li></ul> */
    if (strpos($postinfo_string, '%meta%') !== FALSE) {
        ob_start();
        the_meta();
        $the_meta = ob_get_contents();
        ob_end_clean();
        // 3.4.3.: remove bfa_ata metas */
        $the_meta = preg_replace("/<li>(.*)bfa_ata(.*)<\\/li>/i", "", $the_meta);
        $postinfo = str_replace("%meta%", $the_meta, $postinfo);
    }
    // Single post meta values, not formatted
    if (strpos($postinfo_string, '%meta(') !== FALSE) {
        $postinfo = preg_replace_callback("|%meta\\('(.*?)'\\)%|", "bfa_meta_value", $postinfo);
    }
    // Since 3.6.7, parse widget areas
    $postinfo = bfa_parse_widget_areas($postinfo);
    return $postinfo;
}
Ejemplo n.º 6
0
	<?php if (have_posts()) : ?>
		
		<?php while (have_posts()) : the_post(); ?>
				
			<div class="post">
				<h2 id="post-<?php the_ID(); ?>"><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></h2>
				<small><?php the_time('F jS, Y') ?> <!-- by <?php the_author() ?> --></small>
				
				<div class="entry">
					<?php the_content('Read the rest of this entry &raquo;'); ?>
				</div>
		
				<p class="postmetadata">Posted in <?php the_category(', ') ?> <strong>|</strong> <?php edit_post_link('Edit','','<strong>|</strong>'); ?>  <?php comments_popup_link('No Comments &#187;', '1 Comment &#187;', '% Comments &#187;'); ?></p> 
				
				<!--
				<?php trackback_rdf(); ?>
				-->
			</div>
	
		<?php endwhile; ?>

		<div class="navigation">
			<div class="alignleft"><?php posts_nav_link('','','&laquo; Previous Entries') ?></div>
			<div class="alignright"><?php posts_nav_link('','Next Entries &raquo;','') ?></div>
		</div>
		
	<?php else : ?>

		<h2 class="center">Not Found</h2>
		<p class="center"><?php _e("Sorry, but you are looking for something that isn't here."); ?></p>
		<?php include (TEMPLATEPATH . "/searchform.php"); ?>
Ejemplo n.º 7
0
function wpi_template_attachment()
{
    global $post;
    $pby_class = wpi_get_theme_option('post_by_enable') ? 'pby' : 'pby dn';
    ?>
	<ul class="hfeed r cf">
	<?php 
    while (have_posts()) {
        the_post();
        ?>
	<li class="xfolkentry hentry hreview hlisting cf">		
		<dl class="r">
			<dd class="postmeta-date fl">
				<ul class="span-1 pdate r">
					<li class="pmonth"><span><?php 
        the_time('M');
        ?>
</span></li>
					<li class="pday"><span><?php 
        the_time('d');
        ?>
</span></li>
					<li class="pyear"><span><?php 
        the_time('Y');
        ?>
</span></li>
				</ul>
			</dd>
			<dd class="postmeta-head span-13 start fl">
				<?php 
        wpi_hatom_title();
        ?>
				<div class="postmeta-info">				
				<span class="<?php 
        echo $pby_class;
        ?>
">Posted by <cite class="vcard reviewer author"><?php 
        wpi_post_author();
        ?>
</cite>.</span> <p class="di"><?php 
        _e('Filed under', WPI_META);
        wpi_cat_links(1);
        ?>
.</p>
					<p><span class="ptime r"><?php 
        printf(__(' <cite>%s</cite>', WPI_META), wpi_get_postime());
        ?>
</span></p><?php 
        wpi_text_size();
        ?>
 
				</div>	
			</dd>
			<dd class="entry-content description entry cb ox">
			<?php 
        do_action('wpi_before_content_attachment');
        ?>
<div class="entry-attachment pdt"><a href="<?php 
        echo wp_get_attachment_url($post->ID);
        ?>
" title="<?php 
        echo wp_specialchars(get_the_title($post->ID), 1);
        ?>
" class="thickbox thumb-" rel="attachment"><?php 
        echo wp_get_attachment_image($post->ID, 'large');
        ?>
</a></div>
					<div class="entry-caption mgt"><?php 
        if (!empty($post->post_excerpt)) {
            the_excerpt();
        }
        ?>
</div>			
					<?php 
        if (wpi_option('post_author_description')) {
            ?>
					<fieldset id="post-author" class="cb cf pdt mgt">
						<?php 
            $ll = __('About the Author', WPI_META);
            ?>
						<?php 
            t('legend', $ll, array('title' => $ll));
            ?>
						
					<address class="author-avatar <?php 
            wpiGravatar::authorGID();
            ?>
 rn fl">
					<span class="rtxt">&nbsp;</span>
					</address>	
					<p id="about-author" class="postmetadata fl">
						<small class="db rn"><?php 
            the_author_description();
            ?>
&nbsp;</small>
					</p>
					</fieldset>
				<?php 
        }
        ?>
			</dd>
			<?php 
        $rating_class = wpi_get_theme_option('post_hrating') ? 'rating-count' : 'rating-count dn';
        ?>
			<dd class="postmeta-comments cf">
			<ul class="xoxo cfl r cf">
			<li class="<?php 
        echo $rating_class;
        ?>
"><?php 
        wpi_hrating();
        ?>
&nbsp;</li>
			<?php 
        if (wpi_get_theme_option('post_bookmarks')) {
            ?>
			<li class="postmeta-response"><?php 
            wpi_bookmarks();
            ?>
			
			<?php 
        }
        ?>
			</li>
			
			</ul>
			<?php 
        edit_post_link(__('Edit this entry.', WPI_META), '<p class="cb edit-links">', '</p>');
        ?>
			</dd>
			<dd class="dn">
				<ul class="more">
					<li class="node-1">				
						<abbr class="dtstart published dtreviewed dc-date" title="<?php 
        the_time('Y-m-dTH:i:s:Z');
        ?>
"><?php 
        the_time('F j, Y');
        ?>
 at <?php 
        the_time('g:i a');
        ?>
</abbr>	
					</li>
					<li class="node-2">
						<abbr class="dtend updated dtexpired" title="<?php 
        the_modified_date('Y-m-dTH:i:s:Z');
        ?>
"><?php 
        the_modified_date('F j, Y');
        ?>
 at <?php 
        the_modified_date('g:i a');
        ?>
</abbr>
					</li>
					<li class="version">0.3</li>
					<li class="type">url</li>					
				</ul>
			</dd>			
		</dl>
<!--
<?php 
        trackback_rdf();
        ?>
-->			
	</li>
	<?php 
    }
    ?>
	</ul>
<?php 
}
 /**
  * Post Content
  */
 function do_post_content()
 {
     if (is_singular()) {
         if (is_page()) {
             edit_post_link(__('(Edit)', 'artshow'), '', '');
         } else {
             $this->image_loop(true);
             if (is_single() && get_option('default_ping_status') == 'open') {
                 echo '<!--';
                 trackback_rdf();
                 echo '-->' . "\n";
             }
         }
     } else {
         $this->image_loop();
     }
     wp_link_pages(array('before' => '<p class="pages">' . __('Pages:', 'artshow'), 'after' => '</p>'));
 }
 function b_wp_contents_show($options, $wp_num = "")
 {
     $no_posts = empty($options[0]) ? 10 : $options[0];
     global $wpdb, $siteurl, $post, $use_cache, $category_cache, $comment_count_cache;
     global $smilies_directory, $wp_smiliessearch, $wp_smiliesreplace, $authordata;
     global $wp_bbcode, $wp_gmcode, $wp_htmltrans, $wp_htmltranswinuni, $wp_filter;
     global $wp_id, $wp_mod, $wp_base, $wp_inblock, $xoopsConfig, $previousday, $time_difference, $day;
     $id = 1;
     $use_cache = 1;
     if ($wp_num == "") {
         $wp_id = $wp_num;
         $wp_inblock = 2;
         require dirname(__FILE__) . '/../wp-config.php';
         $wp_inblock = 0;
     }
     global $dateformat, $timeformat;
     $dateformat = stripslashes(get_settings('date_format'));
     $timeformat = stripslashes(get_settings('time_format'));
     $now = date('Y-m-d H:i:s', time() + get_settings('time_difference') * 3600);
     $request = "SELECT DISTINCT * FROM {$wpdb->posts[$wp_id]} ";
     $request .= " LEFT JOIN {$wpdb->post2cat[$wp_id]} ON ({$wpdb->posts[$wp_id]}.ID = {$wpdb->post2cat[$wp_id]}.post_id) ";
     $request .= "WHERE post_status = 'publish' ";
     $request .= " AND post_date <= '" . $now . "'";
     $request .= " GROUP BY {$wpdb->posts[$wp_id]}.ID ORDER BY post_date DESC LIMIT 0, {$no_posts}";
     $lposts = $wpdb->get_results($request);
     if ($lposts) {
         // Get the categories for all the posts
         foreach ($lposts as $post) {
             $post_id_list[] = $post->ID;
             $category_cache[$wp_id][$post->ID] = array();
         }
         $post_id_list = implode(',', $post_id_list);
         $dogs = $wpdb->get_results("SELECT DISTINCT\n\t\t\t\tID, category_id, cat_name, category_nicename, category_description, category_parent\n\t\t\t\tFROM {$wpdb->categories[$wp_id]}, {$wpdb->post2cat[$wp_id]}, {$wpdb->posts[$wp_id]}\n\t\t\t\tWHERE category_id = cat_ID AND post_id = ID AND post_id IN ({$post_id_list})");
         foreach ($dogs as $catt) {
             $category_cache[$wp_id][$catt->ID][] = $catt;
         }
         // Do the same for comment numbers
         $comment_counts = $wpdb->get_results("SELECT ID, COUNT( comment_ID ) AS ccount\n\t\t\t\tFROM {$wpdb->posts[$wp_id]}\n\t\t\t\tLEFT JOIN {$wpdb->comments[$wp_id]} ON ( comment_post_ID = ID  AND comment_approved =  '1')\n\t\t\t\tWHERE post_status =  'publish' AND ID IN ({$post_id_list})\n\t\t\t\tGROUP BY ID");
         foreach ($comment_counts as $comment_count) {
             $comment_count_cache[$wp_id]["{$comment_count->ID}"] = $comment_count->ccount;
         }
     }
     $blog = 1;
     $block = array();
     $block['use_theme_template'] = get_xoops_option('wordpress' . $wp_num, 'use_theme_template');
     $block['style'] = block_style_get($wp_num, false);
     $block['divid'] = 'wpBlockContent' . $wp_num;
     $block['template_content'] = "";
     $i = 0;
     $previousday = 0;
     foreach ($lposts as $post) {
         if ($block['use_theme_template'] == 0) {
             $content = array();
             start_wp();
             $content['date'] = the_date($dateformat, '', '', false);
             $content['time'] = the_time('', false);
             $content['title'] = the_title('', '', false);
             $content['permlink'] = get_permalink();
             //
             ob_start();
             the_author_posts_link();
             $content['author'] = ob_get_contents();
             ob_end_clean();
             //
             ob_start();
             the_category();
             $content['category'] = ob_get_contents();
             ob_end_clean();
             //
             ob_start();
             the_content();
             $content['body'] = ob_get_contents();
             ob_end_clean();
             //
             ob_start();
             link_pages('<br />Pages: ', '<br />', 'number');
             $content['linkpage'] = ob_get_contents();
             ob_end_clean();
             //
             ob_start();
             if (get_xoops_option($wp_mod[$wp_id], 'wp_use_xoops_comments') == 0) {
                 comments_popup_link(_WP_TPL_COMMENT0, _WP_TPL_COMMENT1, _WP_TPL_COMMENTS);
             } else {
                 xcomments_popup_link(_WP_TPL_COMMENT0, _WP_TPL_COMMENT1, _WP_TPL_COMMENTS);
                 echo " | ";
                 comments_popup_link(_WP_TPL_TRACKBACK0, _WP_TPL_TRACKBACK1, _WP_TPL_TRACKBACKS);
             }
             //				comments_popup_link(_WP_TPL_COMMENT0, _WP_TPL_COMMENT1, _WP_TPL_COMMENTS);
             $content['comments'] = ob_get_contents();
             ob_end_clean();
             //
             ob_start();
             trackback_rdf();
             $content['trackback'] = ob_get_contents();
             ob_end_clean();
             //
             $block['contents'][] = $content;
         } else {
             ob_start();
             include get_custom_path('content_block-template.php');
             $block['template_content'] .= ob_get_contents();
             ob_end_clean();
         }
     }
     $previousday = 0;
     $day = 0;
     $comment_count_cache[$wp_id] = array();
     return $block;
 }
 function _b_wp_contents_show($options, $wp_num = "")
 {
     $no_posts = empty($options[0]) ? 10 : $options[0];
     $GLOBALS['dateformat'] = stripslashes(get_settings('date_format'));
     $GLOBALS['timeformat'] = stripslashes(get_settings('time_format'));
     $_criteria = new CriteriaCompo(new Criteria('post_status', 'publish'));
     $_criteria->add(new Criteria('post_date', current_time('mysql'), '<='));
     $_criteria->setGroupBy(wp_table('posts') . '.ID');
     $_criteria->setSort('post_date');
     $_criteria->setOrder('DESC');
     $_criteria->setLimit($no_posts);
     $_criteria->setStart(0);
     $postHandler =& wp_handler('Post');
     $postObjects =& $postHandler->getObjects($_criteria, false, '', 'DISTINCT');
     $lposts = array();
     foreach ($postObjects as $postObject) {
         $lposts[] =& $postObject->exportWpObject();
     }
     if ($lposts) {
         // Get the categories for all the posts
         $_post_id_list = array();
         foreach ($lposts as $post) {
             $_post_id_list[] = $post->ID;
             $GLOBALS['category_cache'][wp_id()][$post->ID] = array();
         }
         $_post_id_list = implode(',', $_post_id_list);
         $_post_id_criteria =& new Criteria('post_id', '(' . $_post_id_list . ')', 'IN');
         $_joinCriteria =& new XoopsJoinCriteria(wp_table('post2cat'), 'ID', 'post_id');
         $_joinCriteria->cascade(new XoopsJoinCriteria(wp_table('categories'), 'category_id', 'cat_ID'));
         $postObjects =& $postHandler->getObjects($_post_id_criteria, false, 'ID, category_id, cat_name, category_nicename, category_description, category_parent', true, $_joinCriteria);
         foreach ($postObjects as $postObject) {
             $_cat->ID = $postObject->getVar('ID');
             $_cat->category_id = $postObject->getExtraVar('category_id');
             $_cat->cat_name = $postObject->getExtraVar('cat_name');
             $_cat->category_nicename = $postObject->getExtraVar('category_nicename');
             $_cat->category_description = $postObject->getExtraVar('category_description');
             $_cat->category_parent = $postObject->getExtraVar('category_parent');
             $GLOBALS['category_cache'][wp_id()][$postObject->getVar('ID')][] =& $_cat;
             unset($_cat);
         }
         // Do the same for comment numbers
         $_criteria =& new CriteriaCompo(new Criteria('post_status', 'publish'));
         $_criteria->add(new Criteria('comment_approved', '1 '));
         $_criteria->add($_post_id_criteria);
         $_criteria->setGroupBy('ID');
         $_joinCriteria =& new XoopsJoinCriteria(wp_table('comments'), 'ID', 'comment_post_ID');
         $postObjects =& $postHandler->getObjects($_criteria, false, 'ID, COUNT( comment_ID ) AS ccount', false, $_joinCriteria);
         foreach ($postObjects as $postObject) {
             $GLOBALS['comment_count_cache'][wp_id()]['' . $postObject->getVar('ID')] = $postObject->getExtraVar('ccount');
         }
     }
     $blog = 1;
     $block = array();
     $block['use_theme_template'] = get_xoops_option(wp_mod(), 'use_theme_template');
     $block['style'] = block_style_get(false);
     $block['divid'] = 'wpBlockContent' . $wp_num;
     $block['template_content'] = "";
     $i = 0;
     $GLOBALS['previousday'] = 0;
     foreach ($lposts as $post) {
         $GLOBALS['post'] = $post;
         if ($block['use_theme_template'] == 0) {
             $content = array();
             start_wp();
             $content['date'] = the_date($GLOBALS['dateformat'], '', '', false);
             $content['time'] = the_time('', false);
             $content['title'] = the_title('', '', false);
             $content['permlink'] = get_permalink();
             $content['author'] = the_author_posts_link('', false);
             $content['category'] = the_category('', '', false);
             $content['body'] = the_content(_WP_TPL_MORE, 0, '', false);
             $content['linkpage'] = link_pages('<br />Pages: ', '<br />', 'number', 'next page', 'previous page', '%', '', false);
             if (get_xoops_option(wp_mod(), 'wp_use_xoops_comments') == 0) {
                 $content['comments'] = comments_popup_link(_WP_TPL_COMMENT0, _WP_TPL_COMMENT1, _WP_TPL_COMMENTS, '', 'Comments Off', false);
             } else {
                 $content['comments'] = xcomments_popup_link(_WP_TPL_COMMENT0, _WP_TPL_COMMENT1, _WP_TPL_COMMENTS, '', 'Comments Off', false);
                 $content['comments'] .= " | ";
                 $content['comments'] .= comments_popup_link(_WP_TPL_COMMENT0, _WP_TPL_COMMENT1, _WP_TPL_COMMENTS, '', 'Comments Off', false);
             }
             $content['trackback'] = trackback_rdf(0, false);
             $block['contents'][] = $content;
         } else {
             ob_start();
             include get_custom_path('content_block-template.php');
             $block['template_content'] .= ob_get_contents();
             ob_end_clean();
         }
     }
     $GLOBALS['previousday'] = 0;
     $GLOBALS['day'] = 0;
     $GLOBALS['comment_count_cache'][wp_id()] = array();
     return $block;
 }
Ejemplo n.º 11
0
function ultimatum_do_post_content($instance=null) {
	$loop_text_vars=$instance['loop_text_vars'];
	global $post;
	if ( is_singular() ) {
		the_content();
		if ( is_singular() && 'open' == get_option( 'default_ping_status' ) && post_type_supports( $post->post_type, 'trackbacks' ) ) {
			echo '<!--';
			trackback_rdf();
			echo '-->' . "\n";
		}
		if ( is_page() && apply_filters( 'ultimatum_edit_post_link', true ) ){
            edit_post_link( __( '(Edit)', 'ultimatum' ), '', '' );
        }
      	wp_link_pages( array( 'before' => '<p class="pages">' . __( 'Pages:', 'ultimatum' ), 'after' => '</p>' ) );
	} else {
		if ( $instance['excerpt']=='true' ) { 
			
			echo '<p>';
			echo ult_excerpt($instance['excerptlength']);
			if($instance['mreadmore']!='false'){
				if($instance['mreadmore']!='after'){
					
					echo '<br /><span style="float:'.$instance['mreadmore'].'"><a href="'.get_permalink().'" class="read-more">'.$loop_text_vars[$instance['rmtext']].'</a></span><br />';
				} else {
					echo ' <a href="'.get_permalink().'" class="read-more">'.$loop_text_vars[$instance['rmtext']].'</a>';
				}
			}
			echo '</p>';
		} elseif ( $instance['excerpt']=='content' ) {
			the_content();
			
		} else {
			
		}
	}

	

}
Ejemplo n.º 12
0
/**
 * Echo the post content.
 *
 * On single posts or pages it echoes the full content, and optionally the
 * trackback string if they are enabled. On single pages, also adds the edit
 * link after the content.
 *
 * Elsewhere it displays either the excerpt, limited content, or full content.
 *
 * Pagination links are included at the end, if needed.
 *
 * @since 1.1.0
 *
 * @uses genesis_get_option() Get theme setting value
 * @uses the_content_limit() Limited content
 */
function genesis_do_post_content()
{
    global $post;
    if (is_singular()) {
        the_content();
        if (is_single() && 'open' == get_option('default_ping_status') && post_type_supports($post->post_type, 'trackbacks')) {
            echo '<!--';
            trackback_rdf();
            echo '-->' . "\n";
        }
        if (is_page() && apply_filters('genesis_edit_post_link', true)) {
            edit_post_link(__('(Edit)', 'genesis'), '', '');
        }
    } elseif ('excerpts' == genesis_get_option('content_archive')) {
        the_excerpt();
    } else {
        if (genesis_get_option('content_archive_limit')) {
            the_content_limit((int) genesis_get_option('content_archive_limit'), __('[Read more...]', 'genesis'));
        } else {
            the_content(__('[Read more...]', 'genesis'));
        }
    }
    wp_link_pages(array('before' => '<p class="pages">' . __('Pages:', 'genesis'), 'after' => '</p>'));
}
Ejemplo n.º 13
0
function thesis_trackback_rdf()
{
    if (is_single()) {
        echo '<!-- ';
        trackback_rdf();
        echo ' -->' . "\n";
    }
}
Ejemplo n.º 14
0
/**
 * calibrefx_do_post_content callback
 *
 * It outputs the post content
 *
 */
function calibrefx_do_post_content()
{
    if (is_singular()) {
        the_content();
        // display content on posts/pages
        if (is_single() and 'open' == get_option('default_ping_status')) {
            echo '<!--';
            trackback_rdf();
            echo '-->' . "\n";
        }
        if (is_page() and apply_filters('calibrefx_edit_post_link', true)) {
            edit_post_link(__('(Edit)', 'calibrefx'), '', '');
        }
    } elseif ('excerpts' == calibrefx_get_option('content_archive')) {
        the_excerpt();
    } else {
        if (calibrefx_get_option('content_archive_limit')) {
            $read_more_text = apply_filters('calibrefx_readmore_text', __('[Read more...]', 'calibrefx'));
            the_content_limit((int) calibrefx_get_option('content_archive_limit'), $read_more_text);
        } else {
            the_content();
        }
    }
    wp_link_pages(array('before' => '<p class="pages">' . __('Pages:', 'calibrefx'), 'after' => '</p>'));
}
 function b_wp_contents_show($options, $wp_num = "")
 {
     $no_posts = empty($options[0]) ? 10 : $options[0];
     global $wpdb, $siteurl, $post, $use_cache;
     global $smilies_directory, $wp_smiliessearch, $wp_smiliesreplace;
     global $wp_bbcode, $wp_gmcode, $wp_htmltrans, $wp_htmltranswinuni;
     global $wp_id, $wp_inblock, $xoopsConfig, $previousday, $time_difference;
     $id = 1;
     $use_cache = 1;
     if ($wp_num == "") {
         $wp_id = $wp_num;
         $wp_inblock = 1;
         require dirname(__FILE__) . '/../wp-config.php';
         $wp_inblock = 0;
     }
     global $dateformat, $timeformat;
     $dateformat = stripslashes(get_settings('date_format'));
     $timeformat = stripslashes(get_settings('time_format'));
     $now = date('Y-m-d H:i:s', time() + $time_difference * 3600);
     $request = "SELECT DISTINCT * FROM {$wpdb->posts[$wp_id]} ";
     $request .= " LEFT JOIN {$wpdb->post2cat[$wp_id]} ON ({$wpdb->posts[$wp_id]}.ID = {$wpdb->post2cat[$wp_id]}.post_id) ";
     $request .= "WHERE post_status = 'publish' ";
     $request .= " AND post_date <= '" . $now . "'";
     $request .= " GROUP BY {$wpdb->posts[$wp_id]}.ID ORDER BY post_date DESC LIMIT 0, {$no_posts}";
     $lposts = $wpdb->get_results($request);
     $blog = 1;
     $block = array();
     $block['use_theme_template'] = get_xoops_option('wordpress' . $wp_num, 'use_theme_template');
     //		if (file_exists(XOOPS_ROOT_PATH.'/modules/wordpress'. (($wp_id=='-')?'':$wp_id) .'/themes/'.$xoopsConfig['theme_set'].'/wp-blocks.css.php')) {
     //			$themes = $xoopsConfig['theme_set'];
     //		} else {
     //			$themes = "default";
     //		}
     //		include_once(XOOPS_ROOT_PATH."/modules/wordpress". (($wp_id=='-')?'':$wp_id) ."/themes/".$themes."/wp-blocks.css.php");
     //
     if (file_exists(XOOPS_ROOT_PATH . '/modules/wordpress' . ($wp_id == '-' ? '' : $wp_id) . '/themes/' . $xoopsConfig['theme_set'] . '/content_block-template.php')) {
         $themes = $xoopsConfig['theme_set'];
     } else {
         $themes = "default";
     }
     $template_fname = XOOPS_ROOT_PATH . "/modules/wordpress" . ($wp_id == '-' ? '' : $wp_id) . "/themes/" . $themes . "/content_block-template.php";
     $block['style'] = block_style_get($wp_num, false);
     $block['divid'] = 'wpBlockContent' . $wp_num;
     $block['template_content'] = "";
     $i = 0;
     $previousday = 0;
     foreach ($lposts as $post) {
         if ($block['use_theme_template'] == 0) {
             $content = array();
             start_wp();
             $content['date'] = the_date($dateformat, '', '', false);
             $content['time'] = the_time('', false);
             $content['title'] = the_title('', '', false);
             $content['permlink'] = get_permalink();
             //
             ob_start();
             the_author();
             $content['author'] = ob_get_contents();
             ob_end_clean();
             //
             ob_start();
             the_category();
             $content['category'] = ob_get_contents();
             ob_end_clean();
             //
             ob_start();
             the_content();
             $content['body'] = ob_get_contents();
             ob_end_clean();
             //
             ob_start();
             link_pages('<br />Pages: ', '<br />', 'number');
             $content['linkpage'] = ob_get_contents();
             ob_end_clean();
             //
             ob_start();
             comments_popup_link(_WP_TPL_COMMENT0, _WP_TPL_COMMENT1, _WP_TPL_COMMENTS);
             $content['comments'] = ob_get_contents();
             ob_end_clean();
             //
             ob_start();
             trackback_rdf();
             $content['trackback'] = ob_get_contents();
             ob_end_clean();
             //
             $block['contents'][] = $content;
         } else {
             ob_start();
             include $template_fname;
             $block['template_content'] .= ob_get_contents();
             ob_end_clean();
         }
     }
     $previousday = 0;
     return $block;
 }
function smarty_trackback_rdf($params)
{
    $timezone = 0;
    extract($params);
    return trackback_rdf($timezone);
}
Ejemplo n.º 17
0
Archivo: post.php Proyecto: nkeat12/dv
/**
 * Echo the post content.
 *
 * On single posts or pages it echoes the full content, and optionally the trackback string if enabled. On single pages,
 * also adds the edit link after the content.
 *
 * Elsewhere it displays either the excerpt, limited content, or full content.
 *
 * Applies the `genesis_edit_post_link` filter.
 *
 * @since 1.1.0
 *
 * @uses genesis_get_option() Get theme setting value.
 * @uses the_content_limit()  Limited content.
 *
 */
function genesis_do_post_content()
{
    if (is_singular()) {
        the_content();
        if (is_single() && 'open' === get_option('default_ping_status') && post_type_supports(get_post_type(), 'trackbacks')) {
            echo '<!--';
            trackback_rdf();
            echo '-->' . "\n";
        }
        if (is_page() && apply_filters('genesis_edit_post_link', true)) {
            edit_post_link(__('(Edit)', 'genesis'), '', '');
        }
    } elseif ('excerpts' === genesis_get_option('content_archive')) {
        the_excerpt();
    } else {
        if (genesis_get_option('content_archive_limit')) {
            the_content_limit((int) genesis_get_option('content_archive_limit'), genesis_a11y_more_link(__('[Read more...]', 'genesis')));
        } else {
            the_content(genesis_a11y_more_link(__('[Read more...]', 'genesis')));
        }
    }
}
Ejemplo n.º 18
0
 function _b_wp_contents_show($options, $wp_num = "")
 {
     $no_posts = empty($options[0]) ? 10 : $options[0];
     $tpl_file = empty($options[1]) ? 'wp_contents.html' : $options[1];
     $category = empty($options[2]) ? "all" : intval($options[2]);
     $GLOBALS['dateformat'] = get_settings('date_format');
     $GLOBALS['timeformat'] = get_settings('time_format');
     $_criteria = new CriteriaCompo(new Criteria('post_status', 'publish'));
     $_criteria->add(new Criteria('post_date', current_time('mysql'), '<='));
     if (empty($category) || $category == 'all' || $category == '0') {
         $_joinCriteria = null;
     } else {
         $_joinCriteria =& new XoopsJoinCriteria(wp_table('post2cat'), 'ID', 'post_id');
         $_wCriteria =& new CriteriaCompo();
         $_wCriteria->add(new Criteria('category_id', intCriteriaVal($category)), 'OR');
         $_catc = trim(get_category_children($category, '', ' '));
         if ($_catc !== "") {
             $_catc_array = explode(' ', $_catc);
             for ($_j = 0; $_j < count($_catc_array); $_j++) {
                 $_wCriteria->add(new Criteria('category_id', intCriteriaVal($_catc_array[$_j])), 'OR');
             }
         }
         $_criteria->add($_wCriteria);
     }
     $_criteria->setGroupBy(wp_table('posts') . '.ID');
     $_criteria->setSort('post_date');
     $_criteria->setOrder('DESC');
     $_criteria->setLimit($no_posts);
     $_criteria->setStart(0);
     $postHandler =& wp_handler('Post');
     $postObjects =& $postHandler->getObjects($_criteria, false, '', 'DISTINCT', $_joinCriteria);
     //		echo $postHandler->getLastSQL();
     $lposts = array();
     foreach ($postObjects as $postObject) {
         $lposts[] =& $postObject->exportWpObject();
     }
     if ($lposts) {
         // Get the categories for all the posts
         $_post_id_list = array();
         foreach ($lposts as $post) {
             $_post_id_list[] = $post->ID;
             $GLOBALS['category_cache'][wp_id()][$post->ID] = array();
         }
         $_post_id_list = implode(',', $_post_id_list);
         $_post_id_criteria =& new Criteria('post_id', '(' . $_post_id_list . ')', 'IN');
         $_joinCriteria =& new XoopsJoinCriteria(wp_table('post2cat'), 'ID', 'post_id');
         $_joinCriteria->cascade(new XoopsJoinCriteria(wp_table('categories'), 'category_id', 'cat_ID'));
         $postObjects =& $postHandler->getObjects($_post_id_criteria, false, 'ID, category_id, cat_name, category_nicename, category_description, category_parent', true, $_joinCriteria);
         foreach ($postObjects as $postObject) {
             $_cat->ID = $postObject->getVar('ID');
             $_cat->category_id = $postObject->getExtraVar('category_id');
             $_cat->cat_name = $postObject->getExtraVar('cat_name');
             $_cat->category_nicename = $postObject->getExtraVar('category_nicename');
             $_cat->category_description = $postObject->getExtraVar('category_description');
             $_cat->category_parent = $postObject->getExtraVar('category_parent');
             $GLOBALS['category_cache'][wp_id()][$postObject->getVar('ID')][] =& $_cat;
             unset($_cat);
         }
         // Do the same for comment numbers
         $_post_id_criteria =& new Criteria('comment_post_ID', '(' . $_post_id_list . ')', 'IN');
         $_criteria =& new CriteriaCompo(new Criteria('post_status', 'publish'));
         $_criteria->add(new Criteria('comment_approved', '1 '));
         $_criteria->add($_post_id_criteria);
         $_criteria->setGroupBy('ID');
         $_joinCriteria =& new XoopsJoinCriteria(wp_table('comments'), 'ID', 'comment_post_ID');
         $postObjects =& $postHandler->getObjects($_criteria, false, 'ID, COUNT( comment_ID ) AS ccount', false, $_joinCriteria);
         foreach ($postObjects as $postObject) {
             $GLOBALS['comment_count_cache'][wp_id()]['' . $postObject->getVar('ID')] = $postObject->getExtraVar('ccount');
         }
         // Get post-meta info
         if ($meta_list = $GLOBALS['wpdb']->get_results('SELECT post_id, meta_key, meta_value FROM ' . wp_table('postmeta') . ' WHERE post_id IN(' . $_post_id_list . ') ORDER BY post_id, meta_key', ARRAY_A)) {
             // Change from flat structure to hierarchical:
             $GLOBALS['post_meta_cache'][wp_id()] = array();
             foreach ($meta_list as $metarow) {
                 $mpid = $metarow['post_id'];
                 $mkey = $metarow['meta_key'];
                 $mval = $metarow['meta_value'];
                 // Force subkeys to be array type:
                 if (!isset($GLOBALS['post_meta_cache'][wp_id()][$mpid]) || !is_array($GLOBALS['post_meta_cache'][wp_id()][$mpid])) {
                     $GLOBALS['post_meta_cache'][wp_id()][$mpid] = array();
                 }
                 if (!isset($GLOBALS['post_meta_cache'][wp_id()][$mpid]["{$mkey}"]) || !is_array($GLOBALS['post_meta_cache'][wp_id()][$mpid]["{$mkey}"])) {
                     $GLOBALS['post_meta_cache'][wp_id()][$mpid]["{$mkey}"] = array();
                 }
                 // Add a value to the current pid/key:
                 $GLOBALS['post_meta_cache'][wp_id()][$mpid]["{$mkey}"][] = $mval;
             }
         }
     }
     $blog = 1;
     $block = array();
     $block['use_theme_template'] = get_xoops_option(wp_mod(), 'use_theme_template');
     $block['style'] = block_style_get(false);
     $block['divid'] = 'wpBlockContent' . $wp_num;
     $block['template_content'] = "";
     $i = 0;
     $GLOBALS['previousday'] = 0;
     foreach ($lposts as $post) {
         $GLOBALS['post'] = $post;
         if ($block['use_theme_template'] == 0) {
             $content = array();
             start_wp();
             $content['date'] = the_date($GLOBALS['dateformat'], '', '', false);
             $content['time'] = the_time('', false);
             $content['title'] = the_title('', '', false);
             $content['permlink'] = get_permalink();
             $content['author'] = the_author_posts_link('', false);
             $content['category'] = the_category('', '', false);
             $content['body'] = the_content(_WP_TPL_MORE, 0, '', false);
             $content['linkpage'] = link_pages('<br />Pages: ', '<br />', 'number', 'next page', 'previous page', '%', '', false);
             if (get_xoops_option(wp_mod(), 'wp_use_xoops_comments') == 0) {
                 $content['comments'] = comments_popup_link(_WP_TPL_COMMENT0, _WP_TPL_COMMENT1, _WP_TPL_COMMENTS, '', 'Comments Off', false);
             } else {
                 $content['comments'] = xcomments_popup_link(_WP_TPL_COMMENT0, _WP_TPL_COMMENT1, _WP_TPL_COMMENTS, '', 'Comments Off', false);
                 $content['comments'] .= " | ";
                 $content['comments'] .= comments_popup_link(_WP_TPL_TRACKBACK0, _WP_TPL_TRACKBACK1, _WP_TPL_TRACKBACKS, '', 'Trackback Off', false);
             }
             $content['trackback'] = trackback_rdf(0, false);
             $block['contents'][] = $content;
         } else {
             ob_start();
             include get_custom_path('content_block-template.php');
             $block['template_content'] .= ob_get_contents();
             ob_end_clean();
         }
     }
     $_wpTpl =& new WordPresTpl('theme');
     $_wpTpl->assign('block', $block);
     if (!$_wpTpl->tpl_exists($tpl_file)) {
         $tpl_file = 'wp_contents.html';
     }
     $block['content'] = $_wpTpl->fetch($tpl_file);
     $GLOBALS['previousday'] = 0;
     $GLOBALS['day'] = 0;
     $GLOBALS['comment_count_cache'][wp_id()] = array();
     return $block;
 }
Ejemplo n.º 19
0
			<div class="clear"></div>
		</div>

		<div class="post">
			<?php 
        the_content('<p class="serif">Read the rest of this entry &raquo;</p>');
        ?>
			<?php 
        wp_link_pages(array('before' => '<p><strong>Pages:</strong> ', 'after' => '</p>', 'next_or_number' => 'number'));
        ?>
		</div>


	   <!--
    	   <?php 
        trackback_rdf();
        ?>
	    -->

		<?php 
        comments_template();
        ?>

	<?php 
    }
} else {
    ?>
		<h2 class="center">Not Found</h2>
		<p class="center"><?php 
    echo "Sorry, but you are looking for something that isn't here.";
    ?>
function genesis_do_post_content()
{
    if (is_singular()) {
        the_content();
        // display content on posts/pages
        if (is_single() && get_option('default_ping_status') == 'open') {
            echo '<!--';
            trackback_rdf();
            echo '-->' . "\n";
        }
        if (is_page()) {
            edit_post_link(__('(Edit)', 'genesis'), '', '');
        }
    } elseif (genesis_get_option('content_archive') == 'excerpts') {
        the_excerpt();
    } else {
        if (genesis_get_option('content_archive_limit')) {
            the_content_limit((int) genesis_get_option('content_archive_limit'), __('[Read more...]', 'genesis'));
        } else {
            the_content(__('[Read more...]', 'genesis'));
        }
    }
    wp_link_pages(array('before' => '<p class="pages">' . __('Pages:', 'genesis'), 'after' => '</p>'));
}