Not signed in (Sign In)

Categories

Vanilla 1.1.5 is a product of Lussumo. More Information: Documentation, Community Support.

Help keep Vanilla free:
Welcome Guest!
Want to take part in these discussions? If you have an account, sign in now.
If you don't have an account, apply for one now.
    •  
      CommentAuthorlech
    • CommentTimeJan 8th 2006
     # 1
    Just tossing this out there as it's often seen on other forums and sometimes, a useful feature. Seeing as how we have access to our own discussions which we started (public of course) perhaps others viewing say my profile could in turn see what discussions i've started just for the hell of it. Might make for a nifty extension if not a core feature.

    Thoughts?
    •  
      CommentAuthorMark
    • CommentTimeJan 8th 2006
     # 2
    Yeah, you could just add a link to the panel on the account page that goes to a discussion search for "username:".
    • CommentAuthorMinisweeper
    • CommentTimeJan 8th 2006 edited
     # 3
    Woo! I wrote my first extension!
    Here you go. Probably worth checking i havent done anything too stupid but it's only a couple lines of code (longest couple of lines i've ever written though).
    See it in action here
    •  
      CommentAuthorMark
    • CommentTimeJan 8th 2006
     # 4
    Nice one :)
    •  
      CommentAuthorlech
    • CommentTimeJan 8th 2006
     # 5
    haha, well that was quick. I knew this was going to be a silly request :) Thanks mini!
  1.  # 6
    You're welcome. Now get your styles up to 0.9.3 spec! I'm missing them!
    •  
      CommentAuthorlech
    • CommentTimeJan 8th 2006
     # 7
    aye aye cap'n. I'm still in the process of updating my computer and getting everything I need to work with in order. HL2 has consumed some of that time since I've not played it before and under this new 6600, omg it's awesome! I just beat it for the second time on hard difficulty. Great game.
  2.  # 8
    Haha, i wouldnt mind doing some gaming. Surprisingly enough server 2k3 doesnt cater for it much. I'm installing MCE on friday though so i recon i might be having some 50" CS fun.
    • CommentAuthordigifad
    • CommentTimeJan 15th 2006
     # 9
    It seems this only works if logged in. Otherwise, you get the error -

    Notice: Undefined variable: AccountUser in /pathtovanilla/extensions/UserDiscussions.php on line 14
  3.  # 10
    Really? I didnt check that. Shouldnt accountuser still exist though mark? *scratches head.
    •  
      CommentAuthorMark
    • CommentTimeJan 18th 2006
     # 11
    Here's a failsafe:

    if ($Context->SelfUrl == 'account.php') {
    if (!$AccountUser) {
    $UserID = ForceIncomingString("u", 0);
    if ($UserID == 0) $UserID = $this->Context->Session->UserID;
    if ($UserID > 0) {
    $UserManager = $Context->ObjectFactory->NewContextObject($Context, "UserManager");
    $AccountUser = $UserManager->GetUserById($UserID);
    }
    if ($AccountUser) $Panel->AddString('<ul class=\'LinkedList\'><li><a class=\'PanelLink\' href=\'search/?PostBackAction=Search&Type=Discussions&Advanced=1&btnSubmit=Search&AuthUsername='.$AccountUser->Name.'\'>'.$Context->Dictionary["DiscussionsStartedByUser"].'</a></li></ul>', 1);
    }
  4.  # 12
    Interesting. One day i'll get the hang of this... Cheers.
Add your comments
    Username Password
  • Format comments as