• 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!

TOPIC: how to make override on file upload field without

how to make override on file upload field without 11 years 3 months ago #26467

  • office47
  • office47's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 1
I am sure I am not only one that has this need.

I need to make override for upload field so that when image is uploaded actually to populate path of image so it is shown in article as image (not link to image file ) or in contact to populate image field .

below is how it is done now but it is core hack and i need permanent solution

In \administrator\components\com_rsform\helpers\rsform.php

around line 1000 have to change from

if (in_array($property, $uploadFields))
$value = '<a href="'.JURI::root().'index.php?option=com_rsform&task=submissions.view.file&hash='.md5($submission->SubmissionId.$secret.$property).$Itemid.'">'.basename($submission->values[$property]).'</a>';

to

if (in_array($property, $uploadFields))
$value = '<img src="'.'images/somename /'.basename($submission->values[$property]).'" width="350px" />'; //this is line that is changed actually
// Check if this is a multiple field
elseif (in_array($ComponentId, $multipleFields))
$value = str_replace("\n", $form->MultipleSeparator, $value);
elseif ($form->TextareaNewLines && in_array($ComponentId, $textareaFields))
$value = nl2br($value);

in order to populate some fiedls with image.
example contact image

how to override not to hack core, can it be done outside of
\administrator\components\com_rsform\helpers

Thanks in advance
The administrator has disabled public write access.

how to make override on file upload field without 11 years 2 months ago #26473

  • octavian
  • octavian's Avatar
  • OFFLINE
  • RSJoomla! Official Staff
  • Posts: 783
  • Thank you received: 110
Why are you modifying the source code instead of simply using {field:path} as described here ?
Please note: my help is not official customer support. To receive your support, submit a ticket by clicking here
Regards,
RSJoomla! Development Team
The administrator has disabled public write access.
The following user(s) said Thank You: office47
  • 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!