[3.3][RC] Autolinks 1.3.9

A place for Extension Authors to post and receive feedback on Extensions still in development. No Extensions within this forum should be used within a live environment!
Scam Warning
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: Extensions Development rules

IMPORTANT FOR NEEDED EVENTS!!!
If you need an event for your extension please read this for the steps to follow to request the event(s)
lixxbox
Registered User
Posts: 3
Joined: Thu Jan 03, 2019 9:53 am

Re: [3.1][3.2][RC] Autolinks 1.2.5

Post by lixxbox »

hi,

attention, i'm not a coder. :)
maybe someone can test this.

in event/listener.php

in the forloop at line 185 add something like this:

Code: Select all

// Headlines [h1]-[h4]
if (strstr($part, '<h4') || strstr($part, '<h3') || strstr($part, '<h2') || strstr($part, '<h1'))
{
	$headline = true;
}
if (!empty($headline) && strstr($part, '</h4') || strstr($part, '</h3') || strstr($part, '</h2') || strstr($part, '</h1'))
{
	$headline = false;
}
further down there is a passage like this:

Code: Select all

if (!($part{0} == '<' && $parts[$index + 1]{0} == '>') &&
!($part{0} == '[' && $parts[$index + 1]{0} == ']') &&
empty($img) && empty($code) && empty($alink) && empty($ulink) && empty($script))
change it to this (add "&& empty($headline)"):

Code: Select all

if (!($part{0} == '<' && $parts[$index + 1]{0} == '>') &&
!($part{0} == '[' && $parts[$index + 1]{0} == ']') &&
empty($img) && empty($code) && empty($alink) && empty($ulink) && empty($headline) && empty($script))

@pierredu looks like you try to not replace inside code-tags, which does not work (for me). Replace [ with <
// Code
if (strstr($part, '[code'))
{
$code = true;
}
if (!empty($code) && strstr($part, '[/code'))
{
$code = false;
}
User avatar
pierredu
Registered User
Posts: 1256
Joined: Thu Nov 01, 2012 8:04 am
Location: Paris (France)

Re: [3.1][3.2][RC] Autolinks 1.2.5

Post by pierredu »

I'll look at this when I'm back from holidays.
User avatar
pierredu
Registered User
Posts: 1256
Joined: Thu Nov 01, 2012 8:04 am
Location: Paris (France)

Re: [3.1][3.2][RC] Autolinks 1.2.5

Post by pierredu »

Your code should work.
lixxbox
Registered User
Posts: 3
Joined: Thu Jan 03, 2019 9:53 am

Re: [3.1][3.2][RC] Autolinks 1.2.5

Post by lixxbox »

In your github repository you made this change also for the img-tag, which breaks your extension for everything that comes after an image. The image bbcode does not create an html-end-tag, but your code expects one.

I‘m not really sure if a rule for an img-tag is needed.
User avatar
pierredu
Registered User
Posts: 1256
Joined: Thu Nov 01, 2012 8:04 am
Location: Paris (France)

Re: [3.1][3.2][RC] Autolinks 1.2.7

Post by pierredu »

Thanks for pointing this problem.
I don't have the time now to test it really, but I commented those lines out.
The repo was updated.
thecas
Registered User
Posts: 57
Joined: Sun Feb 04, 2018 4:25 pm

Re: [3.1][3.2][RC] Autolinks 1.2.7

Post by thecas »

Code: Select all

Fatal error: Call to a member function add_lang() on null in /home/mhd-01/www.wisp-forum.it/htdocs/ext/lmdi/autolinks/acp/autolinks_module.php on line 23
This in a new italian installation trying to access to the settings.
Thank you.
thecas
Registered User
Posts: 57
Joined: Sun Feb 04, 2018 4:25 pm

Re: [3.1][3.2][RC] Autolinks 1.2.7

Post by thecas »

Code: Select all

<?php
/**
 *
 * @package	Extension Autolink [Italian] (from Emanuele Ing Benatti)
 * @author	Máté Bartus <[email protected]>
 * @author	Pierre Duhem <[email protected]>
 * @version	$Id: info_acp_autolink.php 46 2010-07-20 14:14:53Z CHItA $
 *
 **/

if (!defined('IN_PHPBB'))
{
	exit;
}

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

	// Menu text and titles
	'ACP_AUTOLINKS_TITLE'			=> 'Amministrazione Autolink',
	'AUTOLINK_ADD_A_NEW_WORD'		=> 'Aggiungi nuovo Autolink',
	'RECURS_FEATURE'				=> 'Previeni sostituzione ricorsivi ',
	'RECURS_FEATURE_EXPLAIN'			=> 'Se l\'URL contiene il termine da sostituire, c\'è il rischio di una sostituzione ricorsiva con conseguente possibile malfunzionamento del link. Questa opzione elimina questa possibilità ma con un pattern matching esatto in caso di possibile sostituzione ricorsiva.',
	'TERM_ADDITION'				=> 'Aggiungi un nuovo termine',
	'TERM_ADDITION_EXPLAIN'			=> 'Questa opzione mostra un form per creare un nuovo termine.',
	'AL_FORUM_SELECTION'			=> 'Seleziona forum',
	'AL_NOSHOW_LIST'				=> 'Abilita autolinks',
	'LEGEND_ADD_TERM'				=> 'Gestione Parole',


	// Main form's words
	'ACP_AUTOLINKS_CONFIG'			=> 'Configurazione Autolink',

	'ACP_AUTOLINK_WORDS'			=> 'Gestione termini',
	'ACP_AUTOLINK_WORD'				=> 'Termini',
	'ACP_AUTOLINK_WORD_NOTE'			=> 'Qui puoi impostare la parola da sostituire al link. L\'estensione non &egrave; case sensitive.',
	'ACP_AUTOLINK_URL'				=> 'URL',
	'ACP_AUTOLINK_URL_NOTE'			=> 'Qui puoi impostare l\'URL per la parola scelta.',

	// Logs
	'LOG_AUTOLINK_WORD_ADDED'		=> 'La parola (%s) è stata correttamente aggiunta al database Autolink!',
	'LOG_AUTOLINK_WORD_EDIT'			=> 'I dettagli della parola “%s” sono stati aggiornati al database Autolink!!',
	'LOG_AUTOLIMK_WORD_DELETE'		=> '“%s” è stata rimossa dal database Autolink!',
	'LOG_AUTOLINK_CONFIG_UPDATED'		=> 'Le impostazioni di Autolink sono state aggiornate!',

	// ACP table heading words
	'AUTOLINK_NAME'				=> 'Keyword',
	'AUTOLINK_URL'					=> 'URL',
	'AUTOLINK_BLANK'				=> 'Usa il tag target=\'_blank\' per i links',
	'AUTOLINK_BLANK_EXPLAIN'			=> 'Spunta questo checkbox se vuoi aprire il link in una nuova finestra.',

	// Error messages
	'AUTOLINK_NOT_ADDED'			=> 'La parola non &egrave; stata aggiunta dall\'Autolink database!',
	'AUTOLINK_NOT_REMOVED'			=> 'La parola non è stata rimossa dall\' the Autolink database!',
	'AUTOLINK_NOT_UPDATED'			=> 'La parola non è stata aggiornata nell\'Autolink database!',
	'AUTOLINK_INVALID_ID'			=> 'Prova a modificare o rimuovere la parola con ID errato',
	'AUTOLINK_DIFFERENT_SIZE_ARRAY'	=> 'The amount of the added URLs and the rates have to be equall!',
	'INVALID_FORM_KEY'				=> 'Il formato della chiave no è valido!',
	'AUTOLINK_EMPTY_WORD_FIELD'		=> 'Devi inserire la parola (termine) nel form!',
	'AUTOLINK_EMPTY_URL_FIELD'		=> 'Devi inserire l\'URL nel form!',
	'AUTOLINK_WORD_ALREADY_EXIST'		=> 'La parola esiste gi&agrave; ;)')
);
If you want to upgrade into the next version this italian translation! ;)
User avatar
pierredu
Registered User
Posts: 1256
Joined: Thu Nov 01, 2012 8:04 am
Location: Paris (France)

Re: [3.1][3.2][RC] Autolinks 1.2.7

Post by pierredu »

Thanks for the italian translation.
I'll try to have a look today or tomorrow.
thecas
Registered User
Posts: 57
Joined: Sun Feb 04, 2018 4:25 pm

Re: [3.1][3.2][RC] Autolinks 1.2.7

Post by thecas »

And check me out my error.
Thank you so much and happy new year.
User avatar
pierredu
Registered User
Posts: 1256
Joined: Thu Nov 01, 2012 8:04 am
Location: Paris (France)

Re: [3.2][RC] Autolinks 1.3.2

Post by pierredu »

I uploaded a version 1.3.2 on Github (see first post). This should cure the problem.
dommm063
Registered User
Posts: 60
Joined: Fri Mar 07, 2008 4:13 pm

Re: [3.2][RC] Autolinks 1.3.2

Post by dommm063 »

Hi,

Do you know if this extension is working with phpbb 3.3 ?
User avatar
pierredu
Registered User
Posts: 1256
Joined: Thu Nov 01, 2012 8:04 am
Location: Paris (France)

Re: [3.2][RC] Autolinks 1.3.2

Post by pierredu »

There is no reason why it wouldn't work.
dommm063
Registered User
Posts: 60
Joined: Fri Mar 07, 2008 4:13 pm

Re: [3.2][RC] Autolinks 1.3.2

Post by dommm063 »

There are some changes in code between 3.2 and 3.3, and some extensions could not work (especially with services.yml files).

If someone has already tested/implemented it on a 3.3 forum, I would appreciate any comment/remark.
If not, I will make a test.

Thanks
User avatar
pierredu
Registered User
Posts: 1256
Joined: Thu Nov 01, 2012 8:04 am
Location: Paris (France)

Re: [3.2][RC] Autolinks 1.3.2

Post by pierredu »

I just checked.
Version 1.3.2 works under 3.3.x.
dommm063
Registered User
Posts: 60
Joined: Fri Mar 07, 2008 4:13 pm

Re: [3.2][RC] Autolinks 1.3.2

Post by dommm063 »

Great. Thanks a lot.
Post Reply

Return to “Extensions in Development”