Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
#1 2006-02-16 00:38:04
- Ji31
- Member
- Registered: 2005-08-24
- Posts: 103
Inserting php - replacing of smilies?
I want to insert this code in one place of my site. This should replace the text emoticons for images.
But it does nothing.
What I have wrong?
<txp:php>
global $thisarticle;
$smilies = array(
";-)" => "< src=”/images/site/01.gif” />;"
":-)-" => "< src=”/images/site/02.gif” />;"
":-)" => "< src=”/images/site/03.gif” />;"
":-D" => "< src=”/images/site/04.gif” />;"
"B-)" => "< src=”/images/site/05.gif” />;"
":-O" => "< src=”/images/site/06.gif” />;"
":-(" => "< src=”/images/site/07.gif” />;"
);
return str_replace(array_keys($smilies), array_values($smilies), $thisarticle[body]);
</txp:php>
PS: (img is missing just here, for good viewing)
Thanx
Last edited by Ji31 (2006-02-16 00:38:37)
Offline
#2 2006-02-16 00:42:42
- zem
- Developer Emeritus
- From: Melbourne, Australia
- Registered: 2004-04-08
- Posts: 2,579
Offline
#3 2006-02-16 00:56:38
- Ji31
- Member
- Registered: 2005-08-24
- Posts: 103
Re: Inserting php - replacing of smilies?
> zem wrote:
> FAQ.
Ok, so, if I had good understand, $thisarticle doesn’t work-so what I should use? Or did I understand it wrong (also it is more than possible – my english is not so good)? Or where I have the mystake? I didn’t find anything wrong :-(
Offline
#4 2006-02-16 02:12:40
- zem
- Developer Emeritus
- From: Melbourne, Australia
- Registered: 2004-04-08
- Posts: 2,579
Re: Inserting php - replacing of smilies?
Follow the recommendations in the FAQ. Use <txp:php>
, turn on debugging, use standard PHP debugging techniques, etc.
Alex
Offline
Pages: 1