Dear Balint,
To display items, the items have to be there, first. When the user enters an item with images, the data file has an array of urls that point to each image. This line in the display subroutine:
@image = split /\s/, $image || (push @image, $image);
breaks up the array of urls. And this block
foreach (@image) {
$_ !~ /\.\w{3,}$/ && next;
$_ =~ /http:\/\//i
? ($img_info .= qq|<tr>\n<td><img src="$_"></td>\n</tr>\n|)
: ($img_info .= qq|<tr>\n<td><img src="$config{'img_url'}/$_"></td>\n</tr>\n|);
}
will read each image in the array - whether it's three or thirty.
So the trick is to get more image urls into that image array at the time the item is entered.
First you have to give the user a place to enter more pictures:
in sub new {
search for this:
$form{"IMAGE$_"} = "" for 0 .. 3
and change the 3 to 6 like so:
$form{"IMAGE$_"} = "" for 0 .. 6;
or any number of images you want your user to be able to enter.
do the same in sub proc_new {
so all the images make it to the data files:
where it says
for (1 .. 3)
change it to
for (1 .. 6)
(there are two places to change this in this subroutine)
Back in sub new {
Find the html table that displays the form to input the images. Here's the block that shows the input line for image #3:
<tr bgcolor="$config{colortablebody}" rowspan="3">
<td colspan="3" nowrap><b>$txt{'Image'} 3:</b>
</font><input type="file" name="UploadFile2"
size="38">
</td>
</tr>
So it's a matter here of adding a copy of this block - one for each additional image you want.
To make the image input column on the right line up with the images that Dieter has in his table, put in a dummy data entry after the bgcolor line.
So your copies will look like this (I changed the image sizes so your code might not look exactly like this)
<tr bgcolor="$config{colortablebody}" rowspan="5">
<td></td>
<td colspan="3" nowrap><b>$txt{'Image'} 4:</b>
</font><input type="file" name="UploadFile2"
size="38">
</td>
As I was writing this, I changed the number of images on my auction from 6 to 8, so I'm pretty sure this is all there is to it. If you'd like to see the text of the code in full, here's a link to it as a text file that you can download and examine:
Multimedia file viewing and clickable links are available for registered members only!! You need to
or
!!
The only changes I made were in thise two subroutines:
sub new
sub proc_new
Good luck and thanks for asking!
Michele