示例#1
0
function setesm_postdisplay($postid = 0, $ast = 0, $astc = 0, $useragent = '0')
{
    global $page;
    $noreg = get_post_meta($postid, 'No Registration', $single = true);
    if ($noreg != null) {
        $bypassreg = 1;
    }
    // if (preg_match("/Googlebot|Yahoo|msnbot|bingbot/i", $useragent) > 0){ $bypassreg = 1;}
    if (isset($_COOKIE['esmpass'])) {
        $bypassreg = 1;
    }
    /* Check if the user is on page gt 1 and not logged in */
    global $page;
    //wp ecn 3591 6336 4361
    //wp esn 7084 6274
    //sr 139 127
    //webinar 163 166 167
    if ($bypassreg == 1 or is_user_logged_in()) {
        $showpagecontent = 1;
    } else {
        if (in_category(array(139, 127)) and !$bypassreg == 1 or in_category(array(139, 127)) and !is_user_logged_in()) {
            $showpagecontent = 0;
        } else {
            if (in_category(array(163, 166, 167)) and $page > 1) {
                $showpagecontent = 0;
            } else {
                if ($astused > 1) {
                    $showpagecontent = 0;
                } else {
                    //let them in
                    $showpagecontent = 1;
                }
            }
        }
    }
    ?>


<div style="clear:both; padding-bottom:5px;"></div>
<?php 
    if (function_exists('wp_socializer')) {
        echo '<div class="wp-socializer-buttons" style="height:20px; margin-top:5px;">';
        echo '<span class="wpsr-btn">' . wp_socializer(facebook, 'style=button_count&type=send') . '</span>';
        $blog_id = get_current_blog_id();
        if ($blog_id == '2') {
            echo '<span class="wpsr-btn">' . wp_socializer(retweet, 'type=compact&username=eschoolnews') . '</span>';
        } elseif ($blog_id == '3') {
            echo '<span class="wpsr-btn">' . wp_socializer(retweet, 'type=compact&username=ecampusnews') . '</span>';
        } elseif ($blog_id == '4') {
            echo '<span class="wpsr-btn">' . wp_socializer(retweet, 'type=compact&username=eclassroomnews') . '</span>';
        } else {
            echo '<span class="wpsr-btn">' . wp_socializer(retweet, 'type=compact') . '</span>';
        }
        echo '<span class="wpsr-btn">' . wp_socializer(plusone, 'type=medium') . '</span>';
        if (function_exists('wp_email')) {
            echo '<span class="wpsr-btn">';
            email_link();
            echo '</span>';
        }
        if (function_exists('wp_print')) {
            echo '<span class="wpsr-btn">';
            print_link();
            echo '</span>';
        }
        echo '</div>';
    }
    ?>
					<div id="post-<?php 
    the_ID();
    ?>
" <?php 
    post_class('entry');
    ?>
>
						<div class="entry_title">


<div style="float:left; width:475px;"> 
	<h2 style="color:#000 !important; font-size:24px;"><?php 
    if (in_category(array(19, 20, 21))) {
        echo 'Press Release: ';
    }
    the_title();
    ?>
</h2>

<?php 
    $SubTitle = get_post_meta($postid, 'Sub Title', $single = true);
    if ($SubTitle != null) {
        echo '<h3>' . $SubTitle . '</h3>';
    }
    if (get_the_author_meta('user_level') > 3) {
        if (function_exists('gkl_postavatar')) {
            echo '<style type="text/css">img.postavatar {height: 45px; width: auto;}</style>';
            gkl_postavatar(postavatar);
        }
    }
    ?>

<?php 
    $PageByLine = get_post_meta($postid, 'Byline', $single = true);
    if ($PageByLine != null) {
        echo '<span class="byline">' . $PageByLine . '<br/>';
    } else {
        echo '<span class="byline">';
    }
    if (in_category(29)) {
        echo '<a href="' . get_category_link(29) . '">' . 'Read more news from Around the Web </a><br/>' . the_time('F jS, Y') . '</span>';
    } elseif (in_category(126)) {
        echo '<a href="' . get_category_link(126) . '">' . 'View more Sites of the Week </a><br/>' . the_time('F jS, Y') . '</span>';
    } elseif (in_category(19)) {
        echo '<a href="' . get_category_link(19) . '">' . 'View more Press Releases </a><br/>' . the_time('F jS, Y') . '</span>';
    } elseif (in_category(20)) {
        echo '<a href="' . get_category_link(20) . '">' . 'View more Partner Press Releases</a><br/>' . the_time('F jS, Y') . '</span>';
    } elseif (in_category(21)) {
        echo '<a href="' . get_category_link(21) . '">' . 'View more Press Releases from Technology Providers</a><br/>' . the_time('F jS, Y') . '</span>';
    } else {
        $AltAuthorName = get_post_meta($postid, 'Alt Author Read More Name', $single = true);
        $AltAuthorLink = get_post_meta($postid, 'Alt Author Read More Link', $single = true);
        $AltDate = get_post_meta($postid, 'Alt Date', $single = true);
        if ($AltAuthorName != null) {
            if ($AltAuthorName == 'hide' or $AltAuthorName == '0') {
                //delete the line
            } else {
                if ($AltAuthorLink != null) {
                    echo '<a href="' . $AuthorLink . '" title="' . $AltAuthorName . '" rel="author">' . $AltAuthorName . '</a><br />';
                } else {
                    echo $AltAuthorName;
                    echo '<br />';
                }
            }
        } else {
            ?>
Read more by <?php 
            the_author_posts_link();
            echo '<br />';
        }
        ?>
    <?php 
        if ($AltDate != null) {
            if ($AltDate == 'hide' or $AltDate == '0') {
                //delete the line
            } else {
                echo $AltDate;
                //display custom date
            }
        } else {
            echo the_time('F jS, Y');
        }
    }
    ?>
</span>

</div>




<div style="clear:both"></div>
<?php 
    if (in_category(array(10223))) {
        echo '<div style="clear:both"></div><div style="display:block; float:right; font-size:9px; color:#333333; background-color:#FFFFFF;">(ADVERTISEMENT)</div>';
    }
    ?>

</div>




<!--start slider dependents-->
			<!--end slider dependents-->
	<?php 
    if ($showpagecontent == 1) {
        // Theme innerpage slider
        if (get_option('of_an_inslider') == 'Site Wide') {
            require_once GABFIRE_INC_PATH . '/theme-gallery.php';
        } elseif (get_option('of_an_inslider') == 'Tag-based' && has_tag(get_option('of_an_inslider_tag')) or term_exists(get_option('of_an_inslider_tag', 'gallery-tag', ''))) {
            require_once GABFIRE_INC_PATH . '/theme-gallery.php';
        } elseif (get_option('of_an_inslider') == 'Disable') {
            // do nothing
        }
        // If there is a video, display it
        gab_media(array('name' => 'gab-fea', 'enable_video' => 'true', 'video_id' => 'archive', 'catch_image' => 'false', 'enable_thumb' => 'false', 'media_width' => '483', 'media_height' => '300', 'thumb_align' => 'aligncenter', 'enable_default' => 'false'));
        // Display content
        the_content();
        $ContactName = get_post_meta($postid, 'Contact Name', $single = true);
        $ContactEmail = get_post_meta($postid, 'Contact Email', $single = true);
        $ContactPhone = get_post_meta($postid, 'Contact Phone', $single = true);
        $ContactURL = get_post_meta($postid, 'Contact URL', $single = true);
        if ($ContactURL != null) {
            if (!preg_match("#^http://www\\.[a-z0-9-_.]+\\.[a-z]{2,4}\$#i", $ContactURL)) {
                $ContactURL = 'http://' . $ContactURL;
            }
        }
        $GrantOrg = get_post_meta($postid, 'Grant Org', $single = true);
        if ($ContactName != null || $ContactEmail != null || $ContactPhone != null || $ContactURL != null || $GrantOrg != null) {
            ?>
<blockquote>
<strong>Contact Information</strong><hr />
<ul>
<?php 
            $Eligibility = get_post_meta($postid, 'Eligibility', $single = true);
            $GrantDeadline = get_post_meta($postid, 'Grant Deadline', $single = true);
            $GrantHeadline = get_post_meta($postid, 'Grant Headline', $single = true);
            $GrantValue = get_post_meta($postid, 'Grant Value', $single = true);
            if ($GrantOrg != null) {
                echo '<li><strong>Grant Organization: </strong>' . $GrantOrg . '</li>';
            }
            if ($ContactName != null) {
                echo '<li><strong>Contact Name: </strong>' . $ContactName . '</li>';
            }
            if ($ContactPhone != null) {
                echo '<li><strong>Contact Phone: </strong>' . $ContactPhone . '</li>';
            }
            if ($ContactEmail != null) {
                echo '<li><strong>Contact Email: </strong>' . $ContactEmail . '</li>';
            }
            if ($ContactURL != null) {
                echo '<li><strong>Contact URL: </strong><a href="' . $ContactURL . '" target="_blank" alt="Grant Link">' . substr($ContactURL, 0, 30) . '</a>...</li>';
            }
            if ($Eligibility != null) {
                echo '<li><strong>Eligibility: </strong>' . $Eligibility . '</li>';
            }
            if ($GrantDeadline != null) {
                $grantdatetime = date_create($GrantDeadline);
                echo '<li><strong>Grant Deadline: </strong>' . $grantdatetime->format('l F jS, Y') . '</li>';
            }
            if ($GrantValue != null) {
                echo '<li><strong>Grant Value: </strong>' . $GrantValue . '</li>';
            }
            echo '</ul></blockquote>';
        }
        // make sure any advanceded content gets cleared
        echo '<div class="clear"></div>';
        // Display pagination
        echo '<div align="left" style="border-top: 1px solid #ccc; width:100%; float:left; font-size:20px; font-weight:bold; line-height:30px;">';
        if ($astused > 1) {
            enhanced_link_pages(array('blink' => '', 'alink' => '&nbsp;', 'before' => '', 'after' => '', 'next_or_number' => 'both', 'afterhref' => 'ast=' . $astused . '&astc=' . $astc));
        } else {
            enhanced_link_pages(array('blink' => '', 'alink' => '&nbsp;', 'before' => '', 'after' => '', 'next_or_number' => 'both'));
        }
        echo '</div>';
        ?>
		
<div style="clear:both"></div>				
   <?php 
        // Post Widget
        gab_dynamic_sidebar('PostWidget');
        ?>

						<?php 
    } else {
        ?>
						
<p><?php 
        print string_limit_words(get_the_excerpt(), 350);
        ?>
...</p>

<div style="border:#CCCCCC solid 1px; padding:10px;">
<form action="<?php 
        echo get_option('home');
        ?>
/wp-login.php" method="post">
<table style="width:100%;">
<tr><td colspan="2"><p><strong>Free registration required to continue reading this article.</strong></p></td></tr>
<tr><td style="width:45%; padding-right:10px; border-right:1px solid #666">

Register today and receive free access to all our news and resources and the ability to customize your news by topic with My eSchool News.<br /><br />
<a href="<?php 
        echo get_option('home');
        ?>
/wp-login.php?action=register&redirect_to=?redirect_to=<?php 
        echo urlencode(get_permalink());
        ?>
" style="text-decoration:underline;"><strong>Register now.</strong></a>
</td>
<td style="width:55%; padding-left:10px">
Already a member? Log in 

<div>Username: <input type="text" name="log" id="log" value="" /></div>
<div>Password:&nbsp <input name="pwd" id="pwd" type="password" value="" /></div>
<input type="submit" name="submit" value="Login" class="button">
<input name="rememberme" id="rememberme" type="hidden" checked="checked" value="forever">
<input type="hidden" name="redirect_to" value="<?php 
        echo $_SERVER['REQUEST_URI'];
        ?>
">
<br />
<a href="<?php 
        echo get_option('home');
        ?>
/wp-login.php?action=lostpassword" target="_blank">Lost Password?</a>
	

</td></tr></table>
</form>	
</div>		
<?php 
    }
    //end showpagecontent check
    ?>
</div><!-- .entry -->

				

<?php 
}
<?php
/**
 * Social Sharing Buttons
 * Requires WP Socializer Plugin. http://www.aakashweb.com/docs/wp-socializer-docs/manual-placement/
 */
?>
<?php if( function_exists( 'wp_socializer' ) ) : ?>
<div class="social-share">
	<?php echo wp_socializer( 'facebook'  ); ?>
	<?php echo wp_socializer( 'retweet', array('type'=>'nocount') ); ?>
	<?php echo wp_socializer( 'linkedin'  ); ?>
	<?php echo wp_socializer( 'plusone', array('type' => 'small') ); ?>
</div>
<?php endif; ?>