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.

How to use PostDiscussionOptionsRender

edited November 2006 in Vanilla 1.0 Help
Hello,

I'd like to add some text on the index.php below every discussion entry. Directly below the line with Category, Started by, Comments.....
How can I make this work inside an extension??

I don't know how to handle it...
can someone help me please

Comments

  • Your delegate function will be passed the usual array of delegate parameters; you'll be using the key 'DiscussionList'. This is a string you can add to by reference. Note that it's in the context of a <ul> block, so you should add your text as a <li> and style it as needed.
  • I've tried it with something like this, but it doesn't work:

    if ($Context->SelfUrl == "index.php") { $Context->AddToDelegate("DiscussionList","PostDiscussionOptionsRender","Test"); function Test(&$DiscussionManager) { echo '<li>This is a test</li>'; } }
  • Instead of:
    echo '<li>This is a test</li>';
    Try:
    $DiscussionManager->DelegateParameters['DiscussionList'] .= '<li>This is a test</li>';
  • No unfortunately this isn't working... I've also tried ['Discussion'] instead of ['DiscussionList']
  • I took a look at the "Discussion Pages" extension and found the solution:
    $Context->AddToDelegate("DiscussionGrid","PostDiscussionOptionsRender","Test")
This discussion has been closed.