function prayer_page()
{
    global $post;
    global $wpdb;
    $page_id = $_POST['page_id'];
    $pid = $_POST['pid'];
    $paged = get_query_var('paged') ? get_query_var('paged') : $page_id;
    $offset_value = $paged * get_option('posts_per_page');
    //$args = array( 'cat' => $categoryname,'order'=>'ASC','posts_per_page'=>'6','paged'=>$paged,'offset'=>$offset_value);
    if ($pid != "") {
        $args = array('post_type' => 'post', 'orderby' => 'post_date', 'paged' => $paged, 'offset' => $offset_value, 'post__in' => $pid);
    }
    query_posts($args);
    while (have_posts()) {
        the_post();
        //$normal_image = wp_get_attachment_url( get_post_thumbnail_id() );
        //$normal_image = get_field("normal_image");
        ?>
			  				 <section>
                                  <div class="image-main ff-left">
                                  	<a href="<?php 
        the_permalink();
        ?>
" title="">
                                         <?php 
        if (has_post_thumbnail()) {
            the_post_thumbnail('custom-size');
        } else {
            ?>
													  <img src="<?php 
            echo get_template_directory_uri();
            ?>
/library/images/pray-img-1.jpg">
										 <?php 
        }
        ?>
 
										 </a>
                                        <div class="img-des">
                                             <ul>
                                            	<?php 
        $url = wp_get_attachment_url(get_post_thumbnail_id($post->ID, 'thumbnail'));
        ?>
                                            	<?php 
        $postid = get_the_ID();
        ?>
 
                                            	   <!-- <li><span class="share"></span></li> -->
                                                 <li>
                                                	<a class="fb" href="http://www.facebook.com/sharer.php?s=100&p[title]=<?php 
        the_title();
        ?>
&p[url]=<?php 
        the_permalink();
        ?>
&p[summary]=<?php 
        echo get_post_field('post_content', $postid);
        ?>
&p[images][0]=<?php 
        echo $url;
        ?>
" onclick="javascript:window.open(this.href, '', 'menubar=no,toolbar=no,resizable=no,scrollbars=no,height=400,width=600');return false;" title="Facebook"></a>
                                                </li>
                                                 <li>
                                                	<a class="twt" href="http://twitter.com/home?status=<?php 
        the_title();
        ?>
+<?php 
        the_permalink();
        ?>
+<?php 
        echo substr($post->post_content, 0, 80);
        ?>
" onclick="javascript:window.open(this.href, '', 'menubar=no,toolbar=no,resizable=no,scrollbars=no,height=400,width=600');return false;" title="Twitter"></a>
	                            				</li>
                                                <li>
                                                	<a class="gp"  href="https://plus.google.com/share?url=<?php 
        the_permalink();
        ?>
" onclick="javascript:window.open(this.href,'', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=400,width=600');return false;" title="Google+"></a>
                                                </li>
                                            </ul>
                                            <!-- <p>I’m telling my friends to pray</p> -->
                                        </div>
                                    </div>
                                    <div class="user-detail ff-left" id="<?php 
        the_author_ID();
        ?>
">
                                    	
                                    		<!----user avtar---->
									<?php 
        $authore_id = get_the_author_meta('ID');
        ?>
									<?php 
        $provider = get_the_author_meta("wsl_current_provider", $authore_id);
        ?>
									
									<?php 
        if ($provider == "") {
            ?>
										<?php 
            $user_pix = $wpdb->get_row("SELECT * FROM " . $wpdb->prefix . "user_avtar WHERE user_id = {$authore_id}");
            ?>
										<?php 
            if ($user_pix->user_avtar == "") {
                ?>
												<a href="<?php 
                echo get_author_posts_url(get_the_author_meta('ID'));
                ?>
" title="<?php 
                the_author_nickname();
                ?>
"><img src="<?php 
                echo get_template_directory_uri();
                ?>
/library/images/epray-icon.png" class="avtr_img" /></a>
										<?php 
            } else {
                ?>
												<a href="<?php 
                echo get_author_posts_url(get_the_author_meta('ID'));
                ?>
" title="<?php 
                the_author_nickname();
                ?>
"><img src="<?php 
                bloginfo('stylesheet_directory');
                ?>
/library/avtar/<?php 
                echo $user_pix->user_avtar;
                ?>
" class="avtr_img"/></a> 
										<?php 
            }
            ?>
									
									<?php 
        } else {
            ?>
												<a href="<?php 
            echo get_author_posts_url(get_the_author_meta('ID'));
            ?>
" title="<?php 
            the_author_nickname();
            ?>
"><?php 
            echo get_avatar($authore_id, 60);
            ?>
 </a> 
									<?php 
        }
        ?>
										<!----user avtar---->
                                     
                                        <div class="user-name">
                                        	<?php 
        if (!is_user_logged_in()) {
            ?>
 
                                        	<h3><a href="#Loginform" title="<?php 
            the_author_nickname();
            ?>
"><?php 
            the_author_nickname();
            ?>
</a></h3>
                                             <?php 
        } else {
            ?>
 
                                            <h3><a href="<?php 
            echo get_author_posts_url(get_the_author_meta('ID'));
            ?>
" title="<?php 
            the_author_nickname();
            ?>
"><?php 
            the_author_nickname();
            ?>
</a></h3>
                                           	<?php 
        }
        ?>
                                            <div class="clear"></div>
                                            <span><?php 
        echo get_the_time();
        ?>
 / <?php 
        the_time('F d,Y');
        ?>
</span>
                                        </div>
                                        <div class="clear"></div>
                                        
                                     <?php 
        echo "<p>" . get_excerpt_with_hashtag(130) . "</p>";
        ?>
                                        
                                        <ul id="<?php 
        echo get_the_ID();
        ?>
">
                                        	<?php 
        if (!is_user_logged_in()) {
            ?>
 
													 <a href="#Loginform">
													  <li class="like">
			                                                <span>
			                                                	<?php 
            $postid = get_the_ID();
            $likecount = $wpdb->get_var("SELECT COUNT(*) FROM " . $wpdb->prefix . "post_like WHERE post_id = {$postid}");
            echo $likecount;
            ?>
															</span>
			                                            </li>
			                                            </a>
                                             <?php 
        } else {
            ?>
 
													<a href="javascript:void(0);" class="like_plus" title="I'm Praying">
			                                            <li class="like">
			                                                <span>
			                                                	<?php 
            $postid = get_the_ID();
            $likecount = $wpdb->get_var("SELECT COUNT(*) FROM " . $wpdb->prefix . "post_like WHERE post_id = {$postid}");
            echo $likecount;
            ?>
																
			                                                	</span>
			                                            </li>
		                                            </a>
                                            	  	
										    <?php 
        }
        ?>
										    
										    <?php 
        if (!is_user_logged_in()) {
            ?>
 
													<a href="#Loginform">
                                               <li class="list">
	                                                <span><?php 
            $postid = get_the_ID();
            $prayerlistcount = $wpdb->get_var("SELECT COUNT(*) FROM " . $wpdb->prefix . "user_paryer_list WHERE post_id = {$postid}");
            echo trim($prayerlistcount);
            ?>
													</span>
	                                             </li>
	                                          </a>
	                                            <?php 
        } else {
            ?>
 
	                                            <a href="javascript:void(0);" class="prayer_list" title="Add to Prayer List">
                                             	<li class="list">
	                                                <span><?php 
            $postid = get_the_ID();
            $prayerlistcount = $wpdb->get_var("SELECT COUNT(*) FROM " . $wpdb->prefix . "user_paryer_list WHERE post_id = {$postid}");
            echo trim($prayerlistcount);
            ?>
													</span>
	                                             </li>
	                                            </a>
                                                <?php 
        }
        ?>
                                             <?php 
        if (!is_user_logged_in()) {
            ?>
  
													<a href="#Loginform">
	                                            <li class="ref">
	                                                <span><?php 
            echo $my_var = get_comments_number($post_id);
            ?>
</span>
	                                            </li>
                                            </a>
												<?php 
        } else {
            ?>
   
                                            <a href="<?php 
            the_permalink();
            ?>
#prayerform" title="Prayer Replies">
	                                            <li class="ref">
	                                                <span><?php 
            echo $my_var = get_comments_number($post_id);
            ?>
</span>
	                                            </li>
                                            </a>
                                            <?php 
        }
        ?>
                                        </ul>
                                        
                                        
                		<?php 
        $posttags = get_the_tags();
        $postid = get_the_ID();
        //print_r($posttags);
        if (is_array($posttags)) {
            foreach ($posttags as $tag) {
                if (!is_user_logged_in()) {
                    ?>
									<a class="prg_notlog" href="#Loginform" title="<?php 
                    echo $tag->name;
                    ?>
">#<?php 
                    echo $tag->name;
                    ?>
</a>
									<?php 
                } else {
                    ?>
 
									<a class="prg" href="javascript:void(0);" id="<?php 
                    echo $postid;
                    ?>
" title="<?php 
                    echo $tag->name;
                    ?>
">#<?php 
                    echo $tag->name;
                    ?>
</a>
									<?php 
                }
                ?>
									<?php 
            }
        }
        ?>
  										
                                    </div>
                                </section>
		<?php 
    }
    die;
}
Ejemplo n.º 2
0
        $cat_id = $category[0]->cat_ID;
        $cat_name = $category[0]->cat_name;
        $cat_slug = $category[0]->category_nicename;
        ?>
								<span class="category category-<?php 
        echo $cat_slug;
        ?>
"><?php 
        echo $cat_name;
        ?>
</span>
								<?php 
        echo get_avatar(get_the_author_id(), 15);
        ?>
								<span><?php 
        echo the_author_nickname();
        ?>
</span>
							</div>
						</li>
					</a>
				<?php 
    }
    ?>
				<?php 
}
?>
				<?php 
wp_reset_query();
?>
				</ul>
Ejemplo n.º 3
0
function 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_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_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_firstname();
        $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_lastname();
        $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_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_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_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_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_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_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) {
        $date_param = preg_match("/(.*)\\%date\\('(.*?)'\\)(.*)/i", $postinfo_string, $date_matches);
        ob_start();
        the_time($date_matches[2]);
        $date = ob_get_contents();
        ob_end_clean();
        $postinfo = preg_replace("/(.*)%date\\((.*?)\\)%(.*)/i", "\${1}" . $date . "\${3}", $postinfo);
    }
    // Date & Time, last modified
    if (strpos($postinfo_string, '%date-modified(') !== FALSE) {
        $date_param = preg_match("/(.*)\\%date-modified\\('(.*?)'\\)(.*)/i", $postinfo_string, $date_matches);
        ob_start();
        the_modified_time($date_matches[2]);
        $date_modified = ob_get_contents();
        ob_end_clean();
        $postinfo = preg_replace("/(.*)%date-modified\\((.*?)\\)%(.*)/i", "\${1}" . $date_modified . "\${3}", $postinfo);
    }
    // Tags, linked - since WP 2.3
    if (strpos($postinfo_string, '%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) {
        $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) {
        $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 href="' . get_category_link($all_categories[0]->cat_ID) . '">' . $category . '</a>';
        $postinfo = str_replace("%category-linked%", $category_linked, $postinfo);
    }
    // Categories, linked
    if (strpos($postinfo_string, '%categories-linked') !== FALSE) {
        $category_linked_separator = preg_match("/(.*)%categories-linked\\('(.*?)'\\)(.*)/i", $postinfo_string, $category_linked_matches);
        ob_start();
        the_category($category_linked_matches[2]);
        $categories_linked = ob_get_contents();
        ob_end_clean();
        $postinfo = preg_replace("/(.*)%categories-linked\\((.*?)\\)%(.*)/i", "\${1}" . $categories_linked . "\${3}", $postinfo);
    }
    // Categories, not linked
    if (strpos($postinfo_string, '%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) {
        $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) {
        $comments_rss_link_text = preg_match("/(.*)%comments-rss\\('(.*?)'(.*)/i", $postinfo_string, $comments_rss_matches);
        ob_start();
        //  "post_comments_feed_link" since WP 2.5, else "comments_rss_link"
        if (function_exists('post_comments_feed_link')) {
            post_comments_feed_link($comments_rss_matches[2]);
        } else {
            comments_rss_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) {
        $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) {
        $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) {
        $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) {
        $sociable = (function_exists('sociable_html2') and function_exists('sociable_html')) ? $sociable = sociable_html2() : "";
        $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);
    }
    /* PHP code in Post Info Items.
    	But not for WPMU */
    /*removed in 3.4.3. - PHP code works in WPMU too */
    if (strpos($postinfo_string, '<?php ') !== FALSE) {
        ob_start();
        eval('?>' . $postinfo);
        $postinfo = ob_get_contents();
        ob_end_clean();
    }
    return $postinfo;
}