Condirional text

Get help with installation and running phpwcms here. Please do not post bug reports or feature requests here.
Post Reply
User avatar
sustia
Posts: 651
Joined: Fri 2. Apr 2004, 22:29
Location: Lecce (Italy)
Contact:

Condirional text

Post by sustia »

Hi, I want to put the Author name in the article, and someone suggest me to put the {AUTHOR} text for replace, and it works fine.

The problem is that in some section the name of tha author doesn't exist, but the text Autor is always displayed.

Look at this:

http://noria.ba.cnr.it/sito/wcms/index.php?ecometro
To the right you can see the text "Autore" without the name of the author, but if you look at this page:
http://noria.ba.cnr.it/sito/wcms/index. ... 15,0,0,1,0
after the "Autore" you can see the name "Angelo Signore" that is the name of the author.

What I want to do is to put the text in second case, but not in the first case.

So i try to put in the template some php code, like this (sorry, but I'm a newbie):

Code: Select all

<?php
if ($AUTHOR!='')
{
echo "$AUTHOR";
}
else
{
echo "";
}
?>
but it doesn't work.
Where I'm wrong?

Thanks a lot.
Jérôme
Posts: 481
Joined: Tue 16. Mar 2004, 10:33
Location: Cologne, Germany
Contact:

Post by Jérôme »

As far as I know, this is not possible at the moment. But the correspondant replacement tag could be modified, so that you could use something like {AUTHOR:Autore} and the rest would be done in the background.

I will have a look at it and tell you if I think I could handle this :)
User avatar
sustia
Posts: 651
Joined: Fri 2. Apr 2004, 22:29
Location: Lecce (Italy)
Contact:

Post by sustia »

Thanks for the answer Jérôme.

I try your solution, but seems it doesn't work.

Maybe after that you have a look can give a solution :D
Jérôme
Posts: 481
Joined: Tue 16. Mar 2004, 10:33
Location: Cologne, Germany
Contact:

Post by Jérôme »

It can't work, because the core code is not changed yet :). But I am working on it :).
Jérôme
Posts: 481
Joined: Tue 16. Mar 2004, 10:33
Location: Cologne, Germany
Contact:

Post by Jérôme »

One question: When is the author-field of an article empty? I could not find out how to remove an author from an article...
Jérôme
Posts: 481
Joined: Tue 16. Mar 2004, 10:33
Location: Cologne, Germany
Contact:

Post by Jérôme »

Hello sustia!

Please try this method I have described in this topic. This should solve your problem.

I have placed it in the 'hacks & enhancements' area because it requires a change in the source code.

I hope it works. If it does not, please don't replay in this thread, but in the thread of the released MOD, so that others can benefit from the discussion, too.

- Jérôme
Post Reply