Skocz do zawartości
"Idzie nowe..." - o zmianach i nie tylko ×
Przeniesienie zakupów z IPS Marketplace / Moving bought items from IPS Marketplace ×

Wyświetlenie linku do obrazka po wysłaniu.


inzonek

Rekomendowane odpowiedzi

Witam,

Jak wyświetlić link do obrazka wysłanego na serwer w uploads/(..miesiąc..) po wysłaniu? Wszystko pięknie działa, lecz niestety nie pokazuje tego linku wysłanego obrazka, a o to w tym ma właśnie chodzić, aby wyświetlało link, aby użytkownik mógł normalnie korzystać z tego obrazka po wysłaniu na serwer.

Z góry dzięki! :)

Odnośnik do komentarza
Udostępnij na innych stronach

  • Manager

storageContainer

 

/**
 * Upload class for Form Builder
 */
class _Upload extends FormAbstract
{
	/**
	 * @brief	Default Options
	 * @code
	 	$defaultOptions = array(
	 		'storageExtension'	=> 'Profile',										// The file storage extension to use. This is required if postKey is NULL and temporary is FALSE.
	        'storageContainer'  => NULL,                                            // The file storage container to use.
	 		'multiple'			=> TRUE,											// Specifies if the field should allow multiple file uploads. Default is FALSE.
	 		'image'				=> array( 'maxWidth' => 100, 'maxHeight' => 100 ),	// If the upload must be an image, can pass TRUE or an array with max width and height (in which case, image will be resized appropriately). Default is NULL. Max width/height cannot be used in conjunction with temporary uploads. If it can be, but doesn't have to an image, and you still want to specify max width and height, add an "optional" property set to true
	 		'allowedFileTypes'	=> array( 'pdf', 'txt' ),							// Allowed file extensions. NULL allows any. Default is NULL.
	 		'maxFileSize'		=> 100,												// Maximum file size in megabytes. NULL is no limit. Default is NULL. Note that there *may* be server limitations regardless of this value which are calculated automatically.
	 		'totalMaxSize'		=> 100,												// If this is a "multiple" upload field, the maximum storage space allowed in total in megabytes.
	 		'maxFiles'			=> NULL,											// Maximum number of files that can be uploaded
	 		'postKey'			=> 'abc',											// If provided, uploads will be treated as post attachments using the given post key
	 		'temporary'			=> TRUE,											// If TRUE, the image will not be moved and the filename returned, rather than an \IPS\File object. This should ONLY be used for files which are genuinely
	 																				 	temporary (e.g. importing skins, languages) as the file will be deleted after the script finished executing. Default is FALSE.
	 		'callback'			=> function() { ... },								// A callback function to run against submitted files
	 		'minimize'			=> TRUE,											// Default is minimized. Pass FALSE to show the maximized field. Cannot be used in conjunction with temporary uploads
	 		'retainDeleted'		=> FALSE,											// By default, if you specify a default value and the user deletes the files specified, the files will be physically deleted. This option overrides this behaviour.
	 		'template'			=> 'core.attachments.fileItem'						// The javascript template key to use when rendering uploaded items
	 		'obscure'			=> TRUE,											// Controls if an md5 hash should be added to the filename. *Must* be TRUE unless the uploaded files are public to all users (like emoticons)
	 	);
	 * @endcode
	 */

 

  • Lubię to 2

intermedia - profesjonalne rozwiązania Invision Power Board

---

Chcesz uzyskać szybko i sprawnie pomoc? Uzupełnij wersję i adres w profilu.

Odnośnik do komentarza
Udostępnij na innych stronach

@DawPi

// Create the form instance
$form = new \IPS\Helpers\Form;

// Add our form fields
$form->add( new \IPS\Helpers\Form\Upload('name') );

if ( $values = $form->values() )
{
	// I tutaj chce, aby po wysłaniu formularza wyświetlił się tekst
}

// Send the form for output
\IPS\Output::i()->output = $form;

 

Odnośnik do komentarza
Udostępnij na innych stronach

  • Manager

Gdzie ten jest? To się ma tylko wyświetlić? Wrzucałeś to w warunek po if wysłaniu czy tak jak na górze to masz?

  • Lubię to 1

intermedia - profesjonalne rozwiązania Invision Power Board

---

Chcesz uzyskać szybko i sprawnie pomoc? Uzupełnij wersję i adres w profilu.

Odnośnik do komentarza
Udostępnij na innych stronach

@DawPi @X3nO nadal nic

// Create the form instance
$form = new \IPS\Helpers\Form;

// Add our form fields
$form->add( new \IPS\Helpers\Form\Upload('name') );

if ( $values = $form->values() )
{
	\IPS\Output::i()->output = 'tekst' . $values['name'];
	return;
}

// Send the form for output
\IPS\Output::i()->output = $form;
// Create the form instance
$form = new \IPS\Helpers\Form;

// Add our form fields
$form->add( new \IPS\Helpers\Form\Upload('name') );

if ( $values = $form->values() )
{
	\IPS\Output::i()->output = 'tekst' . $values['name'];
}

// Send the form for output
\IPS\Output::i()->output = $form;

Testowałem różne opcje i nic się nie wyświetla (dawałem kod poza ifem też), a nie chcę robić to przez szablon.

Odnośnik do komentarza
Udostępnij na innych stronach

Gość
Ten temat został zamknięty. Brak możliwości dodania odpowiedzi.
  • Ostatnio przeglądający   0 użytkowników

    • Brak zarejestrowanych użytkowników przeglądających tę stronę.
×
×
  • Dodaj nową pozycję...

Powiadomienie o plikach cookie

Umieściliśmy na Twoim urządzeniu pliki cookie, aby pomóc Ci usprawnić przeglądanie strony. Możesz dostosować ustawienia plików cookie, w przeciwnym wypadku zakładamy, że wyrażasz na to zgodę.