Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> NukePie/SimplePie
Author Message
jakec
Site Admin



Joined: Feb 06, 2006
Posts: 3048
Location: United Kingdom

PostPosted: Fri Mar 14, 2008 7:07 am Reply with quote

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. Embarassed

Is there any chance you could point me in the right direction.

Thanks in advance

Jakec
 
View user's profile Send private message
kguske
Site Admin



Joined: Jun 04, 2004
Posts: 6437

PostPosted: Fri Mar 14, 2008 9:23 am Reply with quote

I'll take a look when I get a chance...

_________________
I search, therefore I exist...
Only registered users can see links on this board! Get registered or login!
 
View user's profile Send private message
jakec







PostPosted: Fri Mar 14, 2008 10:58 am Reply with quote

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? Laughing
 
montego
Site Admin



Joined: Aug 29, 2004
Posts: 9457
Location: Arizona

PostPosted: Sat Mar 15, 2008 11:24 am Reply with quote

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 .= '&middot;';
        $content .= '<tr><td valign="top">&bull;</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">&copy;</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 Only registered users can see links on this board! Get registered or login! if you like.

_________________
Only registered users can see links on this board! Get registered or login!
Only registered users can see links on this board! Get registered or login! 
View user's profile Send private message Visit poster's website
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> NukePie/SimplePie

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
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©