1
nmshah
Different homepage for different groups
  • 2008/2/25 21:50

  • nmshah

  • Just can't stay away

  • Posts: 556

  • Since: 2007/7/2 8


I think there was a module which upon login redirected different groups to different pages. I m not sure of the module name.

tried myhome module but the redirection are either not working or i m making some mistake.

using XOOPS 2.0.18.1
php 5.2.3

on searching the forum i found this thread
https://xoops.org/modules/newbb/viewtopic.php?topic_id=58461&forum=20&post_id=259113#forumpost259113

myhome module i have tried and the other module i can not find as the dev site is still not working.

What shall i be doing? please help.

2
christian
Re: Different homepage for different groups
  • 2008/2/25 23:46

  • christian

  • Just can't stay away

  • Posts: 401

  • Since: 2002/2/24


Hi,

Look in our modules repository. The two versions for the startup modules are added today. (version 0.2 for XOOPS 2.2.x and version 0.3 for XOOPS 2.0.x)

3
Mazarin
Re: Different homepage for different groups
  • 2009/9/11 21:04

  • Mazarin

  • Just can't stay away

  • Posts: 533

  • Since: 2008/12/10


Since Startup 0.2 and 0.3 are not working for the current version of Xoops, do we have any other module that can do this?

4
ghia
Re: Different homepage for different groups
  • 2009/9/12 7:29

  • ghia

  • Community Support Member

  • Posts: 4953

  • Since: 2008/7/3 1


You can play with different custom blocks that show or hide for the different user groups and maybe with defacer change the looks.
You can also check with smarty which user group is active and do theme changements with it, with this hack:
Modify /class/template.php and add:
global $xoopsUser;
    if ( 
is_object($xoopsUser) ) {
        
$this->assign'xoops_usergroups'$xoopsUser->getGroups() );
    }

after:
$this->Smarty();

In your templates do something like:
<{if 1|in_array:$xoops_usergroups}>Show for group 1<{/if}>
<{if 
2|in_array:$xoops_usergroups}>Show for group 2<{/if}>


Could maybe a good addition to the core if interest by other people.

5
Mazarin
Re: Different homepage for different groups
  • 2009/9/12 10:37

  • Mazarin

  • Just can't stay away

  • Posts: 533

  • Since: 2008/12/10



The Startup module seemed to do exactly what I was after. Maybe it's fairly easy to update to 2.3.x compatibility. Which do you think is best suited for upgrading, Startup for 2.0.x or Startup for 2.2.x?

6
ghia
Re: Different homepage for different groups
  • 2009/9/12 14:36

  • ghia

  • Community Support Member

  • Posts: 4953

  • Since: 2008/7/3 1


In principle 2.0.x
Where did you download it?

7
tzvook
Re: Different homepage for different groups
  • 2009/9/12 15:27

  • tzvook

  • Just can't stay away

  • Posts: 875

  • Since: 2003/2/1 2


I'm interested too, if one have the module files I'd love to take a look ....

8
Mazarin
Re: Different homepage for different groups
  • 2009/9/12 15:52

  • Mazarin

  • Just can't stay away

  • Posts: 533

  • Since: 2008/12/10


Actually, I realized I can get by with a redirect after login for now (just a simple modification to include/checklogin.php), so I'm happy to hand this task over to tzvook

I downloaded both modules from the repository here.

9
ptomter
Re: Different homepage for different groups
  • 2010/7/8 12:55

  • ptomter

  • Just popping in

  • Posts: 49

  • Since: 2009/3/31


I have this code and I want a two customs link for a special group.



<div id="tools"><img src="<{$xoops_url}>/images/tlf_NBF.gif" alt="" width="227" height="31" />
<ul>
<li class="none"><{$smarty.const._TOG}></li>
<{php}> if (is_object($GLOBALS['xoopsUser'])) { <{/php}>
<li><a href="<{xoAppUrl /}>modules/profile/user.php"><{$smarty.const._MP}></a></li>
<li><a href="<{xoAppUrl /}>modules/profile/user.php?op=logout"><{$smarty.const._LU}></a></li>
<{php}> } else { <{/php}>
<li><a href="<{xoAppUrl /}>modules/profile/user.php"><{$smarty.const._B2}></a></li>
<{php}> } <{/php}>
<li>
</ul>

Where should I place the following line? Could I just paste it in in front of <{php}> tag or does this line need tags like that also?

<{if 10|in_array:$xoops_usergroups}>Show for group 1<{/if}>

10
Burning
Re: Different homepage for different groups
  • 2010/7/8 14:33

  • Burning

  • Theme Designer

  • Posts: 1163

  • Since: 2006/8/22


hi'

Another solution if it can help you :

• 1 : open www/include/checklogin.php

• 2 : put this piece of code around the line 63
after :
setcookie($xoopsConfig['usercookie'], 0, -1'/'XOOPS_COOKIE_DOMAIN0);
        }
    }

add :
Quote:

// Redirection hack after login
if ( in_array(1, $_SESSION['xoopsUserGroups'] ) ) {
$_POST['xoops_redirect'] = "/modules/ilovesushi";
} elseif ( in_array(2, $_SESSION['xoopsUserGroups'] ) ) {
$_POST['xoops_redirect'] = "/modules/ipreferpizza";
}
// Redirection hack after login


• 3 : adapt the hack
green : id of the Group
red : module name
Still learning CSS and... english

Login

Who's Online

249 user(s) are online (127 user(s) are browsing Support Forums)


Members: 0


Guests: 249


more...

Donat-O-Meter

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

Latest GitHub Commits