Hi Dieter!
Tried swapping out the old sub disp_list with the new one on the forum.
Before:
Multimedia file viewing and clickable links are available for registered members only!! You need to
or
!!
and after:
Multimedia file viewing and clickable links are available for registered members only!! You need to
or
!!
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
Multimedia file viewing and clickable links are available for registered members only!! You need to
or
!!
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