Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#25 2011-06-16 16:16:19

iaian7
Plugin Author
From: US
Registered: 2006-12-05
Posts: 57
Website

Re: an7_filter

Got it working yet? Sorry I can’t be of much use remotely, PHP is difficult to debug without actually seeing it!


VFX artist, photographer, designer, CG generalist, and hobbyist web developer
My TXP sites: blog | reels | portfolios

Offline

#26 2011-06-16 16:19:35

wordgasm
Member
Registered: 2006-05-17
Posts: 83
Website

Re: an7_filter

Sorry, I don’t know if you read this from the previous comment

Never mind, it works perfect now. Thanks for the help! Great plugin! :D

So yes, it’s working already. Thank you dear author.:p

I thought you just wanted to know how I fixed it.

Offline

#27 2011-06-16 16:24:21

iaian7
Plugin Author
From: US
Registered: 2006-12-05
Posts: 57
Website

Re: an7_filter

Haha, oh dear…completely missed the updated message. Glad you got it working!


VFX artist, photographer, designer, CG generalist, and hobbyist web developer
My TXP sites: blog | reels | portfolios

Offline

#28 2013-02-28 22:31:13

gour
Member
From: Hlapičina, Croatia
Registered: 2013-01-17
Posts: 124

Re: an7_filter

I’m converting Concrete5 site which uses TinyMCE editor and its emoticons.

For the new Txp site I do want to stay with Textile and get emoticons via an7_filter plugin, but I wonder if you can recommend/share some setup which goes nicely along with plugin’s default setup ?

Last edited by gour (2013-03-01 21:03:31)

Offline

#29 2013-03-01 21:09:05

gour
Member
From: Hlapičina, Croatia
Registered: 2013-01-17
Posts: 124

Re: an7_filter

gour wrote:

For the new Txp site I do want to stay with Textile and get emoticons via an7_filter plugin, but I wonder if you can recommend/share some setup which goes nicely along with plugin’s default setup ?

Here is my incomplete setup for the icons which come along with TinyMCE:

function an7_filter($atts, $thing='')  {
	global $thisarticle;
	global $thiscomment;
extract(lAtts(array(
	'imga'	=> ' <img src="/images/emoticons/',	// defines the first half of the image, sans filename
	'imgb'	=> '.gif" alt="" class="an7_filter" /> ',	// defines the second half of the image, including file format
),$atts));
$replacements = array(
	//
	" >:-o"		=>	$imga."smiley-yell".$imgb,
	" >:o"		=>	$imga."smiley-yell".$imgb,
	" x-o"		=>	$imga."smiley-yell".$imgb,
	" xo"		=>	$imga."smiley-yell".$imgb,
	" :angry:"	=>	$imga."smiley-yel".$imgb,
	" :-["		=>	$imga."smiley-embarassed".$imgb,
	" :["		=>	$imga."smiley-embarassed".$imgb,
	" :blush:"	=>	$imga."smiley-embarrassed".$imgb,
	" 8-)"		=>	$imga."smiley-cool".$imgb,
	" 8)"		=>	$imga."smiley-cool".$imgb,
	" :cool:"	=>	$imga."smiley-cool".$imgb,
	" :'("		=>	$imga."smiley-cry".$imgb,
	" :cry:"	=>	$imga."smiley-cry".$imgb,
	" :-!"		=>	$imga."eeeih".$imgb,
	" :!"		=>	$imga."eeeih".$imgb,
	" :eeeih:"	=>	$imga."eeeih".$imgb,
	" :-("		=>	$imga."smiley-frown".$imgb,
	" :("		=>	$imga."smiley-frown".$imgb,
	" :frown:"	=>	$imga."smiley-frown".$imgb,
	" =-o"		=>	$imga."gasp".$imgb,
	" :-o"		=>	$imga."gasp".$imgb,
	" :o"		=>	$imga."gasp".$imgb,
	" :gasp:"	=>	$imga."gasp".$imgb,
	" :-D"		=>	$imga."grin".$imgb,
	" :D"		=>	$imga."grin".$imgb,
	" :grin:"	=>	$imga."grin".$imgb,
	" o:-)"		=>	$imga."smiley-innocent".$imgb,
	" o:)"		=>	$imga."smiley-innocent".$imgb,
	" 0:-)"		=>	$imga."smiley-innocent".$imgb,
	" 0:)"		=>	$imga."smiley-innocent".$imgb,
	" :innocent:"	=>	$imga."smiley-innocent".$imgb,
	" :-*"		=>	$imga."smiley-kiss".$imgb,
	" :*"		=>	$imga."smiley-kiss".$imgb,
	" :kiss:"	=>	$imga."smiley-kiss".$imgb,
	" :-P"		=>	$imga."smiley-laughing".$imgb,
	" :P"		=>	$imga."smiley-laughing".$imgb,
	" :laugh:"	=>	$imga."smiley-laughing".$imgb,
	" :-$"		=>	$imga."smiley-money-mouth".$imgb,
	" :$"		=>	$imga."smiley-money-mouth".$imgb,
	" :money:"	=>	$imga."smiley-money-mouth".$imgb,
	" :-x"		=>	$imga."smiley-sealed".$imgb,
	" :x"		=>	$imga."smiley-sealed".$imgb,
	" :sealed:"	=>	$imga."smiley-sealed".$imgb,
	" :-)"		=>	$imga."smiley-smile".$imgb,
	" :)"		=>	$imga."smiley-smile".$imgb,
	" :smile:"	=>	$imga."smiley-smile".$imgb,
	" :-/"		=>	$imga."smiley-undecided".$imgb,
	" :/"		=>	$imga."smiley-undecided".$imgb,
	" :undecided:"=>	$imga."smiley-undecided".$imgb,
	" ;-)"		=>	$imga."smiley-wink".$imgb,
	" ;)"		=>	$imga."smiley-wink".$imgb,
	" :wink:"	=>	$imga."smiley-wink".$imgb);
$wrap = parse($thing);
$filtered = strtr($wrap, $replacements);
return $filtered;
}

Maybe it will be of help to someone and I’ll complete it when I finish some other stuff. ;)

Offline

#30 2020-02-27 17:07:40

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

Re: an7_filter

Hi all,

I’m updating an ancient Textpattern site that I built back in 2006 because my host is shutting off PHP 5.4 soon. I started out with Textpattern 4.0.4 on PHP 5.4 and have managed to update to Textpattern 4.7.3, which I have running on PHP 7.2. Now I’m dealing with the plugins which were all state of the art way back when, but now (unsurprisingly!) break the site. So I’ve turned them all off and am turning them back on one by one, fixing issues as I go.

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

Offline

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

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,096
Website GitHub Mastodon Twitter

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 | hblack.art | EMAP | A Sea change | Toolkit of Care
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: 4,752
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:
# .....................................................................

H4sIAAAAAAAAA61Z3W/jOA5/boD5HzTZYpIM8tWP6YeTGFhgd3BzD4di0cU97ACFYsuJbmzL
kOQ2ucX+70dSdhI7Ti9ZpA+1TP5EUTRFkQz3rq68P41367VTnoj2xHhXY6/N0/uXSMZWaKTc
ASG3S0Uv19de+xuXgGAD9k+1TNmvMjUiFulmMmFfci2RcgP4pbWZNxpJmjYMVDKyq2xUXeTe
a78KbaQiOV+89nh4PbwimVdeOxQm0DKzBfsB0L8bmS4YTxnXmq/7bCuOvck4ZlpkMQ8Es2Jl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jLNJw47E+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: 122

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