WordPress.org

Ready to get started?Download WordPress

Forums

User Submitted Posts
[resolved] Newbie questions re: authors (2 posts)

  1. Sheila
    Member
    Posted 7 months ago #

    Just setting up a new site that wants to use your plugin. If I'm reading this all correctly I can either have all user submitted articles appear by a single default author...OR.... I can required a login and then the article will be attributed to the actual author.

    My goal is to set this up so that the login is required for contributors (I've already turned that on in settings) and have the link. Now I want to make it so they don't see the submission form until logged in. I suppose I need to go find a membership plug-in or some such.

    Then I want to be sure that each author has completed a profile with a photo and bio that will appear after the article. I've set my theme template up to display that. And I've added an Avatar plugin. So I tested this and created a contributor login with bio and avatar. But it still defaulted to the author set in the User Submitted Posts settings where it says "Specify the user that should be assigned as author for user-submitted posts." So is there a way for the actual user for each post to be automatically displayed? I see that we can manually change the author when approving the pending post. But if we have a lot of submissions I'm not sure it'll be obvious which author goes with the submission.

    Am I missing a setting or am I expecting too much? Is this something that's easily doable or requiring a lot of custom coding?

    Also I see that if the contributor adds an image it becomes the featured image. Cool. But if they upload more images what happens to them? How can they add images to their article? I did read the notes and see that "Attached images are not displayed automatically in posts, but rather may be displayed using template tags, either WP's built-in tags or the USP template tags." HOWEVER...I'm unclear what to do with that information! Sorry.

    Thanks. This is a DEV site at http://tca.hoffmangraphics.com/article-submission-form/

    http://wordpress.org/plugins/user-submitted-posts/

  2. Jeff Starr
    Member
    Plugin Author

    Posted 6 months ago #

    ...can either have all user submitted articles appear by a single default author...OR.... I can required a login and then the article will be attributed to the actual author.

    Correct, that is the case.

    ..make it so they don't see the submission form until logged in. I suppose I need to go find a membership plug-in or some such.

    No need for another plugin, just add something like this to theme's functions.php:

    function usp_member($attr, $content = null) {
    	extract(shortcode_atts(array(
    		'deny' => '',
    	), $attr));
    	if (is_user_logged_in() && !is_null($content) && !is_feed()) return $content;
    	return $deny;
    }
    add_shortcode('usp_member', 'usp_member');

    Then you can just wrap the USP form shortcode with [usp_member deny="Please log in to submit posts."][/usp_member]

    ...is there a way for the actual user for each post to be automatically displayed?

    Yes, each submitter's "Name" is attached to the post as a custom field, so you can conditionally display them as needed. Here is one way to do it, placing this code in the WP loop:

    $usp_author = get_post_meta($post->ID, 'user_submit_name', true);
    if (usp_is_public_submission()) {
    	echo $usp_author;
    } else {
    	the_author_posts_link();
    }

    Am I missing a setting or am I expecting too much? Is this something that's easily doable or requiring a lot of custom coding?

    Totally doable, just a couple of edits to the theme template, which is how the free version is designed to work: maximum flexibilty in terms of implementation. Conversely, the Pro version of the plugin provides shortcodes and template tags already built-in, so need to add any custom code.

    How can they add images to their article?

    In the documentation there are several template tags available for displaying submitted content. One simple example would be this:

    $images = usp_get_post_images();
    foreach ($images as $image) {
    	echo $image;
    }

    Much more is possible by configuring parameters, or even further possibilities open up when using other template tags, which are instrumental to working with WordPress. For example, usp_post_attachments() works out of the box with numerous parameters available for customizing the output. More info on this in the readme.txt.

    I hope this is useful, let me know if I may provide further infos, glad to help.

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.