Changing the layout of frontend user upload

Phoca Gallery - image gallery extension
Debbie
Phoca Newbie
Phoca Newbie
Posts: 5
Joined: 26 Aug 2011, 14:13

Changing the layout of frontend user upload

Post by Debbie »

Hi,

Sorry to bother you all....

I'm just wondering if it is possible to re-order the layout of the front-end user upload option?

At the moment the user is presented with the browse option to find their image, with the upload button located beside it, followed by an input box for the title and an input box for the description.
For the website I am building it is important that all images are given a title and a description. Can I move the "upload" button so that it appears below the description box, as this will encourage users to fill out all fields first?
Is there a certain php file I need to change to do this?

Or, can I make the title and description fields compulsory somehow?


Thanks in advance. :|

Debbie
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 49172
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Changing the layout of frontend user upload

Post by Jan »

Hi, then you need to customize the template for this:

components/com_phocagallery/views/user/tmpl/ ...

Jan
If you find Phoca extensions useful, please support the project
Debbie
Phoca Newbie
Phoca Newbie
Posts: 5
Joined: 26 Aug 2011, 14:13

Re: Changing the layout of frontend user upload

Post by Debbie »

Thanks Jan,


I will try that now.

Debbie
Debbie
Phoca Newbie
Phoca Newbie
Posts: 5
Joined: 26 Aug 2011, 14:13

Re: Changing the layout of frontend user upload

Post by Debbie »

Hi Jan,

I have tried moving rows in the table in the default_uploadform.php, but it didn't cause any changes to happen.

Do I need to change another php file too?

Thanks for your help.

I really just need the upload button to be at the bottom, below the title and description.


Also, is it possible to change "title" to "Insert your name here:"?
This will allow the users name to appear alongside their photos (instead of a title).

I really appreciate your help.

Thanks!

Debbie
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 49172
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Changing the layout of frontend user upload

Post by Jan »

Hi, try to recheck if you have moved the right rows.

The titles can be hardcoded in the code, or you can change them in language files:

https://www.phoca.cz/documents/46-transl ... extensions (see this article to know where the language files are listed)

Jan
If you find Phoca extensions useful, please support the project
Debbie
Phoca Newbie
Phoca Newbie
Posts: 5
Joined: 26 Aug 2011, 14:13

Re: Changing the layout of frontend user upload

Post by Debbie »

Hi,

To change the layout I have tried the following:

In the default_uploadform.php file I have changed the info from this:

Code: Select all

<table>
	<tr>
		<td><?php echo JText::_('COM_PHOCAGALLERY_FILENAME');?>:</td>
		<td>
		<input type="file" id="file-upload" name="Filedata" />
		<input type="submit" id="file-upload-submit" value="<?php echo JText::_('COM_PHOCAGALLERY_START_UPLOAD'); ?>"/>
		<span id="upload-clear"></span>
		</td>
	</tr>

	<tr>
		<td><?php echo JText::_( 'COM_PHOCAGALLERY_IMAGE_TITLE' ); ?>:</td>
			<td>
				<input type="text" id="phocagallery-upload-title" name="phocagalleryuploadtitle" value=""  maxlength="255" class="comment-input" /></td>
		</tr>
		
		<tr>
			<td><?php echo JText::_( 'COM_PHOCAGALLERY_DESCRIPTION' ); ?>:</td>
			<td><textarea id="phocagallery-upload-description" name="phocagalleryuploaddescription" onkeyup="countCharsUpload('<?php echo $this->tmpl['upload_form_id']; ?>');" cols="30" rows="10" class="comment-input"></textarea></td>
		</tr>
			
		<tr>
			<td>&nbsp;</td>
			<td><?php echo JText::_('COM_PHOCAGALLERY_CHARACTERS_WRITTEN');?> <input name="phocagalleryuploadcountin" value="0" readonly="readonly" class="comment-input2" /> <?php echo JText::_('COM_PHOCAGALLERY_AND_LEFT_FOR_DESCRIPTION');?> <input name="phocagalleryuploadcountleft" value="<?php echo $this->tmpl['maxuploadchar'];?>" readonly="readonly" class="comment-input2" />
			</td>
		</tr>
</table>

to this....:

Code: Select all

<table>
	<tr>
		<td><?php echo JText::_( 'COM_PHOCAGALLERY_IMAGE_TITLE' ); ?>:</td>
			<td>
				<input type="text" id="phocagallery-upload-title" name="phocagalleryuploadtitle" value=""  maxlength="255" class="comment-input" /></td>
		</tr>
		
		<tr>
			<td><?php echo JText::_( 'COM_PHOCAGALLERY_DESCRIPTION' ); ?>:</td>
			<td><textarea id="phocagallery-upload-description" name="phocagalleryuploaddescription" onkeyup="countCharsUpload('<?php echo $this->tmpl['upload_form_id']; ?>');" cols="30" rows="10" class="comment-input"></textarea></td>
		</tr>
			
		<tr>
			<td>&nbsp;</td>
			<td><?php echo JText::_('COM_PHOCAGALLERY_CHARACTERS_WRITTEN');?> <input name="phocagalleryuploadcountin" value="0" readonly="readonly" class="comment-input2" /> <?php echo JText::_('COM_PHOCAGALLERY_AND_LEFT_FOR_DESCRIPTION');?> <input name="phocagalleryuploadcountleft" value="<?php echo $this->tmpl['maxuploadchar'];?>" readonly="readonly" class="comment-input2" />
			</td>
		</tr>
		
		<tr>
		<td><?php echo JText::_('COM_PHOCAGALLERY_FILENAME');?>:</td>
		<td>
		<input type="file" id="file-upload" name="Filedata" />
		<input type="submit" id="file-upload-submit" value="<?php echo JText::_('COM_PHOCAGALLERY_START_UPLOAD'); ?>"/>
		<span id="upload-clear"></span>
		</td>
	</tr>
</table>
i.e., I moved the upload button.

However, this made no change to my upload page at all. It still looks the same.

Is there another file that I need to change, or different code I need to move/change?


Thanks,

Debbie

p.s. I am very new to this, so simple instructions would be great! :)
JTM
Phoca Newbie
Phoca Newbie
Posts: 2
Joined: 01 Sep 2011, 00:45

Re: Changing the layout of frontend user upload

Post by JTM »

Hello -

I know you must hear the praises all the time, but Phoca extensions are really great. :)

I believe I have a simple issue, that is right in line with Debbie's. In her code above, the maxlength of the image title is 255. I simply want to change that to a lower number, but when I do so in the same code that Debbie is manipulating, it also has no affect. If you can, please let us know if another file needs to be changed.

Thank you
JTM
Phoca Newbie
Phoca Newbie
Posts: 2
Joined: 01 Sep 2011, 00:45

Re: Changing the layout of frontend user upload

Post by JTM »

Jan -

Sorry to bother you.... I stumbled across the answer minutes after posting this. But, I posted after hours of frustration, so please do not think me hastey.

Debbie -

In case it will help you, I found another default_uploadform.php file in the Category section:

components/com_phocagallery/views/category/tmpl/ ...

That is where I needed to make my change.

I hope that helps.

- JTM
Debbie
Phoca Newbie
Phoca Newbie
Posts: 5
Joined: 26 Aug 2011, 14:13

Re: Changing the layout of frontend user upload

Post by Debbie »

JTM wrote:Jan -

Sorry to bother you.... I stumbled across the answer minutes after posting this. But, I posted after hours of frustration, so please do not think me hastey.

Debbie -

In case it will help you, I found another default_uploadform.php file in the Category section:

components/com_phocagallery/views/category/tmpl/ ...

That is where I needed to make my change.

I hope that helps.

- JTM
Thank you so much JTM, you solved my problem!!! :|
Post Reply