Page Menu
Home
Code
Search
Configure Global Search
Log In
Files
F4168092
modifier.sector.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
530 B
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
Thu, Dec 4, 00:30 (1 d, 14 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
23710
Default Alt Text
modifier.sector.php (530 B)
Attached To
rZED Zed
Event Timeline
Log In to Comment