• Resolved hamidnpc

    (@hamidnpc)


    Hi,
    How can i restrict messagebox page for users? for example i want to show messages of 4 users.

    I did this with another approach, I restricted per message, but it has many many problem that i can’t solve that.

    My old approach:
    in templates/messagebox.php

    
    line 44: 
    	$i=1; // added by myself
    			while ( $messages->have_posts() ) { 
    foreach ...
    ...
    if($i++ > 4) { // hide messages up 4
    echo "it is restricted";
    }
    break ; // show messages 
    echo "it is not restricted"
    end foreach
    end while
    

    Although this approach compatibility worked, It depends on messages count.

    But i wanna show messages per users, So only show messages of 4 users for example,Not any more.

    Is it possible with ‘fep_get_participants’?

    Thanks!

    • This topic was modified 8 years, 9 months ago by hamidnpc.

    The page I need help with: [log in to see the link]

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

    (@shamim51)

    You can restrict sending messages up to 4 users. That approach will be easier. So that 1 user will be able to send message up to 4 users (or as much as you like).

    Thread Starter hamidnpc

    (@hamidnpc)

    Hi,
    Thanks for your answer!

    I didn’t get you.
    What is your approach? there is no options to “restrict sending messages”.
    Even though it is options in Settings that i can’t find that, I don’t want that.

    Since i want to all users send any messages they want, But spacial role like seller just can’t open that, I did all part of roles and other stuff.

    But i don’t know how to filter messages per users, actually showing all messages of 4 users.
    Look codes: templates/messegebox.php


    <?php if ( rcp_get_subscription_id() == 2 ) ) // my spacial plan {
    if($i++ > 4) { ?>

    <span class="<?php echo $class; ?>"><?php the_title(); ?> <span> restricted </span> </span><?php echo $span; ?><div class="fep-message-excerpt">restricted...</div>

    <?php break;
    }
    } else {?>

    <span class="<?php echo $class; ?>"> get_the_ID())); ?>"><?php the_title(); ?></span><?php echo $span; ?><div class="fep-message-excerpt"><?php echo fep_get_the_excerpt(100); ?></div>
    <?php } ?>

    Plugin Author Shamim Hasan

    (@shamim51)

    Can you know which 4 users (or any amount) a user can send messages? eg. User A can Send message to user B, C, D and E. If it is possible to know other users then this can be easily done.

    Thread Starter hamidnpc

    (@hamidnpc)

    It doesn’t matter, There is no different between users.

    I just want to all users can send any messages they want to everybody, BUT i want to show messages of 4 users for spacial role like “seller”.

    Actually something like a filter in messgebox page.A filter that can show all messages from 2 person, all messages from 4 person and so on. There is no difference between users.

    Did you understand?

    Thanks!

    Plugin Author Shamim Hasan

    (@shamim51)

    You can use fep_get_participants and keep value in a static variable. Every message participants merge and count and show that message (like your approach). When your desire users count get then show message only if all participants of that message are available in static variable, if not restrict that message.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Restrict “messagebox” page per user’ is closed to new replies.