Need extra help with your Joomla site? Consider paid Joomla support by the developer of Chameleon and MetaMod.
- Index
- » MetaMod Pro
- » MetaMod Pro General Support
- » Show module on Jomsocial profile...
Show module on Jomsocial profile pages only
Show module on Jomsocial profile pages only
I have a module I want to display only when a JomSocial profile is being shown. I have used the following code in a MetaMod module to do this:
Code:
if ($option == "com_community" and $view == "profile") return 102;
However, if a user is logged in and they select one of the options to edit their profile, the module is displayed. I do not want this behavior, because the module is using the userID of the JomSocial user being viewed to display data. If there is no userid in the URL, the module shows nothing, which can be confusing for my users.
So basically, I want to show the module when the above is true, but NOT when there is one of the following tasks being performed - uploadAvatar, editPage, edit, or preferences. I have tried this, but just cannot seem to get the syntax correct:
Code:
$showit == false;
$task = JRequest::getVar("task");
if ($option == "com_community" and $view == "profile") {
if ($task == "uploadAvatar" or $task == "edit" or $task == "preferences" or $task == "editPage") {$showit == false;}
endif;
}
$endif;
if ($showit == true) return 102;
Can anyone provide some guidance?
Thanks!!!
Re: Show module on Jomsocial profile pages only
Hi momentis,
the problem might just be with the use of "endif" which is not necessary since you are using {} syntax.
So try this:
Code:
$showit == false;
$task = JRequest::getVar("task");
if ($option == "com_community" and $view == "profile") {
if ($task == "uploadAvatar" or $task == "edit" or $task == "preferences" or $task == "editPage") {
$showit == false;
}
}
if ($showit == true) return 102;
- Index
- » MetaMod Pro
- » MetaMod Pro General Support
- » Show module on Jomsocial profile...
Board Info
- Board Stats:
- Total Topics:
- 1699
- Total Polls:
- 6
- Total Posts:
- 5965
- Posts this week:
- 3
- User Info:
- Total Users:
- 8012
- Newest User:
- grant1ab
- Members Online:
- 0
- Guests Online:
- 235
- Online:
- There are no members online
Forum Legend:
Topic
New
Locked
Sticky
Active
New/Active
New/Locked
New Sticky
Locked/Active
Active/Sticky
Sticky/Locked
Sticky/Active/Locked