Discuss! Today in the history of the plugin Xiao Yi
Today in the History of Little Ant is a game for Discuz! The forum's content-based plugin brings "Today in History" to the site: it automatically aggregates historical events, birthdays, and deaths that occurred on that day each day. It has both a standalone display page and can be embedded in any page in the form of forum homepage widgets and front-end DIY modules.
I. Plugin Introduction
Today in the History of Little Ant is a game for Discuz! The forum's content-based plugin brings "Today in History" to the site: it automatically aggregates historical events, birthdays, and deaths that occurred on that day each day. It has both a standalone display page and can be embedded in any page in the form of forum homepage widgets and front-end DIY modules.
The plugin includes four free data sources: Baidu Encyclopedia official, Tmini, guest API, and interface box. Website owners can select the main interface in the backend and use the drop-down box to schedule the order of backup interfaces. When the main interface fails, it will automatically switch in sequence. If it fails continuously, it will automatically trip the circuit breaker. If all failures occur, the most recent cache will continue to be displayed, and the page will never be blank.
The data is locally cached: Baidu Encyclopedia sources are pulled for a whole month at a time, while other sources are pulled daily. All sources are placed in the plugin's `cache/` directory, which does not cause interface frequency limits or add additional burden to the server.
Plugin demo:https://fjxiaoyidzx50.fqlook.cn/plugin.php?id=fjxiaoyi_today:index
II. Plugin Features
1. Four data sources + automatic disaster recovery
Baidu Encyclopedia Official (Keyless, includes title/year/description/link/holiday/image, supports monthly retrieval)\Tmini (Keyless by default, exclusive ckey optional)\Guest API (Keyless)\Interface Box (Requires registration ID + KEY, uses public test ID as a backup if not applied for)
The failure judgment covers HTTP non-200, business code exception, JSON parsing failure, null event, and frequency limiting/authentication error; Automatically test and recover after 3 consecutive failed fuses for 30 minutes.
2. All interface addresses can be changed. The call URLs of all four data sources can be edited directly in the background, and it supports one-click restoration of the built-in default addresses. If the official interface address changes, the website owner can change the configuration without modifying the code.
3. View by date (calendar): The monthly calendar for the current month is provided at the top of the independent page. Click on any date to switch to view it (`?m=&d=` ); The selected date is highlighted, and "Back to Today" is provided when it is not today. Baidu Encyclopedia Source is a monthly interface. There are no new requests for switching any date within the same month, and it is only pulled once each month.
4. Two sets of built-in templates, one-click skin replacement: "Warm Gold Classic" and "Azure Starry Sea". One-click switching in the background, each with a set of category icons (35×35px) and a built-in banner background image; Each template allows you to upload custom images (JPG / PNG / WebP, recommended 1600 × 533) to the banners and restore them to their default settings with one click without interfering with each other.
5. The front-end DIY module (drag-and-drop) has been registered in the Discuz front-end DIY module list. Any DIY page such as the portal homepage, channel page, forum homepage, and topic list can be dragged into it. The properties panel is adjustable: display style (compact double-column / single-column card (including introduction) / vertical timeline), number of displayed items (1-50), event type (milestone / birth / death), specified date (leave blank for today, or fill in "month-day" to fix a certain day), whether to display holidays / years / introduction / accompanying images / encyclopedia links / special topic entry, rounded corners, automatic same height as the same frame module, and color scheme (follow the plugin settings or specify a separate template).
The module only reads from the local cache and does not initiate any network requests. It will not slow down the site even when placed on high-frequency pages.
6. The mobile version is fully compatible. Both the standalone page and homepage widgets have built-in mobile templates (`template/touch/`), which are automatically switched by Discuz without additional settings; All backend settings (template color scheme, banner, icons, custom links, encyclopedia switch) take effect simultaneously. The mobile calendar is collapsed by default. After expanding, you can select "Year/Month/Day" to view it. "Back to Today" will appear when the date is not today.
7. Custom Links at the Bottom of the Calendar: The webmaster supports custom links (icon + title + subtitle + link) at the bottom of the calendar on the right side of the independent page. The format is `icon|title|subtitle|link`, one per line; It has three built-in default links: Wikipedia, Baidu Encyclopedia Calendar, and On This Day, which can be restored to the default links with one click. The protocol has filtered `javascript:`/`data:`.
8. Compliance and Security: You can hide the "View Encyclopedia" backlinks on event entries with one click and instead mark the actual data source on the page to avoid excessive backlinks; All output is escaped by `dhtmlspecialchars()`, external requests enable SSL certificate verification, and uninstallation scripts automatically clear cache and runtime upload files.
III. Reasons why the website owner chose this plugin
1. Right out of the box, zero cost: Baidu Encyclopedia's official and customer APIs are completely keyless, ready to use immediately after installation; No application required, no payment required.
2. Data will not be interrupted: With four sources backing up each other + automatic circuit breaker + old cache backup, the page will not go blank even if any interface fails.
3. Server-friendly: All data is cached locally, page rendering is never connected to the internet, there is no risk of interface frequency limitation, and it does not slow down the forum.
4. High-quality content: The only official Baidu Encyclopedia source that provides images of holidays and events serves as the default main source, resulting in a better display effect than plain text sources.
5. Zero barriers to entry: Interface addresses, display switches, template color schemes, and custom links can all be completed with just a click of the mouse in the background, without needing to modify the code.
6. Integrated into the site instead of a plug-in: It can be used as a forum homepage widget or as a DIY module to drag into any position in the portal, channel, or section list, seamlessly integrating with existing pages.
7. Compatible with both PC and mobile devices: Mobile templates automatically switch with Discuz, providing a complete mobile experience.
8. Clean and compliant: No self-built data tables are created, and uninstallation leaves no residue; Backlinks can be hidden and the source can be indicated; Output escape and SSL verification are complete.
9. Wide compatibility: Supports Discuz at the same time! X3.4/X3.5/X5.0/X5.1, UTF-8 Simplified Chinese encoding makes upgrading painless.
1.1.3
The category buttons are adaptive in width, and the narrow screen is automatically displayed in two columns.
1.1.2
Fix Discuz! 3.4 and 3.5 Background settings page error messages, unified configuration of compatibility calls for reading, saving and Logo configuration.
Fixed an issue where WAP titles and subtitles were abnormally newlined due to date squeezing.
Optimize the narrow screen header layout by moving the "Today" tab below the date.
1.1.1 (2026-10-08)
• Fixed a white space issue at the bottom of the foreground DIY module (the built-in lower and outer margins of the module overlap with the DIY panel margins).
- Corrected the value of the Baidu Encyclopedia image field (changed to `pic_share` / `pic_index` / `pic_calendar`), and uniformly changed the image address to HTTPS to avoid mixed content warnings.
- The "Display Event Summary" display is consistent in three formats: compact double-row, single-row card, and vertical timeline.
- Introduced cache version number, and the old cache is automatically invalidated after the plugin is updated.
1.1.0 (2026-10-08)
- Added a front-end DIY module "Today in the History of Ant" (4 new files in the `block/` directory), supporting drag-and-drop addition and properties panel parameter adjustment.
- A new "Show Images" switch has been added in the background, and "Only Baidu Encyclopedia official data sources return images" has been marked in the background and DIY panel.
1.0.8 (2026-10-07)
- Mobile version layout optimization: four category tags have been changed to plain text, category icons have been moved to the left side of the timeline (15×15px), and the "Extended Reading" area has been placed at the bottom.
- The mobile calendar has been changed to a foldable version. When expanded, it provides a drop-down menu for the year, month, and day and a "View" button, and remains expanded with `xyt_cal=1`.
1.0.7 (2026-10-07)
- The mobile version of the template is refactored to the same name as the PC, placed in `template/touch/` (`index.htm`, `widget.htm`), and automatically routed by Discuz.
- Fixed `mobile_template_no_found` caused by mobile template routing errors, and page crashes caused by missing mobile forum homepage widgets.
1.0.6 (2026-10-07)
- Added "Calendar Bottom Link" (Further Reading) customization feature, including three default links and one-click restore default.
- Sidebar changed from scattered sticky to full column uniform sticky, short screen scrollable.
1.0.4 (2026-10-07)
- Added a dual-template system (Warm Gold Classic / Azure Starry Sea), with complete isolation of icons and backgrounds between templates (`bg_theme01` / `bg_theme02`).
1.0.3 (2026-10-07)
- Data source information is moved to the bottom of the page and separated by dashed lines; The inner margins and font size of the calendar grid have been increased to improve crowding.
- Added four category SVG icons, "Year + Type" color scheme in the left column of the timeline, banner background image upload, and "Restore default background".
- Migrate all copywriting into the language pack.
1.0.2 (2026-10-07)
- Added "View Encyclopedia" button switch (`hide_baike`): allows you to hide external links and indicate data sources.
- Added View calendar by date ; Baidu Encyclopedia Source has been changed to be retrieved and cached locally for the entire month.
1.0.1 (2026-10-06)
- The order of alternate data sources has been changed to a drop-down menu (primary source + alternate 1-4), eliminating the need for manual input.
- The backend has been refactored into 6 independent sections, explaining how to apply for a KEY from source to source.
- Four data source interface URLs are editable and support one-click recovery of the built-in default address.
1.0.0 (2026-10-06)
- First standardized release: standardized XML manifest (`Title/Version/Data`), module file changed to `.inc.php`, PC/mobile mount point separation, scheduled tasks moved to `cron/`, homepage widget changed to read-only caching mode.
This plugin has a WYSIWYG backend setting, and the front-end DIY supports module insertion.
