goldenapples / recommended-links

a plugin to add a reddit-style system of link sharing, commenting, and rating to WordPress
http://goldenapplesdesign.com/projects/recommended-links-plugin-for-wordpress/
23 stars 0 forks source link

Allow public to see add link widget #13

Closed dldahly closed 12 years ago

dldahly commented 12 years ago

Love this plugin. Non-registered users of the site can't see the add links form widget. I can't see an option to change this in the plugin settings (there is a tick box for public voting, but not for link submission). I can't quite figure out how to allow this by editing the plugin code (though I can see some likely places where this might be possible, but I'm not knowledgeable enough to know for certain). Any help would be appreciated...

goldenapples commented 12 years ago

There isn't currently an option for that, although it would be an easy tweak to make.

If you removed the user permissions check on lines 25-26 of widgets.php, then the widget would be visible to all users.

Then, you would also have to change the user permissions check on lines 135-138 of recommended-links.php to allow links by anonymous users to be posted. Finally, you'd have to give the created links a default author further down in the same function - WordPress posts can't be created with an author ID of zero.

I have some placeholders in there for an option to allow unregistered users to post, but I haven't finished building them, primarily because of this last problem. Who should be listed as the author of anonymous links? Should it be the site admin? Or a new user called "anonymous"? Actually, maybe I'm over-thinking this and I could just build in an option to let the site owner select that.

dldahly commented 12 years ago

Thanks again. I found some of that code (allowing the option to show in the menu). I understand your other suggestions and will give it a try.

Best,

DL

On 24 May 2012, at 17:56, "Nathaniel Taintor" reply@reply.github.com wrote:

There isn't currently an option for that, although it would be an easy tweak to make.

If you removed the user permissions check on lines 25-26 of widgets.php, then the widget would be visible to all users.

Then, you would also have to change the user permissions check on lines 135-138 of recommended-links.php to allow links by anonymous users to be posted. Finally, you'd have to give the created links a default author further down in the same function - WordPress posts can't be created with an author ID of zero.

I have some placeholders in there for an option to allow unregistered users to post, but I haven't finished building them, primarily because of this last problem. Who should be listed as the author of anonymous links? Should it be the site admin? Or a new user called "anonymous"? Actually, maybe I'm over-thinking this and I could just build in an option to let the site owner select that.


Reply to this email directly or view it on GitHub: https://github.com/goldenapples/recommended-links/issues/13#issuecomment-5911641

dldahly commented 12 years ago

Your updated appears to have successfully added this feature.