Page Menu
Home
Code
Search
Configure Global Search
Log In
Files
F15613099
modifier.sector.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
530 B
Referenced Files
None
Subscribers
None
modifier.sector.php
View Options
<?php
declare
(
strict_types
=
1
);
/**
* Smarty plugin
*
* @package Smarty
* @subpackage PluginsModifier
*/
use
Hypership\Geo\Octocube
;
/**
* Smarty sector modifier plugin
*
* Type: modifier<br>
* Name: sector<br>
* Purpose: prints the sector from a location
*/
function
smarty_modifier_sector
(
GeoLocation
$location
)
:
string
{
$xyz
=
explode
(
','
,
substr
(
$location
->
local
,
1
,
-
1
));
$x
=
(
int
)
$xyz
[
0
];
$y
=
(
int
)
$xyz
[
1
];
$z
=
(
int
)
$xyz
[
2
];
return
(
string
)
Octocube
::
getSector
(
$x
,
$y
,
$z
);
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Wed, Nov 25, 20:55 (1 d, 18 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
23710
Default Alt Text
modifier.sector.php (530 B)
Attached To
Mode
rZED Zed
Attached
Detach File
Event Timeline
Log In to Comment