Quick Language werkt niet met Collapsible Forum Categories

Plaats reactie
Gebruikersavatar

Auteur
bennybernaer
phpBBservice Teamlid
phpBBservice Teamlid
Berichten in topic: 4
Berichten: 887
Lid geworden op: 25 jul 2010 15:41
Naam: Benny
Locatie: Antwerpen
Verstuurde bedankjes: 9 keren
Ontvangen bedankjes: 4 keren
Contacteer:

Quick Language werkt niet met Collapsible Forum Categories

Bericht door bennybernaer » 23 aug 2017 20:06

Uw phpBB versie: 3.2.1

Geïnstalleerde extensies: 34

Forum link: https://www.zelfbeschadiging.be

PHP Versie: 7.2

Heeft u wat verandert waardoor het probleem zich nu voor doet? Prosilver aangepast maar daar heeft het niets mee te maken.

Wat heeft u al geprobeerd om het probleem op de lossen? Nog niets

Uw bericht:
Quick Language werkt niet samen met Callapsible forum categories. Want als ik de callapsible extensie uitschakel dan werkt de Quick language wel. Is er een manier om deze werkend te krijgen in combinatie met de board callapsible?
To reach a star, you gotta have a dream and to have a dream, you gotta have a strength...
To be that strong, you gotta have a will and the will is within your heart...



Vind phpBBservice.nl leuk op Facebook.
| buy me a beer

Gebruikersavatar

Theriddler
phpBBservice Teamlid
phpBBservice Teamlid
Berichten in topic: 2
Berichten: 1189
Lid geworden op: 04 jan 2012 13:44
Locatie: 127.0.0.1
Verstuurde bedankjes: 2 keren
Ontvangen bedankjes: 5 keren
Contacteer:

Re: Quick Language werkt niet met Collapsible Forum Categories

Bericht door Theriddler » 27 aug 2017 08:56

Je kunt in de code kijken van national flags van rmcgirr83 die ondersteuning bied voor collapsible forum categories
sommige code kun je dan gebruiken om de quick language compatible te maken met die andere extensie.
Als ik eens tijd heb zal ik eens kijken.
Met vriendelijke groet,
Afbeelding
phpBBservice.nl
Steeds tot uw dienst.

Afbeelding Support Tools | My Extensions | buy me a beer Afbeelding

Gebruikersavatar

Auteur
bennybernaer
phpBBservice Teamlid
phpBBservice Teamlid
Berichten in topic: 4
Berichten: 887
Lid geworden op: 25 jul 2010 15:41
Naam: Benny
Locatie: Antwerpen
Verstuurde bedankjes: 9 keren
Ontvangen bedankjes: 4 keren
Contacteer:

Re: Quick Language werkt niet met Collapsible Forum Categories

Bericht door bennybernaer » 27 aug 2017 13:47

Bedankt voor de tip Danny!

In quicklanguage.html heb ik onderstaande code gevonden

Code: Selecteer alles

<li class="rightside no-bulletin" >
    <div class=" lang-wrapper">
	    <form id='frmQuickLang' action="{U_QUICK_LANG_ACTION}" method="post" class="lang_form">
                <!-- BEGIN langs -->
                    <div class="lang <!-- IF langs.S_SELECTED_LANG  --> lang_selected<!-- ENDIF -->" title="{langs.LANG_LOCAL_NAME}" data-iso="{langs.LANG_ISO}" style='background:url("{BOARD_URL}/ext/alg/quicklanguage/styles/all/theme/images/flags/{langs.LANG_ISO}.png") no-repeat'></div>
                <!-- END langs -->
                <input type="hidden" name='h_lang' />
	    </form>
    </div>
</li>

En in index_flags. html de volgende

Code: Selecteer alles

<a class="category<!-- IF S_NATIONALFLAGS_HIDDEN --> hidden-category<!-- ENDIF -->" style="display: none; height: 0"></a>
<div class="forabg" id="flags">
	<div class="inner">
	<ul class="topiclist">
		<li class="header">
			<dl class="<!-- IF PHPBB_IS_32 -->row-item<!-- ELSE -->icon<!-- ENDIF -->">
				<dt><!-- IF U_FLAGS --><a href="{U_FLAGS}"><!-- ENDIF -->{L_NATIONAL_FLAGS}<!-- IF U_FLAGS --></a><!-- ENDIF --></dt>
				<dd></dd>
			</dl>
			<!-- IF U_NATIONALFLAGS_COLLAPSE_URL --><a href="{U_NATIONALFLAGS_COLLAPSE_URL}" class="collapse-btn collapse-<!-- IF S_NATIONALFLAGS_HIDDEN -->show<!-- ELSE -->hide<!-- ENDIF -->" data-hidden="{S_NATIONALFLAGS_HIDDEN}" data-ajax="phpbb_collapse" data-overlay="true" title="{L_COLLAPSIBLE_CATEGORIES_TITLE}" style="display: none; line-height: 0;"></a><!-- ENDIF -->
		</li>
	</ul>
	<ul class="forums flags collapsible">
	<!-- BEGIN flag -->
		<li class="flags_bg flagslist">
			<a href="{flag.U_FLAG}">{flag.FLAG}</a><br>{flag.FLAG_USERS}
		</li>
	<!-- END flag -->
	</ul>
	</div>
</div>
Ik heb geprobeerd om wat met die code te spelen zodat het er zo komt uit te zien:

Code: Selecteer alles

<li class="rightside no-bulletin" >
    <div class=" lang-wrapper">
	    <form id='frmQuickLang' action="{U_QUICK_LANG_ACTION}" method="post" class="lang_form">
                <!-- BEGIN langs -->
                    <div class="lang <!-- IF langs.S_SELECTED_LANG  --> lang_selected<!-- ENDIF -->" title="{langs.LANG_LOCAL_NAME}" data-iso="{langs.LANG_ISO}" style='background:url("{BOARD_URL}/ext/alg/quicklanguage/styles/all/theme/images/flags/{langs.LANG_ISO}.png") no-repeat'></div>
                    <!-- END langs -->
					<!-- IF U_COLLAPSIBLE_CATEGORIES_URL --><a href="{COLLAPSIBLE_CATEGORIES_TITLE}" class="collapse-btn collapse-<!-- IF S_COLLAPSIBLE_CATEGORIES_HIDDEN -->show<!-- ELSE -->hide<!-- ENDIF -->" data-ajax="phpbb_collapse" data-overlay="true" title="{L_COLLAPSIBLE_CATEGORIES_TITLE}" style="display: none; line-height: 0;"></a><!-- ENDIF -->
                    	</li>
	               </ul>
			   <input type="hidden" name='h_lang' />
	    </form>
    </div>
</li>
Maar dit werk helemaal niet... Weet ook niet of ik het zo goed doe, en of ik wel in de juiste bestanden zit te zoeken.. :(

Edit:
Ik zie trouwens dat op jou forum ook niet alles vertaald word Danny! Zo blijven (onderwerpen, berichten, laatste bericht en statistieken ongewijzigd). Terwijl de extensie op dit forum wel volledig zijn werk doet
To reach a star, you gotta have a dream and to have a dream, you gotta have a strength...
To be that strong, you gotta have a will and the will is within your heart...



Vind phpBBservice.nl leuk op Facebook.
| buy me a beer

Gebruikersavatar

Theriddler
phpBBservice Teamlid
phpBBservice Teamlid
Berichten in topic: 2
Berichten: 1189
Lid geworden op: 04 jan 2012 13:44
Locatie: 127.0.0.1
Verstuurde bedankjes: 2 keren
Ontvangen bedankjes: 5 keren
Contacteer:

Re: Quick Language werkt niet met Collapsible Forum Categories

Bericht door Theriddler » 28 aug 2017 08:39

begin met het aanpassen van het bestand: service.yml
(zorg ervoor dat er geen tabs in voorkomen alleen met spaties werken)

Code: Selecteer alles

services:
    alg.quicklanguage.listener:
        class: alg\quicklanguage\event\listener
        arguments:
            - @config
            - @dbal.conn
            - @request
            - @template
            - @user
            - %core.root_path%
            - %core.php_ext%
            - '@?phpbb.collapsiblecategories.operator'
        tags:
            - { name: event.listener }
daarna bestand: listener.php

Code: Selecteer alles

public function __construct(\phpbb\config\config $config, \phpbb\db\driver\driver_interface $db, \phpbb\request\request_interface $request, \phpbb\template\template $template, \phpbb\user $user, $root_path, $php_ext, \phpbb\collapsiblecategories\operator\operator $operator = null)
	{
		$this->config = $config;
		$this->db = $db;
		$this->request = $request;
		$this->template = $template;
		$this->user = $user;
		$this->root_path = $root_path;
		$this->php_ext = $php_ext;
		$this->operator = $operator;
Nu kunnen we "$this->operator" gebruiken welke in verbinding staat met de collapisble extentie.

kijk daarna eens vanaf deze lijn waar $operator begint: https://github.com/rmcgirr83/phpBB-3.1- ... s.php#L227

Verder kan ik even niet kijken, heb het ook nog niet getest maar misschien is het al voldoende om de bestanden service.yml en listener.php aan te passen (alleen het stukje wat ik al aangepast heb in bovenstaande voorbeelden). Ik denk niet dat het nodig is om de template bestanden aan te passen.
Met vriendelijke groet,
Afbeelding
phpBBservice.nl
Steeds tot uw dienst.

Afbeelding Support Tools | My Extensions | buy me a beer Afbeelding

Gebruikersavatar

Auteur
bennybernaer
phpBBservice Teamlid
phpBBservice Teamlid
Berichten in topic: 4
Berichten: 887
Lid geworden op: 25 jul 2010 15:41
Naam: Benny
Locatie: Antwerpen
Verstuurde bedankjes: 9 keren
Ontvangen bedankjes: 4 keren
Contacteer:

Re: Quick Language werkt niet met Collapsible Forum Categories

Bericht door bennybernaer » 28 aug 2017 14:53

Ik heb de bestanden aangepast met de code die je hebt geplaatst, maar dit geeft geen resultaat Danny...
services.yml en listener.php

Code: Selecteer alles

<?php

/**
*
* @package quicklanguage
* @copyright (c) 2014 Alg
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
*
*/

namespace alg\quicklanguage\event;

/**
 * @ignore
 */

use Symfony\Component\EventDispatcher\EventSubscriberInterface;

class listener implements EventSubscriberInterface
{

	const OK= 0;
	const QUICK_LANG_NO = 1;
	const QUICK_LANG_EN_DISABLE = 2;
	const API_YANDEX = 1;
	const API_BING = 2;

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

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

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

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

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

	/** @var string phpBB root path */
	protected $root_path;

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

	protected $allow_guests;
	protected $is_english_show;
	protected $error;

public function __construct(\phpbb\config\config $config, \phpbb\db\driver\driver_interface $db, \phpbb\request\request_interface $request, \phpbb\template\template $template, \phpbb\user $user, $root_path, $php_ext, \phpbb\collapsiblecategories\operator\operator $operator = null)
	{
		$this->config = $config;
		$this->db = $db;
		$this->request = $request;
		$this->template = $template;
		$this->user = $user;
		$this->root_path = $root_path;
		$this->php_ext = $php_ext;
		$this->operator = $operator;

		//Setup the common settings
		$this->allow_guests = isset($config['quicklanguage_allow_guests']) ? (bool) $config['quicklanguage_allow_guests'] : true;
		$this->is_english_show = isset($config['quicklanguage_is_english_show']) ? (bool) $config['quicklanguage_is_english_show'] : true;
		$this->error = listener::OK;
	}

	static public function getSubscribedEvents()
	{
		return array(
			'core.user_setup'			=> 'user_setup',
			'core.page_header_after'=> 'page_header_after',
			'core.display_forums_modify_template_vars'		=> 'display_forums_modify_template_vars',
			'core.display_forums_modify_category_template_vars'		=> 'display_forums_modify_category_template_vars',
			'core.viewforum_get_topic_data'=> 'viewforum_get_topic_data',
			'core.generate_forum_nav'=> 'generate_forum_nav',
			//'core.search_forum_modify_rowset'=> array('search_forum_modify_rowset', -10),
			//'core.forum_list_modify_rowset'=> array('forum_list_modify_rowset', -10),
			'core.search_modify_forum_select_list'=> array('search_modify_forum_select_list', -10),
			'core.get_forum_list_modify_data'=> array('get_forum_list_modify_data', -10),
			'core.forum_list_jumpbox_modify_rowset'=> array('forum_list_jumpbox_modify_rowset', -10),
			'core.forum_list_make_forum_select_modify_rowset'=> array('forum_list_make_forum_select_modify_rowset', -10),
			'core.acp_forums_modify_rowset'=> array('acp_forums_modify_rowset', -10),
			'core.acp_manage_forums_initialise_data'=> array('acp_manage_forums_initialise_data', -10),
			'core.display_forums_modify_forum_rows'=> array('display_forums_modify_forum_rows', -10),
		);
	}

	public function user_setup($event)
	{
		$this->quick_language_enable = false;

		//get all installed languages
		$sql = "SELECT * FROM " . LANG_TABLE;
		$result = $this->db->sql_query($sql);
		$counter = 0;
		$this->lang_info = array();
		while ($row = $this->db->sql_fetchrow($result))
		{
				$this->lang_info[] = $row;
				if (!($row['lang_iso'] == 'en' && !$this->is_english_show))
				{
					$counter++;
				}
		}
		$this->db->sql_freeresult($result);

		if ($counter < 2 || $event['user_data']['is_bot'] || ( $event['user_data']['user_id'] == ANONYMOUS && !$this->allow_guests))
		{
			//do nothing
			$this->quick_language_enable = false;
				$this->current_lang = $event['user_data']['is_registered'] ?  $event['user_lang_name'] :  $this->config['default_lang'];
			return;
		}
		$this->quick_language_enable = true;
		$this->current_lang = $event['user_data']['is_registered'] ?  $event['user_lang_name'] :  $this->request_cookie('quicklang', $this->config['default_lang'] );
		$submit = (isset($_POST['h_lang'])) ? true : false;
		if (!$submit)
		{
			if ($event['user_data']['is_registered'])
			{
				return;
			}
			else	 //user is guest
			{
				if ($this->current_lang != $this->config['default_lang'])
				{
					$event['user_lang_name'] = $this->current_lang;
				}
				return;
			}

		}
		$new_lang = basename($this->request->variable('h_lang', $this->current_lang ));
		//validate user data
		$res = $this->get_iso($new_lang);
		$this->new_lang = $new_lang;
		if ($res == '')
		{
			$this->error = listener::QUICK_LANG_NO;
			return;
		}
		if ($res == 'en' && !$this->is_english_show)
		{
			$this->error = listener::QUICK_LANG_EN_DISABLE;
			return;
		}

		//registered user
		if ( $event['user_data']['is_registered'])
		{
			if ($new_lang != $event['user_data']['user_lang'])
			{
				//change user lang preference
				$sql = "UPDATE "  . USERS_TABLE . " SET user_lang = '" . $new_lang . "' WHERE user_id=" . (int) $event['user_data']['user_id'];
				$this->db->sql_query($sql);
				$event['user_lang_name'] = $new_lang;
				$this->current_lang = $new_lang;
				return;
			}
		}
		// guest (not bot)
		if ( $event['user_data']['user_id'] == ANONYMOUS)
		{
			if ($new_lang != $this->current_lang)
			{
				//change guest lang preference
				$this->user->set_cookie('quicklang', $new_lang, 0);
				$event['user_lang_name'] = $new_lang;
				$this->current_lang = $new_lang;
			}
		}
	}

	public function page_header_after($event)
	{
		//if (!$this->quick_language_enable)
		//{
		//	 return;
		//}
		$this->user->add_lang_ext('alg/quicklanguage', 'quicklanguage');
		$url_back = build_url();
		if (substr($url_back, -1) == '?' )
		{
			$url_back = rtrim($url_back, '?');
		}
		$url_translate = '';
		$url_translate_getlang = '';
		$current_lang_name = '';
		if (isset($this->config['quicklanguage_is_link_translate_show']) && $this->config['quicklanguage_is_link_translate_show'] >0 && isset($this->config['quicklanguage_translate_api_key']) && $this->config['quicklanguage_translate_api_key'] != '' && isset($this->config['quicklanguage_translate_api_type']))
		{
			if ($this->config['quicklanguage_translate_api_type'] ==listener::API_YANDEX)
			{
				$url_translate = 'https://translate.yandex.net/api/v1.5/tr.json/translate';
				$url_translate_getlang = 'https://translate.yandex.net/api/v1.5/tr.json/getLangs?&ui=en';
			}
		}

		foreach ($this->lang_info as $row)
		{
			if (!($row['lang_iso'] == 'en' && !$this->is_english_show))
			{
				$this->template->assign_block_vars('langs', array (
				'LANG_ID'		=> $row['lang_id'],
				'LANG_ISO'		=> $row['lang_iso'],
				'LANG_LOCAL_NAME'		=> censor_text($row['lang_local_name']),
				'S_SELECTED_LANG'	=>	$this->current_lang == $row['lang_iso'],
				));
				if ($this->current_lang == $row['lang_iso'])
				{
					$current_lang_name = censor_text($row['lang_local_name']);
				}
			}
		}
		$this->template->assign_vars(array(
			'U_QUICK_LANG_ACTION'	=>  $url_back,
			'S_QUICK_LANGUAGE_ENABLE'	=> (bool) $this->quick_language_enable,
			'S_CURRENT_LANG'	=>	$this->current_lang,
			'S_CURRENT_LANG_NAME'	=>	$current_lang_name,
			'U_TRANSLATE_POST'	=>	$url_translate,
			'U_TRANSLATE_GETLANG'	=>	$url_translate_getlang,
			'S_YK'	=>	isset($this->config['quicklanguage_translate_api_key']) ? $this->config['quicklanguage_translate_api_key'] : '',
			'S_SHOW_TRANSLATE_POST'	=> (bool) $url_translate != '',
			));

		if ($this->config['sitename'] && isset($this->user->lang['SITENAME_NAME']))
		{
			$this->template->assign_vars(array('SITENAME'	=> $this->user->lang['SITENAME_NAME'],));
		}
		if ($this->config['site_desc'] && isset($this->user->lang['SITE_DESCRIPTION_NAME']))
		{
			$this->template->assign_vars(array('SITE_DESCRIPTION'	=> $this->user->lang['SITE_DESCRIPTION_NAME'],));
		}
		if ($this->config['site_home_url'] && isset($this->user->lang['SITE_HOME_NAME']))
		{
			$this->template->assign_vars(array('L_SITE_HOME'	=> $this->user->lang['SITE_HOME_NAME'],));
		}
		$forum =	(int) $this->request->variable('f', '0');
		if ($forum && isset($this->user->lang['FORUM_NAME_' . $forum]))
		{
			$this->template->assign_vars(array('FORUM_NAME'	=> $this->user->lang['FORUM_NAME_' . $forum],));

		}

		$index_path = append_sid("{$this->root_path}index.$this->php_ext");
		if ($index_path && isset($this->user->lang['INDEXPAGE_NAME']))
		{
			$this->template->assign_vars(array('L_INDEX'	=> $this->user->lang['INDEXPAGE_NAME'],));
		}
		$redirect = append_sid("{$this->root_path}" . $url_back, "");

		if ($this->error == listener::QUICK_LANG_NO)
		{
			meta_refresh (5, $url_back);
			trigger_error(sprintf($this->user->lang['QUICK_LANG_NO'], $this->new_lang) . '<br /><br /><a href="'. $redirect .  '">' .  $this->user->lang['BACK_TO_PREV'] . '</a>');
		}
		if ($this->error == listener::QUICK_LANG_EN_DISABLE)
		{
			meta_refresh (5, $url_back);
		}

	}

	public function display_forums_modify_template_vars($event)
	{
		$this->user->add_lang_ext('alg/quicklanguage', 'quicklanguage');
		$forum_row = $event['forum_row'];
		$row = $event['row'];
		if (isset($this->user->lang['FORUM_NAME_' . $forum_row['FORUM_ID']]))
		{
			$forum_row['FORUM_NAME'] = $this->user->lang['FORUM_NAME_' . $forum_row['FORUM_ID']];
		}
		if (isset($this->user->lang['FORUM_DESC_' . $forum_row['FORUM_ID']]))
		{
			$forum_row['FORUM_DESC'] = $this->user->lang['FORUM_DESC_' . $forum_row['FORUM_ID']];
		}
		//if (isset ($forum_row['SUBFORUMS']) && $row['forum_subforumslist_type'])
		if (isset ($forum_row['SUBFORUMS']) )
		{
		//print_r($forum_row['SUBFORUMS'] );
		}

		$event['forum_row'] = $forum_row;
	}

	public function display_forums_modify_category_template_vars($event)
	{
		$this->user->add_lang_ext('alg/quicklanguage', 'quicklanguage');
		$cat_row = $event['cat_row'];
		if (isset($this->user->lang['FORUM_NAME_' . $cat_row['FORUM_ID']]))
		{
			$cat_row['FORUM_NAME'] = $this->user->lang['FORUM_NAME_' . $cat_row['FORUM_ID']];
		}
		if (isset($this->user->lang['FORUM_DESC_' . $cat_row['FORUM_ID']]))
		{
			$cat_row['FORUM_DESC'] = $this->user->lang['FORUM_DESC_' . $cat_row['FORUM_ID']];
		}
		$event['cat_row'] = $cat_row;
}

	public function viewforum_get_topic_data($event)
	{
		$forum_data = $event['forum_data'];
		$forum_name = $forum_data['forum_name'];
		$forum_desc = $forum_data['forum_desc'];
		$forum_id = $forum_data['forum_id'];
		if (isset($this->user->lang['FORUM_NAME_' .  $forum_data['forum_id']]))
		{
			$forum_name = $this->user->lang['FORUM_NAME_' . $forum_id];
		}
		if (isset($this->user->lang['FORUM_DESC_' . $forum_id]))
		{
			$forum_desc = $this->user->lang['FORUM_DESC_' .$forum_id];
		}
		$this->template->assign_vars(array(
					'FORUM_NAME'	=> $forum_name,
					'FORUM_DESC'	=> $forum_desc,
				));
	}

	public function generate_forum_nav($event)
	{
		$this->user->add_lang_ext('alg/quicklanguage', 'quicklanguage');
		$navlinks = $event['navlinks'];
		if (isset($this->user->lang['FORUM_NAME_' . $navlinks['FORUM_ID']]))
		{
			$navlinks['FORUM_NAME'] = $this->user->lang['FORUM_NAME_' . $navlinks['FORUM_ID']];
			$event['navlinks'] = $navlinks;
		}
		$navlinks_parents = $event['navlinks_parents'];
		foreach ($navlinks_parents as $key => $navlink)
		{
			$forum_id = $navlink['FORUM_ID'];
			if (isset($this->user->lang['FORUM_NAME_' .  $navlink['FORUM_ID']]))
			{
				$navlink['FORUM_NAME'] = $this->user->lang['FORUM_NAME_' . $navlink['FORUM_ID']];
				$navlinks_parents[$key] = $navlink;
			}
			$event['navlinks_parents'] = $navlinks_parents;
		}
	}
	//public function search_forum_modify_rowset($event)
	public function search_modify_forum_select_list($event)
	{
		$this->user->add_lang_ext('alg/quicklanguage', 'quicklanguage');
		$rowset = $event['rowset'];
		foreach ($rowset as $key => $row)
		{
		//print_r('$key = ' . $key);
			if (isset($this->user->lang['FORUM_NAME_' . $row['forum_id']]))
		{
			$row['forum_name'] = $this->user->lang['FORUM_NAME_' . $row['forum_id']];
			$rowset[$key] = $row;
		}

		}
		 $event['rowset'] = $rowset;
		 //print_r($event['rowset']);
	}
	//public function forum_list_modify_rowset($event)
	public function get_forum_list_modify_data($event)
	{
	//print_r($event);
		$this->user->add_lang_ext('alg/quicklanguage', 'quicklanguage');
		$rowset = $event['rowset'];
		foreach ($rowset as $key => $row)
		{
		//print_r('$key = ' . $key);
			if (isset($this->user->lang['FORUM_NAME_' . $row['forum_id']]))
		{
			$row['forum_name'] = $this->user->lang['FORUM_NAME_' . $row['forum_id']];
			$rowset[$key] = $row;
		}

		}
		 $event['rowset'] = $rowset;
		 //print_r($event['rowset']);
	}
	public function forum_list_jumpbox_modify_rowset($event)
	{
		$this->user->add_lang_ext('alg/quicklanguage', 'quicklanguage');
		$rowset = $event['rowset'];
		foreach ($rowset as $key => $row)
		{
		//print_r('$key = ' . $key);
			if (isset($this->user->lang['FORUM_NAME_' . $row['forum_id']]))
		{
			$row['forum_name'] = $this->user->lang['FORUM_NAME_' . $row['forum_id']];
			$rowset[$key] = $row;
		}

		}
		 $event['rowset'] = $rowset;
		 //print_r($event['rowset']);
	}
	public function forum_list_make_forum_select_modify_rowset($event)
	{
		$this->user->add_lang_ext('alg/quicklanguage', 'quicklanguage');
		$rowset = $event['rowset'];
		foreach ($rowset as $key => $row)
		{
		//print_r('$key = ' . $key);
			if (isset($this->user->lang['FORUM_NAME_' . $row['forum_id']]))
		{
			$row['forum_name'] = $this->user->lang['FORUM_NAME_' . $row['forum_id']];
			$rowset[$key] = $row;
		}

		}
		 $event['rowset'] = $rowset;
		 //print_r($event['rowset']);
	}
	public function acp_forums_modify_rowset($event)
	{
		$this->user->add_lang_ext('alg/quicklanguage', 'quicklanguage');
		$rowset = $event['rowset'];
		foreach ($rowset as $key => $row)
		{
		//print_r('$key = ' . $key);
			if (isset($this->user->lang['FORUM_NAME_' . $row['forum_id']]))
		{
			$row['forum_name'] = $this->user->lang['FORUM_NAME_' . $row['forum_id']];
			$rowset[$key] = $row;
		}

		}
		 $event['rowset'] = $rowset;
		 //print_r($event['rowset']);
	}
	public function acp_manage_forums_initialise_data($event)
	{
	//print_r('acp_manage_forums_initialise_data');
		$this->user->add_lang_ext('alg/quicklanguage', 'quicklanguage');
		$forum_data = $event['forum_data'];
		$row = $event['row'];
		$forum_id = $event['forum_id'];
		print_r($this->user->lang['FORUM_NAME_' .  $forum_id]);
		if (isset($this->user->lang['FORUM_NAME_' .  $forum_id]))
		{
			$forum_data['forum_name'] = $this->user->lang['FORUM_NAME_' . $forum_id];
			$row['forum_name'] = $this->user->lang['FORUM_NAME_' . $forum_id];
		print_r($forum_data['forum_name'] );
		}
		if (isset($this->user->lang['FORUM_DESC_' . $forum_id]))
		{
			$forum_data['forum_desc'] = $this->user->lang['FORUM_DESC_' .$forum_id];
			$row['forum_desc'] = $this->user->lang['FORUM_DESC_' .$forum_id];
		}

		 $event['forum_data'] = $forum_data;
		 $event['row'] = $row;
		 //print_r($event['forum_data']);
	}
	public function display_forums_modify_forum_rows($event)
	{
		$this->user->add_lang_ext('alg/quicklanguage', 'quicklanguage');
		$forum_rows = $event['forum_rows'];
		$subforums = $event['subforums'];
		$row = $event['row'];
		$parent_id = $event['parent_id'];
		//$forum_id = $event['forum_id'];
		//print_r($forum_rows[486]);
		if (isset($subforums[$parent_id]))
		{
			foreach ($subforums[$parent_id] as $subforum_id => $subforum_row)
			{
				if (isset($this->user->lang['FORUM_NAME_' .  $subforum_id]))
				{
				// print_r('id = ' . $subforum_id . ':' . $subforum_row['name'] . '***' );
					$subforum_row['name'] = $this->user->lang['FORUM_NAME_' . $subforum_id];
					$subforums[$parent_id][$subforum_id] = $subforum_row;
					//print_r($subforums[$parent_id][$subforum_id]);
					//$subforums[$parent_id][];
				}
			}
			$event['subforums'] = $subforums;
		//print_r($subforums[$parent_id]);
		//$subf = $subforums[$parent_id];

		//print_r('***');
		}
	return;
		if (isset($this->user->lang['FORUM_NAME_' .  $forum_id]))
		{
			$forum_data['forum_name'] = $this->user->lang['FORUM_NAME_' . $forum_id];
			$row['forum_name'] = $this->user->lang['FORUM_NAME_' . $forum_id];
		}
		if (isset($this->user->lang['FORUM_DESC_' . $forum_id]))
		{
			$forum_data['forum_desc'] = $this->user->lang['FORUM_DESC_' .$forum_id];
			$row['forum_desc'] = $this->user->lang['FORUM_DESC_' .$forum_id];
		}

		 $event['forum_data'] = $forum_data;
		 $event['row'] = $row;
		 //print_r($event['forum_data']);
	}

	public function request_cookie($name, $default = null)
	{
		$name = $this->config['cookie_name'] . '_' . $name;
		return $this->request->variable($name, $default, false, 3);
	}

	private function get_iso($l)
	{
		foreach ($this->lang_info as $lang)
		{
			if ($lang['lang_iso'] == $l)
			{
				return $lang['lang_iso'];
			}
		}
			return '';
	}
}
Nu kunnen we "$this->operator" gebruiken welke in verbinding staat met de collapisble extentie.

kijk daarna eens vanaf deze lijn waar $operator begint: https://github.com/rmcgirr83/phpBB-3.1- ... s.php#L227

Verder kan ik even niet kijken, heb het ook nog niet getest maar misschien is het al voldoende om de bestanden service.yml en listener.php aan te passen (alleen het stukje wat ik al aangepast heb in bovenstaande voorbeelden). Ik denk niet dat het nodig is om de template bestanden aan te passen.
En wat bedoel je hier juist mee? Welke code moet ik hier uit halen, en in welk bestand moet ik beginnen zoeken. Want het voorbeeld waar je naar verwijst zit in de ext/nationalflags/core/ Maar de quicklanguage gebruikt geen core bestanden.
To reach a star, you gotta have a dream and to have a dream, you gotta have a strength...
To be that strong, you gotta have a will and the will is within your heart...



Vind phpBBservice.nl leuk op Facebook.
| buy me a beer

Gebruikersavatar

Auteur
bennybernaer
phpBBservice Teamlid
phpBBservice Teamlid
Berichten in topic: 4
Berichten: 887
Lid geworden op: 25 jul 2010 15:41
Naam: Benny
Locatie: Antwerpen
Verstuurde bedankjes: 9 keren
Ontvangen bedankjes: 4 keren
Contacteer:

Re: Quick Language werkt niet met Collapsible Forum Categories

Bericht door bennybernaer » 15 sep 2017 13:34

Iemand een idee?


Laatst omhoog gehaald door bennybernaer op 15 sep 2017 13:34.
To reach a star, you gotta have a dream and to have a dream, you gotta have a strength...
To be that strong, you gotta have a will and the will is within your heart...



Vind phpBBservice.nl leuk op Facebook.
| buy me a beer

Plaats reactie