Closed (fixed)
Project:
RSS Feeds Block
Version:
6.x-1.3
Component:
Code
Priority:
Critical
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
18 Jul 2010 at 01:19 UTC
Updated:
25 Nov 2010 at 19:00 UTC
I'd like to be able to create public blocks, not just private blocks. So, for instance, when I create a block from a RSS url I'd like to have the option to decide if the block will be visible to everyone.
Comments
Comment #1
amedjesi commentedIf I'm understanding you correctly this is out of scope for this project. This project gives authenticated users the ability to have there own block of RSS feeds that they control and view.
You should be able to pull this off without this module just using views and the feedapi module I think. Using the feedapi module create a content type (or using the existing one). Using that content type add the RSS feed(s). Then create a view block that pulls that content. Add that block to whatever page and allow it so that anyone can view it.
If I didn't understand what you mean or if you need some help with what I said above just comment some more.
Comment #2
Azrael256 commentedHi,
I would like to have public blocks too, now, I know, I know, I could use Views and standard blocks. But this wouldn't be as practical as the current RSS Feeds Block module, which allows to select which feed to display from a combobox (which is great), thus avoiding the need to have as many blocks as there are different feeds.
Actually I was planning to use RSS Feed blocks to only give my user access to some admin-preselected feeds (hiding the fields to make new feeds).
I thought maybe instead of a full new feature, you had some quick & dirty way to customize the module that way ? I was able to prevent users from adding/deleting feeds (simply by commenting the right lines in the .module file), but I didn't succeed in letting them see feeds created by the admin. I tried to modify the rss feeds block views (deleting the "current user: yes" filter), but it apparently isn't enough to make it work.
Is there a solution and if yes, how do I proceed ?
Comment #3
amedjesi commentedOff the top of my head I think if you just hard code who the user is instead of getting the active user it should work. I'll try to figure out what lines you would need to change to get it working this way.
Comment #4
lyudmila commentedI am having the same issue. Would like to show the feeds created by an admin (in the RSS block) to all roles. If you could figure out which lines to comment out it would be greatly appreciated.
Thank you so much!
Comment #5
amedjesi commentedHaven't tested this out at all but here it goes. In theme_rss_feeds_block you want to comment line 333 to 336 to remove the add box. Comment out line 321 to get rid of the delete button. Also comment out rss_feeds_block_node_grants and rss_feeds_block_node_access_records. May need to rebuild node permissions in admin/content/node-settings.
Then you need to replace global $user; lines. Do this everywhere expect rss_feeds_block_add_feed and rss_feeds_block_remove_feed functions. Replace global user; with:
$user = new stdClass;
$user->uid = 1;
Just to be safe comment line 103 to 117 so that users can never run the code to add and remove feeds. The last thing is to update the views so that it filters by the admin user instead of the current user.
I think that should be it. To add feeds you would just go to node/add. If you have any problems with this just ask.
Comment #6
Azrael256 commentedHello, and thanks for your help.
I'm getting the following error : Fatal error: Call to undefined function object() in /www/modules/rss_feeds_block/rss_feeds_block.module on line 557
Any idea ?
Comment #7
amedjesi commentedIs this line within the function rss_feeds_block_access? If so can just comment that whole thing.
Comment #8
Azrael256 commentedHello, and thanks again for helping me.
It was indeed in that function. As commenting the whole function would give a warning from Drupal on every page, I didn't comment the function as a whole, but everything inside it except "return TRUE;".
Basically, it works simply like that :
I don't know if it could be a trouble, but at least now it installs fine, and there is no more warning when rss_feeds_block block isn't called by Drupal.
However, once installed, any call to the block brings a : Fatal error: Call to undefined function object() in /www/modules/rss_feeds_block/rss_feeds_block.module on line 314. Happens on every page+role where the block is set to appear. Not on the other ones.
Line 314 follows
function theme_rss_feeds_block() {As a side note, trying to display the block brings a fatal error, but I can access "rss feeds block items" and "rss feeds block" nodetype nodes with no trouble.
Obviously there is a problem with that object() thing. Is it supposed to be a Drupal function ? Or perhaps a function from one of the modules rss_feeds_block depends on ? Can't it be replaced by something else ?
Comment #9
amedjesi commentedOh what I said above where global $user should be replaced with $user = object(); $user->uid = 1;. It shouldn't be $user = object() it should be $user = new stdClass; so
$user = new stdClass;
$user->uid = 1;
Comment #10
Azrael256 commentedThanks, it seems to work flawlessly now.