Skip to content
Docs

Developer guide

Other conventions (time zones, IP, gallery)

A collection of core conventions worth knowing when building third-party extensions.

Time zone handling

Zittme manages time zones in two parts.

TypeMeaningSetting
Internal time zoneA fixed time zone used when storing dates in the DB. Set at installation and cannot be changed afterwardlocale.internal_timezone
Display time zoneThe time zone used when showing dates on screen. Admins can change itlocale.default_timezone

Dates are mostly stored as YYYYMMDDHHIISS strings.

Rules for development:

  • Store in the internal time zone: date('YmdHis'), getInternalDateTime()
  • Display in the display time zone: zdate($value, 'Y-m-d'), getDisplayDateTime()
  • If you cut a stored value with substr and show it as is, it will be off on sites in other time zones. Always use zdate() for display.
  • The core calculates daylight saving time automatically. Do not handle it yourself.

Thanks to this structure, stored dates stay correct even when you move servers.

IP addresses and range notation

Places that accept IPs, such as block lists and allow lists, support the following notations.

NotationExample
Single IPv4192.168.122.96
Wildcard192.168.122.*, 192.168.*.*
Range192.168.122.0-192.168.122.255
CIDR192.168.216.0/24
IPv62001:2300::ffff:0, ::1
IPv6 CIDR2001:2300::/64

Use the core filter for validation and matching in code. IPv6 has many notations, so parsing it yourself is risky.

use Zittme\Framework\Filters\IpFilter;

IpFilter::validateRange($range);          // 대역 표기가 올바른가
IpFilter::inRange($ipaddress, $range);    // 이 IP가 대역에 드는가

PhotoSwipe (image gallery)

A feature that shows content images enlarged in a gallery when clicked is built in as an add-on. It works in skins without any extra integration, as long as you follow the markup rules.

  • Images inside a container with the xe_content (or rhymix_content) class automatically become gallery items. By convention, skins add this class to the content output area.
  • To include an image outside the container in the gallery, add the photoswipe-images class (takes priority over exclusion rules).
  • To exclude a specific image from the gallery, add the photoswipe-escape (or rx-escape) class.
  • Images inside links (a), code (pre,code), and form elements are excluded automatically.
<div class="rhymix_content xe_content">{!! $oDocument->getContent(false) !!}</div>

<img class="photoswipe-images" src="poster.jpg" alt="" />   <!-- 본문 밖이지만 갤러리 포함 -->
<img class="photoswipe-escape" src="icon.png" alt="" />     <!-- 갤러리 제외 -->