The eAuction Support Forums
https://www.everyscript.de/cgi-bin/yabb/YaBB.pl eAuction 1.6.1.x >> Discussion of Functions >> sub disp_list (Replacement) https://www.everyscript.de/cgi-bin/yabb/YaBB.pl?num=1069603462 Message started by Forum Admin on 11/23/03 at 17:04:22 |
Title: sub disp_list (Replacement) Post by Forum Admin on 11/23/03 at 17:04:22 The following code should be used as a replacement of the original subroutine. The layout of the tables has been changed and they are able to display 'thumbnails' of an item-image instead of displaying only the camera-icon. Code:
|
Title: Re: sub disp_list (Replacement) Post by thisolddoll on 11/23/03 at 23:50:37 Hi Dieter! Tried swapping out the old sub disp_list with the new one on the forum. Before: http://www.todauction.com/cgi-bin/dieter/dieterbef.pl?action=search&searchtype=items&searchstring=50&lang=1 and after: http://www.todauction.com/cgi-bin/dieter/dieteraft.pl?action=search&searchtype=items&searchstring=50&lang=1 However, as you can see from the first, I'd been noodling and came up with this from your "you can do it this way" code. Also managed to make it work for the my items sub. :-D http://www.todauction.com/cgi-bin/dieter/dieter.pl?action=search&searchtype=items&searchstring=50&lang=1 Not using your image size subroutine because these photos in the listing need to be big and it wasn't letting me list with my photos. # in sub disp_user_auction { Again Replace this: # $image # ? ($img_info = qq|<img src="$config{'icon_url'}/$config{'if_image'}" border="0">|) # : ($img_info = qq|<img src="$config{'icon_url'}/$config{'no_image'}" border="0">|); ########### ################ with this my @image; #not declared yet in disp_user_auction so do it here my $disp_img; #use in place of img_info because it's used elsewhere and get confusing @image = split /\s/, $image; #white space delimiter $image ? do { $image !~ /http\:/ #this assumes the user didn't put in any direct links along with upload ? ($disp_img = qq|<img src="$config{'img_url'}/$image[0]" width=50 border=0>|) : ($disp_img = qq|<img src="$image[0]" width=50 border=0>|); } : ($disp_img = qq|<img src="$config{'icon_url'}/$config{'no_image'}" border="0">|); ################# #Then instead of the line after this: #print <<EO_HTML if $form{'searchtype'} =~ /^my_/; # <tr $$rowcolor> #put this: <td align="center" width="50">$disp_img</td> ##################################### # # In sub disp_list # Replace this: # $image # ? ($img_info = qq|<img src="$config{'icon_url'}/$config{'if_image'}" border="0">|) # : ($img_info = qq|<img src="$config{'icon_url'}/$config{'no_image'}" border="0">|); ################ with this my $disp_img; @image = split /\s/, $image; $image ? do { $image !~ /http\:/ ? ($disp_img = qq|<img src="$config{'img_url'}/$image[0]" width=50 border=0>|) : ($disp_img = qq|<img src="$image[0]" width=50 border=0>|); } : ($disp_img = qq|<img src="$config{'icon_url'}/$config{'no_image'}" border="0">|); ################# and substitute $disp_img for img_info in the two html blocks: print <<EO_HTML unless $form{'searchtype'} =~ /^my_/; <tr $$rowcolor> <td align="center" width="50">$disp_img</td> print <<EO_HTML if $form{'searchtype'} =~ /^my_/; <tr $$rowcolor> <td align="center" width="50">$disp_img</td> So, do that call that a "case statement" in perl? Nice! Thanks, Dieter! Michele |
Title: Re: sub disp_list (Replacement) Post by www.blitzday.com on 08/26/04 at 13:08:47 Michelles Way does not work for me as the uses strings which i cannot even find back in the whole script like: print <<EO_HTML if $form{'searchtype'} =~ /^my_/; especially the =~ /^my_/; Does someone have a good working script which indeed shows on the first page where the top items are listed which shows a a little thumbnail? ie 20 x 20 Please met me know if you do, as will i try to figue out how to do this, you might save me time though :-) |
The eAuction Support Forums » Powered by YaBB 2.2! YaBB © 2000-2007. All Rights Reserved. |