PluginProbe
Link Library / trunk
Link Library vtrunk
7.9.7 7.9.6 7.9.5 7.9.4 7.9.3 7.9.2 7.9.1 6.0-Beta11 6.0-Beta12 6.0-Beta2 6.0-Beta3 6.0-Beta4 6.0-Beta5 6.0-Beta6 6.0-Beta7 6.0-Beta8 6.0-Beta9 6.6.8 7.1.4 7.1.5 7.1.6 7.1.7 7.1.8 7.1.9 7.2.0 All 135 releases
link-library / rsspreview.php

rsspreview.php in Link Library trunk, at rsspreview.php

72 lines 2.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 function link_library_generate_rss_preview( $my_link_library_plugin ) {
4 $linkid = intval( $_GET['linkid'] );
5 $itemcount = intval( $_GET['previewcount'] );
6
7 $link_rss = get_post_meta( $linkid, 'link_rss', true );
8 $link_url = get_post_meta( $linkid, 'link_url', true );
9 $link = get_post( $linkid );
10
11 $genoptions = get_option('LinkLibraryGeneral');
12
13 include_once(ABSPATH . WPINC . '/feed.php');
14
15 if ( !empty( $link_rss ) && !empty( $link ) ) {
16 // Get a SimplePie feed object from the specified feed source.
17 $rss = fetch_feed( $link_rss );
18 if ( !is_wp_error( $rss ) ) { // Checks that the object is created correctly
19 // Figure out how many total items there are, but limit it to 5.
20 $maxitems = $rss->get_item_quantity( $itemcount );
21
22 // Build an array of all the items, starting with element 0 (first element).
23 $rss_items = $rss->get_items( 0, $maxitems );
24
25 }
26 ?>
27 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
28
29 <html xmlns="http://www.w3.org/1999/xhtml">
30 <head>
31 <title><?php echo ( empty( $_GET['feed'] ) ) ? 'RSS_PHP' : 'RSS_PHP: ' . $link->post_title; ?></title>
32
33 <!-- META HTTP-EQUIV -->
34 <meta http-equiv="content-type" content="text/html; charset=UTF-8; ?>" />
35 <meta http-equiv="imagetoolbar" content="false" />
36
37 <?php if ( isset( $genoptions['stylesheet'] ) && !empty( $genoptions['stylesheet'] ) ) { ?>
38 <style id='LinkLibraryStyle' type='text/css'>
39 <?php echo stripslashes( $genoptions['fullstylesheet'] ); ?>
40 </style>
41 <?php } ?>
42
43 </head>
44
45 <body>
46 <div id="ll_rss_preview_results">
47 <?php if ( $rss_items ) { ?>
48 <?php foreach($rss_items as $item): ?>
49 <div class="ll_rss_preview_title" style="padding:0 5px 5px;">
50 <h1><a target="feedwindow" href="<?php echo $item->get_permalink(); ?>"><?php echo $item->get_title(); ?></a><div class='ll_rss_preview_date'><?php echo $item->get_date('j F Y | g:i a'); ?></div></h1>
51 <div class='ll_rss_preview_content'><?php echo $item->get_description(); ?></div>
52 </div>
53 <br />
54 <?php
55 endforeach;
56 ?>
57 <br />
58 <div>
59 <a class="ll_rss_preview_button" target="feedwindow" href="<?php echo $link_rss; ?>"><span>More News from this Feed</span></a> <a class="ll_rss_preview_button" target="sitewindow" href="<?php echo $link_url; ?>"><span>See Full Web Site</span></a>
60 </div>
61 <br />
62 <br />
63 <?php } ?>
64 </div>
65 </body>
66 </html>
67
68 <?php
69 exit;
70 }
71 }
72