Announcement

Collapse
No announcement yet.

About $onlineusers and its usage

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

  • About $onlineusers and its usage

    In usercp there is the buddy list code and I'd like to know how the $onlineusers thing works... I can't paste the part, but it's that BUDDY LIST TABLE START part of usercp.

    Now, I know the code it pulls out is in usercp_buddy, but I can't understand how the $onlineusers works. In usercp it works just fine, shows all your buddies who are online, but if I take the to forumhome... Nothing. What's up with this? And if anyone could tell me how to be able to show buddy list outside of the control panel I'd be happy...

    Thanks,
    IgeL

  • #2
    http://sitepointforums.com

    If you are a registered member you will see a section that says:

    Username's Personal Features:
    Private Messages Launch Buddy List Subscribed Threads.

    Click on Launch Buddy List... Is this what you mean? Or do you want it accessible on all pages?
    Translations provided by Google.

    Wayne Luke
    The Rabid Badger - a vBulletin Cloud demonstration site.
    vBulletin 5 API - Full / Mobile
    Vote for your favorite feature requests and the bugs you want to see fixed.

    Comment


    • #3
      Well, that's not exactly want I want to do... But it's close enough. At the moment I just want the buddy list to show in forumhome, but if it works then I'll expand it to every other page too (just for graphical reasons).

      I have copypasted the BUDDY LIST thing, but I don't have any idea how to deal with the $onlineusers. I guess it doesn't "execute" it...

      Comment


      • #4
        Look at the code in usercp.php.
        Translations provided by Google.

        Wayne Luke
        The Rabid Badger - a vBulletin Cloud demonstration site.
        vBulletin 5 API - Full / Mobile
        Vote for your favorite feature requests and the bugs you want to see fixed.

        Comment


        • #5
          Does not work. As I said, I copypasted the whole <!--BUDDY LIST STARTS HERE--> till the <!-- BUDDY LIST STOPS HERE--> or whatever they are...

          Comment


          • #6
            This is getting weird...

            $onlineusers works in the usercp templates, but not in any other template (like newthread.php). WTF is up with this?


            Puh, I guess I just gotta hope a miracle happens while I'm sleeping...
            Last edited by IgeL; Tue 20th Feb '01, 2:12pm.

            Comment


            • #7
              The reason it works is this... The $onlineusers variable is parsed and built in usercp.php and it is global... it basically becomes part of the template cache. So while you are in that file you can use that variable.

              However if you go into newthread.php, showthread.php, index.php or any other file, you will find no reference to $onlineusers. So when you use this variable PHP is outputting the value of it. It works just fine there just isn't anything to output. To make it work on all templates like you wish you have to make it global to all pages by including it in a file that is global to all pages..
              Translations provided by Google.

              Wayne Luke
              The Rabid Badger - a vBulletin Cloud demonstration site.
              vBulletin 5 API - Full / Mobile
              Vote for your favorite feature requests and the bugs you want to see fixed.

              Comment


              • #8
                So I have to edit the usercp.php file manually (by downloading it) and search for the correct part and copypaste it to MyVeryOwnFile.php, and and.. hmm. Well I see what I can do.

                Update: Well it seems I will not even try this anymore. Too much hassle, and I'd have to do the same for $newmessages (pm)... I guess I just have to edit the graphical interface somehow, but it won't be as cool anymore. =(

                Update 2: Actually I will... I just got global.php and usercp.php from the host, so I can edit them... Doesn't seem too complicated, just copypasting the buddy list and personal message parts from usercp.php to global.php... And it should work. At least I hope so.
                Last edited by IgeL; Wed 21st Feb '01, 1:30am.

                Comment


                • #9
                  I'm the man! Hah, I got the code working... I won't bother to try the personal messages thing, though. Anyways, thanks for your help wluke... =)

                  Comment

                  Loading...
                  Working...
                  X