diff --git a/code/web/app/app_achievements/_AchWebParser/script/_scriptDir b/code/web/app/app_achievements/_AchWebParser/script/_scriptDir new file mode 100644 index 000000000..e69de29bb diff --git a/code/web/app/app_achievements/_AchWebParser/script/in_region_script.php b/code/web/app/app_achievements/_AchWebParser/script/in_region_script.php deleted file mode 100644 index 9008a907b..000000000 --- a/code/web/app/app_achievements/_AchWebParser/script/in_region_script.php +++ /dev/null @@ -1,132 +0,0 @@ -sendSQL("SELECT c_pos_x,c_pos_y FROM ryzom_character WHERE c_xmlid='".$xmlid."'","ARRAY"); - #$points[] = floor($comp[0]['c_pos_x'])." ".floor($comp[0]['c_pos_y']); - $points[] = floor($pos->x/1000)." ".floor($pos->y/1000); - - $pointLocation = new pointLocation(); - - foreach($points as $point) { - if($pointLocation->pointInPolygon($point, $region[$where], false) != "outside") { - return true; - } - } - - echo "false"; - - return false; - } - } -?> \ No newline at end of file diff --git a/code/web/app/app_achievements/_AchWebParser/script/include_InPoly_class.php b/code/web/app/app_achievements/_AchWebParser/script/include_InPoly_class.php deleted file mode 100644 index 14e2ff3a2..000000000 --- a/code/web/app/app_achievements/_AchWebParser/script/include_InPoly_class.php +++ /dev/null @@ -1,70 +0,0 @@ -pointOnVertex = $pointOnVertex; - - // Transform string coordinates into arrays with x and y values - $point = $this->pointStringToCoordinates($point); - $vertices = array(); - foreach($polygon as $vertex) { - $vertices[] = $this->pointStringToCoordinates($vertex); - } - - // Check if the point sits exactly on a vertex - if($this->pointOnVertex == true and $this->pointOnVertex($point, $vertices) == true) { - return "vertex"; - } - - // Check if the point is inside the polygon or on the boundary - $intersections = 0; - $vertices_count = count($vertices); - - for($i=1; $i < $vertices_count; $i++) { - $vertex1 = $vertices[$i-1]; - $vertex2 = $vertices[$i]; - if($vertex1['y'] == $vertex2['y'] and $vertex1['y'] == $point['y'] and $point['x'] > min($vertex1['x'], $vertex2['x']) and $point['x'] < max($vertex1['x'], $vertex2['x'])) { // Check if point is on an horizontal polygon boundary - return "boundary"; - } - if($point['y'] > min($vertex1['y'], $vertex2['y']) and $point['y'] <= max($vertex1['y'], $vertex2['y']) and $point['x'] <= max($vertex1['x'], $vertex2['x']) and $vertex1['y'] != $vertex2['y']) { - $xinters = ($point['y'] - $vertex1['y']) * ($vertex2['x'] - $vertex1['x']) / ($vertex2['y'] - $vertex1['y']) + $vertex1['x']; - if($xinters == $point['x']) { // Check if point is on the polygon boundary (other than horizontal) - return "boundary"; - } - if($vertex1['x'] == $vertex2['x'] || $point['x'] <= $xinters) { - $intersections++; - } - } - } - // If the number of edges we passed through is even, then it's in the polygon. - if ($intersections % 2 != 0) { - return "inside"; - } - else { - return "outside"; - } - } - - function pointOnVertex($point, $vertices) { - foreach($vertices as $vertex) { - if ($point == $vertex) { - return true; - } - } - - return false; - - } - - function pointStringToCoordinates($pointString) { - $coordinates = explode(" ", $pointString); - return array("x" => $coordinates[0], "y" => $coordinates[1]); - } - } -?> \ No newline at end of file diff --git a/code/web/app/app_achievements/_doc/Ryzom Player Achievements.pdf b/code/web/app/app_achievements/_doc/Ryzom Player Achievements.pdf index 80edb86bb..92734385a 100644 Binary files a/code/web/app/app_achievements/_doc/Ryzom Player Achievements.pdf and b/code/web/app/app_achievements/_doc/Ryzom Player Achievements.pdf differ diff --git a/code/web/app/app_achievements/index.php b/code/web/app/app_achievements/index.php index 71b1ae82d..40cbda50b 100644 --- a/code/web/app/app_achievements/index.php +++ b/code/web/app/app_achievements/index.php @@ -69,6 +69,8 @@ if(!$_USER->isIG()) { 'cookie' => true )); + #code taken from facebook tutorial + // Get the url to redirect for login to facebook // and request permission to write on the user's wall. $login_url = $facebook->getLoginUrl( diff --git a/code/web/app/app_achievements_admin/index.php b/code/web/app/app_achievements_admin/index.php index 802f76d24..50da9cefc 100644 --- a/code/web/app/app_achievements_admin/index.php +++ b/code/web/app/app_achievements_admin/index.php @@ -74,7 +74,7 @@ require_once("class/CSRAtom_class.php"); $DBc = ryDB::getInstance("app_achievements_test"); -function mkn($x) { +function mkn($x) { // make NULL function for SQL global $DBc; if($x == null || strtolower($x) == "null" || $x == "") { return "NULL"; @@ -87,7 +87,7 @@ function mkn($x) { $c = "