Add the node id of a feed item's source to the meme and related content objects

bflora - January 3, 2009 - 09:07
Project:Memetracker
Version:6.x-1.1-alpha6
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:active
Description

My memetracker has about 40 sources in it.

Items from some of these sources are themed differently due the information being different.

In order to theme them differently, I have to run a test against the node ID of each item's parent feed.

There does not appear to be any easy, resource-cheap way to do this.

Right now I have to run a node_load for each meme

$node = node_load($meme->headline->int_id);

Then do some funky php judo that someone on IRC had to show me after 20 minutes of begging to get $val, which is the node ID of the parent feed for the top node in a meme.

  list(, $val)= each($node->feedapi_node->feed_nids);

And I have to repeat this for each related content item.

These node_loads add up pretty quickly. If I could get the source feed's ID as part of the $meme object and part of the $related_content object, I'd be able to save some memory and improve performance.....which is pretty terrible at the moment.

 
 

Drupal is a registered trademark of Dries Buytaert.