Esempio n. 1
0
function ua_webtide_loop_jobs_after_the_title($post)
{
    // Get details
    $details = array();
    if ($department = get_post_meta($post->ID, 'department', true)) {
        $details['Department'] = $department;
    }
    if ($closing_date = strtotime(get_post_meta($post->ID, 'closing_date', true))) {
        $details['Closing Date'] = date('n/j/Y', $closing_date);
    }
    // Add details
    if ($details) {
        ?>
<p class="post-meta"><?php 
        $details_index = 0;
        foreach ($details as $detail_label => $detail) {
            // If more than 1 detail, add a space between them
            if ($details_index > 0) {
                echo '&nbsp;&nbsp;/&nbsp;&nbsp;';
            }
            // Print the detail
            echo $detail_label . ': <span class="meta-value">' . $detail . '</span>';
            // Keep track of the detail index
            $details_index++;
        }
        ?>
</p><?php 
    }
    // Add social media share buttons
    if ($tweet_intent_url = get_ua_webtide_job_tweet_intent_url($post->ID)) {
        ?>
<a class="social-button twitter" href="<?php 
        echo $tweet_intent_url;
        ?>
" target="_blank">Share on Twitter</a><?php 
    }
    if ($facebook_share_url = get_ua_webtide_facebook_share_url($post->ID)) {
        ?>
<a class="social-button facebook" href="<?php 
        echo $facebook_share_url;
        ?>
" target="_blank">Share on Facebook</a><?php 
    }
}
Esempio n. 2
0
function get_ua_webtide_job_body_for_mailchimp($post_id, $args = array())
{
    // Set up defaults
    $defaults = array('header_prefix' => NULL, 'header_suffix' => NULL);
    extract(wp_parse_args($args, $defaults), EXTR_OVERWRITE);
    // Get the job permalink
    $job_permalink = get_permalink($post_id);
    // Get the job title
    $job_title = get_the_title($post_id);
    // Create the email body
    $email_body = NULL;
    // Add the job title
    $email_body = '<h2 style="margin:1.1em 0 0.075em 0;">' . $header_prefix . '<a href="' . $job_permalink . '" target="_blank">' . $job_title . '</a> ' . $header_suffix . '</h2>';
    // Add the job details
    $department = get_post_meta($post_id, 'department', true);
    $closing_date = strtotime(get_post_meta($post_id, 'closing_date', true));
    if ($department || $closing_date) {
        $email_body .= '<p style="margin:0 0 10px 0; color:#444;">';
        if ($department) {
            $email_body .= '<strong>Department:</strong> ' . $department;
        }
        if ($closing_date) {
            // Add separator
            if ($department) {
                $email_body .= ' / ';
            }
            $email_body .= '<strong>Closing Date:</strong> ' . date('n/j/Y', $closing_date);
        }
        $email_body .= '</p>';
    }
    // Build Facebook share URL
    $facebook_share_url = get_ua_webtide_facebook_share_url($post_id);
    // Build Twitter share URL
    $twitter_share_url = get_ua_webtide_job_tweet_intent_url($post_id);
    // Add the social share
    if ($facebook_share_url || $twitter_share_url) {
        $email_body .= '<table border="0" cellpadding="0" cellspacing="0" width="100%" class="mcnShareBlock" style="margin: 0;padding: 0;border-collapse: collapse;mso-table-lspace: 0pt;mso-table-rspace: 0pt;-ms-text-size-adjust: 100%;-webkit-text-size-adjust: 100%;">
		    <tbody class="mcnShareBlockOuter" style="padding:0;">
		            <tr>
		                <td valign="top" style="padding: 0;mso-table-lspace: 0pt;mso-table-rspace: 0pt;-ms-text-size-adjust: 100%;-webkit-text-size-adjust: 100%;" class="mcnShareBlockInner">
		                    <table border="0" cellpadding="0" cellspacing="0" width="100%" class="mcnShareContentContainer" style="border-collapse: collapse;mso-table-lspace: 0pt;mso-table-rspace: 0pt;-ms-text-size-adjust: 100%;-webkit-text-size-adjust: 100%;">
		    <tbody><tr>
		        <td align="left" style="padding-top: 0;padding-left: 0;padding-bottom: 0;padding-right: 0;mso-table-lspace: 0pt;mso-table-rspace: 0pt;-ms-text-size-adjust: 100%;-webkit-text-size-adjust: 100%;">
		            <table border="0" cellpadding="0" cellspacing="0" width="100%" class="mcnShareContent" style="border: 0;background: none;border-collapse: collapse;mso-table-lspace: 0pt;mso-table-rspace: 0pt;-ms-text-size-adjust: 100%;-webkit-text-size-adjust: 100%;">
		                <tbody><tr>
		                    <td align="left" valign="top" class="mcnShareContentItemContainer" style="padding: 0;mso-table-lspace: 0pt;mso-table-rspace: 0pt;-ms-text-size-adjust: 100%;-webkit-text-size-adjust: 100%;">
								<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse;mso-table-lspace: 0pt;mso-table-rspace: 0pt;-ms-text-size-adjust: 100%;-webkit-text-size-adjust: 100%;">
									<tbody><tr>
										<td align="left" valign="top" style="mso-table-lspace: 0pt;mso-table-rspace: 0pt;-ms-text-size-adjust: 100%;-webkit-text-size-adjust: 100%;">';
        if ($facebook_share_url) {
            $email_body .= '<table align="left" border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse;mso-table-lspace: 0pt;mso-table-rspace: 0pt;-ms-text-size-adjust: 100%;-webkit-text-size-adjust: 100%;">
					                                <tbody><tr>
					                                    <td valign="top" style="padding-right: 9px;padding-bottom: 0;mso-table-lspace: 0pt;mso-table-rspace: 0pt;-ms-text-size-adjust: 100%;-webkit-text-size-adjust: 100%;" class="mcnShareContentItemContainer">
					                                        <table border="0" cellpadding="0" cellspacing="0" width="" class="mcnShareContentItem" style="border-collapse: separate;border: 1px solid #CCCCCC;border-radius: 5px;background-color: #FAFAFA;mso-table-lspace: 0pt;mso-table-rspace: 0pt;-ms-text-size-adjust: 100%;-webkit-text-size-adjust: 100%;">
					                                            <tbody><tr>
					                                                <td align="left" valign="middle" style="padding-top: 5px;padding-right: 9px;padding-bottom: 5px;padding-left: 9px;mso-table-lspace: 0pt;mso-table-rspace: 0pt;-ms-text-size-adjust: 100%;-webkit-text-size-adjust: 100%;">
					                                                    <table align="left" border="0" cellpadding="0" cellspacing="0" width="" style="border-collapse: collapse;mso-table-lspace: 0pt;mso-table-rspace: 0pt;-ms-text-size-adjust: 100%;-webkit-text-size-adjust: 100%;">
					                                                        <tbody><tr>
					                                                            <td align="center" valign="middle" width="24" class="mcnShareIconContent" style="mso-table-lspace: 0pt;mso-table-rspace: 0pt;-ms-text-size-adjust: 100%;-webkit-text-size-adjust: 100%;">
					                                                                <a href="' . $facebook_share_url . '" target="_blank" style="word-wrap: break-word;-ms-text-size-adjust: 100%;-webkit-text-size-adjust: 100%;color: #990000;font-weight: normal;text-decoration: underline;"><img src="http://cdn-images.mailchimp.com/icons/social-block-v2/color-facebook-48.png" style="display: block;border: 0;outline: none;text-decoration: none;-ms-interpolation-mode: bicubic;height: auto !important;" height="24" width="24" class=""></a>
					                                                            </td>
					                                                            <td align="left" valign="middle" class="mcnShareTextContent" style="padding-left: 5px;mso-table-lspace: 0pt;mso-table-rspace: 0pt;-ms-text-size-adjust: 100%;-webkit-text-size-adjust: 100%;">
					                                                                <a href="' . $facebook_share_url . '" target="" style="color: #505050;font-family: Arial;font-size: 12px;font-weight: normal;line-height: 100%;text-align: center;text-decoration: none;word-wrap: break-word;-ms-text-size-adjust: 100%;-webkit-text-size-adjust: 100%;">Share</a>
					                                                            </td>
					                                                        </tr>
					                                                    </tbody></table>
					                                                </td>
					                                            </tr>
					                                        </tbody></table>
					                                    </td>
					                                </tr>
					                            </tbody></table>';
        }
        $email_body .= '<!--[if gte mso 6]>
										</td>
								    	<td align="left" valign="top">
										<![endif]-->';
        if ($twitter_share_url) {
            $email_body .= '<table align="left" border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse;mso-table-lspace: 0pt;mso-table-rspace: 0pt;-ms-text-size-adjust: 100%;-webkit-text-size-adjust: 100%;">
					                                <tbody><tr>
					                                    <td valign="top" style="padding-right: 0;padding-bottom: 0;mso-table-lspace: 0pt;mso-table-rspace: 0pt;-ms-text-size-adjust: 100%;-webkit-text-size-adjust: 100%;" class="mcnShareContentItemContainer">
					                                        <table border="0" cellpadding="0" cellspacing="0" width="" class="mcnShareContentItem" style="border-collapse: separate;border: 1px solid #CCCCCC;border-radius: 5px;background-color: #FAFAFA;mso-table-lspace: 0pt;mso-table-rspace: 0pt;-ms-text-size-adjust: 100%;-webkit-text-size-adjust: 100%;">
					                                            <tbody><tr>
					                                                <td align="left" valign="middle" style="padding-top: 5px;padding-right: 9px;padding-bottom: 5px;padding-left: 9px;mso-table-lspace: 0pt;mso-table-rspace: 0pt;-ms-text-size-adjust: 100%;-webkit-text-size-adjust: 100%;">
					                                                    <table align="left" border="0" cellpadding="0" cellspacing="0" width="" style="border-collapse: collapse;mso-table-lspace: 0pt;mso-table-rspace: 0pt;-ms-text-size-adjust: 100%;-webkit-text-size-adjust: 100%;">
					                                                        <tbody><tr>
					                                                            <td align="center" valign="middle" width="24" class="mcnShareIconContent" style="mso-table-lspace: 0pt;mso-table-rspace: 0pt;-ms-text-size-adjust: 100%;-webkit-text-size-adjust: 100%;">
					                                                                <a href="' . $twitter_share_url . '" target="_blank" style="word-wrap: break-word;-ms-text-size-adjust: 100%;-webkit-text-size-adjust: 100%;color: #990000;font-weight: normal;text-decoration: underline;"><img src="http://cdn-images.mailchimp.com/icons/social-block-v2/color-twitter-48.png" style="display: block;border: 0;outline: none;text-decoration: none;-ms-interpolation-mode: bicubic;height: auto !important;" height="24" width="24" class=""></a>
					                                                            </td>
					                                                            <td align="left" valign="middle" class="mcnShareTextContent" style="padding-left: 5px;mso-table-lspace: 0pt;mso-table-rspace: 0pt;-ms-text-size-adjust: 100%;-webkit-text-size-adjust: 100%;">
					                                                                <a href="' . $twitter_share_url . '" target="" style="color: #505050;font-family: Arial;font-size: 12px;font-weight: normal;line-height: 100%;text-align: center;text-decoration: none;word-wrap: break-word;-ms-text-size-adjust: 100%;-webkit-text-size-adjust: 100%;">Tweet</a>
					                                                            </td>
					                                                        </tr>
					                                                    </tbody></table>
					                                                </td>
					                                            </tr>
					                                        </tbody></table>
					                                    </td>
					                                </tr>
					                            </tbody></table>';
        }
        $email_body .= '<!--[if gte mso 6]>
										</td>
								    	<td align="left" valign="top">
										<![endif]-->
					                        
										</td>
									</tr>
								</tbody></table>
		                    </td>
		                </tr>
		            </tbody></table>
		        </td>
		    </tr>
		</tbody></table>
		
		                </td>
		            </tr>
		    </tbody>
		</table>';
    }
    // Add description
    if (($job_post_content = get_post_field('post_content', $post_id)) && ($job_content = wpautop($job_post_content, false))) {
        $email_body .= $job_content;
    }
    return $email_body;
}