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

Recent

Welcome to TinyPortal. Please login or sign up.

Members
  • Total Members: 3,963
  • Latest: BiZaJe
Stats
  • Total Posts: 195,913
  • Total Topics: 21,308
  • Online today: 884
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 451
  • Total: 451

[Block] WoW Ulduar Progress block

Started by maddogie, April 15, 2009, 11:19:30 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

maddogie

#10
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>';




ZarPrime

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

Starrbuck

No apology necessary!  Glad to put your work to good use!

This works fine, no more errors.  Thanks!

Inny

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

Starrbuck

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.

Inny

That will work aswell but i think its not XHMTL Valid if you care that is  :coolsmiley:

Tyrock

 :up: Nice work!!!

what Font do you use for the 10/25.png ? :D

Tyrock

btw... were is Ignis in this Block? xD

Inny

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'); 

whackedspinach

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?

This website is proudly hosted on Crocweb Cloud Website Hosting.