Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Options

How can I add sprites here?

NikyNiky New
edited June 2015 in Vanilla 2.0 - 2.8

Hello Vanilla, I need to know if it's possible to add sprites on links from Profile.
Like This:
http://i.imgur.com/Wef3359.png
Please HELP me :)

Tagged:

Comments

  • Options

    Replace

    public function ProfileController_AddProfileTabs_Handler($Sender){ if(!$this->IsEnabled()) return; $KarmaBank = new KarmaBankModel($Sender->User->UserID); $Balance = $KarmaBank->GetBalance(); $Sender->AddProfileTab('KarmaBank','profile/karmabank/'.$Sender->User->UserID.'/'.rawurlencode($Sender->User->Name), 'KarmaBank',T('KarmaBank.KarmaBank','Karma Bank').(isset($Balance->Balance) && is_numeric($Balance->Balance) ? '<span class="Count">'.sprintf(T('KarmaBank.NumberFormat',"%01.2f"),$Balance->Balance).'</span>':'')); }

    To this

    public function ProfileController_AddProfileTabs_Handler($Sender){ if(!$this->IsEnabled()) return; $KarmaBank = new KarmaBankModel($Sender->User->UserID); $Balance = $KarmaBank->GetBalance(); $Sender->AddProfileTab('KarmaBank','profile/karmabank/'.$Sender->User->UserID.'/'.rawurlencode($Sender->User->Name), 'KarmaBank',T('KarmaBank.KarmaBank','<span class="Sprite SpPreferences"></span>Karma Bank').(is_numeric($Balance->Balance) ? '<span class="badge pull-right" class="Count">'.sprintf(T('KarmaBank.NumberFormat',"%01.2f"),$Balance->Balance).'</span>':'')); }

  • Options
    hgtonighthgtonight ∞ · New Moderator

    @DmcBoos Vanilla provides a helper function called Sprite($Name) that could be used here instead.

    'KarmaBank',Sprite('SpPreferences') . T('KarmaBank.KarmaBank','Karma Bank').(isset($Balance->Balance) && is_numeric($Balance->Balance) ? '<span class="Count">'.sprintf(T('KarmaBank.NumberFormat',"%01.2f"),$Balance->Balance).'</span>':''));
    

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

  • Options

    @hgtonight said:
    DmcBoos Vanilla provides a helper function called Sprite($Name) that could be used here instead.

    'KarmaBank',Sprite('SpPreferences') . T('KarmaBank.KarmaBank','Karma Bank').(isset($Balance->Balance) && is_numeric($Balance->Balance) ? '<span class="Count">'.sprintf(T('KarmaBank.NumberFormat',"%01.2f"),$Balance->Balance).'</span>':''));
    

    Thank You! Worked!

Sign In or Register to comment.