Fixed bad commit that was sending wrong day value to PHP for upcoming events.

Fixed dir_events_query in PHP file: always get current time in UTC, simplified
timezone handling, and include in-progress events when passed "u" for day number.
Updated pre-built OpenSimSearch.dll file.
This commit is contained in:
Kevin Cozens
2016-01-13 15:10:52 -05:00
parent e4864fceea
commit d81faa31dc
3 changed files with 8 additions and 6 deletions
@@ -658,9 +658,10 @@ namespace OpenSimSearch.Modules.OpenSearch
//The flags are: SortAsc (1 << 15), PerMeterSort (1 << 17)
maturity |= 163840;
//When character before | is a u get upcoming/in-progress events
//Character before | is number of days before/after current date
//Characters after | is the number for a category
ReqHash["text"] = "0|0";
ReqHash["text"] = "u|0";
ReqHash["flags"] = maturity.ToString();
ReqHash["query_start"] = "0";
@@ -689,6 +690,7 @@ namespace OpenSimSearch.Modules.OpenSearch
mapItemReply mapitem = new mapItemReply();
//Events use a comma separator in the landing point
landingpoint = d["landing_point"].ToString().Split(',');
mapitem.x = Convert.ToUInt32(landingpoint[0]);
mapitem.y = Convert.ToUInt32(landingpoint[1]);
Binary file not shown.
+5 -5
View File
@@ -319,9 +319,8 @@ function dir_events_query($method_name, $params, $app_data)
$terms = array();
//The date and time for events are in UTC
$time_info = gettimeofday();
$now = $time_info['sec'];
//Event times are in UTC so we need to get the current time in UTC.
$now = time();
if ($day == "u") //Searching for current or ongoing events?
{
@@ -331,7 +330,8 @@ function dir_events_query($method_name, $params, $app_data)
else
{
//For events in a given day we need to determine the days start time
$now -= ($now % 86400);
$now -= idate("Z"); //Adjust for timezone
$now -= ($now % 86400); //Adjust to start of day
//Is $day a number of days before or after current date?
if ($day != 0)
@@ -505,7 +505,7 @@ function event_info_query($method_name, $params, $app_data)
$data = array();
while (($row = mysql_fetch_assoc($result)))
{
$date = strftime("%G-%m-%d %H:%M:%S",$row["dateUTC"]);
$date = strftime("%G-%m-%d %H:%M:%S", $row["dateUTC"]);
$category = "*Unspecified*";
if ($row['category'] == 18) $category = "Discussion";