Need extra help with your Joomla site? Consider paid Joomla support by the developer of Chameleon and MetaMod.
- Index
- » MetaMod
- » MetaMod General Support
- » Do not show modules in profile editing
Do not show modules in profile editing
Re: Do not show modules in profile editing
Are you asking to be able to turn off modules when you are on the editing page(s) of CB?
Ok, looking at CB I see URLs like this:
Looking at my own profile:
index.php?option=com_comprofiler&task=userProfile&user=62
Another view of my own profile page:
index.php?option=com_comprofiler
editing my own profile:
index.php?option=com_comprofiler&task=userDetails
update my image:
index.php?option=com_comprofiler&task=userAvatar
manage my connections:
index.php?option=com_comprofiler&task=manageConnections
So I want to exclude the module when I am editing my profile, updating my image, or managing my connections.
Code:
$exclude = false;
if ($option == "com_comprofiler") {
$task = JRequest::getVar("task");
if ($task == "userDetails" or $task == "userAvatar" or $task == "manageConnections") $exclude = true;
}
if ($exclude == false) return "101, 102, 103"; /* replace numbers with the modules ids you want to show */
(edited to change com_profiler to com_comprofiler)
19-Nov-09 23:27:07
Re: Do not show modules in profile editing
Hi sniper_rio,
thanks for pointing out the com_comprofiler error. I fixed that in the post above.
Can you turn on advanced debugging to see what values "task" and "option" have on the pages that you want to exclude the modules?
Cheers,
Stephen
Re: Do not show modules in profile editing
Includes the following line in the code and it seems that it worked. If you say that is correct, it was resolved.
Includes "usersList" too.
hug
$exclude = false;
if ($option == "com_comprofiler") {
$task = JRequest::getVar("task");
if ($task == "userDetails" or $task == "userAvatar" or $task == "manageConnections" or $task == "userslist") $exclude = true;
}
if ($option == "com_myblog" or $option == "com_content" or $option == "com_seyret" or $option == "com_remository" or $option == "com_simgallery" or $option == "com_myblog" or $option == "com_myblog") $exclude = true;
if ($exclude == false) return "211"; /* replace numbers with the modules ids you want to show */
Re: Do not show modules in profile editing
Hey that looks good. So what you are doing is this:
1 - checks if you are in CB. If you're on the userDetails page, userAvatar pate, manageConnections or userslist, set a flag to exclude the modules.
2 - checks to see if you are on any myblog,article, seyret videos, remository or simgallery pages, and if so sets the flag for excluding the modules. [N.B. I see that you have included the check for "com_myblog" 3 times. You only need this once]
3 - if the flag for excluding the module has not been set, include the module.
This is a good technique to use. However, if you are excluding so many different components, you should ask yourself if it would be simpler to reverse the process and just turn the module ON for a particular component or other condition. But what you have is fine.
Cheers,
Stephen
- Index
- » MetaMod
- » MetaMod General Support
- » Do not show modules in profile editing
Board Info
- Board Stats:
- Total Topics:
- 1689
- Total Polls:
- 6
- Total Posts:
- 5941
- Posts this week:
- 1
- User Info:
- Total Users:
- 7618
- Newest User:
- goure1dhowen
- Members Online:
- 0
- Guests Online:
- 129
- 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