eAuction
  Not just another Perl script
Google
Welcome, Guest. Please Login or Register


If you use eAuction a lot and like it or if you make money from eAuction or from eAuction-related activities ...
then the project asks you for a donation in favor of the further development.



The forums are protected by
AccessControl
(written by Dieter Werner)
Click here if you want to check your IP against the most important RBLs of the net.
Click here in order to visite the AccessControl forums.


<< Visit the international e Auction Marketplace >>
Buy and sell PC and Consumer Electronic components






  HomeHelpSearchLoginRegister
 



Pages: 1 2 3 
Display Item (Read 639 times)
thisolddoll
eAuction Novice
*
Offline

I love my cats!

Posts: 0
Ohio
Gender: female
Re: Display Item
Reply #3 - 12/28/03 at 04:59:44
 
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 Login or Register!!


The only changes I made were in thise two subroutines:

sub new
sub proc_new

Good luck and thanks for asking!
Michele
Back to top
 
 

Michele


Advertising
View Profile | WWW | AIM   IP Logged
Dieter Werner
Administrator
*****
Offline

Dipl. Paranoiac ®

Posts: 1162
Germany
Gender: male
Re: Display Item
Reply #4 - 12/28/03 at 11:20:05
 
Very good Michele  Smiley
Back to top
 
 

Multimedia file viewing and clickable links are available for registered members only!!  You need to Login or Register!!


Greetings from Germany
Dieter Werner




Advertising
View Profile | WWW   IP Logged
floinfo
eAuction User
**
Offline

I love Perl

Posts: 26

Re: Display Item
Reply #5 - 12/28/03 at 19:44:33
 
O, I forget!
Also, it is great on your auction site the "description" area.

When I see for example the:

Multimedia file viewing and clickable links are available for registered members only!!  You need to Login or Register!!


Your item description is in a nice table, cool!

How did you do that? Just used a html table copy/paste or did you modified the script, so anybody could write text in the table format when post an item ?

Thanks, Balint
Back to top
 
 


Advertising
View Profile   IP Logged
Pages: 1 2 3 


If you like eAuction, please Rate it.
If you don't like eAuction, please Rate it too.


1 is being poor and 10 is being excellent


EveryScript

ip-location


AccessControl - Members Only