/[drupal]/contributions/modules/aggregator2/aggregator2_logo.module
ViewVC logotype

Diff of /contributions/modules/aggregator2/aggregator2_logo.module

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.4, Thu Jul 20 10:15:14 2006 UTC revision 1.5, Fri Jul 21 10:15:25 2006 UTC
# Line 1  Line 1 
1  <?php  <?php
2  // $Id: aggregator2_logo.module,v 1.3 2005/12/09 17:59:22 ahwayakchih Exp $  // $Id: aggregator2_logo.module,v 1.4 2006/07/20 10:15:14 ahwayakchih Exp $
3    
4  /*  /*
5   * Aggregator2 Logo filter   * Aggregator2 Logo filter
# Line 29  function aggregator2_logo_help($section) Line 29  function aggregator2_logo_help($section)
29  * Implementation of hook_nodeapi().  * Implementation of hook_nodeapi().
30  */  */
31  function aggregator2_logo_nodeapi(&$node, $op, $teaser = NULL, $page = NULL) {  function aggregator2_logo_nodeapi(&$node, $op, $teaser = NULL, $page = NULL) {
32    if ($node->type == 'aggregator2-item' && $op == 'load' && !$node->image) {    if ($node->type == 'aggregator2_item' && $op == 'load' && !$node->image) {
33      // 'Cache' logos, so we don't run SQL query for each item when they have are from the same feed      // 'Cache' logos, so we don't run SQL query for each item when they have are from the same feed
34      global $aggregator2_feed_logos;      global $aggregator2_feed_logos;
35      if (!$aggregator2_feed_logos[$node->fid]) {      if (!$aggregator2_feed_logos[$node->fid]) {
# Line 38  function aggregator2_logo_nodeapi(&$node Line 38  function aggregator2_logo_nodeapi(&$node
38      $node->image = $aggregator2_feed_logos[$node->fid];      $node->image = $aggregator2_feed_logos[$node->fid];
39    }    }
40    
41    if (($node->type != 'aggregator2-item' && $node->type != 'aggregator2-feed') || $op != 'view' || !$node->image) {    if (($node->type != 'aggregator2_item' && $node->type != 'aggregator2-feed') || $op != 'view' || !$node->image) {
42      return;      return;
43    }    }
44    
45    if (($node->type == 'aggregator2-item' && !variable_get('aggregator2_logo_items', 0))    if (($node->type == 'aggregator2_item' && !variable_get('aggregator2_logo_items', 0))
46      || ($node->type == 'aggregator2-feed' && !variable_get('aggregator2_logo_feed', 0))) {      || ($node->type == 'aggregator2_feed' && !variable_get('aggregator2_logo_feed', 0))) {
47      return;      return;
48    }    }
49    

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.5

  ViewVC Help
Powered by ViewVC 1.1.2