Warcraft Recent loots (port from phpbb3portal)

Forum rules
This forum is not for support requests.

Only post Modifications for Board3 Portal 1.0.x in this forum.
Locked
User avatar

Topic author
talonos
Portal Specialist
Posts: 242
Joined: 7. June 2009 15:12
phpBB.com User: talonos

Warcraft Recent loots (port from phpbb3portal)

Post by talonos »

here is a port over of teksonics recent loots block @ HERE

DOWNLOAD: http://board3.de/download/file.php?id=215

Follow the install instructions

also make your you have crackpots wowhead tooltip installed into your forum from HERE

Screenshots
2 Raids visible
Image

3 Raids visible
Image

3 Raids visible and wowhead tooltip
Image

ACP
Image

DOWNLOAD: http://board3.de/download/file.php?id=215
Creating board3 website? check the sites out below for board3 compatible extensions
Talonos: Pretereo stormrage EU OFFLINE!
User avatar

Ice
Former Team Member
Posts: 359
Joined: 20. January 2008 23:43
Location: England, United Kingdom

Re: Warcraft Recent loots (port from phpbb3portal)

Post by Ice »

Cleaned up the code a bit.
Recent Item's Block v0.1.2.zip
(4.71 KiB) Downloaded 1879 times
Board3 Portal Dev & English Tech Support
User avatar

Ice
Former Team Member
Posts: 359
Joined: 20. January 2008 23:43
Location: England, United Kingdom

Re: Warcraft Recent loots (port from phpbb3portal)

Post by Ice »

Also, here's a link to the wowhead tooltip.
wowhead-3.2.2.zip
(71.32 KiB) Downloaded 1419 times
And the itemcache
itemcache_en.zip
(144.3 KiB) Downloaded 1371 times
And install instructions.

http://code.google.com/p/wowheadtooltip ... BB3Install
Board3 Portal Dev & English Tech Support
User avatar

Topic author
talonos
Portal Specialist
Posts: 242
Joined: 7. June 2009 15:12
phpBB.com User: talonos

Re: Warcraft Recent loots (port from phpbb3portal)

Post by talonos »

i cant beleive it 84 topic views and 7days later and no reply or comment except for Ices fix and to think loads of people are after blocks like this......... i think i better just say "bump" and try and continue my work..........
Creating board3 website? check the sites out below for board3 compatible extensions
Talonos: Pretereo stormrage EU OFFLINE!

solaxx
Active Member
Posts: 4
Joined: 12. July 2009 17:36
phpBB.com User: solaxx

Re: Warcraft Recent loots (port from phpbb3portal)

Post by solaxx »

I'm working on a new board for my guild, and I have installed "Recent Item's Block" this morning. It was a hard work for me, I'm a noob in php but I did it (installation, translation in french, customization).

It seems everything works fine, so I must say a big thanks to you talonos and Ice.

Next, Recruitment block and Raid progress block, and after maybe the hardest one, a phpraider block (like the one you use on your site Heroes of Warcraft).


Thanks again.

(sorry for my english).
Guilde Reflets Noirs : http://www.refletsnoirs.net

cromatics
Portal Enthusiast
Posts: 105
Joined: 31. October 2008 16:29
Contact:

Re: Warcraft Recent loots (port from phpbb3portal)

Post by cromatics »

hallo,
habe da was gefunden um den Phpraidplaner ins Portal einzufügen, und es geht ganz gut.....

raidweek.php to go into your phpraider folder folder

Code: Select all

    <?
    // Where the raidcalender's index.php is located
    $raid_cal_index = 'http://YOURSITENAME/phpraider/';

    // Where the raidcalenders raid-icons are located
    $raid_icon_folder = '/LINK TO YOUR RAID IMAGES FOLDER/'; // IE                   /raid/games/WoW/images/raids/

    // MySQL- settings. Note that db_table_prefixes can vary depending on what you choose when you install phpraider.
    $db_raid_server         = 'HOSTNAME';
    $db_raid_database_name   = 'DATABASE NAME';
    $db_raid_database_user   = 'USERNAME';
    $db_raid_database_pwd   = 'PASSWORD';
    $db_table_raid         = 'phpraider_raid';
    $db_table_signups      = 'phpraider_signups';

    // How many hours + or - the viewer should calculate. Some do have to edit this to make
    // the timedisplay to be correct.
    // For example $timezone = 3  or  $timezone = -4
    $timezone = -7;

    // Layout. The size of the windows of the days displayed.
    //$layout_frame_width   = 100;
    $layout_frame_width     = 65;
    $layout_frame_height   = 46;
    $layout_frame_raidinfo   = 20;

    // How many raid icons fit in the table cell?
    $max_raids_per_day      = 2;

    // What will be displayed when no raids are planned for that particular day.
    // You can choose to have a text or an icon.
    // $no_raid_type = 'image';
    // $no_raid_type = 'text';
    // $no_raid_type = 'none';
    $no_raid_type = 'text';                                                // What mode do you want?
    $no_raid_text = 'No raid today';                                // What text to be shown
    $no_raid_image = '/phpraider/games/WoW/images/raids/unknown.png';        // link to your icon if you use that.


    // READ ME ________________________________________________________________________________________
    //goto line 131 and in that line u will find the word URLINK change that word to the link of your phpraider index.php IE http://mywebsite/phpraider/index.php
    //
    // END OF CONFIGURATION
    // ******************************************************

    $db = mysql_connect($db_raid_server, $db_raid_database_user, $db_raid_database_pwd);
    mysql_select_db($db_raid_database_name, $db);

    //CHECK OFFSET FROM CURRENT WEEK AND SETS VARIABLES
    if ($_GET["offset"]) {
       $weekoffset = $_GET["offset"]*604800;
       $wo = $_GET["offset"];
    }
    else {
       $weekoffset = 0;
       $wo = 0;
    }
    $prev = $wo-1;
    $next = $wo+1;

    $weekstart = (date('U')-(date('w')+6)%7*86400)+$weekoffset;        // sets start date of displayed week
    $timezone = $timezone * 3600;                                        // Calculates the timezone-diff.

    ?>

    <html>
    <head>
       <style>
    body {
       margin: 0px;
       padding: 0px;
       background-color: #000000;
       color: #b0b0b0;
       font-family: Arial, Verdana, sans-serif;
    }
    table {
       border: 1px solid #282828;
    }
    td {
       border: 1px solid #404040;
    }
    td.today {
       background-color: #202020;
       border: 1px solid #407040;
    }
    a:link,a:active,a:visited {
       text-decoration: none;
       color: #006699;
    }
    a:hover {
       text-decoration: underline;
       color: #4080b0;
    }
    .daycontent {
       clear: both;
       text-align: center;
       margin: 0px;
       padding-bottom: 0px;
       padding-top: 2px;
    }
    .day {
       color: #ffcc33;
       font-size: 10pt;
       padding-left: 4px;
       font-weight: bold;
       float: left;
    }
    .date {
       color: #808080;
       font-size: 8pt;
       padding-top: 2px;
       padding-right: 4px;
       float: right;
    }
    #info {
       color: #c0b050;
       font-size: 8pt;
       text-align: center;
    }
    .available    { color: #80d080; }
    .unavailable  { color: #f08080; }
    .field        { color: #60b0b0; }

       </style>
       <script type="text/javascript">
    function InsertText(str) {
       var oDiv=document.getElementById("info");
       oDiv.innerHTML=str;
    }
    function ClearText() {
    InsertText("<a href=\"?offset=<?=$prev;?>\"><< Previous</a> - <a href=\"?offset=0\">Current</a> - <a href=\"?offset=<?=$next;?>\">Next >></a><a href=\"URLINK/index.php\" class=\"raid_calendar\" target=\"_parent\">Sign Up Here</a></td></tr></table>");
    }   
       </script>
    </head>
    <body onload='javascript:ClearText()'>

    <!-- PHP -->
    <?

    // Lets deal with the output

    echo "\t<table width='" . (7 * ($layout_frame_width+2) + 2) . "px' border='0' cellspacing='0' cellpadding='0'>\n";
    echo "\t<tr height='" . $layout_frame_height . "'>\n";

    $now_timestamp = time( date("H,i") );
    $now = date(dm, $now_timestamp);

    // Loops through the week
    for ( $i = 0; $i < 7; $i++ ) {

       $raidscheduled = 0;
       
       $current = $weekstart + (86400*($i) );
       $xday = date('D', $current);
       $xdate = date('d', $current);
       $currdate = date('dm', $current);
       
       if ($now == $currdate) {
          $today = " class='today'";
       } else {
          $today = "";
       }
       
       echo "\t\t<td{$today} valign='top' width='" . $layout_frame_width . "px'>\n";
       echo "\t\t\t<div class='day'>" . $xday . "</div><div class='date'>" . $xdate . "</div>\n";
       echo "\t\t\t<div class='daycontent'>";
       
       // Getting raid start dates
       $sql = mysql_query("SELECT * FROM $db_table_raid ORDER by start_time", $db);
       
       while ($check = mysql_fetch_array($sql)){
       
          // Checks if the date of the raid is equal to displayed day
            if ($currdate == date('dm', $check["start_time"])) {
          
          // We need to have a maximum number of raids per day (otherwise layout becomes a mess)      
          if ($raidscheduled < $max_raids_per_day) {

             // Count the signups
             $sql2 = mysql_query("SELECT COUNT(*) FROM $db_table_signups WHERE raid_id=".$check['raid_id']." AND cancel=0");
             $signupcount = mysql_result($sql2, 0);
             
             // Count the cancels
             $sql2 = mysql_query("SELECT COUNT(*) FROM $db_table_signups WHERE raid_id=".$check['raid_id']." AND cancel=1");
             $cancelcount = mysql_result($sql2, 0);
                      
                $invite_time = date("H:i",($check["invite_time"]+$timezone));
                $start_time = date("H:i",($check["start_time"]+$timezone));
                $freeze_time = date("H:i",$check["start_time"]-(($check["freeze_time"]*3600)+$timezone));
                     
                $img_txt = $check['location'];
             $img_txt .= " (<span class='available'>" . $signupcount . "</span>,<span class='unavailable'>" . $cancelcount . "</span>)";
                if ($now_timestamp <= $freeze_timestamp) {
                $img_txt .= " Freeze: <span class='field'>" . $freeze_time . "</span>";
                } else {
                   $img_txt .= " <span class='field'>Frozen</span>";
                }
             $img_txt .= " Invite: <span class='field'>" . $invite_time . "</span>";
             $img_txt .= " Start: <span class='field'>" . $start_time . "</span>";
             
             echo "<a target='_parent' href='" . $raid_cal_index . "index.php?option=com_view&id=" . $check['raid_id'] . "'><img src='" . $raid_icon_folder . $check['icon_name']."' onmouseover=\"InsertText('" . addslashes($img_txt) . "');\" onmouseout='ClearText();' border='0'></a>";
             echo "</a>";
          }

               $raidscheduled = $raidscheduled + 1;
          }
       }
       
       if (!$raidscheduled) {
          switch ($no_raid_type) {
             case text:
                  echo $no_raid_txt . "";
                  break;
             case image:
                  echo "<img src='" . $no_raid_image . "'>";
                  break;
             default:
                  echo "";
                  break;
          }
       }
       echo "</div>\n";
        echo "\t\t</td>\n";
    }

    echo "\t</tr>\n";
    echo "\t<tr>\n";
    echo "\t\t<td colspan='7' height='" . $layout_frame_raidinfo . "'><div id='info'></div></td>\n";
    echo "\t</tr>\n";
    echo "\t</table>\n";
    ?>
    <!-- ENDPHP -->

    </body>
    </html>

raidwwek.html to go into your /styles/YOUR THEME/template/portal/block/ folder

Code: Select all

{$C_BLOCK_H_L}Wochenuebersicht Radplaner{$C_BLOCK_H_R}
<table class="tablebg" cellspacing="1" width="100%">
	<tr class="row1">
		<td style="text-align:center;">
             <div align="center"><p align="center"><iframe src="http://deine seite/phpraider/raidweek.php" frameborder="0" width="471" scrolling="no" height="90" allowtransparency="allowtransparency"></iframe></p>      <span class="corners-bottom"><span></span></span>
</td>
	</tr>
</table>
{$LR_BLOCK_F_L}{$LR_BLOCK_F_R}

and to display it on your portal put

Code: Select all

<!-- INCLUDE portal/block/raidweek.html -->

Thresherinc
Active Member
Posts: 12
Joined: 21. October 2009 12:13
phpBB.com User: Thresherinc

Re: Warcraft Recent loots (port from phpbb3portal)

Post by Thresherinc »

cromatics wrote:hallo,
habe da was gefunden um den Phpraidplaner ins Portal einzufügen, und es geht ganz gut.....

raidweek.php to go into your phpraider folder folder

Code: Select all

    <?
    // Where the raidcalender's index.php is located
    $raid_cal_index = 'http://YOURSITENAME/phpraider/';

    // Where the raidcalenders raid-icons are located
    $raid_icon_folder = '/LINK TO YOUR RAID IMAGES FOLDER/'; // IE                   /raid/games/WoW/images/raids/

    // MySQL- settings. Note that db_table_prefixes can vary depending on what you choose when you install phpraider.
    $db_raid_server         = 'HOSTNAME';
    $db_raid_database_name   = 'DATABASE NAME';
    $db_raid_database_user   = 'USERNAME';
    $db_raid_database_pwd   = 'PASSWORD';
    $db_table_raid         = 'phpraider_raid';
    $db_table_signups      = 'phpraider_signups';

    // How many hours + or - the viewer should calculate. Some do have to edit this to make
    // the timedisplay to be correct.
    // For example $timezone = 3  or  $timezone = -4
    $timezone = -7;

    // Layout. The size of the windows of the days displayed.
    //$layout_frame_width   = 100;
    $layout_frame_width     = 65;
    $layout_frame_height   = 46;
    $layout_frame_raidinfo   = 20;

    // How many raid icons fit in the table cell?
    $max_raids_per_day      = 2;

    // What will be displayed when no raids are planned for that particular day.
    // You can choose to have a text or an icon.
    // $no_raid_type = 'image';
    // $no_raid_type = 'text';
    // $no_raid_type = 'none';
    $no_raid_type = 'text';                                                // What mode do you want?
    $no_raid_text = 'No raid today';                                // What text to be shown
    $no_raid_image = '/phpraider/games/WoW/images/raids/unknown.png';        // link to your icon if you use that.


    // READ ME ________________________________________________________________________________________
    //goto line 131 and in that line u will find the word URLINK change that word to the link of your phpraider index.php IE http://mywebsite/phpraider/index.php
    //
    // END OF CONFIGURATION
    // ******************************************************

    $db = mysql_connect($db_raid_server, $db_raid_database_user, $db_raid_database_pwd);
    mysql_select_db($db_raid_database_name, $db);

    //CHECK OFFSET FROM CURRENT WEEK AND SETS VARIABLES
    if ($_GET["offset"]) {
       $weekoffset = $_GET["offset"]*604800;
       $wo = $_GET["offset"];
    }
    else {
       $weekoffset = 0;
       $wo = 0;
    }
    $prev = $wo-1;
    $next = $wo+1;

    $weekstart = (date('U')-(date('w')+6)%7*86400)+$weekoffset;        // sets start date of displayed week
    $timezone = $timezone * 3600;                                        // Calculates the timezone-diff.

    ?>

    <html>
    <head>
       <style>
    body {
       margin: 0px;
       padding: 0px;
       background-color: #000000;
       color: #b0b0b0;
       font-family: Arial, Verdana, sans-serif;
    }
    table {
       border: 1px solid #282828;
    }
    td {
       border: 1px solid #404040;
    }
    td.today {
       background-color: #202020;
       border: 1px solid #407040;
    }
    a:link,a:active,a:visited {
       text-decoration: none;
       color: #006699;
    }
    a:hover {
       text-decoration: underline;
       color: #4080b0;
    }
    .daycontent {
       clear: both;
       text-align: center;
       margin: 0px;
       padding-bottom: 0px;
       padding-top: 2px;
    }
    .day {
       color: #ffcc33;
       font-size: 10pt;
       padding-left: 4px;
       font-weight: bold;
       float: left;
    }
    .date {
       color: #808080;
       font-size: 8pt;
       padding-top: 2px;
       padding-right: 4px;
       float: right;
    }
    #info {
       color: #c0b050;
       font-size: 8pt;
       text-align: center;
    }
    .available    { color: #80d080; }
    .unavailable  { color: #f08080; }
    .field        { color: #60b0b0; }

       </style>
       <script type="text/javascript">
    function InsertText(str) {
       var oDiv=document.getElementById("info");
       oDiv.innerHTML=str;
    }
    function ClearText() {
    InsertText("<a href=\"?offset=<?=$prev;?>\"><< Previous</a> - <a href=\"?offset=0\">Current</a> - <a href=\"?offset=<?=$next;?>\">Next >></a><a href=\"URLINK/index.php\" class=\"raid_calendar\" target=\"_parent\">Sign Up Here</a></td></tr></table>");
    }   
       </script>
    </head>
    <body onload='javascript:ClearText()'>

    <!-- PHP -->
    <?

    // Lets deal with the output

    echo "\t<table width='" . (7 * ($layout_frame_width+2) + 2) . "px' border='0' cellspacing='0' cellpadding='0'>\n";
    echo "\t<tr height='" . $layout_frame_height . "'>\n";

    $now_timestamp = time( date("H,i") );
    $now = date(dm, $now_timestamp);

    // Loops through the week
    for ( $i = 0; $i < 7; $i++ ) {

       $raidscheduled = 0;
       
       $current = $weekstart + (86400*($i) );
       $xday = date('D', $current);
       $xdate = date('d', $current);
       $currdate = date('dm', $current);
       
       if ($now == $currdate) {
          $today = " class='today'";
       } else {
          $today = "";
       }
       
       echo "\t\t<td{$today} valign='top' width='" . $layout_frame_width . "px'>\n";
       echo "\t\t\t<div class='day'>" . $xday . "</div><div class='date'>" . $xdate . "</div>\n";
       echo "\t\t\t<div class='daycontent'>";
       
       // Getting raid start dates
       $sql = mysql_query("SELECT * FROM $db_table_raid ORDER by start_time", $db);
       
       while ($check = mysql_fetch_array($sql)){
       
          // Checks if the date of the raid is equal to displayed day
            if ($currdate == date('dm', $check["start_time"])) {
          
          // We need to have a maximum number of raids per day (otherwise layout becomes a mess)      
          if ($raidscheduled < $max_raids_per_day) {

             // Count the signups
             $sql2 = mysql_query("SELECT COUNT(*) FROM $db_table_signups WHERE raid_id=".$check['raid_id']." AND cancel=0");
             $signupcount = mysql_result($sql2, 0);
             
             // Count the cancels
             $sql2 = mysql_query("SELECT COUNT(*) FROM $db_table_signups WHERE raid_id=".$check['raid_id']." AND cancel=1");
             $cancelcount = mysql_result($sql2, 0);
                      
                $invite_time = date("H:i",($check["invite_time"]+$timezone));
                $start_time = date("H:i",($check["start_time"]+$timezone));
                $freeze_time = date("H:i",$check["start_time"]-(($check["freeze_time"]*3600)+$timezone));
                     
                $img_txt = $check['location'];
             $img_txt .= " (<span class='available'>" . $signupcount . "</span>,<span class='unavailable'>" . $cancelcount . "</span>)";
                if ($now_timestamp <= $freeze_timestamp) {
                $img_txt .= " Freeze: <span class='field'>" . $freeze_time . "</span>";
                } else {
                   $img_txt .= " <span class='field'>Frozen</span>";
                }
             $img_txt .= " Invite: <span class='field'>" . $invite_time . "</span>";
             $img_txt .= " Start: <span class='field'>" . $start_time . "</span>";
             
             echo "<a target='_parent' href='" . $raid_cal_index . "index.php?option=com_view&id=" . $check['raid_id'] . "'><img src='" . $raid_icon_folder . $check['icon_name']."' onmouseover=\"InsertText('" . addslashes($img_txt) . "');\" onmouseout='ClearText();' border='0'></a>";
             echo "</a>";
          }

               $raidscheduled = $raidscheduled + 1;
          }
       }
       
       if (!$raidscheduled) {
          switch ($no_raid_type) {
             case text:
                  echo $no_raid_txt . "";
                  break;
             case image:
                  echo "<img src='" . $no_raid_image . "'>";
                  break;
             default:
                  echo "";
                  break;
          }
       }
       echo "</div>\n";
        echo "\t\t</td>\n";
    }

    echo "\t</tr>\n";
    echo "\t<tr>\n";
    echo "\t\t<td colspan='7' height='" . $layout_frame_raidinfo . "'><div id='info'></div></td>\n";
    echo "\t</tr>\n";
    echo "\t</table>\n";
    ?>
    <!-- ENDPHP -->

    </body>
    </html>

raidwwek.html to go into your /styles/YOUR THEME/template/portal/block/ folder

Code: Select all

{$C_BLOCK_H_L}Wochenuebersicht Radplaner{$C_BLOCK_H_R}
<table class="tablebg" cellspacing="1" width="100%">
	<tr class="row1">
		<td style="text-align:center;">
             <div align="center"><p align="center"><iframe src="http://deine seite/phpraider/raidweek.php" frameborder="0" width="471" scrolling="no" height="90" allowtransparency="allowtransparency"></iframe></p>      <span class="corners-bottom"><span></span></span>
</td>
	</tr>
</table>
{$LR_BLOCK_F_L}{$LR_BLOCK_F_R}

and to display it on your portal put

Code: Select all

<!-- INCLUDE portal/block/raidweek.html -->
These instructions worked perfectly with but one exception.

In raidweek.php at line 171 the line

Code: Select all

     $sql = mysql_query("SELECT * FROM $db_table_raid ORDER by start_time", $db);
was not actually resolving the variable $db_table_raid now clearly this is something to do with the quoting in it.

I solved it by hardcoding in the table name, I'm sure there's a more elegant method of doing it but it was about 01:00 when I found it and I was a little tired.
:D

Many thanks for this simple solution.
Locked

Return to “board3 Portal v1.0.x - Modifications”