Members: 16,996
Threads: 38,845
Posts: 159,389
Online: 20

Newest Member: Kl_broka@rediffmail.com


Odoo.tv - Outdoor Television


Sedo - Domains kaufen und verkaufen das Projekt mambers.com steht zum Verkauf Besucherstatistiken von mambers.com etracker® Web-Controlling statt Logfile-Analyse

Go Back   Mambers.com > Development > Module Development

Reply
 
LinkBack Thread Tools Display Modes
Old 28.04.2004, 01:29   #1 (permalink)
Baby Mamber
 
Join Date: Apr 2004
Posts: 4
mumbojumbo is on a distinguished road
Default Module Access Level: unexpected results

I'd like to make some modules disappear when a user logs in. It would be useful to hide advertising when a paid member accesses the site. Currently, module "access level" can be set to: Public, Registered, or Special. I'd expect "Public" to mean the module will only be shown to non-members, but really it means "show all the time". Has anyone written a hack that changes the choices to "Everyone, Public, Registered, Special" - where "Public" would work as I just stated?

thanks,
Glen
mumbojumbo is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
Old 28.04.2004, 01:41   #2 (permalink)
Professional Mamber
 
tonyskyday's Avatar
 
Join Date: Apr 2004
Location: Charlottesville, VA USA
Posts: 565
tonyskyday is on a distinguished road
Default Re: Module Access Level: unexpected results

Something like this should work for you...

In your template's index.php file:
PHP Code:
if (!$my->id) {
mosLoadModules ('right');
} else {
mosLoadModules ('user1');
?> 
Where right and user1 are the module positions you want displayed.

-Tony
tonyskyday is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 28.04.2004, 07:54   #3 (permalink)
Baby Mamber
 
Join Date: Apr 2004
Posts: 4
mumbojumbo is on a distinguished road
Default Re: Module Access Level: unexpected results

Thanks Tony, that's a good solution! Unfortunately, there are some modules that I need to display for both the general public and paid members (positioned in nearly every module location). Unless you have another trick up your sleeve, I'm guessing there isn't much else I could do without digging into core files. Maybe an item to add to the 4.6 wish list.
thanks,
Glen
mumbojumbo is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 28.04.2004, 07:59   #4 (permalink)
Professional Mamber
 
tonyskyday's Avatar
 
Join Date: Apr 2004
Location: Charlottesville, VA USA
Posts: 565
tonyskyday is on a distinguished road
Default Re: Module Access Level: unexpected results

I'm not sure exactly what you are saying, but I think I vaguely get it.

Anyway, the only other tricks up my sleeve are to add more module positions (I can dig up the hack if you can't find it) and to include the modules directly.
PHP Code:
if (!$my->id) { 
include (
'modules/mod_unregistered'); 
} else { 
include (
'modules/mod_registered'); 
?> 
Or something similar (I can't recall if that is the EXACT right syntax.

From what I understand, 5.0 will deal with all of this in a very different way, since the template file will have no php in it at all, only xhtml and xml!

-Tony
tonyskyday is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 21.07.2004, 01:31   #5 (permalink)
Senior Mamber
 
Join Date: May 2004
Posts: 163
kergo is on a distinguished road
Default Re: Module Access Level: unexpected results

Quote:
Originally Posted by tonyskyday
From what I understand, 5.0 will deal with all of this in a very different way, since the template file will have no php in it at all, only xhtml and xml!
That's bad ... I only understand PHP but xhtml and xml is foreign for me.

@mumbojumbo: maybe you can use a "chenged" version of the "hack" of tonyskyday anyway 'til Mambo 5:
Code:
<?php if (!$my->id) { 
mosLoadModules ('user1'); 
} else { 
mosLoadModules ('user2'); 
} 
mosLoadModules (right');
?>
"right" contains the modules you wanna display in any case ...

I know this code ain't this what you're searchin' for (for example: 'cause you have to put the unregistered-only or registered-only staff at the top), but maybe you get along with it til Mambo 5 ...
kergo is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Information on Access Level blackhat Mambo 4.5 'How Do I' Questions 2 16.04.2004 01:27
How to implement a two access level registration system? TheEdge Mambo 4.5 'How Do I' Questions 1 10.04.2004 12:48
Change default access level of users to "Author" Trevor Mambo 4.5 'How Do I' Questions 1 09.04.2004 18:50


All times are GMT +2. The time now is 08:12.

Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.1.0
A vBSkinworks Design
© Copyright 2004-2008 by Arthur Konze Webdesign.