Code used exactly the same as the link
http://www.chronoengine.com/forums/index.php?option=com_chronoforums&cont=posts&f=2&t=13056#p26629
When there is no attachment, broken link image icon shows in the article.(IE7 screenshot attached)
I searched the forum, but i could not find the answer.
Can somebody kindly help me to translate (if there is no attachment, post text only, else post with attachment) to php language? Thank you. 😀
http://www.chronoengine.com/forums/index.php?option=com_chronoforums&cont=posts&f=2&t=13056#p26629
When there is no attachment, broken link image icon shows in the article.(IE7 screenshot attached)
I searched the forum, but i could not find the answer.
Can somebody kindly help me to translate (if there is no attachment, post text only, else post with attachment) to php language? Thank you. 😀
Hi freefall,
It will be something like this:
You could go further and check that the file exists too.
Bob
It will be something like this:
$file_1 = JRequest::getVar('file_1', '');
if ( $file_1 ) {
$fulltext_template = str_replace('{file_1}', '<p><img style="max-width:500px;border:5px solid #eeeeee;" src="/components/com_chronocontact/uploads/showandtell/'.JRequest::getVar("file_1").'" target="_blank" ></p>', $fulltext_template);
} else {
$fulltext_template = str_replace('{file_1}', '', $fulltext_template);
}
repeated for each file.You could go further and check that the file exists too.
Bob
This topic is locked and no more replies can be posted.