Seite 1 von 1

Extension News Scroll [gelöst]

Verfasst: 09.09.2018 09:46
von chris1278
Hallo habe die extension News Scroll in meinem Forum aktiviert.

Mein Forum phpbb 3.2.2
php 7.2.9

Nach erfolgreicher aktivierung kommt wenn ich den TAB Erweiterungen und dann auf News Scroll (noch nicht übersetzt aber die englischen files in de verzeichnis kopiert) klicke folgende Fehermeldung:
[phpBB Debug] PHP Warning: in file [ROOT]/ext/hifikabin/newsscroll/acp/newsscroll_module.php on line 141: sizeof(): Parameter must be an array or an object that implements Countable
Siehe bild: [ externes Bild ]

Ich hab auch mal etwas erstellt in der Box. Der Fehler scheint lediglich im Adminbereich zu liegen.

Ich bin mal so frei und stelle hier den Quelltext der Besagten Datei rein.

Code: Alles auswählen

<?php
/**
*
* @package phpBB Extension - News Scroll
* @copyright (c) 2015 HiFiKabin
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
*
*/

namespace hifikabin\newsscroll\acp;

class newsscroll_module
{
    /** @var \phpbb\config\config */
    protected $config;

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

    /** @var \phpbb\db\driver\driver_interface */
    protected $db;

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

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

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

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

    /** @var string */
    protected $phpbb_root_path;

    /** @var string */
    protected $php_ext;

    /** @var string */
    public $u_action;

    public function main($id, $mode)
    {
        global $config, $db, $phpbb_log, $request, $template, $user, $phpbb_root_path, $phpEx, $phpbb_container;

        $this->config = $config;
        $this->config_text = $phpbb_container->get('config_text');
        $this->db = $db;
        $this->log = $phpbb_log;
        $this->request = $request;
        $this->template = $template;
        $this->user = $user;
        $this->phpbb_root_path = $phpbb_root_path;
        $this->php_ext = $phpEx;

        // Add the posting lang file needed by BBCodes
        $this->user->add_lang(array('posting'));

        // Add the Newsscroll ACP lang file
        $this->user->add_lang_ext('hifikabin/newsscroll', 'info_acp_newsscroll');

        // Load a template from adm/style for our ACP page
        $this->tpl_name = 'acp_newsscroll_config';

        // Set the page title for our ACP page
        $this->page_title = 'ACP_NEWSSCROLL_CONFIG';

        // Define the name of the form for use as a form key
        $form_name = 'acp_newsscroll_config';
        add_form_key($form_name);

        // Set an empty error string
        $error = '';

        // Include files needed for displaying BBCodes
        if (!function_exists('display_custom_bbcodes'))
        {
            include($this->phpbb_root_path . 'includes/functions_display.' . $this->php_ext);
        }

        // Get all Newsscroll data from the config_text table in the database
        $data = $this->config_text->get_array(array(
            'news_scroll_text',
            'news_scroll_uid',
            'news_scroll_bitfield',
            'news_scroll_options',
            'news_scroll_speed',
        ));

        $submit = $this->request->is_set_post('submit');

        if ($submit)
        {
            if (!check_form_key('acp_newsscroll_config'))
            {
                trigger_error('FORM_INVALID');
            }
            $this->config->set('newsscroll_activated', $this->request->variable('newsscroll_activated', 0));
            $this->config->set('newsscroll_index', $this->request->variable('newsscroll_index', 0));
            $this->config->set('newsscroll_member', $this->request->variable('newsscroll_member', 0));

            // Get new Newsscroll text from the form
            $data['news_scroll_text'] = $this->request->variable('newsscroll_text', '', true);
            $data['news_scroll_speed'] = $this->request->variable('newsscroll_speed', '', true);

            // Prepare Newsscroll text for storage
            generate_text_for_storage(
                $data['news_scroll_text'],
                $data['news_scroll_uid'],
                $data['news_scroll_bitfield'],
                $data['news_scroll_options'],
                !$this->request->variable('disable_bbcode', false),
                !$this->request->variable('disable_magic_url', false),
                !$this->request->variable('disable_smilies', false)
            );

            // Store the Newsscroll settings to the config_table in the database
            $this->config_text->set_array(array(
                'news_scroll_text'          => $data['news_scroll_text'],
                'news_scroll_uid'           => $data['news_scroll_uid'],
                'news_scroll_bitfield'      => $data['news_scroll_bitfield'],
                'news_scroll_options'       => $data['news_scroll_options'],
                'news_scroll_speed'         => $data['news_scroll_speed'],
            ));

            trigger_error($this->user->lang['NEWSSCROLL_CONFIG_SAVED'] . adm_back_link($this->u_action));
        }

            // Get the Newscroll data for the preview
            $news_scroll_text_preview = generate_text_for_display($data['news_scroll_text'], $data['news_scroll_uid'], $data['news_scroll_bitfield'], $data['news_scroll_options']);

            // Prepare the Newsscroll text for editing inside the textbox
            $news_scroll_text_edit = generate_text_for_edit($data['news_scroll_text'], $data['news_scroll_uid'], $data['news_scroll_options']);

            $template->assign_vars(array(
            'NEWSSCROLL_ACTIVATED'      => (!empty($this->config['newsscroll_activated'])) ? true : false,
            'NEWSSCROLL_INDEX'          => (!empty($this->config['newsscroll_index'])) ? true : false,
            'NEWSSCROLL_MEMBER'         => (!empty($this->config['newsscroll_member'])) ? true : false,
z.141-->    'S_ERROR'                   => (sizeof($error)) ? true : false,

            'NEWSSCROLL_TEXT'           => $news_scroll_text_edit['text'],
            'NEWSSCROLL_PREVIEW'        => $news_scroll_text_preview,
            'NEWSSCROLL_SPEED'          => $data['news_scroll_speed'],

            'S_BBCODE_DISABLE_CHECKED'      => !$news_scroll_text_edit['allow_bbcode'],
            'S_SMILIES_DISABLE_CHECKED'     => !$news_scroll_text_edit['allow_smilies'],
            'S_MAGIC_URL_DISABLE_CHECKED'   => !$news_scroll_text_edit['allow_urls'],

            'BBCODE_STATUS'         => $this->user->lang('BBCODE_IS_ON', '<a href="' . append_sid("{$this->phpbb_root_path}faq.{$this->php_ext}", 'mode=bbcode') . '">', '</a>'),
            'SMILIES_STATUS'        => $this->user->lang('SMILIES_ARE_ON'),
            'IMG_STATUS'            => $this->user->lang('IMAGES_ARE_ON'),
            'FLASH_STATUS'          => $this->user->lang('FLASH_IS_ON'),
            'URL_STATUS'            => $this->user->lang('URL_IS_ON'),

            'S_BBCODE_ALLOWED'      => true,
            'S_SMILIES_ALLOWED'     => true,
            'S_BBCODE_IMG'          => true,
            'S_BBCODE_FLASH'        => true,
            'S_LINKS_ALLOWED'       => true,
            'U_ACTION'              => $this->u_action,
        ));

        // Build custom bbcodes array
        display_custom_bbcodes();
    }
}
z
Ich habe dir besagte Zeile mal markiert.

Es handelt sich um folgende Zeile:
'S_ERROR' => (sizeof($error)) ? true : false,
Ich vermute mal das dort ein Fehler im Array aufbau oder so vorliegt. evtl. könnte jemand die Zeile php 7.2 komform machen.

Re: Extension News Scroll

Verfasst: 09.09.2018 10:25
von Kirk
Hallo
Hier hatte jemand das gleiche Problem: https://www.phpbb.com/customise/db/exte ... pic/191226

Re: Extension News Scroll

Verfasst: 09.09.2018 10:25
von Joyce&Luna
Hallo

Schau mal bitte hier https://www.phpbb.com/customise/db/exte ... pic/191226
Es gibt zu jeder Extension einen Support, sie den Reiter oben in der Extension.
Oft sind solche Probleme bekannt.

Edit: Kirk war schneller :D

Re: Extension News Scroll

Verfasst: 09.09.2018 10:46
von chris1278
Alles klar problem gelöst. Von dort die geänderte Datei runtergeladen.

Von dort folgende Datei gedownloadet:

newsscroll_module.zip

Dort befindet sich eine Daeti namens newsscroll_module.php.

Diese in das Verzeichniss:

root/ext/hifikabin/newsscroll/acp

kopieren.
Die vorhandene Datei überschrieben.

Danach Foren und Browser Cache löschen.


So nur zur Info für die die evtl. auch das Problem bekommen.

Und herzlichen Dank!
:grin: :grin: :grin: :grin: :grin: :grin:

Re: Extension News Scroll [gelöst]

Verfasst: 10.09.2018 01:53
von franki
Und hier die deutsche Übersetzung:

Code: Alles auswählen

<?php
/**
*
* @package phpBB Extension - News Scroll
* @copyright (c) 2015 HiFiKabin
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
*
*/


/**
* DO NOT CHANGE
*/
if (!defined('IN_PHPBB'))
{
	exit;
}

if (empty($lang) || !is_array($lang))
{
	$lang = array();
}

// DEVELOPERS PLEASE NOTE
//
// All language files should use UTF-8 as their encoding and the files must not contain a BOM.
//
// Placeholders can now contain order information, e.g. instead of
// 'Page %s of %s' you can (and should) write 'Page %1$s of %2$s', this allows
// translators to re-order the output of data while ensuring it remains correct
//
// You do not need this where single placeholders are used, e.g. 'Message %d' is fine
// equally where a string contains only two placeholders which are used to wrap text
// in a url you again do not need to specify an order e.g., 'Click %sHERE%s' is fine
//
// Some characters you may want to copy&paste:
// ’ » “ ” …
//

$lang = array_merge($lang, array(

	'ACP_NEWSSCROLL'					=> 'Laufband Text',
	'ACP_NEWSSCROLL_CONFIG'				=> 'Laufband Text verwalten',
	'ACP_NEWSSCROLL_CONFIG_EXPLAIN'		=> 'Laufband Text Einstellungen',
	'ACP_NEWSSCROLL_CONFIG_SET'			=> 'Einstellungen',
	'NEWSSCROLL_CONFIG_SAVED'			=> 'Laufband Text Einstellungen gespeichert',

	'NEWSSCROLL_ACTIVATED'				=> 'Laufband Text aktivieren',
	'NEWSSCROLL_INDEX'					=> 'Nur in der Forenübersicht anzeigen',
	'NEWSSCROLL_MEMBER'					=> 'Nur für registrierte Benutzer sichtbar',
	'NEWSSCROLL_SPEED'					=> 'Laufband Geschwindigkeit',
	'NEWSSCROLL_SPEED_EXPLAIN'			=> 'Zeit für einen Durchlauf in Sekunden. Der Standardwert ist 10.',

	'NEWSSCROLL_TEXT'					=> 'Laufband Text',
	'NEWSSCROLL_TEXT_EXPLAIN'			=> 'Gib hier den Text ein, der durchlaufen soll.',

	'NEWSSCROLL_PREVIEW'				=> 'Laufband Text Vorschau',
	'NEWSSCROLL_PREVIEW_EXPLAIN'		=> 'In der Vorschau kann man das Laufband anzeigen, ohne es im Forum aktiviert zu haben.',

));

Re: Extension News Scroll [gelöst]

Verfasst: 10.09.2018 01:57
von chris1278
Danke dafür. evtl. hilft es jemand der die noch nichjt hat. ich hab das dann freihändig übersetzt. Das ist im Grunde janicht schwer.

Re: Extension News Scroll [gelöst]

Verfasst: 10.09.2018 05:51
von Kirk
Bei den Contribution Details dieser Extensionen ist auch ein Link zu den Additional Language Pack vorhanden, dort gibt es ein der Sprachpaket. :wink:

Re: Extension News Scroll [gelöst]

Verfasst: 10.09.2018 15:16
von franki
Hay @Kirk

Die Übersetzung ist von dort :wink: