No announcement yet.

question about a variable

  • Filter
  • Time
  • Show
Clear All
new posts

  • question about a variable

    hey there,

    can someone tell me what the variable for the board members user name is? i previously had digichat setup to auto login users once they were logged in on the board with their username from the board. now it has stopped working and i'm not sure why and thought that the variable name has changed - previously it was $bbusername . I'm not sure if that is the problem though, i'm thinking there might be some limitation on what pages a cookie is valid for or something in which case my chat login page wouldn't be. any ideas would be great


  • #2


    • #3


      • #4
        I have this in my code to check to see if the user is logged in, but it seems not to be working with vB 2.0 - anyone know what the problem could be offhand - I don't really know PHP

        PHP Code:
        <? if ($bbuserinfo[username] != "" ){ ?>
        Last edited by brookelyn; Wed 14th Feb '01, 12:55am.


        • #5
          ok here is what I did:

          <? if ($bbuserinfo[username] != "" ){ ?>
          then applet code goes here with:
          <param name=nick value="<? echo $bbuserinfo[username] ?>">
          <? } else { ?>
          Then again SAME applet code but with:
          <param name=nick value="Guest">
          <? } ?>
          It works fine: when a registered user get in it pulls out his Vb2.0 user name and display it in the chat.
          BUT, and here is my problem, when the user is not regitered, instead of a "Guest" username specified in the ELSE of the code, it display as username: "Unregistered".

          The problem is that it seems it won't load the alternate seconde applet code if the user is not registered.
          So what should I do to have the bbusername replaced by Guest if user is not registered ?

          (between this is for confroom not digichat).

          Or maybe you know a better way to do it with a username variable that would be replaced by Guest value if non vb2 member ?

          Last edited by Sharg; Mon 19th Feb '01, 2:43am.


          • #6
            vB2 gives $bbuserinfo the value "unregistered" if the person isn't logged in. This means it never has a blank value.

            It caused a minor problem with the site I work on, which greeted most people with "Hi Unregistered"!

            I added this line into the php file:
            if($bbuserinfo[username]=="Unregistered"){ $bbuserinfo[username]=""; }
            and it worked as it used to.


            • #7
              Wohoooo !!!
              Thanks Jonathan !!

              It works great now and is vb2.0 complient !
              Last edited by Sharg; Mon 19th Feb '01, 4:06am.


              • #8
                If $bbuserinfo[userid] == 0 than that person is a guest or "Unregistered" so:

                <? if ($bbuserinfo[userid]){ ?>
                then applet code goes here with:
                <param name=nick value="<? echo $bbuserinfo[username] ?>">
                <? } else { ?>
                Then again SAME applet code but with:
                <param name=nick value="Guest">
                <? } ?>


                • #9
                  Thanks freddie
                  I found that with only

                  if($bbuserinfo[username]=="Unregistered"){ $bbuserinfo[username]=""; }

                  and $bbuserinfo[username] at nick as the value, it automatically put Guest if Unregistered and nickname from Vb if registered, so no need of the ELSE if and duplicate applet code


                  • #10
                    if (!$bbuserinfo[userid]) {
                      $bbuserinfo[username] = 'Guest';
                    // Applet here


                    • #11
                      I'm trying to set up 2.0 with the digichat login script. I am very new to this and really don't know anything about php or vB.

                      Would any of you be willing to post your digichat login script in full here? I've been looking for the script used on the Hole site that requires that you are a registered and logged in member to access the chat (nonmembers would be denied access)

                      Thank you!!


                      • #12
                        Ask brookelyn then as the Hole site is her's.


                        • #13
                          I wrote her, but haven't received a reply yet. We all know what the life of a webmaster is like, so I understand

                          What I've done so far is to take mrogish's script from the hacking forum...

                          require( "global.php" );
                              if( $bbuserid ) {
                                $user        = $DB_site->query_first( "SELECT username
                                                                         FROM users 
                                                                        WHERE userid = $bbuserid" );
                                $bbusername  = $user[ username    ];
                                print( "<APPLET align=middle code=\"digi.digichat.DigiChatApplet\" codeBase=\"\"  width=\"600\" height=\"480\" align=\"middle\" ARCHIVE=\"client.jar\" nickname=\"$bbusername\">
                                    <PARAM NAME=\"siteID\" VALUE=\"1000\">
                                    <PARAM NAME=\"cabbase\" VALUE=\"\">
                                    <PARAM NAME=\"background\" VALUE=\"FFFFFF\">
                                    <PARAM NAME=\"textcolor\" VALUE=\"000000\">
                                    <PARAM NAME=\"url\" VALUE=\"$bbuserid\">
                                    <PARAM NAME=\"openProfileURL\" VALUE=\"true\">
                                    <PARAM NAME=\"room\" VALUE=\"$room\">
                                    <PARAM NAME=\"embedded\" VALUE=\"true\">
                                    FanHome Chat requires a Java Compatible web browser to run.
                                    </APPLET>\n" );
                              } else { 
                                print( "<font face=\"TREBUCHET MS,ARIAL,HELVETICA\">Sorry, you must be logged in to use FanHome Chat!</font><br>" );
                              } // end if
                          I've replaced the urls with my own of course. The applet appears, but it doesn't recognize my login, even though i am logged into the forum. So based on your notes here, I changed the two instances of $bbusername to $bbuserinfo, but I didn't change anything else. But it still doesn't recognize my login. I'm apparently leaving something out. Any suggestions?



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