Skip to main content
Recent Posts
3
General ElkArte discussions / Re: Email on bithday
Last post by Steeley -
Supposedly there was a bug-fix in v 1.04 about 10 years ago to make that work properly..

No idea if that capability survived through the email protocol and version updates since then..
I don't gather birthday info from my users (I don't even see where I can with my existing configuration - 
I may have removed that configuration option), so I can't configure emailing it.  :thinking: 
5
General ElkArte discussions / Re: Embedding self hosted videos
Last post by Hectraph -
Elk’s default setup handling video attachments as downloads can be a bit limiting if you’re looking for true embedded playback. Using a third-party embedding add-on might be the easiest solution, especially if you want seamless inline video playback. If @Spuds’ gallery adaptation supports embedded viewing, that could be a solid option too.

If you need to convert videos into a more web-friendly format for embedding, this tool might help: https://www.movavi.com/video-converter/flv-converter.html. Hopefully, a good solution comes up that allows smooth video integration within posts!
6
Support / Re: AI Chatbot
Last post by Steeley -
Hmmm... while the notion sounds admirable, I wonder what your liability would be if your site gives bad advice via a bot? :thinking:
7
Support / Re: AI Chatbot
Last post by Gabriel -
thanks for your reply.

the goal is NOT to let chatbots post junk on the forum of the association of parents in need of legal help, nor other forums.
the goal is to give the LLM a prompt and training by legal experts, psychologists etc. and let it write complaints for people who would have to pay thousands of bucks for lawyers (who often are corrupt or more incapable than LLMs in switzerland).

donotpay com or harvey ai are examples of products developed for the english market only or big enterprises. my idea is to help people who have no money because they have to fight the corrupt system of the state alienating and maltreating children and their parents. in switzerland fathers have basic custodial rights since 2014 only, which is considered a discrimination.

there are thousands of fathers who were destroyed in legal fights. some authorities chose to incriminate the parents without cause and hallucinate accusations without any proof whatsoever to medicate children or place them in homes (which is a profitable business for the contractors).

i know this state system of human and drug trafficking in switzerland very well, because i have fought in courts alone and won a case against this country in 2023 https://hudoc.echr.coe.int/eng?i=001-224555 

i trust LLMs more than human lawyers and judges and so called experts of child protection in switzerland. other sources for my based accusations against switzerland:

- https://www.uek-administrative-versorgungen.ch/research
- https://www.nfp76.ch/en/XNROHSTblDUdThzs/page/findings
- https://www.scientificfreedom.dk/books/ (see "is psychiatry a crime against humanity)
- https://youtu.be/i8m8UzAnBTc (trees of shame)

i get contacted by plenty of parents via facebook, youtube, email etc and i can not read all their files, summarise, publish and write complaints for them. it would be better a bot could help.
9
Support / Re: AI Chatbot
Last post by Gabriel -
thanks for your reply. the AI told me to do this structure in VSCode:

IGEL-Tech_Chatbot1/
├── Controllers/
├── Languages/
├── Templates/
└── css/

then, in IGEL-Tech_Chatbot1/addon.json
Code: [Select]
{
    "id": "igel-tech_chatbot1",
    "version": "1.0",
    "title": "IGEL-Tech Chatbot1",
    "description": "Integriert den IGEL-Tech Chatbot1, der automatisch auf neue Beiträge reagiert.",
    "authors": [
        {
            "name": "Ihr Name",
            "email": "IhreEmail@example.com",
            "url": "https://feed.vereinige.ch"
        }
    ],
    "compatible": "elkarte-1.*",
    "type": "mod",
    "license": "MIT",
    "install": {
        "run_on_load": true
    }
}

IGEL-Tech_Chatbot1/Controllers/ChatbotController.php
Code: [Select]
<?php

namespace ElkArte\Extensions\Chatbot;

use ElkArte\sources\extensions\AbstractController;

class ChatbotController extends AbstractController
{
    public function load()
    {
        // Hooks registrieren
        $this->add_hook('integrate_post_mod', 'onPostMod');
    }

    public function onPostMod($msgOptions, $topic, $posterId, $isNewTopic, $msgTime, $posterName, $posterEmail, $smileysEnabled)
    {
        // Nur auf neue Beiträge reagieren
        if (!$isNewTopic) {
            $message = $msgOptions['body'];
            $response = $this->sendToChatbot($message);
            if ($response) {
                $this->createPost($topic, $response, $this->getChatbotUserId());
            }
        }
    }

    private function sendToChatbot($message)
    {
        $apiKey = get_option('chatbot_api_key');
        $url = 'https://api.openai.com/v1/chat/completions';

        $data = [
            'model' => 'gpt-4',
            'messages' => [
                ['role' => 'user', 'content' => $message]
            ],
        ];

        $ch = curl_init($url);
        curl_setopt($ch, CURLOPT_HTTPHEADER, [
            'Content-Type: application/json',
            'Authorization: Bearer ' . $apiKey,
        ]);
        curl_setopt($ch, CURLOPT_POST, 1);
        curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

        $response = curl_exec($ch);
        if (curl_errno($ch)) {
            error_log('Chatbot API Fehler: ' . curl_error($ch));
            curl_close($ch);
            return false;
        }
        curl_close($ch);

        $responseData = json_decode($response, true);
        return $responseData['choices'][0]['message']['content'] ?? null;
    }

    private function createPost($topicId, $message, $memberId)
    {
        global $smcFunc;

        $insertData = [
            'id_member' => $memberId,
            'id_topic' => $topicId,
            'subject' => 'Antwort vom Chatbot',
            'body' => $message,
            'poster_time' => time(),
        ];

        $smcFunc['db_insert']('insert',
            '{db_prefix}messages',
            ['id_member' => 'int', 'id_topic' => 'int', 'subject' => 'string-65534', 'body' => 'string-65534', 'poster_time' => 'int'],
            [$insertData['id_member'], $insertData['id_topic'], $insertData['subject'], $insertData['body'], $insertData['poster_time']],
            ['id_msg']
        );

        updateLastMessages($topicId, $insertData['poster_time']);
    }

    private function getChatbotUserId()
    {
        return intval(get_option('chatbot_user_id'));
    }
}

IGEL-Tech_Chatbot1/Languages/German.php
Code: [Select]
<?php

$txt['chatbot_plugin_name'] = 'IGEL-Tech Chatbot1';
$txt['chatbot_plugin_desc'] = 'Integriert den IGEL-Tech Chatbot1, der automatisch auf neue Beiträge reagiert.';
$txt['chatbot_api_key'] = 'Chatbot API-Schlüssel';
$txt['chatbot_user_id'] = 'Chatbot Benutzer-ID';
$txt['chatbot_settings'] = 'Chatbot Einstellungen';
$txt['chatbot_save'] = 'Speichern';
$txt['chatbot_invalid_api_key'] = 'Ungültiger API-Schlüssel. Bitte überprüfen Sie Ihre Eingabe.';
$txt['chatbot_invalid_user_id'] = 'Ungültige Benutzer-ID. Bitte überprüfen Sie Ihre Eingabe.';

IGEL-Tech_Chatbot1/Templates/ChatbotSettings.template.php
Code: [Select]
<?php

// Verhindern des direkten Zugriffs auf die Datei
if (!defined('ELKARTE'))
    die('No access...');

function template_chatbot_settings()
{
    global $context, $txt;

    echo '
    <div class="content">
        <form action="' . $context['post_url'] . '" method="post" accept-charset="UTF-8">
            <div class="input-group">
                <label for="chatbot_api_key">' . $txt['chatbot_api_key'] . '</label>
                <input type="text" name="chatbot_api_key" id="chatbot_api_key" value="' . htmlspecialchars(get_option('chatbot_api_key')) . '" required />
            </div>
            <div class="input-group">
                <label for="chatbot_user_id">' . $txt['chatbot_user_id'] . '</label>
                <input type="number" name="chatbot_user_id" id="chatbot_user_id" value="' . intval(get_option('chatbot_user_id')) . '" required />
            </div>
            <input type="submit" name="save" value="' . $txt['chatbot_save'] . '" />
        </form>
    </div>';
}

then zip it and via FTP place it in [my server]feed.vereinige.ch/public_html/packages/

but it did not work, also un-zipped and neither the /addons nor the uploading from my pc in the administrator dashboard.

it would be nice to have a chatbot in a forum, wouldn't it?
10
Support / Re: AI Chatbot
Last post by ahrasis -
You should consult them on how to it in details, as we do not know it, moreover to help you with it. Or you can find and hire a freelance developer to do it for you and your forum.