By gökhan on Thursday, 13 March 2014
Posted in General Issues
Likes 0
Views 464
Votes 0
Hi Guys,

I have an idea! why site admins dont have some specific profil options? I mean, all profils have the same structure. There are report user, points areas etc.

At least, i am trying to achive something, for example removing "report user" and points areas.

is this possible via a simple php & sql query ?

for example ,

<? php if userid (409)  or user type admin;

show report user link

else ;

Hide report user llink


So, i need a query structure like above, after that i can implement it to other options also
You can already determine if the user is a site admin within the theme files in EasySocial.


<?php if ($this->my->isSiteAdmin()) { ?>
do something
<?php } ?>
·
Thursday, 13 March 2014 10:39
·
0 Likes
·
0 Votes
·
0 Comments
·
Ahah, i think you already answered my question on my other message, both two queries will be the same structure. Am i right, Mark ?


<?php if ($this->my->id) { ?>
Logged in
<?php } else { ?>
Not logged in
<?php } ?>


<?php if ($this->my->isSiteAdmin()) { ?>
do something
<?php } else { ?>
do another thing
<?php } ?>
·
Thursday, 13 March 2014 22:58
·
0 Likes
·
0 Votes
·
0 Comments
·
Yep, That's correct
·
Thursday, 13 March 2014 23:26
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi Mark,

I have a site managament Profil for my users can follow, but this page doesnt seem well with Report User link , I tried to implement a query for admin but couldnt achived


Can you please help me for this, just need to add ;

<?php if ($this->my->isSiteAdmin()) { ?>


report user link false in these codes ;

	<div class="mt-10">
<a href="<?php echo FRoute::profile( array( 'id' => $user->getAlias() , 'layout' => 'about' ) );?>"><?php echo JText::_( 'COM_EASYSOCIAL_PROFILE_MORE_INFO' ); ?></a>

<?php if( $this->my->id != $user->id && $this->template->get( 'profile_report' , true ) && $this->access->allowed( 'reports.submit' ) && $this->config->get( 'reports.enabled' ) ){ ?>
&middot;
<?php echo Foundry::reports()->getForm( 'com_easysocial' , SOCIAL_TYPE_USER , $user->id , $user->getName() , JText::_( 'COM_EASYSOCIAL_PROFILE_REPORT_USER' ) , '' , JText::_( 'COM_EASYSOCIAL_PROFILE_REPORT_USER_DESC' ) , $user->getPermalink( true , true ) ); ?>
<?php } ?>
</div>
·
Friday, 18 April 2014 07:44
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello gökhan,

Sorry but I don't really understand you here. Can you please let me know what are you trying to achieve here?
·
Friday, 18 April 2014 13:31
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi Mark

Something like :

<?php if ($this->my->isSiteAdmin != $user->id && $this->template->get( 'profile_report' , false )  { ?>
·
Friday, 18 April 2014 17:49
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi Gokhan,

I still abit lost. Do you mean, if the logged in user is a site admin, and the template setting allowed reporting, then display the report tool link? If that is the case, then your if statement should be like this:


<?php if ($this->my->isSiteAdmin() && $this->template->get( 'profile_report' , false ) { ?>


Please correct me if I've misunderstand you.
Hope this help and have a nice day
Sam
·
Friday, 18 April 2014 18:11
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi Sam,


please look at the picture attached
·
Friday, 18 April 2014 18:40
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi Gokhan,

Okay if I understand correctly, if the current logged in user is an admin and if the admin viewing his own profile, then the report tool should not appear. If that is the case, then try below code:


<?php if ($this->my->isSiteAdmin() && $this->my->id != $user->id && $this->template->get( 'profile_report' , false ) { ?>


Let me know if the above code work for you or not
Sam
·
Friday, 18 April 2014 19:34
·
0 Likes
·
0 Votes
·
0 Comments
·
Yes something like that but not only this but need an php else condition also, i tried but couldnt it, here what i meaned and i couldnt , you can see and fix it here ;

in com_easysocial/themes/wireframe/profile/default.header.php

		<div class="mt-10">
<a href="<?php echo FRoute::profile( array( 'id' => $user->getAlias() , 'layout' => 'about' ) );?>"><?php echo JText::_( 'COM_EASYSOCIAL_PROFILE_MORE_INFO' ); ?></a>
<?php if ($this->my->isSiteAdmin() && $this->my->id != $user->id && $this->template->get( 'profile_report' , false ) ) { ?>
<?php } else { ?>
<?php ( $this->my->id != $user->id && $this->template->get( 'profile_report' , true ) && $this->access->allowed( 'reports.submit' ) && $this->config->get( 'reports.enabled' ) )?>
·
<?php echo Foundry::reports()->getForm( 'com_easysocial' , SOCIAL_TYPE_USER , $user->id , $user->getName() , JText::_( 'COM_EASYSOCIAL_PROFILE_REPORT_USER' ) , '' , JText::_( 'COM_EASYSOCIAL_PROFILE_REPORT_USER_DESC' ) , $user->getPermalink( true , true ) ); ?>
<?php } ?>
</div>
·
Friday, 18 April 2014 21:10
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello gökhan,

I am sorry but we will not be able to assist you further on this customizations as this is already beyond the scope of our support policy. I am afraid you need to look at the example that Sam has provided above and work your way through.
·
Saturday, 19 April 2014 01:26
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post