Hi all I've made an Progress block for my guild and I thought you guys might also want that code. So here it is.
Basicly it shows your guilds progress (for one specific instance) in a graphical manner. In our case the new Ulduar Instance.
You can easily adapt it for other instances.
It shows a greenlight if a boss is down or a redlight if he's still alive.
Read the readme.txt in the zipped file for further instructions.
You'll need the images included in the zipped file attached to this post in order to make this script work.
See it in action here (http://greenskins.de).
// SMF-TinyPortal WoW BossCounter Block - ver. 1.0
// Author: Moktarr of Eredar (maddogie@gmx.de)
// Created: April 10, 2009
// Last Update: April 14, 2009
// Tested on SMF 1.1.8 and TP 0.9.8
// Shows the progress in a single instance for both versions 10 and 25 players.
// greenlight = boss down | redlight = boss alive | cautionsign = false value check status
// You'll need to set the path to the required images
// Settings
// Find Settings start below to set bosses and status
// 'up' = not killed in any version
// '10' = killed in 10 player version
// '25' = killed in 25 player version
// 'all' = killed in 10 player and 25 player version
// edit value inside the first single quote to change the name of the Boss
// edit value inside the second single quote to change the status
// e.g. 'Bossname'=>'status'
// Setting start
$instance='Ulduar'; //Name of instance
$ar_bosse=array(
'Flame Leviathan'=>'up',
'Ignis'=>'up',
'Razorscale'=>'up',
'XT-002'=>'up',
'Iron Council'=>'up',
'Kologarn'=>'up',
'Auriaya'=>'up',
'Mimiron'=>'up',
'Freya'=>'up',
'Thorim'=>'up',
'Hodir'=>'up',
'General Vezax'=>'up',
'Algalon the observer'=>'up',
'Yogg-Saron'=>'up'
);
// Settings end
// Paths
// Images
$path_img_up = '<img src="img/redlight.png" />';
$path_img_down = '<img src="img/greenlight.png" />';
$path_img_error ='<img src="img/error.png" />';
// Do not change anything below this line unless you know what you're doing
echo '
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=windows-1250">
<style type="text/css">
<!--
.OneColFix #container {
width:160px;
border:1px solid #000000;
text-align:left;
margin-top:0;
margin-right:auto;
margin-bottom:0;
margin-left:auto;
}
.OneColFix #content {
padding-top:0;
padding-right:1px;
padding-bottom:0;
padding-left:1px;
}
.bosses {
font-size:small;
}
#instance {
padding-top:5px;
padding-bottom:2px;
font-size:large;
text-align:center;
}
#footer {
border: solid 1px #252525;
padding: 5px;
text-align: center;
font-size: xx-small;
color: #b2b2b2;
background: #1d1d1d url(img/footer-bg.png);
}
-->
</style>
<title></title>
</head>
<body class="OneColFix">
<div id="container">
<div id="content">';
echo '
<div id="instance">' . $instance .'</div>
<div id = "vericon"><img src="img/10.png" /><img src="img/25.png" /></div>';
foreach ($ar_bosse as $boss=>$status) {
switch ($status) {
case 'up':
echo '<div class="bosses">' . ' ' . $path_img_up . ' ' . $path_img_up . ' ' . $boss . "</div>\n";
break;
case '10':
echo '<div class="bosses">' . ' ' . $path_img_down . ' ' . $path_img_up . ' ' . $boss . "</div>\n";
break;
case '25':
echo '<div class="bosses">' . ' ' . $path_img_up . ' ' . $path_img_down . ' ' . $boss . "</div>\n";
break;
case 'all':
echo '<div class="bosses">' . ' ' . $path_img_down . ' ' . $path_img_down . ' ' . $boss . "</div>\n";
break;
default:
echo '<div class="bosses">' . ' ' . $path_img_error . $path_img_error . ' ' . $boss . "</div>\n";
break;
}
}
echo '
<div id="footer"><a href="http://greenskins.de">Black Legends</a> BossCounter V1<br />
Moktarr of Eredar</div>
</div><!-- end #Content -->
</div><!-- end #Container -->
</body>
</html>';
Hi maddogie, welcome to TinyPortal.
Thanks for the code, I'm sure it will be useful. :up:
Good Job :up:
Able to add in the 10/25 columns a new option (tick/X icon) if its killed in hard-mode or not? :buck2:
Well everything is possible, it just depends how much time I have. ;)
To make a long story short. I'm already working on it. 8)
Hello,
works for me but blows my design of the forum. Using Tiny Portal 0.9.8 , SMF 1.1.8 and the IronWow template by Crip. Makes the Portal very small so you can't see everything correct. Any ideas?
Quote from: braucki on May 02, 2009, 02:38:45 PM
Hello,
works for me but blows my design of the forum. Using Tiny Portal 0.9.8 , SMF 1.1.8 and the IronWow template by Crip. Makes the Portal very small so you can't see everything correct. Any ideas?
Well it looks like Crip is using the same tags/labels for CSS. No big deal.
You just need to edit a few lines.
find
.OneColFix #container {
and add BC at the end
.OneColFix #containerBC {
find
<div id="container">change it to
<div id="containerBC">It dosen't really matter what you add we just need a different name
Hello again,
thank you for the fast answer. Works now like a charm^^
Thanks alot
Ok folks today I had a few minutes to finish version 2 of the script.
I've added support for 10 and 25 Player hardmode.
If You've killed a boss in hardmode it will show a star instead of the normal image.
Again you need to upload all images inside the zipped file attached to this post.
Version 2.1 can be found on page 2 (http://www.tinyportal.net/index.php/topic,29267.msg237822.html#msg237822)
Deleted because it flooded the errorlog with error messages.
New Version 2.1 can be found below
This block is throwing off tons of errors in my SMF error log:
8: Use of undefined constant boss_name - assumed 'boss_name'
File: /home/public_html/legionofdarkness/smf/Themes/default/TPortal.template.php (tp_below sub template - eval?)
Line: 96
8: Use of undefined constant status - assumed 'status'
File: /home/public_html/legionofdarkness/smf/Themes/default/TPortal.template.php (tp_below sub template - eval?)
Line: 94
8: Use of undefined constant hardmode - assumed 'hardmode'
File: /home/legionofdarkness/smf/Themes/default/TPortal.template.php (tp_below sub template - eval?)
Line: 99
Any ideas?
Quote from: Starrbuck on June 01, 2009, 11:37:20 PM
This block is throwing off tons of errors in my SMF error log:
8: Use of undefined constant boss_name - assumed 'boss_name'
File: /home/public_html/legionofdarkness/smf/Themes/default/TPortal.template.php (tp_below sub template - eval?)
Line: 96.....
Any ideas?
Thanx for reporting the issue. :up:
Ups my bad :uglystupid2:
One shouldn't develop a script with only a few minutes. I had a typo in one of my lines and copy and pasted it over and over again.
Everyone who is using Version2 of my script should update to Version 2.2 as soon as possible otherwise your errorlog will be flooded with error messages.
If version 2 is already installed on your server you'll only need to copy and paste the script below and replace the old one.
So here comes version 2.2
// SMF-TinyPortal WoW BossCounter Block - ver. 2.2
// Author: Moktarr of Eredar (maddogie@gmx.de)
// Created: May 01, 2009
// Last Update: Jun 01, 2009
// Tested on SMF 1.1.8 and TP 0.9.8
// Shows the progress in a single instance for both versions 10 and 25 players.
// greenlight = boss down |greenstar = boss down in hardmode | redlight = boss alive | cautionsign = false value check status
// You'll need to set the path to the required images
// Settings
// Find Settings start below to set bosses and status
// Possible values for status
// 'up' = not killed in any version
// '10' = killed in 10 player version
// '25' = killed in 10 player version
// 'all' = killed in 10 player and 25 player version
// edit value inside the single quotes to change the settings
// Possible values for hardmode
// 'no' = not killed in hardmode
// '10' = killed in 10 player hardmode
// '25' = killed in 25 player hardmode
// 'all' = killed in 10 player and 25 player hardmode
// edit setting inside of single quotes after =>
// e.g. ('boss_name' => 'Flame Leviathan' , 'status' => 'SET STATUS HERE' , 'hardmode' => 'SET HARDMODE HERE');
// Settings start
//define instance
$instance='Ulduar'; // Name of instance
//Bossstatus
$ar_bosses[] = array ('boss_name' => 'Flame Leviathan' , 'status' => '25' , 'hardmode' => '25');
$ar_bosses[] = array ('boss_name' => 'Razorscale' , 'status' => 'up' , 'hardmode' => 'no');
$ar_bosses[] = array ('boss_name' => 'XT-002' , 'status' => 'up' , 'hardmode' => 'no');
$ar_bosses[] = array ('boss_name' => 'Iron Council' , 'status' => 'up' , 'hardmode' => 'no');
$ar_bosses[] = array ('boss_name' => 'Kologarn' , 'status' => 'up' , 'hardmode' => 'no');
$ar_bosses[] = array ('boss_name' => 'Auriaya' , 'status' => 'up' , 'hardmode' => 'no');
$ar_bosses[] = array ('boss_name' => 'Mimiron' , 'status' => 'up' , 'hardmode' => 'no');
$ar_bosses[] = array ('boss_name' => 'Freya' , 'status' => 'up' , 'hardmode' => 'no');
$ar_bosses[] = array ('boss_name' => 'Thorim' , 'status' => 'up' , 'hardmode' => 'no');
$ar_bosses[] = array ('boss_name' => 'Hodir' , 'status' => 'up' , 'hardmode' => 'no');
$ar_bosses[] = array ('boss_name' => 'General Vezax' , 'status' => 'up' , 'hardmode' => 'no');
$ar_bosses[] = array ('boss_name' => 'Algalon' , 'status' => 'up' , 'hardmode' => 'no');
$ar_bosses[] = array ('boss_name' => 'Yogg-Saron' , 'status' => 'up' , 'hardmode' => 'no');
// Show footer?
$show_footer = 'yes'; // 'yes' or 'no'
// Show legend?
$show_legend = 'yes'; // 'yes' or 'no'
// Block width in Pixels
$block_width ='160';
// Paths
// Imagesfolder
$img_path = 'img/'; // Set to the folder that contains the images
// Images
// Image for alive bosses
$path_img_up = '<img src="' . $img_path . 'redlight_12px.png" />';
// Image for killed bosses
$path_img_down = '<img src="' . $img_path . 'greenlight_12px.png" />';
// Hardmode Image
// Choose ONE of the following 4 lines and comment out the other 3
$path_img_down_hm = '<img src="' . $img_path . 'star_green1_hm_12px.png" />';
// $path_img_down_hm = '<img src="' . $img_path . 'star_green_hm_12px.png" />';
// $path_img_down_hm = '<img src="' . $img_path . 'greenlight_hm_12px.png" />';
// $path_img_down_hm = '<img src="' . $img_path . 'greenlight_hm_12px.png" />';
// ErrorImage
$path_img_error = '<img src="' . $img_path . 'error.png" />';
// Do not change anything below this line unless you know what you're doing
$version = '2.2';
echo'
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=windows-1250">
<style type="text/css">
<!--
.OneColFix_BC #container_BC {
width:' . $block_width . 'px;
border:1px solid #000000;
text-align:left;
margin-top:0;
margin-right:auto;
margin-bottom:0;
margin-left:auto;
}
.OneColFix_BC #content_BC {
padding-top:0;
padding-right:2px;
padding-bottom:0;
padding-left:2px;
}
.bosses_BC {
font-size:x-small;
}
#instance_BC {
padding-top:5px;
padding-bottom:2px;
font-size:x-small;
text-align:center;
color: #869927;
}
#footer_BC {
border: solid 1px #252525;
padding: 5px;
text-align: center;
font-size: x-small;
color: #b2b2b2;
background: #1d1d1d url(' . $img_path . 'footer-bg.png);
}
#legend_BC{
font-size: xx-small;
}
#instance_BC{
font-size:large;
}
-->
</style>
<title></title>
</head>
<a href="http://greenskins.de"></a>
<body class="OneColFix_BC">
<div id="container_BC_bc">
<div id="content_BC">
<div id="instance_BC">' . $instance . '</div>
<div id = "vericon">' . '<img src="' . $img_path . '10.png" />' . '<img src="' . $img_path . '25.png" /></div>';
foreach($ar_bosses as $out => $data) {
switch ($data['status']) {
case 'up':
echo '<div class="bosses_BC">' . $path_img_up . ' ' . $path_img_up . ' ' . $data['boss_name'] . "</div>\n";
break;
case '10':
if($data['hardmode']=='no'){
echo '<div class="bosses_BC">' . $path_img_down . ' ' . $path_img_up . ' ' . $data['boss_name'] . "</div>\n";
}elseif($data['hardmode']=='10'){
echo '<div class="bosses_BC">' . $path_img_down_hm . ' ' . $path_img_up . ' ' . $data['boss_name'] . "</div>\n";
}else{
echo '<div class="bosses_BC">' . $path_img_error . ' ' . $path_img_error . ' ' . $data['boss_name'] . "</div>\n";
}
break;
case '25':
if($data['hardmode']=='no'){
echo '<div class="bosses_BC">' . $path_img_up . ' ' . $path_img_down . ' ' . $data['boss_name'] . "</div>\n";
}elseif($data['hardmode']=='25'){
echo '<div class="bosses_BC">' . $path_img_up . ' ' . $path_img_down_hm . ' ' . $data['boss_name'] . "</div>\n";
}else{
echo '<div class="bosses_BC">' . $path_img_error . ' ' . $path_img_error . ' ' . $data['boss_name'] . "</div>\n";
}
break;
case 'all':
if($data['hardmode']=='no'){
echo '<div class="bosses_BC">' . $path_img_down . ' ' . $path_img_down . ' ' . $data['boss_name'] . "</div>\n";
}elseif($data['hardmode']=='10'){
echo '<div class="bosses_BC">' . $path_img_down_hm . ' ' . $path_img_down . ' ' . $data['boss_name'] . "</div>\n";
}elseif($data['hardmode']=='25'){
echo '<div class="bosses_BC">' . $path_img_down . ' ' . $path_img_down_hm . ' ' . $data['boss_name'] . "</div>\n";
}elseif($data['hardmode']=='all'){
echo '<div class="bosses_BC">' . $path_img_down_hm . ' ' . $path_img_down_hm . ' ' . $data['boss_name'] . "</div>\n";
}else{
echo '<div class="bosses_BC">' . $path_img_error . ' ' . $path_img_error . ' ' . $data['boss_name'] . "</div>\n";
}
break;
default:
echo '<div class="bosses_BC">' . $path_img_error . $path_img_error . ' ' . $boss . "</div>\n";
break;
}
}
if ($show_legend=='yes'){
echo '<hr /><div id="legend_BC">';
echo $path_img_up . ' Alive'. '<br />';
echo $path_img_down . ' Killed' . '<br />';
echo $path_img_down_hm . ' Killed in hardmode' . '<br />';
echo '</div>';
}
if ($show_footer=='yes'){
echo '<div id="footer_BC"><a href="http://greenskins.de">Black Legends</a> BossCounter ' . $version .'<br />
by Moktarr of Eredar</div>';
}
echo '
</div><!-- end #content_BC -->
</div><!-- end #container_BC -->
</body>
</html>';
maddogie,
This is just a suggestion for you but, if the code and zip in the above post is a newer version or an improved version of the code in your OP of the topic, you should consider editing the OP to include the new and improved code and make note here in the thread that the latest code is available in the OP. This will allow your users to get the latest and greatest from the first post without having to take the time to try to figure out which one to use.
ZarPrime
No apology necessary! Glad to put your work to good use!
This works fine, no more errors. Thanks!
Yeah great job. :up:
I think on the next revision you should change your CSS element names because at least for me it messes up with the CSS style of my focum. Should be more tidy like that :P
I removed the CSS from my copy of the block and let the forum's CSS take care of it. Looks fine and seems to match the look of the rest of the site.
That will work aswell but i think its not XHMTL Valid if you care that is :coolsmiley:
:up: Nice work!!!
what Font do you use for the 10/25.png ? :D
btw... were is Ignis in this Block? xD
Find:
$ar_bosses[] = array ('boss_name' => 'Razorscale' , 'status' => 'all' , 'hardmode' => 'no');
Add After:
$ar_bosses[] = array ('boss_name' => 'Ignis the Furnace Master' , 'status' => 'all' , 'hardmode' => 'no');
I want to use this on my wordpress blog. Does anyone here know how I could port that over so I could use it as a sidebar widget in wordpress?
Hello whackedspinach, welcome to TinyPortal.
Is there some special reason that you've posted the same request in three different topics?
Thank you, Ken.
Yes. I would like to try out all three scripts if possible and figured It would be better to post in each block's own topic. I can go delete the others if you would like. Sorry if it looked like I was spamming.
Your best bet would be to take the codes to some place that specializes in custom code for wordpress and ask them how to alter the code. They would be more likely to be familiar with what is needed for a wordpress gadget.