1
bluescreen
Re: Please Help with Member Group type Module.
  • 2006/11/9 9:14

  • bluescreen

  • Just popping in

  • Posts: 10

  • Since: 2006/10/19


Nevermind... I got it!

<?php
include("../../mainfile.php");
include(
XOOPS_ROOT_PATH."/header.php");
$xoopsOption['show_rblock'] = 1;


     
$groups is_object($xoopsUser) ? $xoopsUser->getGroups() : array(XOOPS_GROUP_ANONYMOUS);
    
//ADMIN REDIRECT
    
if ( in_array("1"$groups) ) {

            
header('Location: http://www.consultsports.com/modules/cjaycontent/index.php?id=5');
            exit;
    }
//Subscribed REDIRECT
    
elseif ( in_array("4"$groups) ) {

            
header('Location: http://www.consultsports.com/modules/cjaycontent/index.php?id=6');
            exit;
    }
//Registered REDIRECT
    
elseif ( in_array("2"$groups) ) {

            
header('Location: http://www.consultsports.com/modules/cjaycontent/index.php?id=7');
            exit;
    }
//Anonymous REDIRECT
    
else {

            
header('Location: http://www.consultsports.com/modules/cjaycontent/index.php?id=8');
            exit;
    }

?>


Working like a charm. At least for Admin and Anon... testing the other two now.



2
bluescreen
Re: Please Help with Member Group type Module.
  • 2006/11/9 8:40

  • bluescreen

  • Just popping in

  • Posts: 10

  • Since: 2006/10/19


Can anybody help me with this? I know I should know more PHP if I really want to write this, however i just don't have the time to sit down and learn it right now. Someone, please help me out with this.



3
bluescreen
Please Help with Member Group type Module.
  • 2006/11/7 10:53

  • bluescreen

  • Just popping in

  • Posts: 10

  • Since: 2006/10/19


OK, I'm going to start with I have no clue how to write PHP. However, I've done a little here and there to understand a few things. I want to take the array that shows the usergroups of a user and at this point display an echo statement. I've got it ordered because as I understand it, once PHP finds an if statement that works it ignores the rest. I have also tried to string together a way to come up with the usergroups array, but have been unable to do so because of my lack of understanding PHP as well as XOOPS itself. This is very important to me, so please someone help me out with this one.

This is what I have created using the information I've found.

<?php
include("../../mainfile.php");
include(
XOOPS_ROOT_PATH."/header.php");
$xoopsOption['show_rblock'] = 1;


    if ( @
$xoopsUser && is_object($xoopsUser) ) {
        
$xoopsTpl->assign'xoops_usergroups'$xoopsUser->getGroups() );
    }


    if ( 
in_array("1"$xoops_usergroups) ) {

            echo 
"User is Admin";
            exit;
    }
    elseif ( 
in_array("4"$xoops_usergroups) ) {

            echo 
"User is SUBSCRIBED";
            exit;
    }

    elseif ( 
in_array("2"$xoops_usergroups) ) {

            echo 
"User is Registered";
            exit;
    }

    else {

            echo 
"User is Not Registered";
            exit;
    }
?>


Any Help would be greatly appreciated.



4
bluescreen
Re: $xoops_isadmin, $xoops_isuser, but $xoops_?
  • 2006/11/7 9:35

  • bluescreen

  • Just popping in

  • Posts: 10

  • Since: 2006/10/19


Is there an easy way to quickly modify to use this within a module instead of template? In other words how could I take this and then make a PHP If Statement to lets say redirect the page based on the group? I know nothing about PHP but this is something I could use for my site so that it would redirect the main page based on UserGroup. And MyHome has already been offered to me... have it. The redirect doesn't work, and it only does it based on 2 groups. Not 3 or 4 like I need.



5
bluescreen
Re: Redirection Module
  • 2006/10/30 23:02

  • bluescreen

  • Just popping in

  • Posts: 10

  • Since: 2006/10/19


OK, can someone help me fix this so it will work?


function stuff() {
    global 
$xoopsDB$xoopsUser;

if (
$xoopsUser) {
    
$groups $xoopsUser->getGroups();
} else {
    
$groups XOOPS_GROUP_ANONYMOUS;
}

if(
$groups ['XOOPS_GROUP_ANONYMOUS']) {

print 
"User Group is, ANONYMOUS
"
;
} else {
    print 
"User Group is, USER";
}
}


Like I said before, I am a complete newbie to PHP and don't know alot about it. I can't figure out how to return the User Group IDs as a variable so that I can write a statement.



6
bluescreen
Re: Redirection Module
  • 2006/10/30 9:16

  • bluescreen

  • Just popping in

  • Posts: 10

  • Since: 2006/10/19


Maybe I can do this myself with a small amount of help. Here's what I'm thinking. I can figure out the coding for a redirect with PHP. What I need to know is simply how to check the following.

if user=group then redirect to.

It should be as simple as detecting the user group then applying the redirect so it would look similar to this(obviously this isn't in php format or anything)

If User=Group 1 Then
redirect=("URL")
ElseIf User=Group 2 then
redirect=("URL")
ElseIf User=Group 3 then
redirect=("URL")
EndIf

Is that right or way off?



7
bluescreen
Re: Redirection Module
  • 2006/10/30 8:59

  • bluescreen

  • Just popping in

  • Posts: 10

  • Since: 2006/10/19


Nope. MyHome only allows redirect based on one group. The others go somewhere else. Plus its not working anyways on my xoops. I use MyHome currently for the custom HTML page. But I need one that will redirect between 3 different pages at least not just one.



8
bluescreen
Redirection Module
  • 2006/10/30 8:37

  • bluescreen

  • Just popping in

  • Posts: 10

  • Since: 2006/10/19


This is kind of important to my site. I need a small tiny module that has one purpose. I would make it the default module for the "Home Page". It would then read the users User Group and redirect to a page within a content module I have installed. So basically, I have 3 Groups.

1. Anonymous
2. Subscribers
3. Registered


Therefore, I would want it to redirect as below. (Subscribers are ALWAYS Registered users as well)

If 1 then page 1
If 2 then page 2
If 3 then page 3

It obviously needs to ignore 3 if the person is also a 2. Does this make sense? I hope its something simple because I really need this. Maybe even a small php file I could make myself. Of course I really want an admin control to change the redirect but thats not all that necessary especially if this is a small file I can make myself. Any help on this would be GREATLY appreciated... Very Much appreciated to be honest. I wish I had the money to pay someone to do this unfortunately I don't so I'm asking that someone please help me out of the goodness of their heart. I just got my PHP book yesterday and haven't had the time to open it yet so I hope someone can help me out here.



9
bluescreen
Create Static Pages
  • 2006/10/28 6:18

  • bluescreen

  • Just popping in

  • Posts: 10

  • Since: 2006/10/19


OK, I may just not have looked hard enough. I'm sure I did. I'm looking for the ability to create a static page. Here's what I mean. I want to create a disclaimer for my site on other policies. I want those pages to be available by going to URL/policies/tos.php or URL/policies/disclaimer.php... etc. I currently use Edito for those pages and am wondering if there is an easy way to make the pages still completely within Mambo that is easily edited through the Admin interface. Any help would be greatly appreciated.



10
bluescreen
Changing SignUp Form & Global Title and URL
  • 2006/10/26 5:03

  • bluescreen

  • Just popping in

  • Posts: 10

  • Since: 2006/10/19


Ok, the first one I'm going to ask about is a global title. Is it possible to make a global title? Basically the title that loads with the main index is the same throughout the site. Instead of loading say the name of the module with the title. Is this possible? Also is there anyway possible to show only the main URL at all times without frames? When they visit the site in other words it would always sayhttps://xoops.org/ in the address bar. I don't figure there is a way without frames, but was thought maybe there was something I could do.

Second.
I am using the Subscription module. Is there an easy way to change the signup form to include a module. Basically, I want to force someone to get a subscription when they signup. This would require the signup form to complete and send the user to PayPal and automatically activate the account once payment is recieved. No E-Mail activation needed. If this is to difficult to explain wihtout more information I will provide it. I am willing to pay a reasonable price for someone who knows what they are doing to help me with this if they require it.




TopTop



Login

Who's Online

134 user(s) are online (58 user(s) are browsing Support Forums)


Members: 0


Guests: 134


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