Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Profile: Discussions Started

lechlech Chicagoland
edited January 2006 in Vanilla 1.0 Help
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?


  • MarkMark Vanilla Staff
    Yeah, you could just add a link to the panel on the account page that goes to a discussion search for "username:".
  • edited January 2006
    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
  • MarkMark Vanilla Staff
    Nice one :)
  • lechlech Chicagoland
    haha, well that was quick. I knew this was going to be a silly request :) Thanks mini!
  • You're welcome. Now get your styles up to 0.9.3 spec! I'm missing them!
  • lechlech Chicagoland
    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.
  • 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.
  • 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
  • Really? I didnt check that. Shouldnt accountuser still exist though mark? *scratches head.
  • MarkMark Vanilla Staff
    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); }
  • Interesting. One day i'll get the hang of this... Cheers.
This discussion has been closed.