How can I add sprites here?
Niky
New
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:
0
Comments
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>':'')); }@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.
Thank You! Worked!