Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author maksbd19

    (@maksbd19)

    Okay thats a good feature. I’m going to add this in the next update.

    Thread Starter Shubham Rajdhar

    (@ishubhamraj)

    Great! Woohoo! Will be waiting for the update.. ??

    Meanwhile, I managed to tweak it without having to tweak the plugin itself..

    I copied profile.php from /plugins/ultimate-member/templates/ to /themes/themename/ultimate-member/templates/ (just like you have given in your plugin’s description, so thanks to you!)

    I added these lines the new copied profile.php

    if ( um_is_myprofile() && ( um_user('role') == 'member' || um_user('role') == 'admin') ){
    	$url = 'https://' . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];
    	if ((strpos($url,'gallery_photo') !== false)||(strpos($url,'gallery_video') !== false)){ ?>
    	    <div class="pay">
    			<h3>You need to be a subscribed member for uploading files</h3>
    			<p>Please head over to <a href="link">Payment settings</a> and check back later</p>
    		</div>
    	<?php }
    }

    and ofcourse, added some CSS,

    .pay {
        position: absolute;
        height: 100%;
        padding-top: 10%;
        text-align: center;
        width: 1000px;
        background-color: rgba(210, 210, 210, 0.8);
        z-index: 100;
    }
    .pay h3 {
        color:#000;
    }
    .pay a {
        color: #211414;
        font-weight: bold;
    }
    .pay p {
        font-size:20px;
        color:#F00;
    }

    So it now looks like this :
    Screenshot (using AwesomeScreenshot)

    So as you can see in PHP code above, users whose roles are member or admin(for testing purposes, added admin as well), won’t get to upload pics and videos! They are shown a notice on only the pages of video and picture upload, and not on about tab(2nd and 3rd line of code takes care of that) which links them to payment settings page. Once the payment is confirmed, their user role will be changed to subscribed member (manually by admin for now). That role will ofcourse won’t get the notice and will be able to upload pics and videos. ??

    If you or anyone reading this would like to have a brief look, register here with mock info and try it on profile page! ??
    https://www.dreamtalenthunt.com/register

    Might have been a nasty way to do it, but got the job done for the day. ??

    Regards,
    Shubham.

    Plugin Author maksbd19

    (@maksbd19)

    WOW! You made it! Anyway I’m having some issues with the multiple photo upload feature. As soon as I’m done with I’ll update the plugin. I have included a settings section where you can change the tab titles and also set the roles for whom you want the gallery.

    Keep an eye for the update ??

    Thread Starter Shubham Rajdhar

    (@ishubhamraj)

    That is awesome! ??
    I was going to suggest to go for a settings UI in dashboard but I thought it would be too much to ask..
    Great to see a dev working hard to fulfill needs of users ??

    I’m also interested in seeing tab visibility bound to UM profile status.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Hide galleries for certain user roles’ is closed to new replies.