Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#13 2009-05-07 22:22:41
- dreamer
- Member
- Registered: 2007-06-08
- Posts: 242
Re: an7_filter
how can i replace the default images you have with own images? i want to use this for something else instead of emoticons.
Offline
Re: an7_filter
dreamer wrote:
how can i replace the default images you have with own images? i want to use this for something else instead of emoticons.
Just edit the plugin – look for the array that defines the images, and change them to match whatever it is you need. :)
VFX artist, photographer, designer, CG generalist, and hobbyist web developer
My TXP sites: blog | reels | portfolios
Offline
#15 2010-09-03 21:56:45
- coryldork
- Member
- From: Canada
- Registered: 2010-09-03
- Posts: 10
Re: an7_filter
I’m new to Textpattern, and I’m having trouble displaying the emoticons on all of my articles (er, blogs, really, is what I’m using them for).
They work on this one: http://coryldork.info/blog/?pg=2 but all of the other posts don’t display the emoticons and they get chopped up and repeated.
The post I showed is the first one in Textpattern, though others have been added and given earlier dates (for the sake of my own archiving). So, newer posts don’t show the replacement, and they repeat.
I think I could be messing around with the Forms (default and single) too much, but I’m not quite sure. X:
The default and single forms are the exact same, but if I add the filter to the default form, the repeated and chopped up effect comes into play for newer posts, but the older post displays the emoticons.
Last edited by coryldork (2010-09-04 00:12:33)
Offline
Re: an7_filter
Hmm, that does seem really odd. Not sure how things are set up on your site, but for example, here are my default article and comment forms…
Article:
<txp:an7_filter><txp:body /></txp:an7_filter> <txp:comments /> <h6><txp:if_comments_allowed><txp:an7_comments_invite /></txp:if_comments_allowed></h6> <h6><txp:output_form form="links_bookmark" /></h6>
Comment:
<div class="comments<txp:an7_comments_author />"> <small class="h4"><txp:comment_name />, <txp:comment_permlink><txp:comment_time /></txp:comment_permlink></small> <txp:an7_filter><txp:comment_message /></txp:an7_filter> </div>
You’ll note that the an7_fiter only contains small sections, and I’m careful to exclude the comments tag in the article form, since the comments are filtered already in their own form. Does that help?
VFX artist, photographer, designer, CG generalist, and hobbyist web developer
My TXP sites: blog | reels | portfolios
Offline
Re: an7_filter
Hi, could you help me work this code out? I’m trying to replace two things: a line break with an image, and the text <3
with ♥. The line break works, but the next one doesn’t.
$replacements = array(
"<hr>" => $imga."hr".$imgb,
"<3" => '<strong style="font:8px verdana; color:red;">♥</strong>',
);
Is there something I can do about this? Thanks.
Offline
Re: an7_filter
What exactly isn’t working? Are there any errors? It might help if you can replace “<3” with something simple just to make sure it’s finding things correctly, and pinpoint if it’s the find or replace that’s messing up. :)
VFX artist, photographer, designer, CG generalist, and hobbyist web developer
My TXP sites: blog | reels | portfolios
Offline
Re: an7_filter
<3
remains <3 on the page instead of the html version of $hearts;.
Thanks for the quick reply!
Offline
Re: an7_filter
Hrm, odd. I honestly don’t know what the issue could be, as I haven’t run into issues like this on my own website. Have you checked the page source to make sure “<3” actually appears verbatim (in other words, is there any chance TXP is encoding it oddly)?
VFX artist, photographer, designer, CG generalist, and hobbyist web developer
My TXP sites: blog | reels | portfolios
Offline
Re: an7_filter
Ah, of course! “<“is an HTML entity, so never actually appears on the page. Try this instead:
"<3" => "<strong style=\"font:8px verdana; color:red;\">♥</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
Re: an7_filter
I figured that out too, but it’s still posting <3
in the html instead of ♥
. 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)
Offline
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
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.
Offline