hej. håber der sidder en derude som kan hjælpe mig. med et script som jeg har fundet. jeg kan ikke få den til at vise en hel måned i stedet for en uge. har prøvet en masse ting men kan ikke finde ud af det =)
her er koden.
<html>
<head>
<script type="text/javascript">
function InsertText(str) {
var oDiv=document.getElementById("text");
oDiv.innerHTML=str;
}
</script>
<STYLE type="text/css">
<!--
a.raid_calendar {
text-decoration:none;
font-weight: 900;
color: #C0C0C0;
font-family: Tahoma;
font-size: 12px;
}
a:hover.raid_calendar {
text-decoration:underline;
}
.date_text {
font-size: 10px;
font-family: Tahoma;
font-weight: 900;
color: grey;
}
.raid_text {
font-size: 12px;
font-family: Tahoma;
font-weight: 900;
color: white;
}
-->
</STYLE>
</head>
<body text="white" bgcolor="black">
<?php
//© Copywrite Eternal Souls, Created by Zemathar of the Eternals Souls Guild on EU Scarhield Legion server, feel free to use this code as long as you do not remove this message.
// Here are the config for this page.
// Version 1.1.1
// Emergency bug-correction.
// Fixed how the script connects to the database.
// Version 1.1.0
// Implemented the "no raid" function.
// You can now display an image or text if there is no raid that day.
// You can of cause have it like standard where nothing will be displayed.
// Version 1.0.1
// Implemented $timezone
// There you can change the output time to be in your timezone. You will have to calculate by yourself how many
// hours plus or minus you need.
//
// $db_raid_tabel is a value pointed to where the xxx_raid tabel is located. You will have to check in the database for the
// right value.
// Version 1.0
// I made this addon just because we needed it.
// It has it flaws and buggs but I will try to fix them as soon as possible
// Edited by Vendictive of The Legacy of Legends and Padraigh of MeleeStorm on US Scarlet Crusade
//NOTE! we have put the phpraiderfiles in a folder that we have named raids,
//if you do not want do go thru the code and change to much we advice you to
//do the same.
// ******************************************************
// START OF CONFIGURATION
//
// Include the phpRaider configuration file for easy use database connection.
include("raid/configuration.php");
// 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 = 1;
// Where the raidcalender's index.php is located
$raid_cal_index = 'http:/raid/index.php';
// Where the raidcalenders raid-icons are located
$raid_icon_folder = '/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_tabel = 'phpraider_raid';
// Layout. The size of the windows of the days displayed.
$layout_frame_width = 180;
$layout_frame_height = 100;
$layout_frame_raidinfo = 25;
// 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 = 'none'; // What mode do you want?
// $no_raid_text = 'No raid today'; // What text to be shown
// $no_raid_image = '/raids/games/WoW/images/raids/no_raid.jpg'; // link to your icon if you use that.
$no_raid_txt = 'No raid today';
//
// END OF CONFIGURATION
// ******************************************************
$db = mysql_connect($pConfig['db_server'], $pConfig['db_user'], $pConfig['db_pass']);
mysql_select_db($pConfig['db_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;
}
$weekstart = (date('U')-(date('w')+6)%7*86400)+$weekoffset; // sets start date of displayed week
$timezone *= 3600; // Calculates the timezone-diff.
// Lets deal with the output
echo '<table align="right" width="99%" border="1" bordercolor="#C6C6C6" bgcolor="" cellspacing="0" cellpadding="0" style="border-collapse: collapse; border-color:#000000;" ><tr height="'.$layout_frame_height.'" >'."\n";
for ($i=0;$i<7;$i++) {
// Loops through the week
echo '<td aligh="left" valign="top" width="'.$layout_frame_width.'">'."\n";
$current = $weekstart+(86400*($i));
$day = date('D M d, Y:',$current);
$currdate = date('dmY',$current);
echo '<b><span class="date_text">'. $day . '</b></span><br>'."\n";
$sql = mysql_query("SELECT * FROM $db_raid_tabel ORDER by start_time",$db);
// Get error if there is one
echo mysql_error();
// Getting raid start dates
while ($check = mysql_fetch_array($sql)){
if ($currdate == date('dmY',$check["start_time"])) { // Checks if the date of the raid is equal to displayed day
$invite_start = date("H:i",($check["invite_time"]+$timezone));
$starter = date("H:i",($check["start_time"]+$timezone));
$freeze = date("H:i",$check["start_time"]-(($check["freeze_time"]*3600)+$timezon e));
// $now_tmp = mktime(date("H,i"));
$now_tmp = date("H,i");
$freeze_tmp = $check["start_time"]-(($check["freeze_time"]*3600)+$timezone);
$raid_month = date("n",$check["start_time"]);
$raid_year = date("Y",$check["start_time"]);
$raid_id = $check["raid_id"];
// Here is the text set. The info about a raid when its opened or closed.
// Feel free to edit this part as you wish.
if ($now_tmp <= $freeze_tmp) {
$img_txt = 'Click on the image to view this raid. Invites start at : '.$invite_start.' and the raid starts at : '.$starter;
} else {
$img_txt = 'This raid is closed and over!';
}
echo '<a href="'.$raid_cal_index.'?monthID='.$raid_month.'&yearID='.$raid_year.'" border=0 target=_new><img src="'.$raid_icon_folder.''.$check["icon_name"].'" onmouseover="InsertText(\''.$img_txt.'\');" onmouseout="InsertText(\'\');" border=0"></a>';
}
// else {
// switch ($no_raid_type) {
// case text:
// echo $no_raid_txt;
// break;
// case image:
// echo '<img src="'.$no_raid_image.'">';
// break;
// case none:
// echo '';
// break;
// default:
// echo '';
// }
// }
}
echo '</td>'."\n";
}
echo '<tr><td colspan=7 height='.$layout_frame_raidinfo.'></font><div id="text"><font color=black>.</div></td></tr>';
echo '</table>'."\n";
////////////SLOPPY CALCULATOR FOR CHANGING WEEK////////////
$next = $wo+1;
$prev = $wo-1;
// Here is a IF-statement which controls if the "next week" link should be visible.
// i have set it to be visible only when you are in "/index.php".
// If you want them to always show remote the whole IF-statement but do not remote the echo-line.
?>
</body>
</html>
Tak..
Edit : smider lige et screenshot så i har en ide om hvordan det ser ud