Fork me on GitHub
Current release is 2.1.6 (21 Nov 2014).

Users who have not yet upgraded to 2.1 should get security release 2.0.18.14 (1 Nov 2014). We will stop providing these security releases to 2.0 at the end of this year.

Get Karmabank Url in Discussion user meta

SevMCSevMC
edited May 2012 in Vanilla 2.0 Help
This discussion is related to the Karma Bank addon.

Thanks for this excellent plugin! :)

I was modifying the default.php in order to add the author's Karmabank Url to the KarmaBalance displayed in the dicussion meta, but If I add something like $UserID or $Author it doesn't work (Sorry, Im pretty bad with php XD).

Do you know how can I do that? :)

I got stuck here:

protected function ShowBalance(&$Sender) {
    $Balance = ArrayValue($Sender->EventArguments['Author']->UserID, $Sender->Data('KarmaBalances'));
    echo '<a href="profile/karmabank/'.AUTHORID.'/'.AUTHORNAME.'"><span title="Loudness" class="udb">'.sprintf(T("%01.2f Karma"),$Balance).'</span></a>';
}
Tagged:

Best Answer

  • peregrineperegrine ☯ hasta luego :) In-Flight MVP
    edited May 2012 Answer ✓

    I assume the logic is correct and you want to replace these two items...

    AUTHORID.'/'.AUTHORNAME

    try this...

    $AId = $Sender->EventArguments['Author']->UserID  // would be authorid
    $AName =$Sender->EventArguments['Author']->Name;  // would be authorname
    
    echo '<a href="profile/karmabank/'. $AId . '/'. $AName .'"><span title="Loudness" class="udb">'.sprintf(T("%01.2f Karma"),$Balance).'</span></a>';
    

    Monetary Donations will be appreciated if you use my plugins. Thanks in Advance.
    As a waiter gets a tip for a good meal, tips for successful solutions appreciated as well. Peregrine

Answers

Sign In or Register to comment.