TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

March 28, 2024, 08:42:16 AM

Login with username, password and session length
Members
Stats
  • Total Posts: 195,104
  • Total Topics: 21,212
  • Online today: 176
  • Online ever: 3,540 (September 03, 2022, 01:38:54 AM)
Users Online
  • Users: 1
  • Guests: 187
  • Total: 188
  • illori

[block] Raid Progression Status

Started by ErikG, August 15, 2010, 12:31:10 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

ErikG

Name of Snippet: Raid Progression Status
SMF/TP versions tested:: SMF 2.0 RC3 / TinyPortal 1.0 beta 5.2  (The block does not hook into SMF or TP in any way, so should work in any system that support blocks)
Block Type:: php
Author: Erik Gulliksen
Demo and original post: http://pendulum-guild.co.uk/index.php?topic=266.0
Other Requirements: Requires nothing else to work, but some background images will need to be uploaded if you want them. Feel free to get the ones I use on my guild site.
Description: Just a simple block for showing raid progression. I made it for my World of Warcraft guild, but you should easily be able to edit raid and instance names for it to suit other games.

Just edit the arrays for each instance/variation of a raid and the block will for each instance display the progress (e.g. 7/12) and a detailed list of which events you killed if your hover your mouse over the progress.


/* WoW Progression Block - ver. 0.2

Author: Erik Gulliksen(progressionblock@erik-gulliksen.com) / Protarion of Pendulum  @ EU-Vek'Nilash.
Created: August 13, 2010
Last Update: August 14, 2010
Website: http://pendulum-guild.co.uk/index.php?topic=266.0

This is a code block that displays your raid progression for each individual raid and a tooltip with boss breakdowns. New raids and modes can easily be added by adding new arrays to the config section.
The script is loosely based on SMF-TinyPortal WoW Recruitment Block - ver. 0.5 by Raugturi (Raugturi@gmail.com).

This block code is released under a Creative Commons Attribution 3.0 Unported licence: http://creativecommons.org/licenses/by/3.0/

Requires wz_tooltip to be loaded in the page
http://www.walterzorn.com/tooltip/tooltip_e.htm (The official page appears to be down, a copy can be found at http://pendulum-guild.co.uk/wz_tooltip.js)




Changelog

0.2
* Background image for each raid
* Color seperate for each raid

0.1
* Initial release

*/

// ******************
// * Config Section *
// ******************



// Image Directory: Path to icon folder
// Note: Must contain trailing '/'
$image_dir = 'images/progress/';

// Status Colors: Set the color for each status here.
$notkilled_color = '#8B0000';
$killed_color = '#006400';




/*
== Instance arrays ==

Variables:
Name   - Type: Text,    Value: Instance shortname name (e.g ICC10HC, ICC25N, Nax25 or Nax10)
Display - Type: Integer, Value: 0=hidden, 1=visible
Bosses  - Type: Array,   Element Format: Key = Bossname, Value = Kill status (1 if killed,0 if not killed)
*/

$icc_instances = array(
array(
'name' => 'ICC10 (N)',
'display' => 1,
'bosses' => array('Lord Marrowgar' => 1,'Lady Deathwhisper' => 1,'Gunship Battle' => 1,'Deathbring Saurfang' => 1,'Festergut' => 1,'Rotface' => 1,'Professor Putricide' => 1,'Blood Prince Council' => 1,'Blood-Queen Lana\\\'thel' => 1,'Valithria Dreamwalker' => 1,'Sindragosa' => 1,'The Lich King' => 1)),
array(
'name' => 'ICC10 (HC)',
'display' => 1,
'bosses' => array('Lord Marrowgar' => 1,'Lady Deathwhisper' => 1,'Gunship Battle' => 1,'Deathbring Saurfang' => 0,'Festergut' => 1,'Rotface' => 1,'Professor Putricide' => 0,'Blood Prince Council' => 0,'Blood-Queen Lana\\\'thel' => 1,'Valithria Dreamwalker' => 1,'Sindragosa' => 0,'The Lich King' => 0)),
array(
'name' => 'ICC25 (N)',
'display' => 0,
'bosses' => array('Lord Marrowgar' => 1,'Lady Deathwhisper' => 1,'Gunship Battle' => 1,'Deathbring Saurfang' => 1,'Festergut' => 1,'Rotface' => 0,'Professor Putricide' => 0,'Blood Prince Council' => 0,'Blood-Queen Lana\\\'thel' => 0,'Valithria Dreamwalker' => 0,'Sindragosa' => 0,'The Lich King' => 0)),
array(
'name' => 'ICC25 (HC)',
'display' => 0,
'bosses' => array('Lord Marrowgar' => 0,'Lady Deathwhisper' => 0,'Gunship Battle' => 0,'Deathbring Saurfang' => 0,'Festergut' => 0,'Rotface' => 0,'Professor Putricide' => 0,'Blood Prince Council' => 0,'Blood-Queen Lana\\\'thel' => 0,'Valithria Dreamwalker' => 0,'Sindragosa' => 0,'The Lich King' => 0))
);





$rs_instances = array(
array(
'name' => 'RS10 (N)',
'display' => 1,
'bosses' => array('Saviana Ragefire' => 1,'Baltharus the Warborn' => 1,'General Zarithrian' => 1,'Halion' => 0)),
array(
'name' => 'RS10 (HC)',
'display' => 0,
'bosses' => array('Saviana Ragefire' => 0,'Baltharus the Warborn' => 0,'General Zarithrian' => 0,'Halion' => 0)),
array(
'name' => 'RS25 (N)',
'display' => 0,
'bosses' => array('Saviana Ragefire' => 0,'Baltharus the Warborn' => 0,'General Zarithrian' => 0,'Halion' => 0)),
array(
'name' => 'RS25 (HC)',
'display' => 0,
'bosses' => array('Saviana Ragefire' => 0,'Baltharus the Warborn' => 0,'General Zarithrian' => 0,'Halion' => 0))
);

/*
== Raid arrays ==

Variables:
Name   - Type: Text,    Value: Raid name
Color - Type: Text, Value: HTML color code, e.g. '#FF2B43'
Image - Type: Text, Value: Filename of the image. Will be appended to the image directory defined up top.
Instances  - Type: Instance Array, Value: Use the corresponding $variable defined above
*/
$icc = array(
'name' => 'Icecrown Citadel',
'color'  => '#BBFF00',
'image' => 'icc.jpg',
'instances' => $icc_instances
);

$rs = array(
'name' => 'Ruby Sanctum',
'color'  => '#FF8C00',
'image' => 'rs.jpg',
'instances' => $rs_instances
);


/*
== Main progress array ==

Fill the array with the Raid Arrays defined directly above in the order you want them displayed.
*/
$progress = array(
   $icc,
   $rs
);














//**********************
//* END Config Section *
//**********************

//*********************************
//* Do not edit below here unless *
//* you know what you are doing!! *
//*********************************


foreach ($progress as $raid) {
   echo '<table width="100%" style="background-image:url(\''.$image_dir.$raid['image'].'\');"><tr><td colspan="2" style="color:'.$raid['color'].';">'.$raid['name'].'</td></tr>';
   
   
   foreach($raid['instances'] as $instance) {
      if($instance['display'] == 0)
         continue;
     
     
      $killcount = 0;
      // Creation of the mouseover tooltip for each instance
      $tooltip = '<table width=100% cellpadding=0 cellspacing=0>';
      foreach ($instance['bosses'] as $key => $value) {
         //$color = $value ? $killed_color : $notkilled_color;
         $style = $value ? "color:$killed_color ;" : "text-decoration:line-through;color:$notkilled_color ;";
         $tooltip = $tooltip . '<tr><td style=\\\''.$style.' \\\'> ' . $key . ' </td></tr>';
         $killcount += $value;
      }
      $tooltip = $tooltip . '</table>';
     
      $killcount_text = ' ['.$killcount.'/'.count($instance['bosses']).']';
      echo '<tr><td></td><td align="right"><a style="text-decoration: none;color:'.$raid['color'].';" href="javascript:void(0);" onMouseover="Tip(\'' . $tooltip . '\')" onMouseout="UnTip()">' . $instance['name'] . $killcount_text . '</a></td></tr>';
     
   }
   echo '</table>';
}



Freddy

Nice block Eric, thanks for dropping it in here  8)