[SOLVED] Externes Modul - will so gar nicht

Aktuelle Version: 2.1.0
Veröffentlicht: 26.10.2015
Forum rules
Vor dem erstellen neuer Supportanfragen bitte zuerst in die board3 Portal FAQ schauen und die Suche benutzen!
Viele Fragen sind bereits schon gestellt und beantwortet worden.
Bitte auch unsere Forumsregeln lesen und beachten!
Locked

Topic author
luath
Active Member
Posts: 7
Joined: 19. April 2015 20:02

[SOLVED] Externes Modul - will so gar nicht

Post by luath »

Your Portal Version: 2.1.0-RC2x
Your phpBB Type: Standard phpBB3
MODs installed: Yes
Your knowledge: php-Beginner

PHP Version: 5.1.73
MySQL Version: 14.14
Plattform: centOS 6.6

What have you done before the problem was there?
Frische Installation - nur phpBB 3.1.3 und board3 Portal.

What have you already tryed to solve the problem?
Google, google, google, experiment. ;-)

Description and Message
Ich hatte damit mit -RC1 angefangen, mit -RC2 weiterversucht, am language-Array gescheitert und habe aktuell ein zip vom Entwicklungsbranch installiert, welches behauptet, 2.1.0-RC3 zu sein; insofern ist das Folgende möglicherweise nicht ganz so ernst zu nehmen.

Das Ziel ist ein externes Modul für Board3 Portal, das Einblick in den lokalen Teamspeak3-Server gewährt (ohne die gängigen und gesprächigen Javascriptlösungen zu verwenden). Ich habe mich zuletzt am Guide von github abgearbeitet, aber so richtig wills nicht laufen.
  • Die Darstellung im ACP ist kaputt; die fünf eigenen Parameter werden unterhalb des hellen Datenfelds dargestellt (bei den internen Modulen sind diese Daten auch innerhalb dieser Box).
  • Ich mache offenbar noch etwas grundsätzliches falsch; die Defaults werden nicht angezeigt (und auch nicht in die phpbb_config-Tabelle geschrieben).
Jeglicher Code, der sich mit der eigentlichen Sache (Teamspeak) beschäftigt, ist noch gar nicht aktiv. Insofern würde mich nur interessieren, ob die externen Module in der aktuellen Vorreleasephase schon funktionieren sollten (und ich grob etwas falsch mache).

Viele Grüße
Luath

Edit: Formatkorrektur, das Template-Dings ist zu kompliziert für mich...; 2015-04-30 SOLVED
Last edited by luath on 30. April 2015 07:31, edited 2 times in total.

Topic author
luath
Active Member
Posts: 7
Joined: 19. April 2015 20:02

Re: Externes Modul - will so gar nicht

Post by luath »

luath wrote: PHP Version: 5.1.73
MySQL Version: 14.14
Plattform: centOS 6.6
Natürlich Unfug. Richtig ist:

PHP Version: 5.3.3
MySQL Version: 5.1.73
Plattform: centOS 6.6

Aber das habt ihr euch sicher schon gedacht... :-)
User avatar

Kirk
Dev
Posts: 1937
Joined: 27. July 2010 18:02
phpBB.de User: Kirk
Contact:

Re: Externes Modul - will so gar nicht

Post by Kirk »

Hallo
Ohne das man sich dein Modul selbst anschauen kann, ist es sehr schwierig dir zu helfen.
Gruß Udo

Topic author
luath
Active Member
Posts: 7
Joined: 19. April 2015 20:02

Re: Externes Modul - will so gar nicht

Post by luath »

Hej Kirk -
na da kann ich freilich aushelfen.

du -a luath|egrep -v ts3_php_framework_1.1.23/

Code: Select all

4       luath/ts3fju/composer.json
4       luath/ts3fju/config/services.yml
8       luath/ts3fju/config
12824   luath/ts3fju/ts3_php_framework_1.1.23
4       luath/ts3fju/language/en/ts3fju.php
8       luath/ts3fju/language/en
4       luath/ts3fju/language/de/ts3fju.php
8       luath/ts3fju/language/de
20      luath/ts3fju/language
20      luath/ts3fju/LICENSE
4       luath/ts3fju/styles/all/template/ts3fju_side.html
8       luath/ts3fju/styles/all/template
12      luath/ts3fju/styles/all
16      luath/ts3fju/styles
4       luath/ts3fju/view.php
12900   luath/ts3fju
12904   luath
view.php

Code: Select all

<?php
/**
*
* @package Board3 Portal Teamspeak3 Viewer Module
* @copyright (c) ...
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
*
*/
namespace luath\ts3fju;

/**
* @package Board3 Portal Teamspeak3 Viewer Module
*/
class view extends \board3\portal\modules\module_base
{
    /**
    * Allowed columns: Just sum up your options (Exp: left + right = 10)
    * top       1
    * left      2
    * center    4
    * right     8
    * bottom    16
    */

    public $columns = 10;

    public $name = 'TS3FJU';

    public $image_src = '';

    public $language = array(
            'vendor'    => 'luath/ts3fju',
            'file'      => 'ts3fju',
        );

    /** @var \phpbb\config\config */
    protected $config;

    /** @var \phpbb\template */
    protected $template;

    /**
    * Construct a default module object
    *
    * @param \phpbb\config\config $config phpBB config
    * @param \phpbb\template $template phpBB template
    */
    public function __construct($config, $template)
    {
        $this->config = $config;
        $this->template = $template;
    }

    /**
    * {@inheritdoc}
    */
    public function get_template_side($module_id)
    {
        return '@luath_ts3fju/ts3fju_side.html';
    }

    /**
    * {@inheritdoc}
    */
    public function get_template_acp($module_id)
    {
        return array(
            'title' => 'TS3FJU',
            'legend1' => 'WHATEVER',
            'vars'  => array(
                'luath_ts3fju_hostname_'    . $module_id => array(
                    'lang'      => 'LUATH_TS3FJU_HOSTNAME',
                    'validate'  => 'string',
                    'type'      => 'text:30:100',
                    'explain'   => false),
                'luath_ts3fju_port_'        . $module_id => array(
                    'lang'      => 'LUATH_TS3FJU_PORT',
                    'validate'  => 'int',
                    'type'      => 'text:5:5',
                    'explain'   => false),
                'luath_ts3fju_server_'      . $module_id => array(
                    'lang'      => 'LUATH_TS3FJU_SERVER',
                    'validate'  => 'int',
                    'type'      => 'text:2:2',
                    'explain'   => false),
                'luath_ts3fju_login_'       . $module_id => array(
                    'lang'      => 'LUATH_TS3FJU_LOGIN',
                    'validate'  => 'string',
              'luath_ts3fju_password_'    . $module_id => array(
                    'lang'      => 'LUATH_TS3FJU_PASSWORD',
                    'validate'  => 'string',
                    'type'      => 'text:8:64',
                    'explain'   => false),
            ),
        );
    }

    /**
    * {@inheritdoc}
    */
    public function install($module_id)
    {
        $this->config->set('luath_ts3fju_hostname_'     . $module_id, 'localhost');
        $this->config->set('luath_ts3fju_port_'         . $module_id, 10011);
        $this->config->set('luath_ts3fju_server_'       . $module_id, 1);
        $this->config->set('luath_ts3fju_login_'        . $module_id, 'user');
        $this->config->set('luath_ts3fju_password_'     . $module_id, 'pass');
        return true;
    }

    /**
    * {@inheritdoc}
    */
    public function uninstall($module_id, $db)
    {
        $this->config->delete('luath_ts3fju_hostname_'  . $module_id);
        $this->config->delete('luath_ts3fju_port_'      . $module_id);
        $this->config->delete('luath_ts3fju_login_'     . $module_id);
        $this->config->delete('luath_ts3fju_server_'    . $module_id);
        $this->config->delete('luath_ts3fju_password_'  . $module_id);
        return true;
    }

}

?>
services.yml

Code: Select all

services:
    luath.ts3fju.view:
        class: luath\ts3fju\view
        arguments:
            - @config
            - @template
        tags:
            - { name: board3.portal.module }
Das Template ist ene Standardbox ohne Funktion. Wieso genau sich das Modul überhaupt hat aktivieren lassen, entzieht sich aktuell meiner Kenntnis. Deaktiveren lässt es sich nicht, ohne den Code zu verschieben (Ajax schiebt einen "Service unavailable" vor, Freund Firebug meint, "Language file ./../ext/board3/portal/language/de/modules/Array.php couldn't be opened .").

Edited: code=php
Last edited by luath on 23. April 2015 09:26, edited 1 time in total.
User avatar

Kirk
Dev
Posts: 1937
Joined: 27. July 2010 18:02
phpBB.de User: Kirk
Contact:

Re: Externes Modul - will so gar nicht

Post by Kirk »

Was mir aber auffällt du hast in der view.php u.a. das hier drin stehen:

Code: Select all

    public $language = array(
            'vendor'    => 'luath/ts3fju',
            'file'      => 'ts3fju',
        ); 
Hast du diese language Datei auch mit in deinem Modul drin?

Dann das hier:

Code: Select all

    public function get_template_side($module_id)
    {
        return '@luath_ts3fju/ts3fju_side.html';
    } 
Da musst reinsetzen was du ausgeben willst und dies natürlich in die template Datei eintragen.
Mehr kann ich dir leider nicht helfen weil ich mich mit Teamspeak noch nie befasst habe.
Gruß Udo

Topic author
luath
Active Member
Posts: 7
Joined: 19. April 2015 20:02

Re: Externes Modul - will so gar nicht

Post by luath »

Kuckuck -

im Dateilisting oben sind die beiden vorhandenen Sprachdateien aufgeführt (luath/ts3fju/language/(de|en)/ts3fju.php), die sind - beide - da. Im acp werden diese in der Portalmodulkonfiguration auch sichtbar ausgewertet.

Dass das Template noch nix ist außer das Template ist klar - das bleibt auch so, bis ich das Parametrisieren eines externen Portalmoduls richtig hinbekomme. 1000 Baustellen auf einmal überschreitet meine Kompetenz. Deutlich. :)


Viele Grüße
Luath
User avatar

Marc
Dev
Posts: 2504
Joined: 17. July 2008 21:08
phpBB.de User: marc1706
phpBB.com User: Marc
Location: Clausthal-Zellerfeld / München
Contact:

Re: Externes Modul - will so gar nicht

Post by Marc »

Ich versuche mir das nachher gleich mal anzusehen. Leider hatte ich bis jetzt jeden Tag mindestens einen 11 Stunden Tag. ;)

edit: Könntest du mir dein Paket (also das komplette Modul) zum testen bereitstellen? Gerne auch per PN.

Tecwar
Active Member
Posts: 1
Joined: 25. April 2015 21:08
phpBB.de User: Tecwar
phpBB.com User: Tecwar

Re: Externes Modul - will so gar nicht

Post by Tecwar »

hi,

hatte ein modul fürs TS fertig.

wollte aber damit warten, bis die neu portal-version (RC3) raus ist.
mein modul basiert auf die erweiterung teamspeak-viewer_ext
vorschau

http://area51.gdrr.info/page/viewtopic.php?f=7&t=33

Mfg Tecwar

Topic author
luath
Active Member
Posts: 7
Joined: 19. April 2015 20:02

Re: Externes Modul - will so gar nicht

Post by luath »

Schick - hätte mir denken können, dass irgendwer den Berg schon hochgelaufen ist.

Und wenn das mit der Extensions-Extension und den Sprachpaketen bei Dir hinhaut, ist ziemlich offensichtlich, dass ich mich irgendwo verhauen habe. Um so mehr interessiert es mich, woran's liegt. Gibt ja noch mehr schicke Ideen für externe Module, und ich finde es stark, dass sich die Extension board3.portal ohne Probleme und ohne in den portal-source eingreifen zu müssen erweitern lässt.*

*erweitern lassen müsste. Grrrrrr.
User avatar

Marc
Dev
Posts: 2504
Joined: 17. July 2008 21:08
phpBB.de User: marc1706
phpBB.com User: Marc
Location: Clausthal-Zellerfeld / München
Contact:

Re: Externes Modul - will so gar nicht

Post by Marc »

Das Problem mit der Darstellung im Admin-Bereich ergibt sich daraus, dass du den legend Eintrag falsch gesetzt hast. So wäre das richtig:

Code: Select all

        return array(
            'title'    => 'TS3FJU',
            'vars'    => array(
                'legend1' => 'WHATEVER',
                'luath_ts3fju_hostname_'     . $module_id => array(
                    'lang'         => 'LUATH_TS3FJU_HOSTNAME',
                    'validate'     => 'string', 
                    'type'         => 'text:30:100',
                    'explain'     => false),
                'luath_ts3fju_port_'         . $module_id => array(
                    'lang'         => 'LUATH_TS3FJU_PORT',
                    'validate'     => 'int', 
                    'type'         => 'text:5:5',
                    'explain'     => false),
                'luath_ts3fju_server_'         . $module_id => array(
                    'lang'         => 'LUATH_TS3FJU_SERVER',
                    'validate'     => 'int', 
                    'type'         => 'text:2:2',
                    'explain'     => false),
                'luath_ts3fju_login_'         . $module_id => array(
                    'lang'         => 'LUATH_TS3FJU_LOGIN',
                    'validate'     => 'string', 
                    'type'         => 'text:30:50',
                    'explain'     => false),
                'luath_ts3fju_password_'     . $module_id => array(
                    'lang'         => 'LUATH_TS3FJU_PASSWORD',
                    'validate'     => 'string', 
                    'type'         => 'text:8:64',
                    'explain'     => false),
            ),
        ); 
Nach dem installieren der Extension im Admin-Bereich werden mir auch ohne Probleme die Standardeinstellungen angezeigt.

edit: Der Bug mit dem Löschen ist auch schon bekannt und dürfte demnächst behoben sein: https://github.com/board3/Board3-Portal/issues/528

Topic author
luath
Active Member
Posts: 7
Joined: 19. April 2015 20:02

Re: Externes Modul - will so gar nicht

Post by luath »

Marc wrote:Das Problem mit der Darstellung im Admin-Bereich ergibt sich daraus, dass du den legend Eintrag falsch gesetzt hast. [...]
Uh, stimmt auffällig. Kaum macht man's richtig - gehts. :roll:
Danke für den Hinweis.

Topic author
luath
Active Member
Posts: 7
Joined: 19. April 2015 20:02

Re: Externes Modul - will so gar nicht

Post by luath »

Tecwar wrote:hatte ein modul fürs TS fertig. [...]
http://area51.gdrr.info/page/viewtopic.php?f=7&t=33
Gefällt mir ausgesprochen gut. Könnte mir als Modul fürs Portal sowohl einen Mini-Viewer vorstellen als auch eine Zusammenfassung mit Connect-Knopf.

Ich bin damit jetzt schon glücklich und widme meine Portal-Zeit den Dingen, die wahrscheinlich eher spezielle Nischenprodukte sind (wowprogress, eqdkp...).

Nochmals Danke für die Hinweise - so weit klappt erstmal alles. :-)

[SOLVED]
Locked

Return to “Board3 Portal 2.1.x - Deutscher Support”