|
From: <lpa...@us...> - 2021-07-05 18:44:46
|
Revision: 10008
http://sourceforge.net/p/planeshift/code/10008
Author: lpancallo
Date: 2021-07-05 18:44:44 +0000 (Mon, 05 Jul 2021)
Log Message:
-----------
Updated webconsole for PSUnreal, with new coordinates. not all maps yet.
Modified Paths:
--------------
www/webconsole-new/commonfunctions.php
www/webconsole-new/crafting/resourcemap.php
www/webconsole-new/graphfunctions.php
www/webconsole-new/npcs/viewnpcmap.php
www/webconsole-new/rules/draw_map.php
www/webconsole-new/statistics/statshardware.php
Modified: www/webconsole-new/commonfunctions.php
===================================================================
--- www/webconsole-new/commonfunctions.php 2021-02-27 20:32:26 UTC (rev 10007)
+++ www/webconsole-new/commonfunctions.php 2021-07-05 18:44:44 UTC (rev 10008)
@@ -553,6 +553,7 @@
This method contains hardcoded coords and part of SQL statements. They are the sizes of each map, as well as which sectors they
span in the database. This data "should" be put in a database someday(TM), since right now you will need to edit this code
every time a map gets added to the world. (This gets used for drawing maps.)
+ Coordinates are TOP LEFT of the map. X going positive from left to right, Y going positive from top to bottom.
*/
function getDataFromArea($area) {
@@ -560,10 +561,10 @@
$data;
if ($area=='hydlaa_plaza') {
$data[0] = '(loc_sector_id=15 or loc_sector_id=52 or loc_sector_id=41 or loc_sector_id=42)';
- $data[1] = 535;
- $data[2] = 180;
- $data[3] = 2.2;
- $data[4] = 2.2;
+ $data[1] = 127000;
+ $data[2] = -381000;
+ $data[3] = 1;
+ $data[4] = 1;
$data[5] = array('hydlaa_plaza', 'tavern_de_kadel', 'laanxentrance','laanxmain');
} else if ($area=='hydlaa_jayose') {
$data[0] = '(loc_sector_id=49 or loc_sector_id=40)';
@@ -602,15 +603,15 @@
$data[5] = array('hall', 'trans1', 'dngn', 'cntr', 'trans2', 'merc', 'upper', 'entr', 'outer', 'hycorr1', 'hycorr2');
} else if ($area=='ojaroad1') {
$data[0] = '(loc_sector_id=22)';
- $data[1] = 603;
- $data[2] = 600;
+ $data[1] = 254000;
+ $data[2] = -381000;
$data[3] = 0.9;
$data[4] = 0.9;
$data[5] = array('ojaroad1');
} else if ($area=="ojaroad2") {
$data[0] = '(loc_sector_id=59)';
- $data[1] = 632;
- $data[2] = 625;
+ $data[1] = 381000;
+ $data[2] = -381000;
$data[3] = 1;
$data[4] = 1;
$data[5] = array('ojaroad2');
@@ -623,15 +624,15 @@
$data[5] = array('ojapath', 'Akk-Central', 'Akk-East');
} else if ($area=='bdroad1') {
$data[0] = '(loc_sector_id=60)';
- $data[1] = 491;
- $data[2] = 493;
+ $data[1] = 127000;
+ $data[2] = -508000;
$data[3] = 0.76;
$data[4] = 0.76;
$data[5] = array('bdroad1');
} else if ($area=='bdroad2') {
$data[0] = '(loc_sector_id=61)';
- $data[1] = 669;
- $data[2] = 667;
+ $data[1] = 127000;
+ $data[2] = -635000;
$data[3] = 1.07;
$data[4] = 1.07;
$data[5] = array('bdroad2');
@@ -919,4 +920,39 @@
return ($result[0] == 1);
}
-?>
+function OutputPSVersionDropdown($psversion)
+{
+ return "<select name=psversion id=psversion><option value=ab>Atomic Blue</option><option value=mb>Molecular Blue</option><option value=cbe>Crystal Blue Early</option><option value=cbl>Crystal Blue Late</option><option value=sb>Steel Blue Late</option><option value=ac>Azure Chrysalis</option><option value=az>Azure Spirit</option><option value=psu selected>PSUnreal</option></select>";
+}
+
+function generateWhereClauseByPSVersion($psversion)
+{
+ // PlaneShift Atomic Blue 10 Feb 2002 - 06 March 2003
+ // PlaneShift Molecular Blue 07 March 2003 - 23 Dec 2004
+ // PlaneShift Early Crystal Blue! 24 Dec 2004 - 15 July 2006
+ // PlaneShift called Late Crystal Blue! 16 July 2006 - 14 March 2008
+ // PlaneShift called Steel Blue! 15 March 2008 - 14 December 2009
+ // PlaneShift called Arcane Chrysalis 15 December 2009 - 14 November 2013
+ // PlaneShift called Azure Spirit 15 November 2013 - 19 May 2020
+ // PlaneShift PSUnreal Alpha 0.7.1 20 May 2020 - xx
+
+ // express dates as YYYY-MM-DD
+
+ if ($psversion == "ab")
+ return "last_login<= DATE(\"2003-03-06\")";
+ else if ($psversion == "mb")
+ return "last_login >= DATE(\"2003-03-07\") AND last_login<= DATE(\"2004-12-23\")";
+ else if ($psversion == "cbe")
+ return "last_login >= DATE(\"2004-12-24\") AND last_login<= DATE(\"2006-07-15\")";
+ else if ($psversion == "cbl")
+ return "last_login >= DATE(\"2006-07-16\") AND last_login<= DATE(\"2008-03-14\")";
+ else if ($psversion == "sb")
+ return "last_login >= DATE(\"2008-03-15\") AND last_login<= DATE(\"2009-12-14\")";
+ else if ($psversion == "ac")
+ return "last_login >= DATE(\"2009-12-15\") AND last_login<= DATE(\"2013-11-14\")";
+ else if ($psversion == "az")
+ return "last_login >= DATE(\"2013-11-15\") AND last_login<= DATE(\"2020-05-19\")";
+ else if ($psversion == "psu")
+ return "last_login >= DATE(\"2020-05-20\")";
+}
+?>
\ No newline at end of file
Modified: www/webconsole-new/crafting/resourcemap.php
===================================================================
--- www/webconsole-new/crafting/resourcemap.php 2021-02-27 20:32:26 UTC (rev 10007)
+++ www/webconsole-new/crafting/resourcemap.php 2021-07-05 18:44:44 UTC (rev 10008)
@@ -152,6 +152,8 @@
$query = "SELECT id, loc_x, loc_y, loc_z, radius, visible_radius, probability, reward_nickname, amount from natural_resources where ".$sectors;
//echo "query is $query";
$res = mysql_query2($query);
+
+ echo "<br/>Natural Resources found: " . mysqli_num_rows($res) . "<br/>";
while ($line = fetchSqlRow($res)){
if ($line[8]!=0)
@@ -158,7 +160,7 @@
$amount = 2; // indicates this is also an hunt location
else
$amount = 1; // indicates this is only a natural res
- $elem = $line[0] . "|R:" . $line[5] . " P:".$line[6]." I:".$line[7]."|x|" . $line[1] . "|" . $line[3]."|".$line[6]."|".$amount;
+ $elem = $line[0] . "|R:" . $line[5] . " P:".$line[6]." I:".$line[7]."|x|" . $line[1] . "|" . $line[2]."|".$line[6]."|".$amount;
$result .= ($elem . "\n");
}
}
@@ -168,9 +170,10 @@
$query = "SELECT h.id, h.x, h.y, h.z, h.`range`, h.`range`, 0, s.name from hunt_locations h, item_stats s where h.itemid=s.id and ".$hunt_sectors;
//echo "query is $query";
$res = mysql_query2($query);
+ echo "<br/>Hunt Locations found: " . mysqli_num_rows($res) . "<br/>";
while ($line = fetchSqlRow($res)){
- $elem = $line[0] . "|R:" . $line[5] . " P:".$line[6]." I:".$line[7]."|x|" . $line[1] . "|" . $line[3]."|".$line[6]."|3|33";
+ $elem = $line[0] . "|R:" . $line[5] . " P:".$line[6]." I:".$line[7]."|x|" . $line[1] . "|" . $line[2]."|".$line[6]."|3|33";
$result .= ($elem . "\n");
}
}
@@ -207,8 +210,8 @@
$scalefactorx = $data[3];
$scalefactory = $data[4];
- $x = $centerx+($infos[4]*$scalefactorx);
- $y = $centery-($infos[5]*$scalefactory);
+ $x = (($infos[4]-$centerx)*$scalefactorx)/100;
+ $y = (($infos[5]-$centery)*$scalefactory)/100;
// determine icon
if ($infos[7] == 1) {
Modified: www/webconsole-new/graphfunctions.php
===================================================================
--- www/webconsole-new/graphfunctions.php 2021-02-27 20:32:26 UTC (rev 10007)
+++ www/webconsole-new/graphfunctions.php 2021-07-05 18:44:44 UTC (rev 10008)
@@ -3,7 +3,7 @@
$max = 0;
$total = 0;
- while ($line = fetchSqlAssoc($result))
+ while ($line = mysqli_fetch_row($result))
{
$num = $line[2];
$name = $line[1];
Modified: www/webconsole-new/npcs/viewnpcmap.php
===================================================================
--- www/webconsole-new/npcs/viewnpcmap.php 2021-02-27 20:32:26 UTC (rev 10007)
+++ www/webconsole-new/npcs/viewnpcmap.php 2021-07-05 18:44:44 UTC (rev 10008)
@@ -140,10 +140,10 @@
//echo "<div id=Layer2 style=\"position:absolute; width:1968px; height:954px; z-index:1; left:0px; top:90px\">";
if(!isset($_GET['live']))
- echo "<img src=\"rules/draw_map.php?sector=$sector&type=waypoint,path,tribe,spawn\" >";
+ echo "<img src=\"rules/draw_map.php?sector=$sector&type=waypoint,path,tribe,spawn\" />";
else
- echo "<img src=\"rules/draw_map.php?sector=$sector&type=live\" >";
-
+ echo "<img src=\"rules/draw_map.php?sector=$sector&type=live\" />";
+
$data = getDataFromArea($sector);
$sectors = $data[0];
$centerx = $data[1];
@@ -155,10 +155,12 @@
$query = "SELECT id,name,loc_x,loc_y,loc_z,loc_sector_id, npc_impervious_ind FROM characters WHERE npc_master_id>0 AND " . $sectors . " and npc_spawn_rule>0";
$res = mysql_query2($query);
+ echo "<br/>NPC found: " . mysqli_num_rows($res) . "<br/>";
+
$i=0;
$result = '';
while ($line = fetchSqlRow($res)){
- $elem = $line[0] . "|" . $line[1] . "|x|" . $line[2] . "|" . $line[4]."|".$line[6];
+ $elem = $line[0] . "|" . $line[1] . "|x|" . $line[2] . "|" . $line[3]."|".$line[6];
$result .= $elem . "\n";
}
// get each line
@@ -169,92 +171,94 @@
$tok = strtok("\n");
}
-
- // get all info for each line
- foreach((array) $peoples as $people ) {
-
- // skips commented lines
- $pos = strstr($people, '#');
-
- if ($pos=="0") {
- $tok2 = strtok($people, '|');
- $infos[] = '';
- $count = 1;
- while ($tok2) {
- $tok2 = str_replace("\n", '', $tok2);
- $tok2 = str_replace("\r", '', $tok2);
- $infos[$count]=$tok2;
- $tok2 = strtok('|');
- $count++;
- }
-
-
- $x = $centerx+($infos[4]*$scalefactorx);
- $y = $centery-($infos[5]*$scalefactory);
-
- if ($infos[6] == 'Y') {
- $ball = 'img/ball01m.gif';
- echo "<div id=Layer1 onMouseover=\"ddrivetip('$infos[1] $infos[2]')\"; onMouseout=\"hideddrivetip()\" style=\"position:absolute; offsetTop:20px; width:10px; height:10px; z-index:2; left:".$x."px; top:".$y."px\">";
- echo "<A HREF=index.php?do=npc_details&sub=main&npc_id=$infos[1]><img border=0 src=$ball width=8 height=8></a></div>\n";
-
- } else {
- $ball = 'img/ball04m.gif';
- echo "<div id=Layer1 onMouseover=\"ddrivetip('$infos[1] $infos[2]')\"; onMouseout=\"hideddrivetip()\" style=\"position:absolute; offsetTop:20px; width:10px; height:10px; z-index:2; left:".$x."px; top:".$y."px\">";
- echo "<A HREF=index.php?do=npc_details&sub=main&npc_id=$infos[1]><img border=0 src=$ball width=10 height=10></a></div>\n";
- }
-
- }
- }
+
+ // get all info for each line
+ foreach((array) $peoples as $people ) {
+
+ // skips commented lines
+ $pos = strstr($people, '#');
+
+ if ($pos=="0")
+ {
+ $tok2 = strtok($people, '|');
+ $infos[] = '';
+ $count = 1;
+ while ($tok2) {
+ $tok2 = str_replace("\n", '', $tok2);
+ $tok2 = str_replace("\r", '', $tok2);
+ $infos[$count]=$tok2;
+ $tok2 = strtok('|');
+ $count++;
+ }
+
+
+ $x = (($infos[4]-$centerx)*$scalefactorx)/100;
+ $y = (($infos[5]-$centery)*$scalefactory)/100;
+
+ //echo "x:".$x." y:".$y;
+
+ if ($infos[6] == 'Y') {
+ $ball = 'img/ball01m.gif';
+ echo "<div id=Layer1 onMouseover=\"ddrivetip('$infos[1] $infos[2]')\"; onMouseout=\"hideddrivetip()\" style=\"position:absolute; offsetTop:20px; width:10px; height:10px; z-index:2; left:".$x."px; top:".$y."px\">";
+ echo "<A HREF=index.php?do=npc_details&sub=main&npc_id=$infos[1]><img border=0 src=$ball width=8 height=8></a></div>\n";
+
+ } else {
+ $ball = 'img/ball04m.gif';
+ echo "<div id=Layer1 onMouseover=\"ddrivetip('$infos[1] $infos[2]')\"; onMouseout=\"hideddrivetip()\" style=\"position:absolute; offsetTop:20px; width:10px; height:10px; z-index:2; left:".$x."px; top:".$y."px\">";
+ echo "<A HREF=index.php?do=npc_details&sub=main&npc_id=$infos[1]><img border=0 src=$ball width=10 height=10></a></div>\n";
+ }
+ }
+ }
}
else
{
- // Get Live position data
- $handle = @fopen($report,"r");
- if($handle) {
- while ( !feof($handle) )
- {
- $buffer = fgets($handle, 4096);
- if(preg_match("/npc name=\"(?P<name>.*?)\".*pos_x=\"(?P<x>.*?)\".*pos_z=\"(?P<z>.*?)\" sector=\"(?P<sector>.*?)\"/", $buffer, $matches)) {
- $found = FALSE;
- foreach($data[5] as $sectorname)
- {
- if($matches['sector'] === $sectorname)
- $found = TRUE;
- }
- if($found)
- {
- $ball = 'img/ball01m.gif';
- $x= $centerx+($matches['x']*$scalefactorx);
- $y= $centery-($matches['z']*$scalefactory);
- echo "<div id=Layer1 onMouseover=\"ddrivetip('".$matches['name']."')\"; onMouseout=\"hideddrivetip()\" style=\"position:absolute; offsetTop:20px; width:10px; height:10px; z-index:2; left:".$x."px; top:".$y."px\">";
- echo "<img border=0 src=$ball width=8 height=8></div>\n";
- }
- }
- elseif(preg_match("/player name=\"(?P<name>.*?)\".*pos_x=\"(?P<x>.*?)\".*pos_z=\"(?P<z>.*?)\" sector=\"(?P<sector>.*?)\"/", $buffer, $matches)) {
- $found = FALSE;
- foreach($data[5] as $sectorname)
- {
- if($matches['sector'] === $sectorname)
- $found = TRUE;
- }
- if($found)
- {
- $ball = 'img/ball04m.gif';
- $x= $centerx+($matches['x']*$scalefactorx);
- $y= $centery-($matches['z']*$scalefactory);
- echo "<div id=Layer1 onMouseover=\"ddrivetip('".$matches['name']."')\"; onMouseout=\"hideddrivetip()\" style=\"position:absolute; offsetTop:20px; width:10px; height:10px; z-index:2; left:".$x."px; top:".$y."px\">";
- echo "<img border=0 src=$ball width=10 height=10></div>\n";
- }
- }
-
- }
- }
+ // Get Live position data
+ $handle = @fopen($report,"r");
+ if($handle) {
+ while ( !feof($handle) )
+ {
+ $buffer = fgets($handle, 4096);
+ if(preg_match("/npc name=\"(?P<name>.*?)\".*pos_x=\"(?P<x>.*?)\".*pos_z=\"(?P<z>.*?)\" sector=\"(?P<sector>.*?)\"/", $buffer, $matches)) {
+ $found = FALSE;
+ foreach($data[5] as $sectorname)
+ {
+ if($matches['sector'] === $sectorname)
+ $found = TRUE;
+ }
+ if($found)
+ {
+ $ball = 'img/ball01m.gif';
+ $x= $centerx+($matches['x']*$scalefactorx);
+ $y= $centery-($matches['z']*$scalefactory);
+ echo "<div id=Layer1 onMouseover=\"ddrivetip('".$matches['name']."')\"; onMouseout=\"hideddrivetip()\" style=\"position:absolute; offsetTop:20px; width:10px; height:10px; z-index:2; left:".$x."px; top:".$y."px\">";
+ echo "<img border=0 src=$ball width=8 height=8></div>\n";
+ }
+ }
+ elseif(preg_match("/player name=\"(?P<name>.*?)\".*pos_x=\"(?P<x>.*?)\".*pos_z=\"(?P<z>.*?)\" sector=\"(?P<sector>.*?)\"/", $buffer, $matches)) {
+ $found = FALSE;
+ foreach($data[5] as $sectorname)
+ {
+ if($matches['sector'] === $sectorname)
+ $found = TRUE;
+ }
+ if($found)
+ {
+ $ball = 'img/ball04m.gif';
+ $x= $centerx+($matches['x']*$scalefactorx);
+ $y= $centery-($matches['z']*$scalefactory);
+ echo "<div id=Layer1 onMouseover=\"ddrivetip('".$matches['name']."')\"; onMouseout=\"hideddrivetip()\" style=\"position:absolute; offsetTop:20px; width:10px; height:10px; z-index:2; left:".$x."px; top:".$y."px\">";
+ echo "<img border=0 src=$ball width=10 height=10></div>\n";
+ }
+ }
+
+ }
+ }
else
{
echo '<p class="error">Could not open report.xml file in '.$report.'</p>';
}
- @fclose($handle);
-
+ @fclose($handle);
+
}
}
$sectors_list = PrepSelect('sector');
Modified: www/webconsole-new/rules/draw_map.php
===================================================================
--- www/webconsole-new/rules/draw_map.php 2021-02-27 20:32:26 UTC (rev 10007)
+++ www/webconsole-new/rules/draw_map.php 2021-07-05 18:44:44 UTC (rev 10008)
@@ -40,6 +40,7 @@
draw_map($sector, $type);
}
+// THIS FUNCTION WILL WORK ONLY IF THE INCLUDE ABOVE DO NOT ADD ANY EXTRA SPACES TO THE PAGE
function draw_map($sector, $type)
{
$image_name = '../img/'.$sector.'.gif';
@@ -120,8 +121,8 @@
$radius = $line[4];
$vis_radius = $line[5];
- $ix = $centerx+($x*$scalefactorx);
- $iy = $centery-($z*$scalefactory);
+ $ix = (($x-$centerx)*$scalefactorx)/100;
+ $iy = (($y-$centery)*$scalefactory)/100;
$ir = $radius*$scalefactorx;
imagearc($im,$ix,$iy,2*$ir,2*$ir,0,360,$fg_color);
@@ -152,10 +153,10 @@
$radius = $line[7];
$range_type = $line[8];
- $ix1 = $centerx+($x1*$scalefactorx);
- $iy1 = $centery-($z1*$scalefactory);
- $ix2 = $centerx+($x2*$scalefactorx);
- $iy2 = $centery-($z2*$scalefactory);
+ $ix1 = (($x1-$centerx)*$scalefactorx)/100;
+ $iy1 = (($y1-$centery)*$scalefactory)/100;
+ $ix2 = (($x2-$centerx)*$scalefactorx)/100;
+ $iy2 = (($y2-$centery)*$scalefactory)/100;
$ir = $radius*$scalefactorx;
if ($range_type == "C") // Circle
{
@@ -198,8 +199,8 @@
$z = $line[3];
$radius = $line[4];
- $ix = $centerx+($x*$scalefactorx);
- $iy = $centery-($z*$scalefactory);
+ $ix = (($x-$centerx)*$scalefactorx)/100;
+ $iy = (($y-$centery)*$scalefactory)/100;
$ir = $radius*$scalefactorx;
imagearc($im,$ix,$iy,2*$ir,2*$ir,0,360,$fg_color);
}
@@ -224,8 +225,8 @@
$radius = $line[4];
$flags = $line[5];
- $ix = $centerx+($x*$scalefactorx);
- $iy = $centery-($z*$scalefactory);
+ $ix = (($x-$centerx)*$scalefactorx)/100;
+ $iy = (($y-$centery)*$scalefactory)/100;
$ir = $radius*$scalefactorx;
$style = array($fg_color,$fg_color,$fg_color);
@@ -292,10 +293,10 @@
$id1 = $line2[7];
$id2 = $line2[8];
- $ix1 = $centerx+($x1*$scalefactorx);
- $iy1 = $centery-($z1*$scalefactory);
- $ix2 = $centerx+($x2*$scalefactorx);
- $iy2 = $centery-($z2*$scalefactory);
+ $ix1 = (($x1-$centerx)*$scalefactorx)/100;
+ $iy1 = (($y1-$centery)*$scalefactory)/100;
+ $ix2 = (($x2-$centerx)*$scalefactorx)/100;
+ $iy2 = (($y2-$centery)*$scalefactory)/100;
if (stristr($flags, 'NO_WANDER') !== FALSE)
{
@@ -365,14 +366,14 @@
// Get start point, from waypoint
{
// Draw from start wp to first point
- $query2 = "select w.x,w.z from sc_waypoints w, sc_waypoint_links wl where w.id = wl.wp1 and wl.id=".$path_id;
+ $query2 = "select w.x,w.y from sc_waypoints w, sc_waypoint_links wl where w.id = wl.wp1 and wl.id=".$path_id;
$res2=mysql_query2($query2);
while ($line2 = fetchSqlRow($res2))
{
$x1 = $line2[0];
- $z1 = $line2[1];
- $ix2 = $centerx+($x1*$scalefactorx);
- $iy2 = $centery-($z1*$scalefactory);
+ $y1 = $line2[1];
+ $ix2 = (($x1-$centerx)*$scalefactorx)/100;
+ $iy2 = (($y1-$centery)*$scalefactory)/100;
}
}
// Get path points and draw line from last point
@@ -383,7 +384,7 @@
{
$found = false;
// Draw from start wp to first point
- $query2 = "select id,x,z from sc_path_points where path_id=".$path_id." and prev_point=".$point_id;
+ $query2 = "select id,x,y from sc_path_points where path_id=".$path_id." and prev_point=".$point_id;
$res2=mysql_query2($query2);
while ($line2 = fetchSqlRow($res2))
{
@@ -395,9 +396,9 @@
$point_id = $line2[0];
$x1 = $line2[1];
- $z1 = $line2[2];
- $ix2 = $centerx+($x1*$scalefactorx);
- $iy2 = $centery-($z1*$scalefactory);
+ $y1 = $line2[2];
+ $ix2 = (($x1-$centerx)*$scalefactorx)/100;
+ $iy2 = (($y1-$centery)*$scalefactory)/100;
$ir = 3;
imageline($im,$ix1,$iy1,$ix2,$iy2, IMG_COLOR_STYLED );
@@ -408,7 +409,7 @@
{
// Draw from start wp to first point
- $query2 = "select w.x,w.z from sc_waypoints w, sc_waypoint_links wl where w.id = wl.wp2 and wl.id=".$path_id;
+ $query2 = "select w.x,w.y from sc_waypoints w, sc_waypoint_links wl where w.id = wl.wp2 and wl.id=".$path_id;
$res2=mysql_query2($query2);
while ($line2 = fetchSqlRow($res2))
{
@@ -417,9 +418,9 @@
$iy1 = $iy2;
$x1 = $line2[0];
- $z1 = $line2[1];
- $ix2 = $centerx+($x1*$scalefactorx);
- $iy2 = $centery-($z1*$scalefactory);
+ $y1 = $line2[1];
+ $ix2 = (($x1-$centerx)*$scalefactorx)/100;
+ $iy2 = (($y1-$centery)*$scalefactory)/100;
imageline($im, $ix1, $iy1, $ix2, $iy2, IMG_COLOR_STYLED );
}
@@ -446,8 +447,8 @@
$radius = $line[4];
$id_prev = $line[5];
- $ix1 = $centerx+($x*$scalefactorx);
- $iy1 = $centery-($z*$scalefactory);
+ $ix1 = (($x-$centerx)*$scalefactorx)/100;
+ $iy1 = (($y-$centery)*$scalefactory)/100;
$ir = $radius*$scalefactorx;
imagearc($im,$ix1,$iy1,2*$ir,2*$ir,0,360,$fg_color);
@@ -461,8 +462,8 @@
$y2 = $line2[1];
$z2 = $line2[2];
- $ix2 = $centerx+($x2*$scalefactorx);
- $iy2 = $centery-($z2*$scalefactory);
+ $ix2 = (($x2-$centerx)*$scalefactorx)/100;
+ $iy2 = (($y2-$centery)*$scalefactory)/100;
imageline($im,$ix1,$iy1,$ix2,$iy2,$fg_color);
}
}
@@ -495,8 +496,8 @@
if($found)
{
- $x = $centerx+($pieces[0]*$scalefactorx);
- $y = $centery-($pieces[1]*$scalefactory);
+ $x = (($pieces[0]-$centerx)*$scalefactorx)/100;
+ $y = (($pieces[1]-$centery)*$scalefactory)/100;
if(!($prevx == 999.0 && $prevy == 999.0))
{
imageline($im,$prevx,$prevy,$x,$y,$colors[$colorindex]);
Modified: www/webconsole-new/statistics/statshardware.php
===================================================================
--- www/webconsole-new/statistics/statshardware.php 2021-02-27 20:32:26 UTC (rev 10007)
+++ www/webconsole-new/statistics/statshardware.php 2021-07-05 18:44:44 UTC (rev 10008)
@@ -5,17 +5,28 @@
include('./graphfunctions.php');
if(checkaccess('statistics', 'read'))
{
- ?>
- <form action="./index.php?do=statshardware" method="post"><input type="text" value="10" name="filter" size="4"> Threshold for filtering results <input type="submit" name="Filter" value="Filter"/></form>
- <?php
- echo '<p class="header">Operating Systems</p>';
-
$filter = 10;
+ $psversion = "psu";
if ( isset($_POST['filter']) ) {
$filter = escapeSqlString($_POST['filter']);
}
+ if ( isset($_POST['psversion']) ) {
+ $psversion = escapeSqlString($_POST['psversion']);
+ echo "<br/> PSVersion used for query: ".$psversion;
+ }
+
+ ?>
+ <form action="./index.php?do=statshardware" method="post"> Minimum number of result count required <input type="text" value="<?=$filter?>" name="filter" size="4"><br/>
+ <?php
+ echo "Filter by release: " . OutputPSVersionDropdown($psversion);
+ echo "<br/><input type=\"submit\" name=\"Filter\" value=\"Filter\"/></form>";
+ echo '<p class="header">Operating Systems</p>';
+
- $sql = "SELECT id,operating_system,count(operating_system) as result FROM accounts where operating_system <>'' group by operating_system having result>=".$filter." order by result desc";
+
+
+
+ $sql = "SELECT id,operating_system,count(operating_system) as result FROM accounts where operating_system <>'' AND ".generateWhereClauseByPSVersion($psversion)." group by operating_system having result>=".$filter." order by result desc";
$query = mysql_query2($sql);
if(sqlNumRows($query) < 1)
@@ -26,7 +37,7 @@
echo '<p class="header">Graphics Cards</p>';
- $sql = "SELECT id,graphics_card,count(graphics_card) as result FROM accounts where graphics_card <>'' group by graphics_card having result>=".$filter." order by result desc";
+ $sql = "SELECT id,graphics_card,count(graphics_card) as result FROM accounts where graphics_card <>'' AND ".generateWhereClauseByPSVersion($psversion)." group by graphics_card having result>=".$filter." order by result desc";
$query2 = mysql_query2($sql);
if(sqlNumRows($query2) < 1)
@@ -37,7 +48,7 @@
echo '<p class="header">Graphics Version</p>';
- $sql = "SELECT id,graphics_version,count(graphics_version) as result FROM accounts where graphics_version <>'' group by graphics_version having result>=".$filter." order by result desc";
+ $sql = "SELECT id,graphics_version,count(graphics_version) as result FROM accounts where graphics_version <>'' AND ".generateWhereClauseByPSVersion($psversion)." group by graphics_version having result>=".$filter." order by result desc";
$query2 = mysql_query2($sql);
if(sqlNumRows($query2) < 1)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|