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.

request: new delegate/parameters for Threaded Discussions addon + alpha release

edited November 2007 in Vanilla 1.0 Help
Hi,
Here are Delegates and Delegate Parameters I need (I can reformat this list if needed, or provide the files).
Names are just what I choosed, consistency can be bad.

/themes/discussions.php
just before line 35: include($ThemeFilePath);
$this->DelegateParameters['Discussion'] = &$Discussion;
$this->CallDelegate( 'PreSingleDiscussionRender' );
/library/Vanilla/Vanilla.Control.SearchForm.php
after line 184: if ($Counter < $this->Context->Configuration['SEARCH_RESULTS_PER_PAGE']) {
$this->DelegateParameters['Discussion'] = &$Discussion;
$this->CallDelegate( 'PreSingleDiscussionRender' );
/library/Vanilla/Vanilla.Class.DiscussionManager.php
at the end of the constructor
$this->CallDelegate('PostConstructor');
after line 465: if ($this->Context->WarningCollector->Count() == 0) {
$this->DelegateParameters['SqlBuilder'] = &$s;
$this->CallDelegate( 'PreSaveDiscussion' );
/library/Vanilla/Vanilla.Class.Discussion.php
after line 168: // Define the last page
$this->CallDelegate('PreDefineLastPage');
/library/Vanilla/Vanilla.Class.CommentManager.php
before line 357: $Comment->CommentID = $this->Context->Database->Insert
$this->DelegateParameters['SqlBuilder'] = &$s;
$this->CallDelegate('PreInsertNewComment');

I also have a problem of passing a variable by ref or not: in /library/Vanilla/Vanilla.Class.Discussion.php, I need to pass $Configuration by ref in this function (add the '&')
function GetPropertiesFromDataSet($DataSet, &$Configuration)

That's because I need to break pagination and change $conf['COMMENTS_PER_PAGE'] on the fly.
Is there a simple workaround ?

Now that you have all modifications needed, you could test it ;)
alpha-release

Comments

  • This was quick.
    Big thanks to Dinoboff, every request was achieved (including the $configuration by ref). PostConstructor was renamed to Constructor though.
This discussion has been closed.