hi,
i`m using the submitcontent form and everything works fine.
i added to upload fields and the images are stored on webspace and they are attached on the email.
now my problem:
i want that links to the files/images are shown in the contentitem that was created by the form. so you can see them by using the link.
thx for any help
i`m using the submitcontent form and everything works fine.
i added to upload fields and the images are stored on webspace and they are attached on the email.
now my problem:
i want that links to the files/images are shown in the contentitem that was created by the form. so you can see them by using the link.
thx for any help
Hi snow crash,
files are stored at http://www.domian.com/components/com_chronocontact/uploads/form_name/file_name
you can get file name :
Cheers
Max
files are stored at http://www.domian.com/components/com_chronocontact/uploads/form_name/file_name
you can get file name :
<?php echo JRequest::getVar('file_field_name'); ?>
Cheers
Max
thx for your quick repley
where do i put this code
that the link to the image/file is directly/automatic shown in the new article
thx
where do i put this code
that the link to the image/file is directly/automatic shown in the new article
thx
where do you want to insert it ine the new article ? you can add a place holder for the image like {image1} and then at the on submit box add this code:
<?php
JRequest::setVar('introtext' , str_replace('{image1}', 'http://www.domian.com/components/com_chronocontact/uploads/form_name/'.JRequest::getVar('file_field_name'), JRequest::getVar('introtext')));
?>
thx again
i want that the link is shown at the bottom of the new article under the text that the user typed into the editorbox
but the placeholder shouldn`t be visible in the editor
this is my form html
and this the on submit code
so now how do i get the placeholder hidden
and the url to the image as link so that only the name of the image is shown as link
i want that the link is shown at the bottom of the new article under the text that the user typed into the editorbox
but the placeholder shouldn`t be visible in the editor
this is my form html
<div class="form_item">
<div class="form_element cf_textarea" style="width:600px;">
<label class="cf_label">Presseartikel:</label>
<div style="width:450px; float:left;">
<?php $editor =& JFactory::getEditor();
echo $editor->display( 'fulltext', '<a href="{image1}"><?php echo JRequest::getVar('file_2'); ?></a>' , '100%', '350', '55', '20', false ) ;
?>
</div>
</div>
<div class="clear"> </div></div>
<div class="form_item">
<div class="form_element cf_fileupload">
<label class="cf_label">Bild 1:</label>
<input class="cf_inputbox" size="20" id="file_2" name="file_2" type="file">
<a onclick="return false;" class="tooltiplink"><img src="components/com_chronocontact/css/images/tooltip.png" class="tooltipimg" width="16" border="0" height="16"></a>
<div class="tooltipdiv">Bild: :: Hier können Sie ein Bild hochladen!</div>
</div><div class="clear"> </div></div>
and this the on submit code
<?php
JRequest::setVar('fulltext' , str_replace('{image1}', 'http://cms.awo-hs.de/components/com_chronocontact/uploads/'.JRequest::getVar('file_2'), JRequest::getVar('fulltext')));
?>
so now how do i get the placeholder hidden
and the url to the image as link so that only the name of the image is shown as link
Hi,
at the end of your form code:
onsubmit:
at the end of your form code:
<div id="someid"></div>
onsubmit:
<?php
JRequest::setVar('fulltext' , str_replace('<div id="someid"></div>', '<a href="http://cms.awo-hs.de/components/com_chronocontact/uploads/'.JRequest::getVar('file_2').'">link</a>', JRequest::getVar('fulltext')));
?>
thx now it`s working
i got this for the editor with two placeholder in it ( {image1}, {mage2} )
and this for the on submit
this code only works for one image
when i put in a second placeholder and copy the onsubmit code and make the needed changes (for the file) only the second placeholder gets replaced
how can i do it that both links are shown?
thx for u help
i got this for the editor with two placeholder in it ( {image1}, {mage2} )
<?php
$editor =& JFactory::getEditor();
echo $editor->display( 'fulltext', 'Presseartikel hier einfügen <br /><br /><span style="visibility:hidden;">{image1}, {image2}</span}' , '100%', '350', '55', '20', false ) ;
?>
and this for the on submit
<?php
JRequest::setVar('fulltext' , str_replace('{image1}', '<a class="readon" href="http://cms.awo-hs.de/components/com_chronocontact/uploads/submitcontent/'.JRequest::getVar('file_2').'" target="_blank" >Bild 1</a>', JRequest::getVar('fulltext')));
?>
<?php
JRequest::setVar('fulltext' , str_replace('{image2}', '<a class="readon" href="http://cms.awo-hs.de/components/com_chronocontact/uploads/submitcontent/'.JRequest::getVar('file_3').'" target="_blank" >Bild 2</a>', JRequest::getVar('fulltext')));
?>
<?php
$_POST['catid'] = '95';
$_POST['id'] = '';
$_POST['sectionid'] = '21';
$_POST['state'] = '0';
$_POST['created'] = date("Y-m-d H:i:s");
?>
this code only works for one image
when i put in a second placeholder and copy the onsubmit code and make the needed changes (for the file) only the second placeholder gets replaced
how can i do it that both links are shown?
thx for u help
You will need to do the 2nd str_replace inside the first one, exactly the same way I use str_replace inside the JRequest::setVar function, so one inside one OR after the first replace, write:
then use this variable in the 2nd replace!
Cheers
Max
$fulltext = JRequest::getVar('fulltext');
then use this variable in the 2nd replace!
Cheers
Max
i don`t get it working😟
how should i get those codes together?
thx for your big and fast help
<?php
JRequest::setVar('fulltext' , str_replace('{image1}', '<a class="readon" href="http://cms.awo-hs.de/components/com_chronocontact/uploads/submitcontent/'.JRequest::getVar('file_2').'" target="_blank" >Bild 1</a>',
$fulltext = JRequest::getVar('fulltext');
JRequest::setVar('fulltext' , str_replace('{image2}', '<a class="readon" href="http://cms.awo-hs.de/components/com_chronocontact/uploads/submitcontent/'.JRequest::getVar('file_3').'" target="_blank" >Bild 2</a>',
JRequest::getVar('fulltext')))));
?>
how should i get those codes together?
thx for your big and fast help
try this:
<?php
JRequest::setVar('fulltext' , str_replace('{image1}', '<a class="readon" href="http://cms.awo-hs.de/components/com_chronocontact/uploads/submitcontent/'.JRequest::getVar('file_2').'" target="_blank" >Bild 1</a>', JRequest::getVar('fulltext')));
$fulltext = JRequest::getVar('fulltext');
JRequest::setVar('fulltext' , str_replace('{image2}', '<a class="readon" href="http://cms.awo-hs.de/components/com_chronocontact/uploads/submitcontent/'.JRequest::getVar('file_3').'" target="_blank" >Bild 2</a>', $fulltext));
?>
no it`s not working it only shows the 2nd placeholder as link and the 1st is just plaintext.
try this
<?php
$fulltext = JRequest::getVar('fulltext');
$fulltext = str_replace('{image1}', '<a class="readon" href="http://cms.awo-hs.de/components/com_chronocontact/uploads/submitcontent/'.JRequest::getVar('file_2').'" target="_blank" >Bild 1</a>', $fulltext);
$fulltext = str_replace('{image2}', '<a class="readon" href="http://cms.awo-hs.de/components/com_chronocontact/uploads/submitcontent/'.JRequest::getVar('file_3').'" target="_blank" >Bild 2</a>', $fulltext);
JRequest::setVar('fulltext', $fulltext);
?>
thx so much
works fine😀
works fine😀
hi max
two more questions
how can i show the name of the image as link name?
and how can i hide the link when no image was uploaded?
i think question 2 i solved when question 1 is solved
because when there is no image then there is no name right?
i tried this for Bild 1
but i do get an Parse error
here is the on submit code
thx for your great support
two more questions
how can i show the name of the image as link name?
and how can i hide the link when no image was uploaded?
i think question 2 i solved when question 1 is solved
because when there is no image then there is no name right?
i tried this for Bild 1
echo JRequest::getVar('file_3')
basename($attachments['file_2'])
but i do get an Parse error
here is the on submit code
<?php
$fulltext = JRequest::getVar('fulltext');
$fulltext = str_replace('{image1}', '<a class="readon" href="http://cms.awo-hs.de/components/com_chronocontact/uploads/submitcontent/'.JRequest::getVar('file_2').'" target="_blank" >Bild 1</a>', $fulltext);
$fulltext = str_replace('{image2}', '<a class="readon" href="http://cms.awo-hs.de/components/com_chronocontact/uploads/submitcontent/'.JRequest::getVar('file_3').'" target="_blank" >Bild 2</a>', $fulltext);
JRequest::setVar('fulltext', $fulltext);
?>
thx for your great support
Hi, name of image as link text:
$fulltext = str_replace('{image1}', '<a class="readon" href="http://cms.awo-hs.de/components/com_chronocontact/uploads/submitcontent/'.JRequest::getVar('file_2').'" target="_blank" >'.JRequest::getVar('file_2').'</a>', $fulltext);
thx works perfect
This topic is locked and no more replies can be posted.