(1) 2 »
nmshah nmshah
  • Just can't stay away
  • Just can't stay away
  • Joined: 2007/7/2 4:24
  • From India
  • Group: Registered Users
  • Posts: 556
  • Posted on: 2008/2/25 16:50
Different homepage for different groups #1
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
http://www.xoops.org/modules/newbb/vi ... 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.
christian christian
  • Just can't stay away
  • Just can't stay away
  • Joined: 2002/2/24 18:08
  • From Le Mans - France
  • Group: Registered Users
  • Posts: 401
  • Posted on: 2008/2/25 18:46
Re: Different homepage for different groups #2
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)
Mazarin Mazarin
  • Just can't stay away
  • Just can't stay away
  • Joined: 2008/12/10 16:05
  • From Knivsta, Sweden
  • Group: Registered Users Repository Group
  • Posts: 533
  • Posted on: 2009/9/11 17:04
Re: Different homepage for different groups #3
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?
ghia ghia
  • Community Support Member
  • Community Support Member
  • Joined: 2008/7/3 15:19
  • From Belgium
  • Group: Registered Users
  • Posts: 4946
  • Posted on: 2009/9/12 3:29
Re: Different homepage for different groups #4
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.
Mazarin Mazarin
  • Just can't stay away
  • Just can't stay away
  • Joined: 2008/12/10 16:05
  • From Knivsta, Sweden
  • Group: Registered Users Repository Group
  • Posts: 533
  • Posted on: 2009/9/12 6:37
Re: Different homepage for different groups #5

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?
ghia ghia
  • Community Support Member
  • Community Support Member
  • Joined: 2008/7/3 15:19
  • From Belgium
  • Group: Registered Users
  • Posts: 4946
  • Posted on: 2009/9/12 10:36
Re: Different homepage for different groups #6
In principle 2.0.x
Where did you download it?
tzvook tzvook
  • Just can't stay away
  • Just can't stay away
  • Joined: 2003/2/1 18:15
  • From Israel
  • Group: Registered Users
  • Posts: 854
  • Posted on: 2009/9/12 11:27
Re: Different homepage for different groups #7
I'm interested too, if one have the module files I'd love to take a look ....
Mazarin Mazarin
  • Just can't stay away
  • Just can't stay away
  • Joined: 2008/12/10 16:05
  • From Knivsta, Sweden
  • Group: Registered Users Repository Group
  • Posts: 533
  • Posted on: 2009/9/12 11:52
Re: Different homepage for different groups #8
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.
ptomter ptomter
  • Just popping in
  • Just popping in
  • Joined: 2009/3/31 13:42
  • Group: Registered Users
  • Posts: 49
  • Posted on: 2010/7/8 8:55
Re: Different homepage for different groups #9
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}>
Burning Burning
  • Theme Designer
  • Theme Designer
  • Joined: 2006/8/22 15:44
  • Group: Registered Users Repository Group
  • Posts: 1163
  • Posted on: 2010/7/8 10:33
Re: Different homepage for different groups #10
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
How to effectively post a question in the Xoops forums? - Read here...
Design by: XOOPS UI/UX Team