xgit simple git

nexus

nexus

clone git clone https://kb.hax.al/nexus

addons/example-hello-world/main.php


1<?php
2/**
3 * Hello World โ€” Example addon
4 * Appends a small note below every post footer. Demonstrates the hook system.
5 */
6if (!defined('NEXUS')) exit('Forbidden');
7 
8addon_on('render_post_footer', function (array $post): string {
9    // Return empty string to add nothing, or HTML to append below the post
10    return ''; // Disabled by default โ€” remove the return to activate
11    return '<div style="font-size:11px;color:#94a3b8;margin-top:8px;padding-top:6px;'
12         . 'border-top:1px solid var(--border)">Hello World addon is active โœ“</div>';
13}, 999);
14 
15addon_on('after_topic_created', function (array $data): void {
16    // $data: topic_id, title, slug, category_id, user_id
17    // Example: error_log("New topic created: " . $data['title']);
18});