Posted in General Issues
Likes 0
Views 507
Votes 0
How to hide the block for subscribers on the page and leave only for the administrator?
Highlighted in red in the picture - http://prntscr.com/me7ra1
There is no easy work around for this as you would need to edit the theme file /components/com_easysocial/themes/wireframe/stream/default/default.php

[gist]
<?php if ($story) { ?>
<?php echo $story->html(); ?>
<?php } ?>
[/gist]

Replace this with,

[gist]
<?php if ($story && $this->my->isSiteAdmin()) { ?>
<?php echo $story->html(); ?>
<?php } ?>
[/gist]
·
Wednesday, 30 January 2019 22:54
·
0 Likes
·
0 Votes
·
0 Comments
·
I did as you wrote, but now only the site administrator sees the form, the rest of the form cannot be seen in any application.
But I need to hide the form only in the application page for subscribers.
·
Thursday, 31 January 2019 17:23
·
0 Likes
·
0 Votes
·
0 Comments
·
Correct me if I'm wrong, do you mean you only want to hide the story form in the page view? If yes, perhaps can try the code below:
[gist type="php"]
<?php if (($story && $this->my->isSiteAdmin()) || !($view == 'pages')) { ?>
<?php echo $story->html(); ?>
<?php } ?>
[/gist]
·
Thursday, 31 January 2019 17:50
·
0 Likes
·
0 Votes
·
0 Comments
·
I want to hide the form in pages only. And only for subscribers. Leave the admin page and the owner of the page.
·
Thursday, 31 January 2019 18:01
·
0 Likes
·
0 Votes
·
0 Comments
·
http://prntscr.com/meo86b

Can I do the same for the page only?
·
Thursday, 31 January 2019 18:25
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi there,

This is quite complicated to achieved, where you need a proper checking
Firstly you need to get the specific page admin:
[gist type="php"]
$page = ES::page($id); //get the page id
$pageAdmin = $page->isAdmin()
[/gist]
Then you are able to make the addition checking in the post form by alter the code from previous reply.
·
Thursday, 31 January 2019 19:10
·
0 Likes
·
0 Votes
·
0 Comments
·
Your code from the previous message works as it should for the site administrator, but if I have not logged in to the site, the main page gives an error 404. http://prntscr.com/mep8ok

Could you write me in detail what file to insert into which place to make it work?
·
Thursday, 31 January 2019 19:27
·
0 Likes
·
0 Votes
·
0 Comments
·
Which code did you use? Please understand that our support does not include customization / tweaks.
·
Thursday, 31 January 2019 22:27
·
0 Likes
·
0 Votes
·
0 Comments
·
I used the code:

<?php if (($story && $this->my->isSiteAdmin()) || !($view == 'pages')) { ?>
<?php echo $story->html(); ?>
<?php } ?>

You too understand me, it is not logical in the section for a business page or a public page to give any user the right to write texts and embed images in a tape. This will lead to a big dustbin on the page. You do not have the ability to control the form in the ribbon in the component. I'm trying to get help from you because I paid for your product.
·
Friday, 01 February 2019 14:52
·
0 Likes
·
0 Votes
·
0 Comments
·
If your purpose is to disallow users from posting anything on the Page, it can already be configured in the page settings, http://take.ms/llTBz
·
Saturday, 02 February 2019 00:45
·
0 Likes
·
0 Votes
·
0 Comments
·
Hey.
Thank. This is what you need.
·
Tuesday, 05 February 2019 18:24
·
0 Likes
·
0 Votes
·
0 Comments
·
You are most welcome Glad to hear your issue has resolved.

Just for your information, I have locked and marked this thread as resolved to avoid confusions in the future. Please start a new thread if you have any other issue in the future so it will be easier for us to manage your inquiries.

Thanks for understanding and have a nice day ahead
·
Thursday, 07 February 2019 10:23
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post