Example #1
0
                               <p>
                                       <?php 
                printf(__('This gallery contains <a %1$s>%2$s photos</a>.', 'piratenkleider'), 'href="' . get_permalink() . '" title="' . sprintf(esc_attr__('Permalink to %s', 'piratenkleider'), the_title_attribute('echo=0')) . '" rel="bookmark"', $total_images);
                ?>
                               </p>

                               <?php 
                the_excerpt();
            }
            ?>
                         <a href="<?php 
            echo get_term_link(_x('gallery', 'gallery category slug', 'piratenkleider'), 'category');
            ?>
"><?php 
            _e('More images', 'piratenkleider');
            ?>
</a>
                         | <?php 
            comments_popup_link(__('Post a comment', 'piratenkleider'), __('1 Comment', 'piratenkleider'), __('% kommentare', 'piratenkleider'));
            edit_post_link(__('Edit', 'piratenkleider'), '|', '');
        } else {
            echo piratenkleider_post_teaser($options['category-teaser-titleup'], $options['category-teaser-datebox'], $options['category-teaser-dateline'], $options['category-teaser-maxlength'], $options['teaser-thumbnail_fallback'], $options['category-teaser-floating']);
        }
        /* end of loop */
    }
    if ($wp_query->max_num_pages > 1) {
        next_posts_link(__('&larr; Older entries', 'piratenkleider'));
        previous_posts_link(__('Newer entries &rarr;', 'piratenkleider'));
    }
}
Example #2
0
$col = 0;
$numentries = $options['category-num-article-fullwidth'] + $options['category-num-article-halfwidth'];
$cols = array();
global $query_string;
$args = $query_string;
$args .= '&cat=' . $thisCat;
$args .= '&posts_per_page=' . $numentries;
query_posts($args);
while (have_posts() && $i < $numentries) {
    the_post();
    $i++;
    $output = '';
    if (isset($options['category-num-article-fullwidth']) && $options['category-num-article-fullwidth'] >= $i) {
        $output = piratenkleider_post_teaser($options['category-teaser-titleup'], $options['category-teaser-datebox'], $options['category-teaser-dateline'], $options['category-teaser-maxlength'], $options['teaser-thumbnail_fallback'], $options['category-teaser-floating']);
    } else {
        $output = piratenkleider_post_teaser($options['category-teaser-titleup-halfwidth'], $options['category-teaser-datebox-halfwidth'], $options['category-teaser-dateline-halfwidth'], $options['category-teaser-maxlength-halfwidth'], $options['teaser-thumbnail_fallback'], $options['category-teaser-floating-halfwidth']);
    }
    if (isset($output)) {
        $cols[$col++] = $output;
    }
}
?>
	  
	  
	  
      <div class="columns">
        <?php 
$z = 1;
foreach ($cols as $key => $col) {
    if (isset($options['category-num-article-fullwidth']) && $options['category-num-article-fullwidth'] > $key) {
        echo $col;
Example #3
0
function piratenkleider_display_person($post_id = 0, $format = 'full', $profillink = 1)
{
    global $options;
    $person_shortdesc = get_post_meta($post_id, 'person_shortdesc', true);
    $person_text = apply_filters('the_content', get_post_field('post_content', $post_id));
    $person_link = get_permalink($post_id);
    $person_last_name = get_post_meta($post_id, 'person_last_name', true);
    $person_first_name = get_post_meta($post_id, 'person_first_name', true);
    $person_academic = get_post_meta($post_id, 'person_academic', true);
    $fullname = '';
    if (isset($person_academic) && strlen($person_academic) > 1) {
        $fullname = $person_academic . ' ';
    }
    $fullname .= $person_first_name . ' ' . $person_last_name;
    $person_url = get_post_meta($post_id, 'person_url', true);
    $person_email = get_post_meta($post_id, 'person_email', true);
    $person_pgp_fingerprint = get_post_meta($post_id, 'person_pgp_fingerprint', true);
    $person_facebook = get_post_meta($post_id, 'person_facebook', true);
    $person_twitter = get_post_meta($post_id, 'person_twitter', true);
    $person_wiki = get_post_meta($post_id, 'person_wiki', true);
    $person_google = get_post_meta($post_id, 'person_google', true);
    $person_newsfeed = get_post_meta($post_id, 'person_newsfeed', true);
    $person_imgid = get_post_meta($post_id, 'person_bildid', true);
    $person_image = get_post_meta($post_id, 'person_bild', true);
    $bildfullwidth = $bildsmallwidth = $personenbildfull = $personenbildsmall = $personenbildsidebar = '';
    if (isset($person_imgid) && $person_imgid > 0 || isset($person_image) && strlen($person_image)) {
        $alttext = $fullname;
        $coprightcap = '';
        if (isset($person_imgid) && $person_imgid > 0) {
            $image_attributes = wp_get_attachment_image_src($person_imgid, 'person-thumb');
            $image_attributessmall = wp_get_attachment_image_src($person_imgid, 'post-thumbnails');
            $image_attributessidebar = wp_get_attachment_image_src($person_imgid, $options['sidebar-thumbnail_name']);
            if (isset($image_attributes["credits"]) && strlen($image_attributes["credits"]) > 1) {
                $alttext .= "\n" . ' (' . $image_attributes["credits"] . ')';
                $coprightcap .= '(' . $image_attributes["credits"] . ')';
            }
            if (is_array($image_attributes)) {
                $personenbildfull = '<img itemprop="image" src="' . $image_attributes[0] . '" width="' . $image_attributes[1] . '" height="' . $image_attributes[2] . '" alt="' . $alttext . '" class="size-full">';
                $personenbildsmall = '<img itemprop="image" src="' . $image_attributessmall[0] . '" width="' . $image_attributessmall[1] . '" height="' . $image_attributessmall[2] . '" alt="' . $alttext . '" class="size-full">';
                $personenbildsidebar = '<img src="' . $image_attributessidebar[0] . '" width="' . $image_attributessidebar[1] . '" height="' . $image_attributessidebar[2] . '" alt="' . $alttext . '">';
            }
        } elseif (isset($person_image)) {
            $personenbildfull = '<img itemprop="image" src="' . $person_image . '" alt="' . $alttext . '" class="size-full" height="' . $options['person-thumbnail_height'] . '" style="width: auto;">';
            $personenbildsmall = '<img itemprop="image" src="' . $person_image . '" alt="' . $alttext . '" class="size-full" height="150" style="width: auto;">';
            $personenbildsidebar = '<img src="' . $person_image . '" alt="' . $alttext . '" width="' . $options['sidebar-thumbnail_width'] . '" style="height: auto;">';
        }
        $bildfullwidth = '<div style="width: 210px" class="wp-caption alignright">';
        $bildfullwidth .= $personenbildfull;
        $bildfullwidth .= '<p class="wp-caption-text">' . $fullname;
        if (isset($coprightcap) && strlen($coprightcap) > 1) {
            $bildfullwidth .= '<br>(' . $coprightcap . ')';
        }
        $bildfullwidth .= '</p></div>';
        $bildsmallwidth = '<div style="width: 160px" class="wp-caption alignleft">';
        $bildsmallwidth .= $personenbildsmall;
        $bildsmallwidth .= '<p class="wp-caption-text">' . $fullname;
        if (isset($coprightcap) && strlen($coprightcap) > 1) {
            $bildsmallwidth .= '<br>(' . $coprightcap . ')';
        }
        $bildsmallwidth .= '</p></div>';
    }
    $out = '';
    $kontaktdata = '';
    if (isset($person_url) || isset($person_email) || isset($person_facebook) || isset($person_twitter) || isset($person_wiki) || isset($person_google)) {
        $kontaktdata .= '<h3 class="contact">' . __('Contact', 'piratenkleider') . '</h3>';
        $kontaktdata .= "<ul class=\"contact\">\n";
        if (isset($person_email) && strlen($person_email) > 1) {
            $kontaktdata .= "<li class=\"email\"><span>E-Mail: </span><a itemprop=\"email\" href=\"mailto:" . $person_email . "\">" . $person_email . "</a>";
            $kontaktdata .= "</li>\n";
        }
        if (isset($person_pgp_fingerprint) && strlen($person_pgp_fingerprint) > 1) {
            $kontaktdata .= "<li class=\"pgp\"><span>Fingerprint: </span><code>" . $person_pgp_fingerprint . "</code></li>";
        }
        if (isset($person_url) && strlen($person_url) > 1) {
            $kontaktdata .= "<li class=\"website\"><span>Web: </span><a class=\"extern\" itemprop=\"url\" href=\"" . $person_url . "\">" . piratenkleider_display_url($person_url) . "</a></li>\n";
        }
        if (isset($person_twitter) && strlen($person_twitter) > 1) {
            if (filter_var($person_twitter, FILTER_VALIDATE_URL)) {
                $url = $person_twitter;
            } else {
                $url = 'https://twitter.com/' . $person_twitter;
            }
            $kontaktdata .= "<li class=\"twitter\"><span>Twitter: </span><a href=\"" . $url . "\">" . piratenkleider_display_url($url) . "</a></li>\n";
        }
        if (isset($person_facebook) && strlen($person_facebook) > 1) {
            $kontaktdata .= "<li class=\"facebook\"><span>Facebook: </span><a href=\"" . $person_facebook . "\">" . piratenkleider_display_url($person_facebook) . "</a></li>\n";
        }
        if (isset($person_google) && strlen($person_google) > 1) {
            $kontaktdata .= "<li class=\"google\"><span>Google: </span><a href=\"" . $person_google . "\">" . piratenkleider_display_url($person_google) . "</a></li>\n";
        }
        if (isset($person_wiki) && strlen($person_wiki) > 1) {
            if (filter_var($person_wiki, FILTER_VALIDATE_URL)) {
                $url = $person_wiki;
            } else {
                $url = $options['url-wiki'] . '/User:'******'piratewiki';
            if (preg_match("/wikipedia\\.org/i", $url)) {
                $wikiclass = 'wiki';
            }
            $kontaktdata .= "<li class=\"" . $wikiclass . "\"><span>Wiki: </span><a href=\"" . $url . "\">" . piratenkleider_display_url($url) . "</a></li>\n";
        }
        if (isset($person_newsfeed) && strlen($person_newsfeed) > 1) {
            $kontaktdata .= "<li class=\"feed\"><span>Feed: </span><a href=\"" . $person_newsfeed . "\">" . piratenkleider_display_url($person_newsfeed) . "</a></li>\n";
        }
        $kontaktdata .= "</ul>\n";
    }
    if ($format == 'full') {
        $out .= $bildfullwidth . "\n";
        $out .= "<div class=\"textinfo\">\n";
        $out .= '<h3 class="about">' . __('About', 'piratenkleider') . ' ';
        if ($profillink == 1) {
            $out .= '<a href="' . $person_link . '">';
        }
        $out .= '<span itemprop="name">' . $fullname . '</span>';
        if ($profillink == 1) {
            $out .= '</a>';
        }
        $out .= '</h3>';
        $out .= '<p itemprop="description">' . $person_shortdesc . "</p>\n";
        $out .= $kontaktdata;
        $out .= $person_text;
        $out .= "</div>\n";
        if ($options['vcard-showfeed'] == 1 && isset($person_newsfeed) && strlen($person_newsfeed) > 1) {
            if (function_exists('fetch_feed')) {
                include_once ABSPATH . WPINC . '/feed.php';
                $feed = fetch_feed($person_newsfeed);
                $limit = $feed->get_item_quantity($options['vcard-feed-maxnum']);
                // specify number of items
                $items = $feed->get_items(0, $limit);
                // create an array of items
            }
            if ($limit == 0) {
                $out .= '<div class="personfeed skip">' . __("The feed is either empty or unavailable.", 'piratenkleider') . '</div>';
            } else {
                $out .= '<div class="personfeed">';
                $out .= "<h3>" . __('Last posts', 'piratenkleider') . "</h3>\n";
                $out .= "<ul>";
                foreach ($items as $item) {
                    $out .= '<li><a href="' . $item->get_permalink() . '">';
                    $out .= $item->get_title();
                    $out .= '</a>';
                    $out .= ' (' . $item->get_date('j. F Y') . ')';
                    $out .= '</li>';
                }
                $out .= "</ul>";
                $out .= "</div>\n";
            }
        }
        if ($options['vcard-showlocalentries'] == 1) {
            $searchterm = $fullname;
            $query_args = array('s' => $searchterm);
            $personposts = new WP_Query($query_args);
            if ($personposts->have_posts()) {
                $ppout = $ppoutput = '';
                while ($personposts->have_posts()) {
                    $personposts->the_post();
                    $ppout = piratenkleider_post_teaser(1, 1, 1, 200, 1, 1, 4);
                    if (isset($ppout)) {
                        $ppoutput .= $ppout;
                    }
                }
            }
            wp_reset_query();
            if (isset($ppoutput)) {
                $out .= '<div class="businesscard-entries">';
                $out .= "<h3>" . __('Last entries from this site about', 'piratenkleider') . " {$fullname}</h3>\n";
                $out .= $ppoutput;
                $out .= "</div>\n";
            }
        }
    } elseif ($format == 'small') {
        $out .= $bildsmallwidth;
        $out .= "<div class=\"textinfo\">\n";
        $out .= '<h3 class="about">';
        if ($profillink == 1) {
            $out .= '<a href="' . $person_link . '">';
        }
        $out .= $fullname;
        if ($profillink == 1) {
            $out .= '</a>';
        }
        $out .= '</h3>';
        $out .= '<p>' . $person_shortdesc . "</p>\n";
        $out .= $kontaktdata;
        $out .= "</div>\n";
    } elseif ($format == 'sitebar') {
        $out .= '<section id="steckbrief">';
        if ($profillink == 1) {
            $out .= '<a href="' . $person_link . '">';
        }
        $out .= $personenbildsidebar;
        if ($profillink == 1) {
            $out .= '</a>';
        }
        $out .= '<div class="text">';
        $out .= '<h3>';
        $out .= $fullname;
        $out .= '</h3>';
        $out .= $kontaktdata;
        $out .= '<p>' . $person_shortdesc . "</p>\n";
        $out .= "</div>\n";
        $out .= "</section>\n";
    } elseif ($format == 'table') {
        $out .= "<tr>";
        $out .= "<td>";
        $out .= $bildsmallwidth;
        $out .= "</td>";
        $out .= "<td>";
        $out .= '<h3 class="about">';
        if ($profillink == 1) {
            $out .= '<a href="' . $person_link . '">';
        }
        $out .= $fullname;
        if ($profillink == 1) {
            $out .= '</a>';
        }
        $out .= '</h3>';
        $out .= $kontaktdata;
        $out .= '<p>' . $person_shortdesc . "</p>\n";
        $out .= "</td>";
        $out .= "</tr>";
    } elseif ($format == 'bigtable') {
        $out .= "<tr>";
        $out .= "<td>";
        $out .= $bildfullwidth;
        $out .= "</td>";
        $out .= "<td>";
        $out .= '<h3 class="about">';
        if ($profillink == 1) {
            $out .= '<a href="' . $person_link . '">';
        }
        $out .= $fullname;
        if ($profillink == 1) {
            $out .= '</a>';
        }
        $out .= '</h3>';
        $out .= $kontaktdata;
        $out .= '<p>' . $person_shortdesc . "</p>\n";
        $out .= $person_text;
        $out .= "</td>";
        $out .= "</tr>";
    } else {
        $out .= $bildsmallwidth;
        $out .= "<div class=\"textinfo\">\n";
        $out .= '<h3 class="about">';
        if ($profillink == 1) {
            $out .= '<a href="' . $person_link . '">';
        }
        $out .= $fullname;
        if ($profillink == 1) {
            $out .= '</a>';
        }
        $out .= '</h3>';
        $out .= $person_shortdesc . "\n";
        $out .= $kontaktdata;
        $out .= "</div>\n";
    }
    return $out;
}