Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Poduptime
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
2
Issues
2
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
diasporg
Poduptime
Commits
af3fa032
Commit
af3fa032
authored
Jan 12, 2017
by
noplanman
Committed by
GitHub
Jan 12, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #64 from diasporg/whoisfix
fix using the whois column for random location data
parents
426122d5
af3906c3
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
14 deletions
+12
-14
db/api-more.php
db/api-more.php
+3
-1
db/pull.php
db/pull.php
+5
-9
show.php
show.php
+2
-2
showfull.php
showfull.php
+2
-2
No files found.
db/api-more.php
View file @
af3fa032
...
...
@@ -27,7 +27,9 @@ while ($row = pg_fetch_array($result)) {
echo
'Months Monitored: '
.
$row
[
'monthsmonitored'
]
.
'<br>'
;
echo
'Response Time: '
.
$row
[
'responsetimelast7'
]
.
'<br>'
;
echo
'User Rating: '
.
$row
[
'userrating'
]
.
'<br>'
;
echo
'Server Location: '
.
$row
[
'country'
]
.
'<br>'
;
echo
'Server Country: '
.
$row
[
'country'
]
.
'<br>'
;
echo
'Server State: '
.
$row
[
'state'
]
.
'<br>'
;
echo
'Server City: '
.
$row
[
'city'
]
.
'<br>'
;
echo
'Latitude: '
.
$row
[
'lat'
]
.
'<br>'
;
echo
'Longitude: '
.
$row
[
'long'
]
.
'<br>'
;
}
...
...
db/pull.php
View file @
af3fa032
...
...
@@ -240,15 +240,11 @@ while ($row = pg_fetch_all($result)) {
echo
'<br>'
;
}
if
(
$location
)
{
$ipdata
=
'Country: '
.
$location
[
'country_name'
]
.
"
\n
"
;
$whois
=
'Country: '
.
$location
[
'country_name'
]
.
"
\n
Lat:"
.
$location
[
'latitude'
]
.
' Long:'
.
$location
[
'longitude'
];
$country
=
$location
[
'country_code'
];
$city
=
isset
(
$location
->
city
)
?
iconv
(
'UTF-8'
,
'UTF-8//IGNORE'
,
$location
->
city
)
:
null
;
$state
=
''
;
$months
=
0
;
$uptime
=
0
;
$lat
=
$location
[
'latitude'
];
$long
=
$location
[
'longitude'
];
$country
=
isset
(
$location
[
'country_code'
])
?
iconv
(
'UTF-8'
,
'UTF-8//IGNORE'
,
$location
[
'country_code'
])
:
null
;
$city
=
isset
(
$location
[
'city'
])
?
iconv
(
'UTF-8'
,
'UTF-8//IGNORE'
,
$location
[
'city'
])
:
null
;
$state
=
isset
(
$location
[
'region'
])
?
iconv
(
'UTF-8'
,
'UTF-8//IGNORE'
,
$location
[
'region'
])
:
null
;
$lat
=
isset
(
$location
[
'latitude'
])
?
$location
[
'latitude'
]
:
null
;
$long
=
isset
(
$location
[
'longitude'
])
?
$location
[
'longitude'
]
:
null
;
//if lat and long are just a generic country with no detail lets make some tail up or openmap just stacks them all on top another
if
(
strlen
(
$lat
)
<
4
)
{
$lat
=
$lat
+
(
rand
(
1
,
15
)
/
10
);
...
...
show.php
View file @
af3fa032
...
...
@@ -56,9 +56,9 @@ $numrows = pg_num_rows($result);
echo
'<td>'
.
$row
[
'uptimelast7'
]
.
'%</td>'
;
echo
'<td data-toggle="tooltip" data-placement="bottom" title="active six months: '
.
$row
[
'active_users_halfyear'
]
.
', active one month: '
.
$row
[
'active_users_monthly'
]
.
'">'
.
$row
[
'active_users_halfyear'
]
.
'</td>'
;
if
(
$country_code
===
$row
[
'country'
])
{
echo
'<td class="text-success" data-toggle="tooltip" data-placement="bottom" title="
'
.
$row
[
'whois'
]
.
'"><b>'
.
$row
[
'country'
]
.
'</b></td>'
;
echo
'<td class="text-success" data-toggle="tooltip" data-placement="bottom" title="
City: '
.
(
$row
[
'city'
]
??
'n/a'
)
.
' State: '
.
(
$row
[
'state'
]
??
'n/a'
)
.
'"><b>'
.
$row
[
'country'
]
.
'</b></td>'
;
}
else
{
echo
'<td data-toggle="tooltip" data-placement="bottom" title="
'
.
$row
[
'whois'
]
.
'">'
.
$row
[
'country'
]
.
'</td>'
;
echo
'<td data-toggle="tooltip" data-placement="bottom" title="
City: '
.
(
$row
[
'city'
]
??
'n/a'
)
.
' State: '
.
(
$row
[
'state'
]
??
'n/a'
)
.
'">'
.
$row
[
'country'
]
.
'</td>'
;
}
echo
'<td>'
;
$row
[
'service_facebook'
]
===
't'
&&
print
'<div class="smlogo smlogo-facebook" title="Publish to Facebook" alt="Publish to Facebook"></div>'
;
...
...
showfull.php
View file @
af3fa032
...
...
@@ -96,9 +96,9 @@ $numrows = pg_num_rows($result);
echo
'</a></td>'
;
echo
'<td>'
.
$row
[
'score'
]
.
'/100</td>'
;
if
(
$country_code
===
$row
[
'country'
])
{
echo
'<td class="text-success" data-toggle="tooltip" data-placement="bottom" title="
'
.
$row
[
'whois'
]
.
'"><b>'
.
$row
[
'country'
]
.
'</b></td>'
;
echo
'<td class="text-success" data-toggle="tooltip" data-placement="bottom" title="
City: '
.
(
$row
[
'city'
]
??
'n/a'
)
.
' State: '
.
(
$row
[
'state'
]
??
'n/a'
)
.
'"><b>'
.
$row
[
'country'
]
.
'</b></td>'
;
}
else
{
echo
'<td data-toggle="tooltip" data-placement="bottom" title="
'
.
$row
[
'whois'
]
.
'">'
.
$row
[
'country'
]
.
'</td>'
;
echo
'<td data-toggle="tooltip" data-placement="bottom" title="
City: '
.
(
$row
[
'city'
]
??
'n/a'
)
.
' State: '
.
(
$row
[
'state'
]
??
'n/a'
)
.
'">'
.
$row
[
'country'
]
.
'</td>'
;
}
echo
'<td>'
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment