WordPress.org

Ready to get started?Download WordPress

Forums

PhotoSmash Galleries
Restrict Upload to Authors (2 posts)

  1. bluantinoo
    Member
    Posted 2 years ago #

    Hi,
    very very nice plugin. It's by far the simpler way for galleries upload from front end!

    Is it possibile to (even a workaround) restrict the upload function just to the post authors?

    http://wordpress.org/extend/plugins/photosmash-galleries/

  2. Profusion
    Member
    Posted 2 years ago #

    Hi bluantinoo

    I had a similar requirment and this is the best workaround I could come up with,.. It does require some template hacking though.

    I sooo wish Byron would not give up on this fantasfic plugin. In my opinion it is a real piece of gold and he should not take the opinion of people who can not follow simple instructions to heart.

    Anyway. Here is what I did.

    1) You need to create a section of the post that would only be visible to the author. You can easily do this by following the excellent instructions of Philip entitled "if is post author...".
    2) Now you need to split the PhotoSmash function so that the Upload part is seperate from the Gallery Part. Luckily Byron allows for this in a roundabout way. In your "PhotoSmash Settings -> Advanced" tab you need to select the option for "Use Manual Form Placement:"
    3) Now you can replace Philip's 'AUTHOR CONTENT HERE' part with a "do_shortcode('[photosmash form=..."

    The full code I used looked something like this:
    1. Before the loop:

    <?php
    global $current_user;
    get_currentuserinfo();
    ?>

    2. Inside the loop where you want the Author Only upload form:

    <?php
    if ($post->post_author == $current_user->ID) {
    echo do_shortcode('[photosmash form=my_upload no_gallery=true ]');
    echo "You are only seeing this form because you are the author of this post.";
    } ?>

    PS: I found that two [photosmash] shortcodes on the same page may conflict,- resulting in a "duplicate" error - hence the "no_gallery=true" bit at the end of the photosmash form shortcode I quoted above.

    I hope that helps. Sure it would have been easier if the "Default Minimum role to upload photos:" bit could include an option for "Post Author" - but for now my workaround will have to do until we can encourage Byron to give his attention to PhotoSmash again.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic