Author
Message
jakec Moderator Joined: Feb 06, 2006 Posts: 1712 Location: United Kingdom
Posted:
Fri Mar 14, 2008 7:07 am
I have a feed which includes a <pubDate> field.
I would like to display this field in the boxover and I had look to see if I could huntdown the section of code in the files which defines this, but I to not avail.
Is there any chance you could point me in the right direction.
Thanks in advance
Jakec
kguske Site Admin Joined: Jun 04, 2004 Posts: 4678
Posted:
Fri Mar 14, 2008 9:23 am
I'll take a look when I get a chance...
jakec Moderator Joined: Feb 06, 2006 Posts: 1712 Location: United Kingdom
Posted:
Fri Mar 14, 2008 10:58 am
I'll take another look tonight and hopefully I can find the section of code and I'll have a go hacking it. Whats the worst that can happen?
montego Site Admin Joined: Aug 29, 2004 Posts: 7330 Location: Arizona
Posted:
Sat Mar 15, 2008 11:24 am
jakec , I had a similar desire and also wanted to have indentation on the text, so see if this replacement is more to your liking:
Code:
function headlines($bid, $cenbox=0) {
global $prefix, $db, $useBoxoverWithnukePIE;
if (!defined('_CHARSET')) define('_CHARSET','ISO-8859-1');
include_once(INCLUDE_PATH.'includes/SimplePie/simplepie.inc');
include_once(INCLUDE_PATH.'includes/SimplePie/idn/idna_convert.class.php');
# Create a new instance of the SimplePie object
$feed = new SimplePie();
# Get Feed Information
$bid = intval($bid);
$result = $db->sql_query('SELECT title, url, refresh FROM '.$prefix.'_blocks WHERE bid=\''.$bid.'\'');
list($title, $url, $refresh) = $db->sql_fetchrow($result);
$title = stripslashes(check_html($title, 'nohtml'));
$refresh = intval($refresh);
# Initialize the whole SimplePie object. Read the feed, process it, parse it, cache it, etc.
$feed->set_feed_url($url);
$feed->set_output_encoding(_CHARSET);
$feed->set_cache_duration($refresh);
$feed->init();
$feed->handle_content_type();
$content = '<font class="content"><table width="100%">';
if (isset($feed->error)) {
# If errors, display it.
$content .= htmlspecialchars($feed->error);
}
else
{
foreach($feed->get_items() as $item) {
// $content .= '·';
$content .= '<tr><td valign="top">•</td><td valign="top">';
// If the item has a permalink back to the original post, link the item's title to it.
if ($item->get_permalink())
{
$content .= '<a href="' . $item->get_permalink() . '" title="';
$item_desc = $item->get_description();
$item_date = $item->get_date('F j, Y');
if ($useBoxoverWithnukePIE)
{
if ($item_desc == check_html($item_desc, 'nohtml')) $item_desc = nl2br($item_desc);
$content .= 'cssbody=[nukePIEbody] cssheader=[nukePIEhdr] header=['.encodeBoxover($item_date . ': ' . check_html($item->get_title(), 'nohtml')).'] body=['.encodeBoxover(xmlentities($item_desc)).'] singleclickstop=[On] ';
}
else
{
$content .= check_html($item_desc, 'nohtml');
}
$content .= '">';
}
$content .= $item_date . ': ' . check_html($item->get_title(), 'nohtml');
if ($item->get_permalink()) $content .= '</a>';
// Check for enclosures. If an item has any, set the first one to the $enclosure variable.
/* if ($enclosure = $item->get_enclosure(0)) {
# Use the embed() method to embed the enclosure into the page inline.
$content .= '<div align="center">';
$content .= '<p>' . $enclosure->embed(array(
'audio' => './for_the_demo/place_audio.png',
'video' => './for_the_demo/place_video.png',
'alt' => '<img src="./for_the_demo/mini_podcast.png" class="download" border="0" title="Download the Podcast (' . $enclosure->get_extension() . '; ' . $enclosure->get_size() . ' MB)" />',
'altclass' => 'download'
)) . '</p>';
$content .= '<p class="footnote" align="center">(' . $enclosure->get_type() . '; ' . $enclosure->get_size() . ' MB)</p>';
$content .= '</div>';
}
*/ $content .= '</td></tr>';
}
}
$siteurl = ereg_replace('http://','',$url);
$siteurl = explode('/',$siteurl);
$content .= '</table></font><br /><table border="0" cellspacing="0" cellpadding="0" width="100%"><tr><td><a href="http://'.$siteurl[0].'" title="'.$title.'" target="blank"><b>'._HREADMORE.'</b></a></td><td align="right"><a href="http://nukeseo.com" title="nukePIE (c) nukeSEO.com">©</a></td></tr></table>';
if ($cenbox == 0) {
themesidebox($title, $content);
} else {
themecenterbox($title, $content);
}
}
This is what I use on some of my sites now.
You can see it if you like.
View next topic
View previous topic
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum