Show buffs on 1.73

Miscellaneous code snippets and examples that members have posted

Show buffs on 1.73

Postby Subxero » Thu Jun 21, 2007 9:40 am

A simple query to show current buffs on your mates.

Open /memberdetails.php

SEARCH
Code: Select all
if ($action == 'character' && $roster_conf['show_item_bonuses'])
{
   echo dumpBonuses($name, $server);
}

ADD AFTER
Code: Select all
if ($action == 'character')
{
   echo dumpBuffs($name, $server);
}


Open /lib/Char.php

AT END of file ADD rear dumpBonuses function
Code: Select all
function dumpBuffs($char, $server)
{
   global $roster_conf, $wowdb;

   $server = $wowdb->escape( $server );
   $qry = "SELECT b.name, b.icon, b.tooltip FROM `".ROSTER_BUFFSTABLE."` b, `".ROSTER_PLAYERSTABLE."` p WHERE b.member_id = p.member_id and p.name = '".$char."' and p.server = '".$server."' ORDER BY b.name ASC;";
   $result = $wowdb->query($qry) or die_quietly($wowdb->error(),'Database Error',basename(__FILE__),__LINE__,$qry);

   $bt .= border('sgray','start','Current Buffs').
      '<table style="width:400px;" class="bodyline" cellspacing="0" cellpadding="0" border="0">'."\n";

   $row = 0;
   while($qrow = $wowdb->fetch_array($result))
   {
     $buff_icon = $roster_conf['interface_url'].$qrow['icon'].'.'.$roster_conf['img_suffix'];
      $bt .= '   <tr>
      <td class="membersRowRight'.(($row%2)+1).'" style="white-space:normal;" '.makeOverlib($qrow['tooltip'],'','',1).'><img src="'.$buff_icon.'" width=20px height=20px /> '.$qrow['name'].'</td>
   </tr>';

      $row++;
   }
   $bt .= '</table>'.border('sgray','end');

   if( $row!=0 )
      return $bt;
}


And now you have buffs on every char showed ;)
User avatar
Subxero
WR.net Artisan
WR.net Artisan
 
Posts: 234
Joined: Thu Jul 06, 2006 4:08 pm
Realm: Zul'jin (PvE) - US

Show buffs on 1.73

Postby Subxero » Sun Jun 24, 2007 6:37 pm

If you dont want false buffs on upload char without buffs and stay the previous buffs, change these!

Open /lib/wowdb.php search for:
Code: Select all
   function do_buffs( $data, $memberId )
   {
      $buffs = $data['Attributes']['Buffs'];
      if( !empty($buffs) && is_array($buffs) )
      {
         $this->setMessage('<li>Updating Buffs: ');

         // Delete the stale data
         $querystr = "DELETE FROM `".ROSTER_BUFFSTABLE."` WHERE `member_id` = '$memberId'";
         if( !$this->query($querystr) )
         {
            $this->setError('Buffs could not be deleted',$this->error());
            return;
         }


And change the order to these:
Code: Select all
   function do_buffs( $data, $memberId )
   {
      // Delete the stale data
      $querystr = "DELETE FROM `".ROSTER_BUFFSTABLE."` WHERE `member_id` = '$memberId'";
      if( !$this->query($querystr) )
      {
         $this->setError('Buffs could not be deleted',$this->error());
         return;
      }

      $buffs = $data['Attributes']['Buffs'];
      if( !empty($buffs) && is_array($buffs) )
      {
         $this->setMessage('<li>Updating Buffs: ');
Last edited by Subxero on Sun Jun 24, 2007 6:40 pm, edited 2 times in total.
User avatar
Subxero
WR.net Artisan
WR.net Artisan
 
Posts: 234
Joined: Thu Jul 06, 2006 4:08 pm
Realm: Zul'jin (PvE) - US

Show buffs on 1.73

Postby vblars » Fri Jul 20, 2007 6:55 am

Very nice Subxero great work. :P
User avatar
vblars
WR.net Apprentice
WR.net Apprentice
 
Posts: 50
Joined: Tue Jul 04, 2006 1:52 pm


Return to Code Cache

Who is online

Users browsing this forum: No registered users and 0 guests

cron