1
lynhines
force registration
  • 2005/2/7 13:24

  • lynhines

  • Just popping in

  • Posts: 28

  • Since: 2004/3/4 2


Two questions:

Is it possible to show the modules in the "main menu" to anonymous users but when they click on the button the module, they are redirected to a "please register" page?

Second question, is there way to show a description of the module when the mouse arrow moves over the button?

It is an effort to show what the site is about but encourage
people to register.

Thanks

2
m0nty
Re: force registration
  • 2005/2/7 13:33

  • m0nty

  • XOOPS is my life!

  • Posts: 3337

  • Since: 2003/10/24


offhand no..

but you could hide those blocks from anonymous users.. and create a custom block with menu links in that will show a please register custom made block and then you can redirect them to the registration page..

of course you then hide those blocks from registered users and nobody will know any difference.. not the best way of going about it, but it might suit your needs

3
lynhines
Re: force registration
  • 2005/3/1 14:49

  • lynhines

  • Just popping in

  • Posts: 28

  • Since: 2004/3/4 2


I was wondering if you could use this type of code or similar pasted into the indexes of the modules in the main menu?

"if (empty($xoopsConfigUser['allow_register'])) {

redirect_header('index.php', 6, _US_NOREGISTER);

exit();"

4
Dave_L
Re: force registration
  • 2005/3/1 15:21

  • Dave_L

  • XOOPS is my life!

  • Posts: 2277

  • Since: 2003/11/7


Yes, that approach would work (with similar code), but you would have to add the code to every module file (not just index.php) that's invoked from the browser.

Another approach would be to customize the Main Menu block. You might get by with only changing the template system_block_mainmenu.html, or you might have to hack the PHP that generates it in modules/system/blocks/system_blocks.php (function b_system_main_show).

P.S. I haven't tried either of these approaches - I'm just speculating.

5
Dave_L
Re: force registration
  • 2005/3/2 15:52

  • Dave_L

  • XOOPS is my life!

  • Posts: 2277

  • Since: 2003/11/7


Experimental hack:

In modules/system/blocks/system_blocks.php (function b_system_main_show), change:

if (in_array($i$read_allowed)) {


to:

if ([color=ff0000]true or[/colorin_array($i$read_allowed)) {

6
lynhines
Re: force registration
  • 2005/3/2 17:03

  • lynhines

  • Just popping in

  • Posts: 28

  • Since: 2004/3/4 2


Thanks for your try. Unfortunately making your edit didn't work for me.
I have "anonymous users" with the right to view in the group permissions.

I am very much interested in making it work but for the moment I am continuing with a "dummy main menu" redirecting to the user.php file and trying to hide the same dummy package after login. Kinda messy.

Thanks again.

Login

Who's Online

125 user(s) are online (63 user(s) are browsing Support Forums)


Members: 0


Guests: 125


more...

Donat-O-Meter

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

Latest GitHub Commits