Announcement

Collapse
No announcement yet.

User selectable homepage

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • User selectable homepage

    I'm trying to figure out why this isn't working...

    PHP Code:
    <?php 
    // ######################## SET PHP ENVIRONMENT ########################### 
    error_reporting(E_ALL & ~E_NOTICE); 
    // ##################### DEFINE IMPORTANT CONSTANTS #######################
    define('THIS_SCRIPT''user_page'); 
    // ########################## REQUIRE BACK-END ############################ 
    require_once('./global.php'); 
    // ######################################################################## 
    // ######################### START MAIN SCRIPT ############################ 
    // ######################################################################## 
    if (!$vbulletin->userinfo['userid']) 

    header'Location: http://www.paranormalnetwork.net/cmps_index.php' ) ;

    if (
    $vbulletin->userinfo['field11'] == 'Forums')
    header'Location: http://www.vbulletin.com' ) ;
    else if (
    $vbulletin->userinfo['field11'] == 'Portal')
    header'Location: http://www.paranormalnetwork.net/cmps_index.php' ) ;
    ?>
    Alright, now the one for if the user is a guest works perfectly, and the other two are working perfectly for me... But for all the people I've asked to test it they just get a blank page.

    By default, field11 is set to "Forums" for everybody.

    What's going on and how can I fix this?

    Thanks for your help guys.

  • #2
    Add an else just to test the possibility of them not seeing any redirect.

    PHP Code:
    if (!$vbulletin->userinfo['userid']) 

    header'Location: http://www.paranormalnetwork.net/cmps_index.php' ) ;

    if (
    $vbulletin->userinfo['field11'] == 'Forums')
    header'Location: http://www.vbulletin.com' ) ;
    else if (
    $vbulletin->userinfo['field11'] == 'Portal')
    header'Location: http://www.paranormalnetwork.net/cmps_index.php' ) ;
    else
    echo 
    "Test"

    Comment


    • #3
      Thanks for that... Instead of the blank page they're getting the echo message... What would make this work fine for me but not at all for other people?

      Comment


      • #4
        Either they don't have anything typed in or it's a different case.

        PHP Code:
        if (strtolower($vbulletin->userinfo['field11']) == "forums")
        header'Location: http://www.vbulletin.com' ) ;
        else if (
        strtolower($vbulletin->userinfo['field11']) == "portal")
        header'Location: http://www.paranormalnetwork.net/cmps_index.php' ) ;
        else
        echo 
        "Test"

        Comment


        • #5
          make that field a dropdown so its selected. maybe a better solution would be switch() so you provide cases and then if their selection is neither of those you specify then it defaults to something.

          Comment


          • #6
            If you add a new userfield, even if you define a default value, it will not update the database for all existing members. Check in your database with phpMyAdmin if all users really have a value.
            Want to take your board beyond the standard vBulletin features?
            Visit the official Member to Member support site for vBulletin Modifications: www.vbulletin.org

            Comment

            widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
            Working...
            X