Re: classifieds problem

by Lori Eldridge <lorrie652(at)icehouse.net>

 Date:  Wed, 23 Apr 2003 16:52:09 -0700
 To:  hwg-basics(at)hwg.org
  todo: View Thread, Original
Hi All,

I'm still trying to figure out how to modify the e-classifieds program so it will allow thumbnails in the headlines when searching for a horse and a large photo on the details page. I'm using the commerce edition and it does not provide this option (need to upgrade and the program already cost too much). However, tech support said we can do this is we can figure out how to modify the code.

However, the program only has 4 options--either full size photos or thumbnails or simple icons or no photo at all for **ALL** ads. It does not provide a different size photo for different ad displays.

I have been studying a book on Perl trying to figure out how to rewrite the code but still need some help. 

Here is the if/else code to upload a static image in the headlines display (a small camera gif). There is a similar if/else to upload a .jpg or .miv or .wav files.

************************

if ($allow_photo_uploads eq "on") {

$number = $fields[$index_of_db_id_number];
$mm = "";

  for ($i = 1;$i <= $max_photo_uploads;$i++)
    {
if ((-e "$upload_path/$section.$number.$i.gif") || (-e "$upload_path/$section.$number.$i.jpg")) { 
$mm = "on";
	print qq~<img src="$graphics_dir/smallcamera.gif" width=16 height=12 border=0 alt="small camera icon" align=middle>~;
last; }
    }

**********************
 I would like to change the above  so it will call up the image for the horse that is listed in the headline and turn the image into a thumbnail (this is already set up in the program to set the size of thumbnail).

And following is the code to upload a photo for the details page (large image). 

I need to incorporate the code for the display ad below into the code for the headline above uploading only a thumbnail image. 

********************

if ($allow_photo_uploads eq "on") {

$number = $fields[$index_of_db_id_number];

  for ($i = 1;$i <= $max_photo_uploads;$i++)
    {
if (-e "$upload_path/$section.$number.$i.gif") {
  if (($ad_photo_size eq "full") || ($form_data{'photo_size'} eq "full")) {
	&require_supporting_libraries (__FILE__, __LINE__, "$path/library/image-lib.pl");
	&imagesize("$upload_path/$section.$number.$i.gif");
	print qq~<img src="$photo_dir/$section.$number.$i.gif" width=$image_width height=$image_height alt="Photo for Ad $number"> ~;
	}
  elsif ($ad_photo_size eq "thumbnail") {
	print qq~<a href="$script_url?db=$form_data{'db'}&website=$form_data{'website'}&session_key=$session_key&search_and_display_db_button=on&results_format=long&db_id=$fields[$index_of_db_id_number]&query=retrieval&photo_size=full"><img src="$photo_dir/$section.$number.$i.gif" width=$thumbnail_size height=$thumbnail_size alt="Thumbnail photo for Ad $number"></a> ~;
	}
  elsif ($ad_photo_size eq "icon") {
	print qq~<a href="$script_url?db=$form_data{'db'}&website=$form_data{'website'}&session_key=$session_key&search_and_display_db_button=on&results_format=long&db_id=$fields[$index_of_db_id_number]&query=retrieval&photo_size=full"><img src="$graphics_dir/photo.gif" width=41 height=41 border=0 alt="photo icon"></a> ~;
	}
  else {
    print qq~~;
	}
}

*******
there is similar code for .miv, .wav. etc files.

 If anyone can help me with this I would appreciate it greatly.

Please write me offline as I'm on the digest.

thanks
Lori

HTML: hwg-basics mailing list archives, maintained by Webmasters @ IWA