Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- //Standard Plan Template
- global $post;
- global $pdf_output;
- global $pdf_header;
- global $pdf_footer;
- global $pdf_template_pdfpage;
- global $pdf_template_pdfpage_page;
- global $pdf_template_pdfdoc;
- global $pdf_html_header;
- global $pdf_html_footer;
- //Set a pdf template. if both are set the pdfdoc is used. (You didn't need a pdf template)
- $pdf_template_pdfpage = ''; //The filename off the pdf file (you need this for a page template)
- $pdf_template_pdfpage_page = 1; //The page off this page (you need this for a page template)
- $pdf_template_pdfdoc = ''; //The filename off the complete pdf document (you need only this for a document template)
- $pdf_html_header = true; //If this is true you can write instead of the array a html string on the var $pdf_header
- $pdf_html_footer = false; //If this is true you can write instead of the array a html string on the var $pdf_footer
- //Set the Footer and the Header
- $pdf_header = array (
- 'odd' =>
- array (
- 'R' =>
- array (
- 'content' => '{PAGENO}',
- 'font-size' => 12,
- 'font-style' => 'B',
- 'font-family' => 'Gudea',
- ),
- 'line' => 1,
- ),
- 'even' =>
- array (
- 'R' =>
- array (
- 'content' => '{PAGENO}',
- 'font-size' => 12,
- 'font-style' => 'B',
- 'font-family' => 'Gudea',
- ),
- 'line' => 1,
- ),
- );
- $pdf_footer = array (
- 'odd' =>
- array (
- 'R' =>
- array (
- 'content' => '{DATE m.d.Y}',
- 'font-size' => 12,
- 'font-style' => 'B',
- 'font-family' => 'Gudea',
- ),
- 'C' =>
- array (
- 'content' => '- {PAGENO} / {nb} -',
- 'font-size' => 12,
- 'font-style' => 'B',
- 'font-family' => 'Gudea',
- ),
- 'L' =>
- array (
- 'content' => get_bloginfo('name'),
- 'font-size' => 12,
- 'font-style' => 'B',
- 'font-family' => 'Gudea',
- ),
- 'line' => 1,
- ),
- 'even' =>
- array (
- 'R' =>
- array (
- 'content' => '{DATE d.m.Y}',
- 'font-size' => 12,
- 'font-style' => 'B',
- 'font-family' => 'Gudea',
- ),
- 'C' =>
- array (
- 'content' => '- {PAGENO} / {nb} -',
- 'font-size' => 12,
- 'font-style' => 'B',
- 'font-family' => 'Gudea',
- ),
- 'L' =>
- array (
- 'content' => get_bloginfo('name'),
- 'font-size' => 12,
- 'font-style' => 'B',
- 'font-family' => 'Gudea',
- ),
- 'line' => 1,
- ),
- );
- $pdf_output = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
- <html xml:lang="en">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
- <title>' . get_bloginfo() . '</title>
- </head>
- <body xml:lang="en">
- <bookmark content="'.htmlspecialchars(get_bloginfo('name'), ENT_QUOTES).'" level="0" /><tocentry content="'.htmlspecialchars(get_bloginfo('name'), ENT_QUOTES).'" level="0" />
- <div id="header">
- <div id="headerimg">
- <h1 style="margin-top: -40pt" class="header-logo"><a href="' . get_option('home') . '/">' . get_bloginfo('name') . '</a></h1>
- <div class="description">' . get_bloginfo('description') . '</div>
- </div>
- </div>
- <div id="content" class="widecolumn">';
- if(have_posts()) :
- while (have_posts()) : the_post();
- $pdf_output .= '<bookmark content="'.the_title('','', false).'" level="1" /><tocentry content="'.the_title('','', false).'" level="1" />';
- $pdf_output .= '<div class="post">
- <h2 style="margin-top: -20pt" class="center">
- <a href="' . get_permalink() . '" rel="bookmark" title="Permanent Link to ' . the_title('','', false) . '">' . the_title('','', false) . '</a></h2>';
- // the following is output for wst-intros CPT Single
- if ((is_single()) && ( 'wsg-intros' == get_post_type() ) ) {
- $pdf_output .= '<table style="width: 800px; border-size: 0px; float: none; border-collapse: collapse">';
- $pdf_output .= '<tr><td align="center" colspan="2">' . get_the_post_thumbnail( $post->ID, medium) . '</td></tr>';
- $pdf_output .= '</table>';
- $pdf_output .= '<div style="font-family: Gudea" class="intro-data">';
- $pdf_output .= '<table style="font-family: Gudea; font-size: 12pt; margin-top: 10pt; width: 850px; border-size: 0px; float: none; border-collapse: collapse">';
- if ( get_post_meta($post->ID, 'date_joined', true) ) {
- $pdf_output .= '<tr class="spaceUnder"><td style="width: 25%; vertical-align: top"><span class="intro-label">Date I Joined WSG: </span></td>';
- $pdf_output .= '<td style="width: 75%">' . (get_post_meta($post->ID, 'date_joined', true)) . '</td></tr>';
- }
- if ( get_post_meta($post->ID, 'date_birth', true) ) {
- $pdf_output .= '<tr class="spaceUnder"><td style="width: 25%; vertical-align: top"><span class="intro-label">I was born on: </span></td>';
- $pdf_output .= '<td style="width: 75%; vertical-align: top">' . (get_post_meta($post->ID, 'date_birth', true)) . '</td></tr>';
- }
- if ( get_post_meta($post->ID, 'grew_up', true) ) {
- $pdf_output .= '<tr class="spaceUnder"><td style="width: 25%; vertical-align: top"><span class="intro-label">I grew up in: </span></td>';
- $pdf_output .= '<td style="width: 75%; vertical-align: top">' . (get_post_meta($post->ID, 'grew_up', true)) . '</td></tr>';
- }
- if ( get_post_meta($post->ID, 'schools_majors', true) ) {
- $pdf_output .= '<tr class="spaceUnder"><td style="width: 25%; vertical-align: top"><span class="intro-label">My schools and majors: </span></td>';
- $pdf_output .= '<td style="width: 75%; vertical-align: top">' . ( wpautop (get_post_meta($post->ID, 'schools_majors', true)) ) . '</td></tr>';
- }
- if ( get_post_meta($post->ID, 'family_info', true) ) {
- $pdf_output .= '<tr class="spaceUnder"><td style="width: 25%; vertical-align: top"><span class="intro-label">My family information: </span></td>';
- $pdf_output .= '<td style="width: 75%; vertical-align: top">' . ( wpautop (get_post_meta($post->ID, 'family_info', true)) ) . '</td></tr>';
- }
- if ( get_post_meta($post->ID, 'professions_activities', true) ) {
- $pdf_output .= '<tr class="spaceUnder"><td style="width: 35%; vertical-align: top"><span class="intro-label">My past professions and activities: </span></td>';
- $pdf_output .= '<td style="width: 75%; vertical-align: top">' . ( wpautop (get_post_meta($post->ID, 'professions_activities', true)) ) . '</td></tr>';
- }
- if ( get_post_meta($post->ID, 'doing_now', true) ) {
- $pdf_output .= '<tr class="spaceUnder"><td style="width: 35%; vertical-align: top"><span class="intro-label">What I\'m doing now: </span></td>';
- $pdf_output .= '<td style="width: 75%; vertical-align: top">' . ( wpautop (get_post_meta($post->ID, 'doing_now', true)) ) . '</td></tr>';
- }
- if ( get_post_meta($post->ID, 'fundraising_charities', true) ) {
- $pdf_output .= '<tr class="spaceUnder"><td style="width: 35%; vertical-align: top"><span class="intro-label">Other fundraising activities and charities: </span></td>';
- $pdf_output .= '<td style="width: 75%; vertical-align: top">' . ( wpautop (get_post_meta($post->ID, 'fundraising_charities', true)) ) . '</td></tr>';
- }
- if ( get_post_meta($post->ID, 'something_unknown', true) ) {
- $pdf_output .= '<tr class="spaceUnder"><td style="width: 35%; vertical-align: top"><span class="intro-label">Something you don\'t know about me: </span></td>';
- $pdf_output .= '<td style="width: 75%; vertical-align: top">' . ( wpautop (get_post_meta($post->ID, 'something_unknown', true)) ) . '</td></tr>';
- }
- if ( get_post_meta($post->ID, 'fav_travel', true) ) {
- $pdf_output .= '<tr class="spaceUnder"><td style="width: 35%; vertical-align: top"><span class="intro-label">My favorite travel destination: </span></td>';
- $pdf_output .= '<td style="width: 75%; vertical-align: top">' . ( wpautop (get_post_meta($post->ID, 'fav_travel', true)) ) . '</td></tr>';
- }
- if ( get_post_meta($post->ID, 'fav_restaurant', true) ) {
- $pdf_output .= '<tr class="spaceUnder"><td style="width: 35%; vertical-align: top"><span class="intro-label">My favorite restaurant: </span></td>';
- $pdf_output .= '<td style="width: 75%; vertical-align: top">' . ( wpautop (get_post_meta($post->ID, 'fav_restaurant', true)) ) . '</td></tr>';
- }
- if ( get_post_meta($post->ID, 'fav_lunch', true) ) {
- $pdf_output .= '<tr class="spaceUnder"><td style="width: 35%; vertical-align: top"><span class="intro-label">My Favorite lunch spot: </span></td>';
- $pdf_output .= '<td style="width: 75%; vertical-align: top">' . ( wpautop (get_post_meta($post->ID, 'fav_lunch', true)) ) . '</td></tr>';
- }
- if ( get_post_meta($post->ID, 'night_out', true) ) {
- $pdf_output .= '<tr class="spaceUnder"><td style="width: 35%; vertical-align: top"><span class="intro-label">Place to meet friends for a night out: </span></td>';
- $pdf_output .= '<td style="width: 75%; vertical-align: top">' . ( wpautop (get_post_meta($post->ID, 'night_out', true)) ) . '</td></tr>';
- }
- if ( get_post_meta($post->ID, 'book_movie', true) ) {
- $pdf_output .= '<tr class="spaceUnder"><td style="width: 35%; vertical-align: top"><span class="intro-label">My favorite book, movie or play: </span></td>';
- $pdf_output .= '<td style="width: 75%; vertical-align: top">' . ( wpautop (get_post_meta($post->ID, 'book_movie', true)) ) . '</td></tr>';
- }
- if ( get_post_meta($post->ID, 'out_of_towners', true) ) {
- $pdf_output .= '<tr style="margin:20pt 0"><td style="width: 35%; vertical-align: top"><span class="intro-label">My favorite place to take out of towners: </span></td>';
- $pdf_output .= '<td style="width: 75%; vertical-align: top">' . ( wpautop (get_post_meta($post->ID, 'out_of_towners', true)) ) . '</td></tr>';
- }
- $pdf_output .= '</table>';
- $pdf_output .= '</div>';
- }
- $pdf_output .= '</div>';
- endwhile;
- else :
- $pdf_output .= '<h2 class="center">Not Found</h2>
- <p class="center">Sorry, but you are looking for something that isn\'t here.</p>';
- endif;
- $pdf_output .= '</div>';
- $pdf_output .= '
- </body>
- </html>';
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement