<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link media="screen" rel="stylesheet" href="main.css" type="text/css">
<link media="screen" rel="stylesheet" href="clickmenu.css" type="text/css">
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="jquery.clickmenu.js"></script>
<script language="javascript">
<!--
jQuery.fn.fadeToggle = function(speed, easing, callback) {
return this.animate({opacity: 'toggle'}, speed, easing, callback);
}
$(document).ready(function() {
function maketog(id, start_up) {
// toggles the slickbox on clicking the noted link
if(start_up) {
$('#'+id+'_table').hide();
}
$('#'+id + ' a').click(function() {
$('#'+id+'_table').fadeToggle(400);
return false;
});
}
maketog('info', false);
maketog('act', false);
maketog('equip', true);
maketog('equip2', true);
maketog('jewelry', true);
maketog('jewelry2', true);
maketog('inven', true);
maketog('inven2', true);
maketog('trunk', true);
maketog('trunk2', true);
maketog('force', true);
maketog('force2', true);
//maketog('res', true);
maketog('unit', true);
maketog('unit2', true);
maketog('animus', true);
maketog('animus2', true);
$('#list').clickMenu();
});
function clear_time() {
document.info.time.value= "";
document.info.submit();
}
-->
</script>
<title>RF Log Viewer</title>
</head>
<body>
<?php
//**************************************************//
//** Set your variables here! Meow **//
$basehref = 'http://66.85.166.252/History/jonlogview.php'; //This is the exact URL of this file
$path = "D:/History/Item/"; //Where's waldo? or the item files
$dir = "D:\\History\\Item"; //Same thing with backslashes
$dir2 = $path;
$SERVER=''; // server
$USER=''; // user
$PASS=''; // password
$DB_NAME='';
//** Please don't fuck with the stuff after this **//
//*************************************************//
/*
if(empty($_POST['charSerial']) && empty($his)) //this conditional statement gets rid of the 'folders' loading to cut down page load time
{ //downside is you lose the folders if you're searching or on a character... still pops up first load tho
echo "<ul id='list'>";
echo "<li>Folders";
echo "<ul>";
$files = array();
//start at first directory level
foreach (new DirectoryIterator($path) as $filename)
{
$current = (string) $filename;
//now traverse second directory level
if(strpos($current, '.') === false)
{
echo "<li>".$current."<ul>";
foreach(new DirectoryIterator($path.$current.'/') as $filename2)
{
$current2 = (string) $filename2;
//now traverse third directory level
if(strpos($current2, '.') === false)
{
echo "<li>".$current2."<ul>";
foreach(new DirectoryIterator($path.$current.'/'.$current2.'/') as $filename3)
{
$current3 = (string) $filename3;
//here we look for $term, must start at position 0 for our char serials(so you don't get 23489_ for a search of 3489_
if(strpos($current3, '.') !== 0)
{
echo "<li><a href=".$basehref."?his=\\".$filename."\\".$filename2."\\".$filename3.">".$current3."</a></li>";
}
}
echo "</ul></li>";
}
}
echo "</ul></li>";
}
}
echo "</ul></li></ul>";
}
*/
include 'definitions.php';
include 'functions.php';
//set_time_limit(0);
function print_r2($val){
echo '<pre>';
print_r($val);
echo '</pre>';
}
$LINK = mssql_connect($SERVER,$USER,$PASS);
$DB=mssql_select_db($DB_NAME,$LINK) or die(mssql_get_last_message());
if(isset($his)) // We check to see if we have input on the character - If we do then read the character file
{
if (file_exists($dir.$his))
{
if($id = fopen($dir.$his, "r+"))
{
while(!feof($id))
{
$result[]= trim(fgets($id,1000000));
}
fclose($id);
}
else
{
echo "no file";
}
}
$times = array();
$levels = array();
$monies = array();
$golds = array();
$points = array();
$experience = array();
for($i = 0; $i < sizeof($result); $i++)
{
if(strpos($result[$i], "TIME:") !== false)
{
$times[] = $i;
}
if(strpos($result[$i], "LV:") !== false)
{
$levels[] = $i;
}
if(strpos($result[$i], '$D:') !== false)
{
if($i < 22)
$monies[] = $i;
else if(strpos($result[$i - 1], 'XP:') !== false)
$monies[] = $i;
}
if(strpos($result[$i], '$G:') !== false)
{
if($i < 22)
$golds[] = $i;
else if(strpos($result[$i - 2], 'XP:') !== false)
$golds[] = $i;
}
if(strpos($result[$i], "PvP:") !== false)
{
$points[] = $i;
}
if(strpos($result[$i], "XP:") !== false)
{
$experience[] = $i;
}
}
$loggedtime = substr($result[$times[1]],6) - substr($result[$times[0]],6);
}
//Char Name
if( empty($result) ) //If no character was loaded
{
if(empty($_POST['charSerial']))
{
echo"<h1>No Character Currently Set</h1>"; //display error message
}
else
{
echo"<h1>Search Results</h1>";
}
}
else //If we have a character file loaded
{
echo "<h1>".substr($result[0],6)."</h1>"; //display their name
}
//------------
//Char Info
//
//
//------------
?>
<?
//Definitions for searching
$serial = $_POST['charSerial'];
$month = $_POST['month'];
$day1 = $_POST['day1'];
$day2 = $_POST['day2'];
//Load stuff
if(empty($result)) // If no character loaded give notice message
{
if(empty($serial))
{
echo "<div class='content'>"; // This section generates the notice table
echo "<h2 id='info'><a href='#'>Meow Meow Meow</a></h2>";
echo "<table class='gen_table' id='info_table'>";
echo "<tbody>";
echo "<tr><td class = 'lable'>Notice</td>";
echo "<td colspan'1'>Please select a character log</td></tr>";
echo"</tbody></table></div>"; //End of the notice table
}
echo "<div class='content'>"; // This section generates the search table
echo "<h2 id='info'><a href='#'>Search</a></h2>";
echo "<table class='gen_table' id='info_table'>";
echo "<tbody>";
echo "<tr><td class = 'lable'>Character Serial</td>";
echo "<td colspan'1'><form action = '".$basehref."' method='post'><input name='charSerial' type='text'/></td></tr>";
echo "<tr><td class = 'lable'>Search Options</td>";
echo "<td colspan'1'></td></tr>";
echo "<tr><td class = 'lable'>Month</td>";
echo "<td colspan'1'>";
echo "<select name='month'><option>all</option><option>01</option><option>02</option><option>03</option><option>04</option>";
echo "<option>05</option><option>06</option><option>07</option><option>08</option><option>09</option>";
echo "<option>10</option><option>11</option><option>12</option></select></td></tr>";
echo "<tr><td class = 'lable'>Day</td>";
echo "<td colspan'1'>";
echo "<select name='day1'><option>all</option><option>01</option><option>02</option><option>03</option><option>04</option>";
echo "<option>05</option><option>06</option><option>07</option><option>08</option><option>09</option>";
echo "<option>10</option><option>11</option><option>12</option><option>13</option><option>14</option>";
echo "<option>15</option><option>16</option><option>17</option><option>18</option><option>19</option>";
echo "<option>20</option><option>21</option><option>22</option><option>23</option><option>24</option>";
echo "<option>25</option><option>26</option><option>27</option><option>28</option><option>29</option>";
echo "<option>30</option><option>31</option></select>";
echo " to ";
echo "<select name='day2'><option>all</option><option>01</option><option>02</option><option>03</option><option>04</option>";
echo "<option>05</option><option>06</option><option>07</option><option>08</option><option>09</option>";
echo "<option>10</option><option>11</option><option>12</option><option>13</option><option>14</option>";
echo "<option>15</option><option>16</option><option>17</option><option>18</option><option>19</option>";
echo "<option>20</option><option>21</option><option>22</option><option>23</option><option>24</option>";
echo "<option>25</option><option>26</option><option>27</option><option>28</option><option>29</option>";
echo "<option>30</option><option>31</option></select>";
echo "</td></tr>";
echo "<tr><td class = 'lable'>Search</td>";
echo "<td colspan'1'><input type='submit' /></form></td></tr>";
echo"</tbody></table></div>"; //End of the search table
if(empty($serial))
{
//do nothing (fucking isset returns a false positive and i fucking hate php so i dont know how to boolean .not. like in fortran)
}
else
{
echo "<div class='content'>"; // This section generates the notice table
echo "<h2 id='info'><a href='#'>Results for serial: ".$serial."</a></h2>";
echo "<table class='gen_table' id='info_table'>";
echo "<tbody>";
echo "<tr><td class = 'lable'>Date</td><td class = 'lable'>Time</td><td colspan'1'>File</td></tr>";
searchChar($basehref, $dir2, $serial, $month, $day1, $day2);
echo"</tbody></table></div>"; //End of the notice table
}
}
else // If character loaded then print out char info
{
echo "<div class='content'>"; // This section generates the character table
echo "<h2 id='info'><a href='#'>Character Information</a></h2>";
echo "<table class='gen_table' id='info_table'>";
echo "<tbody>";
echo "<tr><td class='lable'>Serial</td>";
echo "<td colspan='1'>".substr($result[2],4)."</td></tr>";
echo "<tr><td class='lable'>Account Name (serial)</td>";
echo "<td colspan='1'>".substr($result[3],4)."</td></tr>";
$race1 = substr($result[7],6);
echo "<tr><td class='lable'>Race</td>";
echo "<td colspan='1'>".$race[$race1]."</td></tr>";
echo "<tr><td class='lable'>Sex</td>";
echo "<td colspan='1'>".$sex[substr($result[8],5)]."</td></tr>";
echo "<tr><td class='lable'>IP Address</td>";
echo "<td colspan='1'>".substr($result[18],4)."</td></tr>";
echo "<tr><td class='lable'>Minutes Logged In</td>";
echo "<td colspan='1'>".$loggedtime."</td></tr>";
echo "<tr><td class='lable'>Level (LogIn)</td>";
echo "<td colspan='1'>".substr($result[$levels[0]],4)."</td>";
echo "<td class='lable'>Level (LogOut)</td>";
echo "<td colspan='1'>".substr($result[$levels[1]],4)."</td></tr>";
echo "<tr><td class='lable'>Experience (LogIn)</td>";
$xp = substr($result[$experience[0]],4);
$temp = strpos($xp,'(');
echo "<td colspan='1'>".number_format(substr($xp,0,$temp))." ".substr($xp,$temp)."</td>";
echo "<td class='lable'>Experience (LogOut)</td>";
$xp = substr($result[$experience[1]],4);
$temp = strpos($xp,'(');
echo "<td colspan='1'>".number_format(substr($xp,0,$temp))." ".substr($xp,$temp)."</td></tr>";
echo "<tr><td class='lable'>PVP Points (LogIn)</td>";
echo "<td colspan='1'>".number_format(substr($result[$points[0]],5))."</td>";
echo "<td class='lable'>PVP Points (LogOff)</td>";
echo "<td colspan='1'>".number_format(substr($result[$points[1]],5))."</td></tr>";
$class1 = substr($result[9],9);
echo "<tr><td class='lable'>Current Class</td>";
echo "<td colspan='1'>".$class[$class1]."</td>";
echo "<td class='lable'>Old Class</td>";
$oldclass0 = substr($result[10],11);
$temp = strpos($oldclass0,',');
$oldclass1 = substr($oldclass0,$temp+4);
$temp2 = strpos($oldclass1,',');
$oldclass2 = substr($oldclass1,$temp2+4);
echo "<td colspan='1'>".substr($result[10],9,2)." ".$class[substr($oldclass0, 0, $temp)]." 1: ".$class[substr($oldclass1, 0, $temp2)]." 2: ".$class[substr($oldclass2, 0)]."</td></tr>";
echo "<tr><td class='lable'>Last Class Grade</td>";
echo "<td colspan='1'>".substr($result[11],16)."</td>";
echo "<td class='lable'>Init Class Count</td>";
echo "<td colspan='1'>".substr($result[12],14)."</td></tr>";
echo "<tr><td class='lable'>Money (LogIn)</td>";
echo "<td colspan='1'>".number_format(substr($result[$monies[0]],4))."</td>";
echo "<td class='lable'>Money (LogOut)</td>";
echo "<td colspan='1'>".number_format(substr($result[$monies[1]],4))."</td></tr>";
echo "<tr><td class='lable'>Gold (LogIn)</td>";
echo "<td colspan='1'>".number_format(substr($result[$golds[0]],4))."</td>";
echo "<td class='lable'>Gold (LogOut)</td>";
echo "<td colspan='1'>".number_format(substr($result[$golds[1]],4))."</td></tr>";
echo"</tbody></table></div>"; //End of the character information table
}
//--------------
//END CHAR INFO
//--------------
?>
<?
//----------
//Activity
//Display
//----------
if(isset($result))
{
$tempa = array_keys($result, "============");
?>
<div class="content">
<h2 id="act"><a href="#">Activity During Time Period</a></h2>
<table class="gen_table" id="act_table">
<tbody>
<?
$ind = $tempa[4] + 2;
DisplayActivity($result, $ind);
?>
</tbody></table></div>
<?
//----------
//EQUIPMENT
//Display
//----------
//Format and display output for others to see and pass it along!
$tempe = array_keys($result, "EQUIP");
?>
<div class="content">
<h2 id="equip"><a href="#">Equipment (Login)</a></h2>
<table class="gen_table" id="equip_table">
<tbody>
<?
//Login
DisplayCommon($result, $tempe[0], 0);
?>
</tbody></table></div>
<div class="content">
<h2 id="equip2"><a href="#">Equipment (Logout)</a></h2>
<table class="gen_table" id="equip2_table">
<tbody>
<?
//Logout
DisplayCommon($result, $tempe[1], 0);
?>
</tbody></table></div>
<?
//------------
//Jewelry/Ammo
//Display
//------------
$tempj = array_keys($result, "EMBELL");
?>
<div class="content">
<h2 id="jewelry"><a href="#">Jewelry & Ammo (Login)</a></h2>
<table class="gen_table" id="jewelry_table">
<tbody>
<?
//Login
DisplayCommon($result, $tempj[0], 1);
?>
</tbody></table></div>
<div class="content">
<h2 id="jewelry2"><a href="#">Jewelry & Ammo (Logout)</a></h2>
<table class="gen_table" id="jewelry2_table">
<tbody>
<?
//Logout
DisplayCommon($result, $tempj[1], 1);
?>
</tbody></table></div>
<?
//------------
//Inventory
//
//
//------------
$tempi = array_keys($result, "INVEN");
//Inventory Display
?>
<div class="content">
<h2 id="inven"><a href="#">Inventory (Login)</a></h2>
<table class="gen_table" id="inven_table">
<tbody>
<?
DisplayCommon($result, $tempi[0], 2);
?>
</tbody></table></div>
<div class="content">
<h2 id="inven2"><a href="#">Inventory (Logout)</a></h2>
<table class="gen_table" id="inven2_table">
<tbody>
<?
DisplayCommon($result, $tempi[1], 2);
?>
</tbody></table></div>
<?
//------------
//Bank
//
//
//------------
$tempt = array();
for($i = 0; $i < sizeof($result); $i++)
{
if(strpos($result[$i], "TRUNK (") === 0)
{
$tempt[] = $i;
}
}
//Trunk Display
$trunk1 = $result[$tempt[0]];
$trunk2 = $result[$tempt[1]];
$holder1 = strpos($trunk1, "^D:");
$holder2 = strpos($trunk1, ", ^G:");
$holder3 = strpos($trunk1, ")");
$money1 = substr($trunk1, $holder1+3, $holder2-$holder1-3);
$gold1 = substr($trunk1, $holder2+5, $holder3-$holder2-5);
$holder1 = strpos($trunk2, "^D:");
$holder2 = strpos($trunk2, ", ^G:");
$holder3 = strpos($trunk2, ")");
$money2 = substr($trunk2, $holder1+3, $holder2-$holder1-3);
$gold2 = substr($trunk2, $holder2+5, $holder3-$holder2-5);
?>
<div class="content">
<h2 id="trunk"><a href="#">Bank (Login) Money: <?echo number_format($money1);?> Gold: <?echo number_format($gold1);?></a></h2>
<table class="gen_table" id="trunk_table">
<tbody>
<?
DisplayCommon($result, $tempt[0], 4);
?>
</tbody></table></div>
<div class="content">
<h2 id="trunk2"><a href="#">Bank (Logout) Money: <?echo number_format($money2);?> Gold: <?echo number_format($gold2);?></a></h2>
<table class="gen_table" id="trunk2_table">
<tbody>
<?
DisplayCommon($result, $tempt[1], 4);
?>
</tbody></table></div>
<?
//------------
//Force Spells
//
//
//------------
$tempf = array_keys($result, "FORCE");
//Trunk Display
?>
<div class="content">
<h2 id="force"><a href="#">Force Spells (Login)</a></h2>
<table class="gen_table" id="force_table">
<tbody>
<?
DisplayCommon($result, $tempf[0], 3);
?>
</tbody></table></div>
<div class="content">
<h2 id="force2"><a href="#">Force Spells (Logout)</a></h2>
<table class="gen_table" id="force2_table">
<tbody>
<?
DisplayCommon($result, $tempf[1], 3);
?>
</tbody></table></div>
<?
//------------
//Unit
//
//
//------------
if($race1 == 0)
{
$tempu = array_keys($result, "UNIT");
//MAU Display
?>
<div class="content">
<h2 id="unit"><a href="#">Unit (Login)</a></h2>
<table class="gen_table" id="unit_table">
<tbody>
<?
DisplayCommon($result, $tempu[0], 5);
?>
</tbody></table></div>
<div class="content">
<h2 id="unit2"><a href="#">Unit (Logout)</a></h2>
<table class="gen_table" id="unit2_table">
<tbody>
<?
DisplayCommon($result, $tempu[1], 5);
?>
</tbody></table></div>
<?
}
?>
<?
//------------
//Animus
//
//
//------------
if($race1 == 1)
{
$tempu = array_keys($result, "ANIMUS");
//MAU Display
?>
<div class="content">
<h2 id="animus"><a href="#">Animus (Login)</a></h2>
<table class="gen_table" id="animus_table">
<tbody>
<?
DisplayCommon($result, $tempu[0], 6);
?>
</tbody></table></div>
<div class="content">
<h2 id="animus2"><a href="#">Animus (Logout)</a></h2>
<table class="gen_table" id="animus2_table">
<tbody>
<?
DisplayCommon($result, $tempu[1], 6);
?>
</tbody></table></div>
<?
}
}
?>
</body>
</html>
preferences:
37.37 ms | 402 KiB | 5 Q