コード例 #1
0
/**
 * show_project_blogroll function.
 * 
 * @access public
 * @param mixed $query
 * @param mixed $showthumb
 * @param mixed $committeeTitle
 * @return void
 */
function show_project_blogroll($query, $showthumb = 'no', $committeeTitle = '')
{
    global $ProjectType;
    $hasCommitteeTitle = '' == trim($committeeTitle) ? false : true;
    while ($query->have_posts()) {
        $query->the_post();
        if (!$hasCommitteeTitle) {
            $committeeTitle = rotary_get_committee_title_from_project(get_the_id());
        }
        $type = get_field('project_type');
        ?>
		<div class="connectedprojectscontainer clearfix">	
			<div class="projectheader">
			   <h3><?php 
        echo $ProjectType[$type];
        ?>
			    	<br />
				    <span><?php 
        echo $committeeTitle;
        ?>
</span>
			    </h3>
			</div>	
			<div class="projectcontent">			
				<h2 class="projecttitle"><a href="<?php 
        the_permalink();
        ?>
"><?php 
        the_title();
        ?>
</a></h2>
				<?php 
        if (1 == get_field('participants_table_flag')) {
            echo rotary_show_project_icons();
        }
        ?>
				<div class="rotary_project_date"> 
					<?php 
        echo rotary_show_project_dates();
        ?>
				</div>
			<?php 
        if ('yes' == $showthumb) {
            if (has_post_thumbnail()) {
                the_post_thumbnail('medium');
            }
        }
        the_excerpt();
        ?>
				<p><a href="<?php 
        the_permalink();
        ?>
">><?php 
        echo __('Keep Reading');
        ?>
 </a></p>
				</div>		
		</div>
	<?php 
    }
}
コード例 #2
0
/**
 * show_project_blogroll function.
 * 
 * @access public
 * @param mixed $query
 * @param mixed $showthumb
 * @param mixed $committeeTitle
 * @return void
 */
function show_project_blogroll($query, $showthumb = 'no', $committeeTitle = '')
{
    $hasCommitteeTitle = '' == trim($committeeTitle) ? false : true;
    while ($query->have_posts()) {
        $query->the_post();
        ?>
		
		  <?php 
        if (!$hasCommitteeTitle) {
            ?>
		  	<?php 
            $committeeTitle = rotary_get_committee_title_from_project(get_the_id());
            ?>
		  <?php 
        }
        ?>
		<div class="connectedprojectscontainer clearfix">	
			<div class="projectheader">
				   <h3>Project Organized by:
				    	<br />
					    <span><?php 
        echo $committeeTitle;
        ?>
</span>
				    </h3>
					    
			</div>	
			<div class="projectcontent">			
			<h2 class="projecttitle"><a href="<?php 
        the_permalink();
        ?>
"><?php 
        the_title();
        ?>
</a></h2>
				
			<?php 
        rotary_show_project_icons();
        ?>
			<?php 
        $startDate = DateTime::createFromFormat('Ymd', get_field('rotary_project_date'));
        ?>
			<?php 
        $endDate = DateTime::createFromFormat('Ymd', get_field('rotary_project_end_date'));
        ?>
			<?php 
        if (get_field('long_term_project')) {
            ?>
				<?php 
            if (isset($startDate) && isset($endDate)) {
                ?>
						 <?php 
                if ($startDate != $endDate) {
                    ?>
							 <div class="rotary_project_date">
								 <span class="fulldate"><?php 
                    echo $startDate->format('jS F Y');
                    ?>
</span>
								 <?php 
                    if ('' != trim(get_field('rotary_project_end_date'))) {
                        ?>
										<br /><span>To</span><br />
										<span class="fulldate"><?php 
                        echo $endDate->format('jS F Y');
                        ?>
</span>	
								  <?php 
                    } else {
                        ?>
								  		<span> (ongoing)</span>
								  <?php 
                    }
                    ?>
							 </div>
						<?php 
                }
                ?>
				<?php 
            }
            ?>
			<?php 
        } else {
            ?>
				<div class="rotary_project_date">
					<span class="day"><?php 
            echo $startDate->format('l');
            ?>
</span><br />
					<span class="fulldate"><?php 
            echo $startDate->format('jS F Y');
            ?>
</span>
				</div>
			<?php 
        }
        ?>
	
			<?php 
        if ('yes' == $showthumb) {
            ?>
				<?php 
            if (has_post_thumbnail()) {
                ?>
					<?php 
                the_post_thumbnail('medium');
                ?>
				<?php 
            }
            ?>
			<?php 
        }
        ?>
			<?php 
        the_excerpt();
        ?>
			<p><a href="<?php 
        the_permalink();
        ?>
">> Keep Reading</a></p>
			</div>		
						
		</div>
					
	<?php 
    }
}
コード例 #3
0
function rotary_announcement_header($posted_in_id, $announcement_title = null, $context = 'web')
{
    global $ProjectType;
    $posted_in = '<a href="' . get_the_permalink($posted_in_id) . '">' . get_the_title($posted_in_id) . '</a>';
    $post_type = get_post_type($posted_in_id);
    $thumbnail = get_the_post_thumbnail($posted_in_id, array(160, 110));
    // where did this announcement come from - a project, or a committee??
    // If a project, we need to fetch its committee information, if it is associated
    switch ($post_type) {
        case 'rotary_projects':
            $type = get_field('project_type', $posted_in_id);
            $extra_classes = '';
            $committee_title = rotary_get_committee_title_from_project($posted_in_id, $extra_classes);
            break;
        case 'rotary_committee':
            break;
    }
    ob_start();
    switch ($context) {
        case 'web':
            ?>
			<div class="announcement-header">
				<?php 
            if ($thumbnail) {
                $hasthumbnail = "has-thumbnail";
                ?>
					<div class="header-thumbnail-container"><?php 
                echo $thumbnail;
                ?>
</div><?php 
            }
            ?>
					<div class="header-text-container <?php 
            echo $hasthumbnail;
            ?>
">
						<?php 
            if ($announcement_title) {
                ?>
							<h4 class="inline"><?php 
                echo $posted_in;
                ?>
</h4>
							<?php 
                if ('rotary_projects' == $post_type) {
                    ?>
								<span class="project-type"><?php 
                    echo $ProjectType[$type] . ' ';
                    ?>
</span>
								<h5 class="organizing-committee"><?php 
                    echo sprintf(__('Organized by %s'), $committee_title);
                    ?>
</h5>
							<?php 
                }
                ?>
							<h3><?php 
                echo $announcement_title;
                ?>
</h3>
						<?php 
            } else {
                ?>
							<h3  class="inline"><?php 
                echo $posted_in;
                ?>
</h3>
							<?php 
                if ('rotary_projects' == $post_type) {
                    ?>
								<span class="project-type"><?php 
                    echo $ProjectType[$type] . ' ';
                    ?>
</span>
								<h5 class="organizing-committee"><?php 
                    echo sprintf(__('Organized by %s'), $committee_title);
                    ?>
</h5>
							<?php 
                }
                ?>
						<?php 
            }
            ?>
					</div>
			</div>	
		<?php 
            break;
        case 'edit':
            ?>
			<div class="announcement-header">
					<div class="header-text-container <?php 
            echo $hasthumbnail;
            ?>
">
							<h4 class="inline"><?php 
            echo $posted_in;
            ?>
</h4>
							<?php 
            if ('rotary_projects' == $post_type) {
                ?>
								<span class="project-type"><?php 
                echo $ProjectType[$type] . ' ';
                ?>
</span>
								<h5 class="organizing-committee"><?php 
                echo sprintf(__('Organized by %s'), $committee_title);
                ?>
</h5>
							<?php 
            }
            ?>
					</div>
			</div>
			<div class="clearleft"></div>	
		<?php 
            break;
        case 'email':
            ?>
			<table class="announcement-header-table">
				<tr class="announcement-header">
					<?php 
            if ($thumbnail) {
                $hasthumbnail = "has-thumbnail";
                ?>
					<td class="header-thumbnail-container"><?php 
                echo $thumbnail;
                ?>
</td><?php 
            }
            ?>
					<td class="header-text-container <?php 
            echo $hasthumbnail;
            ?>
">
						<?php 
            if ($announcement_title) {
                ?>
							<h4 class="inline"><?php 
                echo $posted_in;
                ?>
</h4>
							<?php 
                if ('rotary_projects' == $post_type) {
                    ?>
								<span class="project-type"><?php 
                    echo $ProjectType[$type] . ' ';
                    ?>
</span>
								<h5 class="organizing-committee"><?php 
                    echo sprintf(__('Organized by %s'), $committee_title);
                    ?>
</h5>
							<?php 
                }
                ?>
							<?php 
                if ($thumbnail) {
                    ?>
</td></tr><tr><td colspan="2" class="header-text-container"><h3><?php 
                    echo $announcement_title;
                    ?>
</h3>
								<?php 
                } else {
                    ?>
								<h3><?php 
                    echo $announcement_title;
                    ?>
</h3>
								<?php 
                }
                ?>
						<?php 
            } else {
                ?>
							<h3  class="inline"><?php 
                echo $posted_in;
                ?>
</h3>
							<?php 
                if ('rotary_projects' == $post_type) {
                    ?>
								<span class="project-type"><?php 
                    echo $ProjectType[$type] . ' ';
                    ?>
</span>
								<h5 class="organizing-committee"><?php 
                    echo sprintf(__('Organized by %s'), $committee_title);
                    ?>
</h5>
							<?php 
                }
                ?>
						<?php 
            }
            ?>
					</td>
				</tr>
			</table>	
			<?php 
            break;
    }
    $return = ob_get_contents();
    ob_end_clean();
    return $return;
}