Need extra help with your Joomla site? Consider paid Joomla support by the developer of Chameleon and MetaMod.
- Index
- » MetaMod
- » MetaMod General Support
- » Show a module on every page where...
Page:
1
Show a module on every page where another module is
Show a module on every page where another module is
Hi,
I'm new here and don't understand PHP. I was wondering what do I have to change in the following recipe so a module will apear on every page another module is also.
Show a module on every page that another module does not appear
Code:
$moduleid = 23; /* the module we are checking for. Customise this! */
$sql = 'SELECT count(*) as c from #__modules m, #__modules_menu mm ' .
'WHERE mm.moduleid = m.id ' .
'and m.published = 1 ' .
'and (mm.menuid = ' .
(int)$Itemid . ' or mm.menuid = 0) and mm.moduleid = ' . (int)$moduleid;
$db->setQuery( $sql, 0, 1 );
$row = $db->loadObject();
$not_there = ($row == null or $row->c == 0);
/* replace 101 with module id to display when the other module is not assigned to this page */
if ($not_there) return 101;
Thanks in advence,
Administrator has disabled public posting
Re: Show a module on every page where another module is
Hi Laurens,
Try this:
Code:
$moduleid = 23; /* the module we are checking for. Customise this! */
$sql = 'SELECT count(*) as c from #__modules m, #__modules_menu mm ' .
'WHERE mm.moduleid = m.id ' .
'and m.published = 1 ' .
'and (mm.menuid = ' .
(int)$Itemid . ' or mm.menuid = 0) and mm.moduleid = ' . (int)$moduleid;
$db->setQuery( $sql, 0, 1 );
$row = $db->loadObject();
$there = $row != null and $row->c > 0;
/* replace XXX with module id to display when the other module is assigned to this page */
if ($there) return XXX;
Administrator has disabled public posting
Page:
1
- Index
- » MetaMod
- » MetaMod General Support
- » Show a module on every page where...
Board Info
- Board Stats:
- Total Topics:
- 1689
- Total Polls:
- 6
- Total Posts:
- 5942
- Posts this week:
- 2
- User Info:
- Total Users:
- 7627
- Newest User:
- rudys68879
- Members Online:
- 0
- Guests Online:
- 176
- 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