In themes that don't override theme_feed_icon() (e.g. Garland) the feed icon turns on or off depending on the RSS Permissions. In themes that do override theme_feed_icon() (e.g. Sky) sky_feed_icon() overrides rss_permissions_feed_icon() and the icon is always displayed.

It might be possible for RSS Permissions module to take back control of theme_feed_icon() by using this technique:
http://shellmultimedia.com/articles/hookthemeregistryalter-advanced-temp...

Comments

phpdiva’s picture

Assigned: Unassigned » phpdiva

I will look into this.

Monzer Emam’s picture

here the one did it for me

/**
 * Implementation of hook_theme_registry_alter to override theme_feed_icon().
 */
function rss_permissions_theme_registry_alter(&$theme_registry) {
  $theme_registry['feed_icon']['function'] = 'rss_permissions_theme_feed_icon';
}

/**
 * Overriding theme_feed_icon().
 * Check permission to view the feed before displaying the icon.
 */
function rss_permissions_theme_feed_icon($variables) {  
  if (rss_permissions_feed_url_access($variables['url'])) {
	return theme_feed_icon($variables);
  }  
  return '';
}

also check #945462-4: Port to Drupal 7

phpdiva’s picture

Status: Active » Needs review

Thanks for this!
I just made a commit to DEV version with this code, with a few changes. It should be available for download sometime today.

If we just call theme_feed_icon(), this does not use any custom theme function to style the icon. The goal of this ticket was to integrate the module with custom theming functions specifically. Right now I'm saving the current theming function name as a variable, and forcing Drupal to use our function. If the RSS icon should be displayed, then I get the theming function name from the variable, and call that.

This approach seems to work for me.

sillygwailo’s picture

Version: 6.x-1.1 » 7.x-1.x-dev
StatusFileSize
new2.43 KB

Here's a patch that removes the header <link> element (for RSS autodiscovery), plus some coding standards (whitespace changes). It checks to see if the full URL for a site is passed to rss_permissions_feed_url_access() then removes the base URL, and does a check for whether the path is a system path or an alias, so that it can work with the system path.

phpdiva’s picture

Version: 7.x-1.x-dev » 6.x-1.1

Hey, @Richard, did you mean to upload your patch to #945462: Port to Drupal 7?
This issue is specifically regarding the feed icon implementation in custom themes.

sillygwailo’s picture

Sure, I guess.

DrewMathers’s picture

Version: 6.x-1.1 » 6.x-1.x-dev
Status: Needs review » Reviewed & tested by the community

I have tested the 12-Jan-2011 dev snapshot with the contrib theme Sky 3.11, and both the address bar and page RSS icons are successfully suppressed.

DrewMathers’s picture

Title: Surpress feed icon in themes that override theme_feed_icon() » Suppress feed icon in themes that override theme_feed_icon()

Just noticed title typo.

DrewMathers’s picture

Also successfully tested with an Artisteer 2 theme.

phpdiva’s picture

Thanks, Drew!
Now as soon as this Git migration is done and I figure out how it works, I'll make a new module release with this update!

BenK’s picture

Subscribing

DrewMathers’s picture

Status: Reviewed & tested by the community » Fixed

Since this feature is now in the dev snapshot, I guess this issues should be declared fixed.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.