Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#31 2020-02-27 18:52:02

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 8,138
Website

Re: an7_filter

M_i wrote #321968:

an7_filter is not working in PHP 7.2 (“Too few arguments to function lAtts()”). Is there an easy way to modify the plugin to get it working on PHP 7.2 or — as nobody seems to be missing this plugin — is there a better way to do this in Textpattern anno 2020?

Any help is much appreciated!
Iris

I’m wondering if this plugin is needed in the latest txp version too. However, smd_query, etc_query or rah_replace might be able to replace it.


Yiannis
——————————
neme.org | hblack.net | LABS | State Machines | NeMe @ github | Covid-19; a resource
I do my best editing after I click on the submit button.

Offline

#32 2020-02-27 21:30:12

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 3,885
Website

Re: an7_filter

M_i wrote #321968:

an7_filter is not working in PHP 7.2 (“Too few arguments to function lAtts()”). Is there an easy way to modify the plugin to get it working on PHP 7.2 or — as nobody seems to be missing this plugin — is there a better way to do this in Textpattern anno 2020?

Hi Iris,

I’ve just tried this out on txp 4.8.0 with php 7.2. and with some very minor modifications it works in very brief testing. Plugin code below.

As the plugin stands, if you want to do your own search and replacing, or want to use your own folder structure, you have to modify the plugin source code. So before you install:

If you’ve made your own modifications to the plugin for your own search and replace items: first

  1. Visit the Admin › Plugins panel and click on the plugin name to reveal the plugin source code:
  2. Copy the two lines beginning 'imga' => '…', and 'imgb' => '…'. If you used your own folder name, or used jpgs instead of pngs, then you have modified them.
  3. Copy everything from $replacements = array( to );. Those are your custom replacements you had.

and paste them somewhere safe. Then install the plugin below, and reinsert the lines you copied over the same lines in the plugin.

# Name: an7_filter v0.2.1 (compressed)
# Type: Public plugin
# Using an array, an7_filter will replace text with specified output; links, images, etc.
# Author: Iaian7 - John Einselen
# URL: http://iaian7.com/txp/an7_filter
# Recommended load order: 5

# .....................................................................
# This is a plugin for Textpattern CMS - http://textpattern.com/
# To install: textpattern > admin > plugins
# Paste the following text into the 'Install plugin' box:
# .....................................................................

H4sIAAAAA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A2yOMQgSaPIhlIEFZs+4cQGZuaDFYonCHgmWn7T/94mo6Q
7JeRGPWwMiH9OCyfyiRPtnH9GaivSoIhwRXKIBowdCZwUJNjT6u0yyvYIwwxVgMQ+2JzAU4j
IIoHy927DndCV4F4pYBELTIGNVxSOHygtM4z6y5DFH49nnijYsC6dAuyV64lp2aVinYTnF6f
zXNcCq8HHsfqDW8OtzJCNyemdWEE5BUc11FpvHY3LxokFm4DprSDRS/wWxdTq+E/PJZ+EbTe
O5HU/jh4Itl0BGKOl0ZtjLNJw47E+YSdcZvUUDibNGoMnE0aFu7nEwYO+X+FwUPv+l3o+54C
Yli+en/svj30KrziXHYrxI+VtyqvKvqX4m1fiaLdV0G73luFRK2wKqU+yzWVKiTX4amQqItS
pWBXo6If/Hen9O8eV+wcnO3rYhPgbMKomD+bNCrKzybNVdbnE/duFnOqtM2t8DcO2tirHqbP
lbenyttl5W1VeatKGR0+U9TNqoCpu1ShuF5PheQaLxVS0QOp0qgfUSFt78xDBynzu5SPSrxC
M/yFBzJXTEGwBsWkBvMohcPtdWwoU0x4ui5/ItmpTDE3AWqgcqjnWSkby76yIHSF327929sk
I193q7LyFzVMLxOAMxFKl4pR1YN1Bw1ozZI0L0gW0gHIEly6p0UUi4ASVe1+voFsIQ8sJXgw
mVZi2CEwQ4Y6uB1TRrNTWbFIcJxjyDhF2YnlNiRoqBumbYotQSKs8B/UmLJHTNjW1NigbIN+
0PTaSfil/Gnzy92tGD/y8Z2IxKMIbyHFCu6iu7uH8RW/F4+37clf/wOe913+ZB0AAA==
colak wrote #321969:

I’m wondering if this plugin is needed in the latest txp version too.

rah_replace would be an option if you have just a few items to replace. Otherwise an7_filter replaces many items and, I guess, still serves a purpose.

If you use it just for emoticons as in the original plugin, you could upgrade your database to utf8mb4 collation, and then search and replace in the database for the correct unicode codes for the emojis. Then you wouldn’t need the plugin at all.

[BTW: the original docs are only available on iaian7.com on archive.org.


TXP Builders – finely-crafted code, design and txp

Offline

#33 2020-03-03 15:38:29

M_i
Member
Registered: 2006-03-05
Posts: 121

Re: an7_filter

Well, one thing sure hasn’t changed with the years — this is still the best forum ever!!

@colak – thank so much for your suggestions, I’ll check them out!
@ jakob – thanks for the updated plugin code, works like a charm!

I’m not using the plugin for emoticons but to add some extra textile-like shortcodes and furnishing some commonly used terms and abbreviations with alt text, so it wouldn’t be very practical to include all that in a rah_replace tag. Though I guess I could stick all replacements in a form to easily reuse whenever the rah_replace tag is called on… but then I’m basically back where I am now. So, I think I’ll keep using an7_filter version 0.2.1 and move on to the next issue!
Thanks again!

Offline

Board footer

Powered by FluxBB