function redirect_expired()
 {
     global $wp_query;
     if (is_singular()) {
         if ('expired' == $wp_query->post->post_status) {
             if (function_exists('is_syndicated') and is_syndicated($wp_query->post->ID)) {
                 $source = get_syndication_feed_object($wp_query->post->ID);
                 $redirect_url = $source->setting('expired post redirect to', 'expired_post_redirect_to', NULL);
             } else {
                 $redirect_url = get_option('feedwordpress_expired_post_redirect_to', NULL);
             }
             if (!is_null($redirect_url) and strlen(esc_url($redirect_url)) > 0 and 'none' != $redirect_url) {
                 header("HTTP/1.1 301 Moved Permanently");
                 header("Location: " . $redirect_url);
             } else {
                 // Meh.
                 if (!($template = get_404_template())) {
                     $template = get_index_template();
                 }
                 if ($template = apply_filters('template_include', $template)) {
                     header("HTTP/1.1 410 Gone");
                     include $template;
                 }
             }
             exit;
         }
     }
 }
 function the_content($content)
 {
     if (!FWP_OLNW_ONLY_REWRITE_SYNDICATED_POSTS or is_syndicated()) {
         $content = preg_replace_callback('/<a \\s+ ([^>]* href=[^>]*)>/ix', array('FWPPlusOpenLinksInNewWindows', 'addTargetAttribute'), $content);
     }
     return $content;
 }
Exemplo n.º 3
0
 public function the_content($content)
 {
     global $post;
     if (function_exists('is_syndicated')) {
         if (is_syndicated()) {
             $source = get_syndication_feed_object($post->ID);
             $sfi = $source->setting('sicem strip featured image', 'sicem_strip_featured_image', 'no');
             switch ($sfi) {
                 case 'yes':
                     $thumbId = get_post_thumbnail_id($post->ID);
                     if (!!$thumbId) {
                         $feat_img = wp_get_attachment_url($thumbId);
                         $find_url = preg_quote($feat_img);
                         $content = preg_replace(':(<img \\s+ [^>]*src=[^>]*)' . $find_url . '([^>]*>):ix', '', $content);
                     }
                     break;
                 case 'no':
                 default:
                     // NOOP
             }
             $ig = $source->setting('sicem insert gallery', 'sicem_insert_gallery', 'no');
             switch ($ig) {
                 case 'before':
                     $content = do_shortcode('[gallery]') . "\n\n" . $content;
                     break;
                 case 'after':
                     $content = $content . "\n\n" . do_shortcode('[gallery]');
                     break;
                     // Leave it.
                 // Leave it.
                 case 'no':
                 default:
                     // NOOP
             }
         }
     }
     return $content;
 }
function feedwordpress_post_edit_controls()
{
    global $post;
    $frozen_values = get_post_custom_values('_syndication_freeze_updates', $post->ID);
    $frozen_post = (count($frozen_values) > 0 and 'yes' == $frozen_values[0]);
    if (is_syndicated($post->ID)) {
        ?>
		<p>This is a syndicated post, which originally appeared at
		<cite><?php 
        print esc_html(get_syndication_source(NULL, $post->ID));
        ?>
</cite>.
		<a href="<?php 
        print esc_html(get_syndication_permalink($post->ID));
        ?>
">View original post</a>.</p>
		
		<p><input type="hidden" name="feedwordpress_noncename" id="feedwordpress_noncename" value="<?php 
        print wp_create_nonce(plugin_basename(__FILE__));
        ?>
" />
		<label><input type="checkbox" name="freeze_updates" value="yes" <?php 
        if ($frozen_post) {
            ?>
checked="checked"<?php 
        }
        ?>
 /> <strong>Manual editing.</strong>
		If set, FeedWordPress will not overwrite the changes you make manually
		to this post, if the syndicated content is updated on the
		feed.</label></p>
		<?php 
    } else {
        ?>
		<p>This post was created locally at this website.</p>
		<?php 
    }
}
Exemplo n.º 5
0
 function row_actions($actions, $post)
 {
     if (is_syndicated($post->ID)) {
         $link = get_delete_post_link($post->ID, '', true);
         $link = MyPHP::url($link, array("fwp_post_delete" => "nuke"));
         $caption = 'Erase the record of this post (will be re-syndicated if it still appears on the feed).';
         $linktext = 'Erase/Resyndicate';
         $keys = array_keys($actions);
         $links = array();
         foreach ($keys as $key) {
             $links[$key] = $actions[$key];
             if ('trash' == $key) {
                 $links[$key] = "<a class='submitdelete' title='" . esc_attr(__('Move this item to the Trash (will NOT be re-syndicated)')) . "' href='" . get_delete_post_link($post->ID) . "'>" . __('Trash/Don&#8217;t Resyndicate') . "</a>";
                 // Placeholder.
                 $links['delete'] = '';
             }
         }
         $links['delete'] = '<a class="submitdelete" title="' . esc_attr(__($caption)) . '" href="' . $link . '">' . __($linktext) . '</a>';
         $actions = $links;
     }
     return $actions;
 }
Exemplo n.º 6
0
 public function row_actions($actions, $post)
 {
     if (is_syndicated($post->ID) && current_user_can('edit_post', $post->ID)) {
         $link = get_delete_post_link($post->ID, '', true);
         $eraseLink = MyPHP::url($link, array("fwp_post_delete" => "nuke"));
         $caption = apply_filters('feedwordpress_ui_erase_link_caption', __('Erase the record of this post (will be re-syndicated if it still appears on the feed).'));
         $linktext = apply_filters('feedwordpress_ui_erase_link_text', __('Erase/Resyndicate'));
         $retireClass = NULL;
         if ($post->post_status == 'fwpzapped') {
             if (count(get_post_meta($post->ID, '_feedwordpress_zapped_blank_me')) > 0) {
                 $retireCap = 'Un-Zap this syndicated post (so it will appear on the site again)';
                 $retireText = 'Un-Zap &amp; Restore';
                 $retireLink = MyPHP::url($link, array("fwp_post_delete" => "unzap"));
             } else {
                 // No Un-Zap link for posts that have
                 // been blanked. You'll just have to
                 // Erase and hope you can resyndicate...
                 $retireLink = NULL;
             }
         } else {
             $retireCap = apply_filters('feedwordpress_ui_zap_link_caption', __('Zap this syndicated post (so it will not be re-syndicated if it still appears on the feed).'));
             $retireText = apply_filters('feedwordpress_ui_zap_link_text', __('Zap/Don&#8217;t Resyndicate'));
             $retireLink = MyPHP::url($link, array("fwp_post_delete" => "zap"));
             $retireClass = 'submitdelete';
         }
         $keys = array_keys($actions);
         $links = array();
         foreach ($keys as $key) {
             $links[$key] = $actions[$key];
             if ('trash' == $key) {
                 #$links[$key] = "<a class='submitdelete' title='" . esc_attr( __( 'Move this item to the Trash (will NOT be re-syndicated)' ) ) . "' href='" . get_delete_post_link( $post->ID ) . "'>" . __( 'Trash' ) . "</a>";
                 // Placeholder.
                 if (!is_null($retireLink)) {
                     $links['zap trash'] = '';
                 }
                 $links['delete'] = '';
             }
         }
         if (!is_null($retireLink)) {
             $links['zap trash'] = '<a class="' . esc_attr($retireClass) . '" title="' . esc_attr(__($retireCap)) . '" href="' . $retireLink . '">' . __($retireText) . '</a>';
         }
         $links['delete'] = '<a class="submitdelete" title="' . esc_attr(__($caption)) . '" href="' . $eraseLink . '">' . __($linktext) . '</a>';
         $actions = $links;
     }
     return $actions;
 }
Exemplo n.º 7
0
get_header();
?>

<!-- Content Start-->
<?php 
if (have_posts()) {
    ?>
<div class="daygroup">

  <?php 
    while (have_posts()) {
        the_post();
        ?>
    <div class="channelgroup"><h3><?php 
        if (is_syndicated()) {
            ?>
 
    <span class="datum"><?php 
            the_time('Y-m-d');
            ?>
 av <?php 
            the_author_nickname();
            ?>
</span><br />
    <a href="<?php 
            the_syndication_source_link();
            ?>
"><?php 
            the_syndication_source();
            ?>
function feedwordpress_item_feed_data()
{
    // In a post context....
    if (is_syndicated()) {
        ?>
<source>
	<title><?php 
        the_syndication_source();
        ?>
</title>
	<link rel="alternate" type="text/html" href="<?php 
        the_syndication_source_link();
        ?>
" />
	<link rel="self" href="<?php 
        the_syndication_feed();
        ?>
" />
<?php 
        $id = get_syndication_feed_guid();
        if (strlen($id) > 0) {
            ?>
	<id><?php 
            print $id;
            ?>
</id>
<?php 
        }
        $updated = get_feed_meta('feed/updated');
        if (strlen($updated) > 0) {
            ?>
	<updated><?php 
            print $updated;
            ?>
</updated>
<?php 
        }
        ?>
</source>
<?php 
    }
}
Exemplo n.º 9
0
			<div class="texto-portada-individual articulo-single">
				<?php 
        the_content('Leer el resto del artículo &raquo;');
        ?>

				<?php 
        wp_link_pages(array('before' => '<p><strong>Pages:</strong> ', 'after' => '</p>', 'next_or_number' => 'number'));
        ?>
				<?php 
        //the_tags( '<p>Tags: ', ', ', '</p>');
        ?>
				<?php 
        /* Nota para los artículos que importamos extenamente */
        if (function_exists("is_syndicated")) {
            if (is_syndicated() and get_the_author() !== get_syndication_source()) {
                echo '<p><cite class="feed">Publicado por ';
                the_author();
                echo ' en <a href="';
                the_syndication_source_link();
                echo '">';
                the_syndication_source();
                echo '</a></cite></p>';
            }
        }
        ?>
			</div>
			
			<h2>Compartir artículo:</h2>
				<!-- Social Media buttons -->
			<div data-social-share-privacy='true'></div>
function add_source_information_content($content)
{
    if (is_syndicated()) {
        $meta = get_feed_meta('add attribution rules');
        if ($meta and !is_array($meta)) {
            $meta = unserialize($meta);
        }
        if (!is_array($meta) or empty($meta)) {
            $meta = get_option('feedwordpress_add_attribution');
        }
        if (is_array($meta) and !empty($meta)) {
            foreach ($meta as $rule) {
                if ('post' == $rule['element']) {
                    $rule['template'] = add_source_information_reformat($rule['template'], 'post');
                    if ('before' == $rule['placement']) {
                        $content = $rule['template'] . "\n" . $content;
                    } else {
                        $content = $content . "\n" . $rule['template'];
                    }
                }
            }
        }
    }
    return $content;
}
Exemplo n.º 11
0
 function the_content($content)
 {
     global $post;
     if (function_exists('is_syndicated')) {
         if (is_syndicated()) {
             $source = get_syndication_feed_object($post->ID);
             $ig = $source->setting('sicem insert gallery', 'sicem_insert_gallery', 'no');
             switch ($ig) {
                 case 'before':
                     $content = do_shortcode('[gallery]') . "\n\n" . $content;
                     break;
                 case 'after':
                     $content = $content . "\n\n" . do_shortcode('[gallery]');
                     break;
                     // Leave it.
                 // Leave it.
                 case 'no':
                 default:
                     // NOOP
             }
         }
     }
     return $content;
 }