1
jbaudin
startup module
  • 2004/2/10 10:24

  • jbaudin

  • Just popping in

  • Posts: 42

  • Since: 2004/1/22


Hello,
first, sorry for my english, but i am french and i don't speak english very well.

I have send this question on frxoops.org but no response.

I have a web site with XOOPS 2.0.5.2.
This web site is a groupware.

I have made a start page for all visitors.
I use the "Homepage" module for startpage.

The user can have acces to the groupware with a password.
But when the user logon to the groupware, he has the same start page like visitor, with blocks that i want to display.

How can i remove only the startpage and keep the blocks when the user has an active connection with the groupware ?

I had tried to modified the ./index.php, but not ok.

Please Help Me !!

Thank you !

2
Mithrandir
Re: startup module

You cannot have different start pages for different usergroups in XOOPS.

What you can do, though, and I may be mis-reading your question, is remove access to certain blocks for anonymous, so they don't get all the blocks available to registered users.

This is done in System Admin -> Groups -> Anonymous Users

3
jbaudin
Re: startup module
  • 2004/2/10 12:06

  • jbaudin

  • Just popping in

  • Posts: 42

  • Since: 2004/1/22


I have do this.
But it's not a block that i want to not display, but a module.
I want that one module only available for anonymous users, not for registered users.

If i disable access to this module for registered users, they are redirect to the display for modifie the profile.

If i use a block, i can't have a lot of pages for the anonymous users.

I just want to display some informations of my company.
But i don"t want display this information for registerd users.

Have you a solution ?

4
jbaudin
Re: startup module
  • 2004/2/16 9:21

  • jbaudin

  • Just popping in

  • Posts: 42

  • Since: 2004/1/22


Is anybody have the solution ?

Thank you !

5
Ace_Armstrong
Re: startup module

I don't know the exact code you would use, but perhaps my suggestion will spark someone to throw it together for you. (I simply don't know enough about the syntax to do it.)

Basically, you can do it by modifying your "theme.html" file to include various "if" subsections. For instance, one of the things I like to do with my themes is create a line along the top that tells the user what account (s)he is logged in underm and if it's the wrong account (for instance, the person's roommate was on and forgot to log off) they can log out. The code looks like this:

Quote:
<{if $xoops_isuser}>






You are currently logged in as <{$xoops_uname}>.    
[ I am not <{$xoops_uname}> ]



<{/if}>


Note that this makes the HTML inside the "if" statement display to any registered user and not display for users who have not logged in.

That much I can do, and I can tell you there must be a XOOPS variable that applies to the groups (it's probably a numeric value), but I don't know enough about the internal workings of XOOPS to be able to script it out for you.

My guess would be that your end code would look something like this:

Quote:


<{if $xoops_userlevel==1}>


You are a Registered User!


<{/if}>

<{if $xoops_userlevel==2}>


You are a Preferred User!


<{/if}>



To put it on the front page only, you would need to enclose the whole thing in this IF statement:

Quote:


<{if $SCRIPT_NAME == "index.php"}>

[ THE CODE FROM ABOVE WOULD GO HERE ]

<{/if}>



Again, that's just a guess. I just made up the "$xoops_userlevel" variable; I don't know what the actual name is (or even if it exists), and I don't know enough about PHP to tell you if I even have the syntax of the IF statement set up properly. Like I said, I'm just offering a strategy and not the actual code.

Is that (marginally) helpful?

6
hsalazar
Re: startup module
  • 2004/2/16 16:02

  • hsalazar

  • Just popping in

  • Posts: 78

  • Since: 2003/2/6 1


jbaudin:

The problem is that you want something not feasible as stated. Let me recapitulate: you want to define a module as the start module, and then to show the module to anonymous users but not to registered users.

If this is correct, just think: what start module would the registered users see?

I have two different suggestions: an easy one and a complex one.

The easy one takes advantage of your own affirmation that you "just want to display some informations of my company". If that is the case, you can and definitely should use a block, a custom block, easily built with XOOPS' block manager.

You say that if you use a block, you "can't have a lot of pages for the anonymous users". I don't see why. Let me explain. Let's say that you have 20 pages you want to show your anonymous users. Fine: tie them up using for instance Tiny Content. Then give anonymous users (but not registered users) access to that module. Then build a block to appear in the start page, and from there point to the relevant pages in Tiny Content. Last, grant anonymous users (but not registered users) access to this block.

This solves at least part of the problem. You'd have a module with content exclusive for anonymous users, and a custom block to point to the module.

The persistent point is what will you show in the start page, other than this module for anonymous users. Well, you could try to display the recent news block, and give access to it just to the registered users. This way, anonymous users would be greeted by the custom block leading them to their exclusive module, while registered users would be greeted by the latest news block.

It would be up to you to decide if anonymous users would have access to the module News or not. But then the link to it would be in the menu, not in the start page.

The alternative, that is, the complex solution, would imply hacking the core. How? By establishing a dynamic startup module.

I don't know the details of how to do this, but in essence you could replicate what happens in the preferences page where you select the start module. That is, you would something like:

if !xoopsUser
then startup module = onemodule
elseif
then startup module = anothermodule

Of course, you'd have to write to the database every time a user logs in and you'd need to make sure the rights are, well, right.

All in all, my recommendation goes for the first alternative. It's safe, easy and does the job. What else can you ak for?

Cheers.

7
jbaudin
Re: startup module
  • 2004/2/17 8:10

  • jbaudin

  • Just popping in

  • Posts: 42

  • Since: 2004/1/22


Thank you for responses.

I try it !

8
technigrafa
Re: startup module

Ok,

Here's one way to do it:

As mentioned, in your theme.html file put in:

<{if $xoops_isuser}>

<{/if}>

That way users go one place, and visitors go another. Not the best solution in all cases, but it might work for you.

Login

Who's Online

207 user(s) are online (44 user(s) are browsing Support Forums)


Members: 0


Guests: 207


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits