Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#21 2011-06-15 22:17:24

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

Re: an7_filter

Ah, of course! “<“is an HTML entity, so never actually appears on the page. Try this instead:

"&lt;3" => "<strong style=\"font:8px verdana; color:red;\">&hearts;</strong>");

(also make sure you end the array without a comma, or you may run into issues – if there’s no item to follow, a comma can screw things up)

Last edited by iaian7 (2011-06-15 22:55:50)


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

Offline

#22 2011-06-16 08:11:50

wordgasm
Member
Registered: 2006-05-17
Posts: 73

Re: an7_filter

I figured that out too, but it’s still posting &lt;3 in the html instead of &hearts;. Also, if I use :heart: instead of <3, the rendered html is still the same—the replacement doesn’t work. But only for that line though.

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

Last edited by wordgasm (2011-06-16 13:22:52)


It takes a heap of sense to write good nonsense. – Mark Twain

Offline

#23 2011-06-16 15:47:56

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

Re: an7_filter

Did you remove the extra comma? Sounds like it’s an array issue now…


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

Offline

#24 2011-06-16 16:07:41

wordgasm
Member
Registered: 2006-05-17
Posts: 73

Re: an7_filter

I’m actually not sure. I just copy-pasted your code from the previous reply. I might have overlooked a tiny detail when I edited the line myself, maybe the \ or the ", but it wasn’t the comma that’s for sure.:p My mistake.


It takes a heap of sense to write good nonsense. – Mark Twain

Offline

#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: 73

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.


It takes a heap of sense to write good nonsense. – Mark Twain

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: 121

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

Board footer

Powered by FluxBB