Solved

makethumb.php in pro bid 5.25 Version Problem

Posted on 2011-10-01
9
706 Views
Last Modified: 2012-05-12
When i create a new auction and i upload an image it isn't show in the end of the auction-create process, where all details of an auction are sum up before submitting it definitly.

The images are being uploaded correctly i checked the steps and the directory where the images are being uploaded during the auction-create process.

The odd thing is, when i reload the page of the auction sum-up the picture shows up. But not in the first place. So it is for the auction itself, the pictures won't show up at the first load of the page, only after reloading the thumbs, pictures and auction thumb picture will show up.

Suggestion in Google found threads where: compile the GD library -> GD Library is correctly compiled, transfer the makethumb.php file in binary mode -> done, directory permissions setting to 777 -> done.

This is extremly annoying if users want to create an auction by themselves, because they don't know the trick of the reload/refresh and it should work without anyways.

The code of the makethumb.php is attached.

<?
// error_reporting(E_ALL|E_STRICT);
ini_set('display_errors', 0);
ini_set('display_startup_errors', 0);

// Fehlermeldungen mit HTML erg‰nzen
// bei Entwicklung f¸r eine Shell ausschalten
ini_set('html_errors', 0); 

## v5.20 -> jun. 20, 2005
$code = 'function gd_info() {
       $array = Array(
                       "GD Version" => "",
                       "FreeType Support" => 0,
                       "FreeType Support" => 0,
                       "FreeType Linkage" => "",
                       "T1Lib Support" => 0,
                       "GIF Read Support" => 0,
                       "GIF Create Support" => 0,
                       "JPG Support" => 0,
                       "PNG Support" => 0,
                       "WBMP Support" => 0,
                       "XBM Support" => 0
                     );
       $gif_support = 0;

       ob_start();
       eval("phpinfo();");
       $info = ob_get_contents();
       ob_end_clean();
     
       foreach(explode("\n", $info) as $line) {
           if(strpos($line, "GD Version")!==false)
               $array["GD Version"] = trim(str_replace("GD Version", "", strip_tags($line)));
           if(strpos($line, "FreeType Support")!==false)
               $array["FreeType Support"] = trim(str_replace("FreeType Support", "", strip_tags($line)));
           if(strpos($line, "FreeType Linkage")!==false)
               $array["FreeType Linkage"] = trim(str_replace("FreeType Linkage", "", strip_tags($line)));
           if(strpos($line, "T1Lib Support")!==false)
               $array["T1Lib Support"] = trim(str_replace("T1Lib Support", "", strip_tags($line)));
           if(strpos($line, "GIF Read Support")!==false)
               $array["GIF Read Support"] = trim(str_replace("GIF Read Support", "", strip_tags($line)));
           if(strpos($line, "GIF Create Support")!==false)
               $array["GIF Create Support"] = trim(str_replace("GIF Create Support", "", strip_tags($line)));
           if(strpos($line, "GIF Support")!==false)
               $gif_support = trim(str_replace("GIF Support", "", strip_tags($line)));
           if(strpos($line, "JPG Support")!==false)
               $array["JPG Support"] = trim(str_replace("JPG Support", "", strip_tags($line)));
           if(strpos($line, "PNG Support")!==false)
               $array["PNG Support"] = trim(str_replace("PNG Support", "", strip_tags($line)));
           if(strpos($line, "WBMP Support")!==false)
               $array["WBMP Support"] = trim(str_replace("WBMP Support", "", strip_tags($line)));
           if(strpos($line, "XBM Support")!==false)
               $array["XBM Support"] = trim(str_replace("XBM Support", "", strip_tags($line)));
       }
       
       if($gif_support==="enabled") {
           $array["GIF Read Support"]  = 1;
           $array["GIF Create Support"] = 1;
       }

       if($array["FreeType Support"]==="enabled"){
           $array["FreeType Support"] = 1;    }
 
       if($array["T1Lib Support"]==="enabled")
           $array["T1Lib Support"] = 1;    
       
       if($array["GIF Read Support"]==="enabled"){
           $array["GIF Read Support"] = 1;    }
 
       if($array["GIF Create Support"]==="enabled")
           $array["GIF Create Support"] = 1;    

       if($array["JPG Support"]==="enabled")
           $array["JPG Support"] = 1;
           
       if($array["PNG Support"]==="enabled")
           $array["PNG Support"] = 1;
           
       if($array["WBMP Support"]==="enabled")
           $array["WBMP Support"] = 1;
           
       if($array["XBM Support"]==="enabled")
           $array["XBM Support"] = 1;
       
       return $array;
   }';

function gd_version() {
	global $code;
	if (empty($result)) {
		if (!function_exists('gd_info')) $gd_info = eval($code);
		else $gd_info = gd_info();
		
		if (substr($gd_info['GD Version'], 0, strlen('bundled (')) == 'bundled (') {
			$result = (float) substr($gd_info['GD Version'], strlen('bundled ('), 3); 
		} else {
			$result = (float) substr($gd_info['GD Version'], 0, 3); 
		}
	}
	return $result;
}

function ImageCreateFunction($x_size, $y_size) {
	$ImageCreateFunction = 'ImageCreate';

	if (gd_version() >= 2.0) {
		$ImageCreateFunction = 'ImageCreateTrueColor';
	}
	if (!function_exists($ImageCreateFunction)) {
		return FALSE;
	}
	return $ImageCreateFunction($x_size, $y_size);
}

function ImageCopyFunction($dst_im, $src_im, $dstX, $dstY, $srcX, $srcY, $dstW, $dstH, $srcW, $srcH) {
	$ImageCopyFunction = 'ImageCopyResized';
	if (gd_version() >= 2.0) {
		$ImageCopyFunction = 'ImageCopyResampled';
	}
	if (!function_exists($ImageCopyFunction)) {
		return FALSE;
	}
	return $ImageCopyFunction($dst_im, $src_im, $dstX, $dstY, $srcX, $srcY, $dstW, $dstH, $srcW, $srcH);
}

function generateThumb($sourceFilename, $thumb_x, $square=FALSE, $border=FALSE) {
	$image_info = getimagesize($sourceFilename);
	$image_width = $image_info[0];
	$image_height = $image_info[1];
	
	$resize_w = ($image_width>$image_height) ? $image_width : $image_height;

	if ($resize_w<$thumb_x) $thumb_x = $resize_w;	
	
	if ($square) { 
		$thumb_image_x = $thumb_x;
		$thumb_image_y = $thumb_x;
	}

	// workaround for v1.6.2 where the GIF images arent recognized.
	$ImgCreate = 'ImageCreateFromJPEG';
	switch ($image_info['mime']) {
		case 'image/gif':
			$ImgCreate = 'ImageCreateFromGIF';
			echo('ImageCreateFromGIF');
			break;
		case 'image/jpeg':
			$ImgCreate = 'ImageCreateFromJPEG';
			echo('ImageCreateFromGIF');
			break;
		case 'image/png':
			$ImgCreate = 'ImageCreateFromPNG';
			echo('ImageCreateFromGIF');
			break;
        
	}

	if (!$square) {
		$shrinkratio = $image_width/$thumb_x;
		$thumb_y = $image_height/$shrinkratio;
		$start_x = 0;
		$start_y = 0;
	} else if ($square) {
		if ($image_width>$image_height) {
			$shrinkratio = $image_width/$thumb_x;
			$thumb_y = $image_height/$shrinkratio;
			$start_x = 0;
			$start_y = (abs($thumb_image_y - $thumb_y)) / 2;
		} else if ($image_width<=$image_height) {
			$shrinkratio = $image_height/$thumb_x;
			$thumb_y =$thumb_x;
			$thumb_x = $image_width/$shrinkratio;
			$start_y = 0;
			$start_x = (abs($thumb_image_x - $thumb_x)) / 2;
		}
	}
	
	$thumbInput = $ImgCreate($sourceFilename); 

   	if (!$thumbInput) { /* See if it failed */
    	$thumbInput  = imagecreate($thumb_x, $thumb_y); /* Create a blank image */
       	$bgc = imagecolorallocate($thumbInput, 255, 255, 255);
       	$tc  = imagecolorallocate($thumbInput, 0, 0, 0);
       	imagefilledrectangle($thumbInput, 0, 0, 150, 30, $bgc);
       	/* Output an errmsg */
       	imagestring($thumbInput, 1, 5, 5, "Error loading $sourceFilename", $tc);
		imagejpeg($thumbInput,'',90);
		imagedestroy($thumbInput);
   	} else {
		if ($square) {
			$thumbOutput = ImageCreateFunction($thumb_image_x,$thumb_image_y) or die("couldn't create image"); 
			$border_x = $thumb_image_x - 1;
			$border_y = $thumb_image_y - 1;
		} else {
			$thumbOutput = ImageCreateFunction($thumb_x,$thumb_y) or die("couldn't create image"); 
			$border_x = $thumb_x - 1;
			$border_y = $thumb_y - 1;
		}
	
		$background_color = imagecolorallocate($thumbOutput, 255, 255, 255);
		imagefill($thumbOutput,0,0,$background_color);
		ImageCopyFunction($thumbOutput,$thumbInput,$start_x,$start_y,0,0,$thumb_x,$thumb_y,$image_width,$image_height) or die("coudln't resize image"); 
		if ($border) {
			$border_color = imagecolorallocate($thumbOutput, 0, 0, 0);
			imagerectangle($thumbOutput,0,0,$border_x,$border_y,$border_color) or die("couldn't create image"); 
		}
		
		$bild = explode("/", $_GET[pic]);
        
		$jmwd_temp = count($bild) - 1;
		$bildname = $bild[$jmwd_temp];

		$jmwd_dateipfad = "uplimg/thumbs/".$_GET[w]."_".$_GET[y]."_".$bildname;
		
		imagejpeg($thumbOutput,$jmwd_dateipfad,90);
		imagejpeg($thumbOutput,'',90);
		imagedestroy($thumbOutput);
	}
}

### here we call the function, and we get the GET parameters;
$pic = $_GET['pic'];
$thumbWidth = $_GET['w'];
$isSquare = ($_GET['sq']=='Y')? TRUE : FALSE;
$isBorder = ($_GET['b']=='Y') ? TRUE : FALSE;

## if check is submitted then do the queries needed, otherwise create the pics
if ($_GET['check']=="phpinfo") {
	phpinfo();
} else if ($_GET['check']=="gdinfo") {
	phpinfo(INFO_MODULES);
} if ($_GET['check']=="") {
	if (isset($pic)&&$thumbWidth>0) {
		
		$bild = explode("/", $_GET[pic]);
		$jmwd_temp = count($bild) - 1;
		$bildname = $bild[$jmwd_temp];

		$jmwd_dateipfad = "uplimg/thumbs/".$_GET[w]."_".$_GET[y]."_".$bildname;

		if(file_exists($jmwd_dateipfad))
		{
			header("Location: ".$jmwd_dateipfad);
		}	
		else
		{
            
			header("Content-type: image/jpeg");
			generateThumb($pic, $thumbWidth, $isSquare, $isBorder);
			echo('Thumb');
		}
        
	} else if (!isset($pic)) {
		echo "<strong>ERROR:</strong> No image submitted";
	} else if ($thumbWidth<=0) {
		echo "<strong>ERROR:</strong> Invalid resizing option";
	}
}
?>

Open in new window

0
Comment
Question by:mcnute
  • 5
  • 4
9 Comments
 
LVL 108

Expert Comment

by:Ray Paseur
Comment Utility
I can't really tell what might be wrong from the code posted here; I would need to see it in action and examine the file structure.  However I see that the code seems to end by using the header() - either to redirect the browser to a file, or to generate an image directly into the browser output stream.

In the HTTP protocol, all headers must come first and be complete before any browser output at all, even invisible whitespace.  So if there is any output from any other part of the scripts before this function is called, the header() here will fail.  It may be that the script is working perfectly and creating the thumbnails, but the header() is not working.

I think what I might do is either try adding ob_start() to the top of the main script that calls this, or modify this to present a link to the client with a note that says something like "See your thumbnail image here."
0
 
LVL 11

Author Comment

by:mcnute
Comment Utility
They are three more files involved the picture generating script. I've attached them here. I can't only reload the images, they still don't come up. I have to reload the whole page, because this would mean significant increase of traffic and the browser will output a security message on every reload which must be confirmed.

They are part of a step process when making auctions. The way i attached the files represent the order in the auction process.
The main script is attached as last, which manages the step REQUESTS.

I tried to put the ob_start(); on the top, but still no luck.
In the screenshot it is possible to see the broken link icons instead of the images. When reloading the images appear correctly.

The browser(firefox 6 mac) gives this error message when trying to navigate to the image through the source code.
In the first attempt it says: The graphic couldn't be loaded, becaus the graphic contains errors. When I reload the image i get this instead:
 
ÿØÿà¿JFIF¿¿¿¿¿¿ÿþ¿;CREATOR: gd-jpeg v1.0 (using IJG JPEG v62), quality = 90
ÿÛ¿C¿




ÿÛ¿C		

ÿÀ¿¿d¿d"¿ÿÄ¿¿¿¿¿¿¿¿¿¿¿	
ÿÄ¿µ¿¿¿}¿!1AQa"q2‘¡#B±ÁRÑð$3br‚	
%&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyzƒ„…†‡ˆ‰Š’“”•–—˜™š¢£¤¥¦§¨©ª²³´µ¶·¸¹ºÂÃÄÅÆÇÈÉÊÒÓÔÕÖ×ØÙÚáâãäåæçèéêñòóôõö÷øùúÿÄ¿¿¿¿¿¿¿¿	
ÿÄ¿µ¿¿w¿!1AQaq"2B‘¡±Á	#3RðbrÑ
$4á%ñ&'()*56789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz‚ƒ„…†‡ˆ‰Š’“”•–—˜™š¢£¤¥¦§¨©ª²³´µ¶·¸¹ºÂÃÄÅÆÇÈÉÊÒÓÔÕÖ×ØÙÚâãäåæçèéêòóôõö÷øùúÿÚ¿¿¿?¿ýS¢Š(¿¢Š(¿¢Š(¿¢Š(¿¢Š(¿¢Š(¿¢Š(¿¢¹¿í{¿ùëÿ¿Žð¬û¯¶™hÒ\¼²†Y¿tŠÅ‚8뎃ںU	½Ž·†œwhí(¯7ƒâݥ±ê
Â7—d–Û>URÇ’¿è={Š,~-Øê<Q›Ô•JËo°}å_¼W\wõô5_U¨G±}ÑéWxS⥿Œ$‘,â¾€¢,™º€F2#ñÇ8(>àúWIý±?÷Ûÿ¿ÿ¿
O
QhÇ<¤®š:+žþØŸûíÿ¿Žÿ¿…5u{¦yGšpH/©Ïj—BHo
5¹ÑÑ\ßö½ßüõÿ¿ÇGøQý¯wÿ¿=ñÑþ{	õY÷GIEsÚ÷ó×ÿ¿áGö½ßüõÿ¿ÇGøQìdUŸtt”W7ý¯wÿ¿=ñÑþQì$UŸtSÅQ–mI-GØ­c¸ÌRmiGpbx>•~²¯-¾ÑfÙÕžžDÊì­‚ ñ¼Я=Ò»£¹èÏbš_ø¹Òÿ¿bٍ‰û‡yB‰xê¿;~B}y^¤j¹Õüjg•†¬Äq¶Ct§Í cŽIëÜŒa‹?°ä˜Ämüg?•»æ]Èû×
¯ ñ·Úªÿ¿Â9qI9ñíÉùƒ)Œªƒ†Ú@¿x9ëƒÇº·—ÜÎw?À½u©xÛû3tŠßù€ym(xÊæ<œü¤peõû£ŽkgÃ’ëWL/­YÛÚê;WÌŽØnŒ ¶¦ìÂ¹›ŸËg/Žî-Q•%wM©¸“´ïÈcÓ²@jü~Ôg±GŠîg[ˆ€IDj|Ù¥0z`u÷æ‡ktû˜Õïò:½²ÿ¿sÿ¿áVô-ÃQœ0Ú|µ8àwôÖ¼ßþ®¨Î%ojæQ3J0ØM§wîÊŽ
å—ßס‘ ñ¨\
ÀþízL:å®’†ŒÎ«n›º±½ŠLRçŠ3^aæ†(Å~4¿bŠ3E¿r‹©É¦Çk›ëInÈ·œìE-½0w É»öí[xª¾§ ÑJÆ)J™¿IüîTž¸ü+ÖŽç¹=Ž2KÏÞI™4—h$ÞWìNyd¨€IàŽ£§ªEqàP&ƒvÁ2¿Ùe;	çu#=yÏC“Ô˨xÍ&u]O‘¿²	ñ•ã'sÜñíô˧¿ñ|qÌSG³•—É(€_1“(äðCàNAük¡??ÄæÖ†Ýǃ£±–Ù´+Ñkö‰a‘bÕL‘6Ü1È;ÎÜðF}+^ßÇš%–›
Û[_xˆ·TòÊ•¿'÷ñ¯9õ«)}â粝äÒ,¡¹Æ"‰ÍäòIÛÇL~'»[š[êØÆ×Öé
×ͽ#PTrqÃñ©m[_̸ï¡,3E<)*«íu2ppG¦*þ‚Àêã ykÁ9ïUq/÷?ñÁþoCÜu€ÃŒ~þB¹k|šÿ¿Ã7sFiqIŠóO,3FiqF(3E¢€9*̹³7¸‘°Ì†Á¿ÿ¿±^ƽ
ŠëX‹t;ž*ý?È­´-”O''šÝpùwP£hÞŸ)'9'ê}c4‚oȃXÁD+œžq‚A¿ Æ9ϯQZ}möþ¾â=¿—âyh]]Ë5¿ŒçXäwa
:²Œœ…øÃöÆ*S`\A¨7‹GØícÛ(’_‘†èÎ\†ŸÝ0ÉÆõëQõ§ÛúûƒÛù~'c¨ØêˆÏgmvŠpZ	É½Á«VÒ½¼Ó´oÎÕ†Osë]]œ«óioëîÄó+4s_Úw_óÔþBí;Ÿùì!]-Ö?Ê?oä_×Èæ¿´î¿ç©ü…Úw?óØþBºZ(ö±þPöðþEý|ŽkûNçþ{ÈQ]-{Xÿ¿(}bÈ¿¯QEÎqQ@Q@Q@Q@Q@Q@Q@Q@Q@Q@Q@Q@Q@ÿÙ

Open in new window

<? 
## v5.22 -> sep. 20, 2005

if ($_SESSION['membersarea']=="Active") { 
header5("$lang[sellitem]");?>
<table width="100%" border="0" cellpadding="2" cellspacing="2" class="sellsteptab">
	<tr align="center">
     <td class="c2" width="15%"><img src="themes/<?=$setts['default_theme'];?>/img/system/sell1.png"></td>
     <td class="c2" width="15%"><img src="themes/<?=$setts['default_theme'];?>/img/system/sell2.png"></td>
     <td class="c2" width="15%"><img src="themes/<?=$setts['default_theme'];?>/img/system/sell3.png"></td>
     <td class="c3" width="15%"><img src="themes/<?=$setts['default_theme'];?>/img/system/sell4.png"></td>
     <td class="c2" width="15%"><img src="themes/<?=$setts['default_theme'];?>/img/system/sell5.png"></td>
     <td class="c2" width="15%"><img src="themes/<?=$setts['default_theme'];?>/img/system/sell6.png"></td>
     <? if ($setts['secondcategory']) { ?>
     <td class="c2" width="10%"><img src="themes/<?=$setts['default_theme'];?>/img/system/sell7.png"></td>
	 <? } ?>
   </tr>
   <tr class="contentfont" align="center">
     <td class="c4"><?=$lang[sellstep1];?></td>
     <? if ($setts['secondcategory']) { ?>
     <td class="c4"><?=$lang[sellstep2];?></td>
	 <? } ?>
     <td class="c4"><?=$lang[sellstep3];?></td>
     <td class="c2"><?=$lang[sellstep4];?></td>
     <td class="c4"><?=$lang[sellstep5];?></td>
     <td class="c4"><?=$lang[sellstep6];?></td>
     <td class="c4"><?=$lang[sellstep7];?></td>
   </tr>
</table><br>

<? 
$prefSeller = "N";
if ($setts['pref_sellers']=="Y") {
	$prefSeller = getSqlField("SELECT preferred_seller FROM probid_users 
	WHERE id='".$_SESSION['memberid']."'","preferred_seller");
	$reduction = (100-$setts['pref_sellers_reduction'])/100;
}
?>
<script language="JavaScript">
function submitform(theform) {
	theform.step.value = "step11";
	theform.curchange.value = "yes";
	theform.submit();
}
</script>
<SCRIPT LANGUAGE="JavaScript" SRC="CalendarPopup.js"></SCRIPT>
<SCRIPT LANGUAGE="JavaScript">document.write(getCalendarStyles());</SCRIPT>
<SCRIPT LANGUAGE="JavaScript" ID="js17">
var cal17 = new CalendarPopup();
cal17.setReturnFunction("setMultipleValues4");
function setMultipleValues4(y,m,d) {
	document.forms[2].date17_year.value=y;
	document.forms[2].date17_month.selectedIndex=m;
	for (var i=0; i<document.forms[2].date17_date.options.length; i++) {
		if (document.forms[2].date17_date.options[i].value==d) {
			document.forms[2].date17_date.selectedIndex=i;
			}
		}
	}
function getDateString(y_obj,m_obj,d_obj) {
	var y = y_obj.options[y_obj.selectedIndex].value;
	var m = m_obj.options[m_obj.selectedIndex].value;
	var d = d_obj.options[d_obj.selectedIndex].value;
	if (y=="" || m=="") { return null; }
	if (d=="") { d=1; }
	return str= y+'-'+m+'-'+d;
	}
</SCRIPT>
 <input type="hidden" name="step" value="step12"> 
<input type="hidden" name="curchange" value=""> 
<table width="100%" border="0" cellpadding="4" cellspacing="4" align="center" class="border"> 
  <tr> 
    <td colspan="2" class="c1"><b><?=$lang[auc_settings]?></b></td> 
  </tr> 
  <tr class="c5"> 
    <td><img src="themes/<?=$setts['default_theme'];?>/img/pixel.gif" width="1" height="1"></td> 
    <td><img src="themes/<?=$setts['default_theme'];?>/img/pixel.gif" width="1" height="1"></td> 
  </tr> 
  <tr class="c3"> 
    <td align="right"><strong> 
      <?=$lang[auctype]?> 
      </strong></td> 
    <td><select name="auctiontype" class="contentfont" onChange="submitform(sistep1);"> 
        <option value="standard" selected> 
        <?=$lang[standardauc]?> 
        </option> 
        <option value="dutch" <? echo ($_REQUEST['auctiontype']=="dutch")?"selected":"";?>> 
        <?=$lang[dutchauc]?> 
        </option> 
      </select></td> 
  </tr> 
  <? if ($_REQUEST['auctiontype']=="standard") $_REQUEST['quantity']=1; ?> 
  <tr class="c2"> 
    <td align="right"><strong> 
      <?=$lang[auccurr]?> 
      </strong></td> 
    <? $getcurrencies=mysql_query("SELECT * FROM probid_currencies"); ?> 
    <td><select name="currency" class="contentfont" onChange="submitform(sistep1);"> 
        <? while ($row=mysql_fetch_array($getcurrencies)) { 
			if ($_REQUEST['currency']!="") echo "<option value=\"".$row['symbol']."\" ".(($_REQUEST['currency']==$row['symbol'])?"selected":"").">".$row['symbol']." ".$row['caption']."</option>";
			else  echo "<option value=\"".$row['symbol']."\" ".$row['active'].">".$row['symbol']." ".$row['caption']."</option>";
		  } ?> 
      </select></td> 
  </tr> 
  <tr class="c3"> 
    <td align="right"><strong> 
      <?=$lang[itemsquant]?> 
      </strong></td> 
    <td><input name="quantity" type="text" class="contentfont" id="quantity" value="<? echo (($_REQUEST['quantity']>=1)?$_REQUEST['quantity']:"1");?>" size="8"  <? echo ($_REQUEST['auctiontype']=="dutch")?"":"readonly"; ?>> </td> 
  </tr> 
  <tr class="c2"> 
    <td align="right"><strong> 
      <?=$lang[aucstarts]?> 
      </strong></td> 
    <td><input name="startprice" type="text" class="contentfont" id="startprice" value="<?=$_REQUEST['startprice'];?>" size="8"> 
      <? echo ($_REQUEST['currency']=="")? $setts['currency'] : $_REQUEST['currency']; ?> <br><span class="smallfont"><?=$lang[buynowonlyexplanation];?></span></td> 
  </tr> 
  <tr class="c3"> 
    <td align="right"><strong> 
      <?=$lang[resprice]?> 
      </strong></td> 
	  <? if ($_REQUEST['auctiontype']=="dutch") $_REQUEST['resprice']=""; ?>
    <td> <input name="resprice" type="text" class="contentfont" id="resprice" value="<?=$_REQUEST['resprice'];?>" size="8" <? echo ($_POST[auctiontype]=="dutch")?"disabled":""; ?>> 
      <? echo ($_REQUEST['currency']=="")? $setts['currency'] : $_REQUEST['currency']; ?>
	  <? echo ($fee['is_rp_fee']=="Y"&&$fee['val_rp_fee']>0&&!freeFees($_SESSION['memberid'])) ?"(+ ".displayAmount(applyVat(calcReduction($fee['val_rp_fee'],$prefSeller,trim($_REQUEST['voucher_code']),"rp"),$_SESSION['memberid']),$setts['currency'],TRUE).") ":""; ?> 
	  <a href="javascript:popUpSmall('popup_rp.php');"> 
      <?=$lang[whatsthis]?> 
      </a> </td> 
  </tr> 
  <tr class="c2"> 
    <td align="right"><strong> 
      <?=ucwords($lang[buynow])?> 
      </strong></td> 
    <td> <input name="buynow" type="radio" value="N" checked> 
      <?=$lang[no]?> 
      <input type="radio" name="buynow" value="Y" <? echo ($_REQUEST['buynow']=="Y")?"checked":"";?>> 
      <?=$lang[yes]?> 
      <input name="bnprice" type="text" class="contentfont" id="bnprice" value="<?=$_REQUEST['bnprice'];?>" size="8"> 
      <? echo ($_REQUEST['currency']=="")? $setts['currency'] : $_REQUEST['currency']; ?> 
	  <? echo ($fee['bin_fee']>0&&!freeFees($_SESSION['memberid'])) ?"(+ ".displayAmount(applyVat(calcReduction($fee['bin_fee'],$prefSeller,trim($_REQUEST['voucher_code']),"bn"),$_SESSION['memberid']),$setts['currency'],TRUE).") ":""; ?> 
	  <a href="javascript:popUpSmall('popup_bn.php');"> 
      <?=$lang[whatsthis]?> 
      </a> </td> 
  </tr> 
  <tr class="c3"> 
    <td align="right"><strong> 
      <?=$lang[bidincr]?> 
      </strong></td> 
    <td><input name="bidinc" type="radio" value="0" checked> 
      <?=$lang[builtinincr]?> 
      <br> 
      <input type="radio" name="bidinc" value="1" <? echo ($_REQUEST['bidinc']==1)?"checked":""; ?>> 
      <?=$lang[customincr]?> 
      <input name="bidincvalue" type="text" class="contentfont" id="bidincvalue" value="<?=$_REQUEST['bidincvalue'];?>" size="8"> 
      <? echo ($_REQUEST['currency']=="")? $setts['currency'] : $_REQUEST['currency']; ?> </td> 
  </tr> 
  <? if ($_REQUEST['listin']!="store"&&($setts['hp_feat']!=0||$setts['cat_feat']!=0||$setts['bold_item']!=0||$setts['hl_item']!=0)) { ?> 
  <tr class="c2"> 
    <td align="right"><strong> 
      <?=$lang[featitem]?> 
      </strong></td> 
    <td> <? 
	  if ($setts['hp_feat']!=0) 
	  	echo "<input type=\"checkbox\" name=\"hpfeat\" value=\"Y\" ".(($_REQUEST['hpfeat']=="Y")?"checked":"").">$lang[featdhomepage] ".
		(($fee['is_hpfeat_fee']=="Y"&&$fee['val_hpfeat_fee']>0&&!freeFees($_SESSION['memberid'])) ?"(+ ".displayAmount(applyVat(calcReduction($fee['val_hpfeat_fee'],$prefSeller,trim($_REQUEST['voucher_code']),"hpfeat"),$_SESSION['memberid']),$setts['currency'],TRUE).") ":"")."<br>";
	  if ($setts['cat_feat']!=0) 
	  	echo "<input type=\"checkbox\" name=\"catfeat\" value=\"Y\" ".(($_REQUEST['catfeat']=="Y")?"checked":"").">$lang[featcatpage] ".
		(($fee['is_catfeat_fee']=="Y"&&$fee['val_catfeat_fee']>0&&!freeFees($_SESSION['memberid'])) ?"(+ ".displayAmount(applyVat(calcReduction($fee['val_catfeat_fee'],$prefSeller,trim($_REQUEST['voucher_code']),"catfeat"),$_SESSION['memberid']),$setts['currency'],TRUE).") ":"")."<br>";
	  if ($setts['bold_item']!=0) 
	  	echo "<input type=\"checkbox\" name=\"bolditem\" value=\"Y\" ".(($_REQUEST['bolditem']=="Y")?"checked":"").">$lang[bolditem] ".
		(($fee['is_bolditem_fee']=="Y"&&$fee['val_bolditem_fee']>0&&!freeFees($_SESSION['memberid'])) ?"(+ ".displayAmount(applyVat(calcReduction($fee['val_bolditem_fee'],$prefSeller,trim($_REQUEST['voucher_code']),"bold"),$_SESSION['memberid']),$setts['currency'],TRUE).") ":"")."<br>";
	  if ($setts['hl_item']!=0) 
	 	 echo "<input type=\"checkbox\" name=\"hlitem\" value=\"Y\" ".(($_REQUEST['hlitem']=="Y")?"checked":"").">$lang[highlighteditem] ".
		(($fee['is_hlitem_fee']=="Y"&&$fee['val_hlitem_fee']>0&&!freeFees($_SESSION['memberid'])) ?"(+ ".displayAmount(applyVat(calcReduction($fee['val_hlitem_fee'],$prefSeller,trim($_REQUEST['voucher_code']),"hl"),$_SESSION['memberid']),$setts['currency'],TRUE).") ":"")."<br>";
	  ?> </td> 
  </tr> 
  <? if ($setts['hpfeat_desc']=="Y") { ?>
  <tr class="c2"> 
    <td align="right"><strong> 
      <?=$lang[hpfeat_desc]?> 
      </strong></td> 
    <td><textarea name="hpfeat_desc" cols="50" rows="4"><?=$_REQUEST['hpfeat_desc'];?></textarea></td> 
  </tr> 
  <? } ?> 
  <? } 
  $_REQUEST['date17_month'] = ($_REQUEST['date17_month']!="") ? $_REQUEST['date17_month'] : $_REQUEST['dmonth']; 
  $_REQUEST['date17_year'] = ($_REQUEST['date17_year']!="") ? $_REQUEST['date17_year'] : $_REQUEST['dyear']; 
  $_REQUEST['date17_date'] = ($_REQUEST['date17_date']!="") ? $_REQUEST['date17_date'] : $_REQUEST['ddate']; 
  ?>
     <tr class="c3">
       <td align="right"><strong><?=$lang[auctionstarttime];?></strong></td>
       <td><input name="starttime" type="radio" value="NOW" checked>
       <?=$lang[now];?><br>
       <input name="starttime" type="radio" value="custom" <? echo ($_REQUEST['starttime']=="custom")?"checked":"";?>> 
       <?=$lang[customtime];?><br>       
       <SELECT NAME="date17_month" id="date17_month" class="contentfont">
         <OPTION>
         <OPTION VALUE="01" <? echo ($_REQUEST['date17_month']==1)?"selected":"";?>><?=$lang[jan]?>
         <OPTION VALUE="02" <? echo ($_REQUEST['date17_month']==2)?"selected":"";?>><?=$lang[feb]?>
         <OPTION VALUE="03" <? echo ($_REQUEST['date17_month']==3)?"selected":"";?>><?=$lang[mar]?>
         <OPTION VALUE="04" <? echo ($_REQUEST['date17_month']==4)?"selected":"";?>><?=$lang[apr]?>
         <OPTION VALUE="05" <? echo ($_REQUEST['date17_month']==5)?"selected":"";?>><?=$lang[may]?>
         <OPTION VALUE="06" <? echo ($_REQUEST['date17_month']==6)?"selected":"";?>><?=$lang[jun]?>
         <OPTION VALUE="07" <? echo ($_REQUEST['date17_month']==7)?"selected":"";?>><?=$lang[jul]?>
         <OPTION VALUE="08" <? echo ($_REQUEST['date17_month']==8)?"selected":"";?>><?=$lang[aug]?>
         <OPTION VALUE="09" <? echo ($_REQUEST['date17_month']==9)?"selected":"";?>><?=$lang[sep]?>
         <OPTION VALUE="10" <? echo ($_REQUEST['date17_month']==10)?"selected":"";?>><?=$lang[oct]?>
         <OPTION VALUE="11" <? echo ($_REQUEST['date17_month']==11)?"selected":"";?>><?=$lang[nov]?>
         <OPTION VALUE="12" <? echo ($_REQUEST['date17_month']==12)?"selected":"";?>><?=$lang[dec]?>
         </SELECT>
       <SELECT NAME="date17_date" class="contentfont">
         <OPTION>
         <OPTION VALUE="01" <? echo ($_REQUEST['date17_date']==1)?"selected":"";?>>1
         <OPTION VALUE="02" <? echo ($_REQUEST['date17_date']==2)?"selected":"";?>>2
         <OPTION VALUE="03" <? echo ($_REQUEST['date17_date']==3)?"selected":"";?>>3
         <OPTION VALUE="04" <? echo ($_REQUEST['date17_date']==4)?"selected":"";?>>4
         <OPTION VALUE="05" <? echo ($_REQUEST['date17_date']==5)?"selected":"";?>>5
         <OPTION VALUE="06" <? echo ($_REQUEST['date17_date']==6)?"selected":"";?>>6
         <OPTION VALUE="07" <? echo ($_REQUEST['date17_date']==7)?"selected":"";?>>7
         <OPTION VALUE="08" <? echo ($_REQUEST['date17_date']==8)?"selected":"";?>>8
         <OPTION VALUE="09" <? echo ($_REQUEST['date17_date']==9)?"selected":"";?>>9
         <OPTION VALUE="10" <? echo ($_REQUEST['date17_date']==10)?"selected":"";?>>10
         <OPTION VALUE="11" <? echo ($_REQUEST['date17_date']==11)?"selected":"";?>>11
         <OPTION VALUE="12" <? echo ($_REQUEST['date17_date']==12)?"selected":"";?>>12
         <OPTION VALUE="13" <? echo ($_REQUEST['date17_date']==13)?"selected":"";?>>13
         <OPTION VALUE="14" <? echo ($_REQUEST['date17_date']==14)?"selected":"";?>>14
         <OPTION VALUE="15" <? echo ($_REQUEST['date17_date']==15)?"selected":"";?>>15
         <OPTION VALUE="16" <? echo ($_REQUEST['date17_date']==16)?"selected":"";?>>16
         <OPTION VALUE="17" <? echo ($_REQUEST['date17_date']==17)?"selected":"";?>>17
         <OPTION VALUE="18" <? echo ($_REQUEST['date17_date']==18)?"selected":"";?>>18
         <OPTION VALUE="19" <? echo ($_REQUEST['date17_date']==19)?"selected":"";?>>19
         <OPTION VALUE="20" <? echo ($_REQUEST['date17_date']==20)?"selected":"";?>>20
         <OPTION VALUE="21" <? echo ($_REQUEST['date17_date']==21)?"selected":"";?>>21
         <OPTION VALUE="22" <? echo ($_REQUEST['date17_date']==22)?"selected":"";?>>22
         <OPTION VALUE="23" <? echo ($_REQUEST['date17_date']==23)?"selected":"";?>>23
         <OPTION VALUE="24" <? echo ($_REQUEST['date17_date']==24)?"selected":"";?>>24
         <OPTION VALUE="25" <? echo ($_REQUEST['date17_date']==25)?"selected":"";?>>25
         <OPTION VALUE="26" <? echo ($_REQUEST['date17_date']==26)?"selected":"";?>>26
         <OPTION VALUE="27" <? echo ($_REQUEST['date17_date']==27)?"selected":"";?>>27
         <OPTION VALUE="28" <? echo ($_REQUEST['date17_date']==28)?"selected":"";?>>28
         <OPTION VALUE="29" <? echo ($_REQUEST['date17_date']==29)?"selected":"";?>>29
         <OPTION VALUE="30" <? echo ($_REQUEST['date17_date']==30)?"selected":"";?>>30
         <OPTION VALUE="31" <? echo ($_REQUEST['date17_date']==31)?"selected":"";?>>31
         </SELECT>
       <SELECT NAME="date17_year" class="contentfont">
         <OPTION>
         <?php
            for($i=date("Y");$i<(date("Y") + 4);$i++){
                echo '<OPTION VALUE="' . $i . '" '; 
                if($_REQUEST['date17_year']==$i) echo "selected";
                else echo "";
                echo '>' . $i;
            }
            
         ?>
         
         </SELECT>
       <A HREF="#" onClick="cal17.showCalendar('anchor17',getDateString(document.forms[2].date17_year,document.forms[2].date17_month,document.forms[2].date17_date)); return false;" TITLE="cal17.showCalendar('anchor17',getDateString(document.forms[2].date17_year,document.forms[2].date17_month,document.forms[2].date17_date)); return false;" NAME="anchor17" ID="anchor17"><img src="themes/<?=$setts['default_theme'];?>/img/system/calendar_b2u.gif" border="0" align="absmiddle"></A> 
	   <select name="shour"  class="contentfont" id="shour">
         <option value="0" selected>00</option>
         <option value="1" <? echo (($_REQUEST['shour']==1)?"selected":"");?>>01</option>
         <option value="2" <? echo (($_REQUEST['shour']==2)?"selected":"");?>>02</option>
         <option value="3" <? echo (($_REQUEST['shour']==3)?"selected":"");?>>03</option>
         <option value="4" <? echo (($_REQUEST['shour']==4)?"selected":"");?>>04</option>
         <option value="5" <? echo (($_REQUEST['shour']==5)?"selected":"");?>>05</option>
         <option value="6" <? echo (($_REQUEST['shour']==6)?"selected":"");?>>06</option>
         <option value="7" <? echo (($_REQUEST['shour']==7)?"selected":"");?>>07</option>
         <option value="8" <? echo (($_REQUEST['shour']==8)?"selected":"");?>>08</option>
         <option value="9" <? echo (($_REQUEST['shour']==9)?"selected":"");?>>09</option>
         <option value="10" <? echo (($_REQUEST['shour']==10)?"selected":"");?>>10</option>
         <option value="11" <? echo (($_REQUEST['shour']==11)?"selected":"");?>>11</option>
         <option value="12" <? echo (($_REQUEST['shour']==12)?"selected":"");?>>12</option>
         <option value="13" <? echo (($_REQUEST['shour']==13)?"selected":"");?>>13</option>
         <option value="14" <? echo (($_REQUEST['shour']==14)?"selected":"");?>>14</option>
         <option value="15" <? echo (($_REQUEST['shour']==15)?"selected":"");?>>15</option>
         <option value="16" <? echo (($_REQUEST['shour']==16)?"selected":"");?>>16</option>
         <option value="17" <? echo (($_REQUEST['shour']==17)?"selected":"");?>>17</option>
         <option value="18" <? echo (($_REQUEST['shour']==18)?"selected":"");?>>18</option>
         <option value="19" <? echo (($_REQUEST['shour']==19)?"selected":"");?>>19</option>
         <option value="20" <? echo (($_REQUEST['shour']==20)?"selected":"");?>>20</option>
         <option value="21" <? echo (($_REQUEST['shour']==21)?"selected":"");?>>21</option>
         <option value="22" <? echo (($_REQUEST['shour']==22)?"selected":"");?>>22</option>
         <option value="23" <? echo (($_REQUEST['shour']==23)?"selected":"");?>>23</option>
       </select>
:
<select name="sminute" class="contentfont" id="sminute">
  <option value="00" selected>00</option>
  <option value="15" <? echo (($_REQUEST['sminute']==15)?"selected":"");?>>15</option>
  <option value="30" <? echo (($_REQUEST['sminute']==30)?"selected":"");?>>30</option>
  <option value="45" <? echo (($_REQUEST['sminute']==45)?"selected":"");?>>45</option>
</select></td>
     </tr>
  <tr class="c3"> 
    <td align="right"><strong> 
      <?=$lang[duration]?> 
      </strong></td> 
    <td> <? echo "<SELECT name=\"duration\" class=\"contentfont\">";
	  $getdurations=mysql_query("SELECT * FROM probid_auction_durations");
	  while ($row=mysql_fetch_array($getdurations)) {
		  echo "<OPTION value=\"".$row['days']."\" ".(($row['days']==$_REQUEST['duration'])?"SELECTED":"").">".$row['description']."</option>";
	  }
	  echo "</SELECT>";
	  ?> </td> 
  </tr> 
  <tr class="c2"> 
    <td align="right"><strong> 
      <?=$lang[privateauc]?> 
      </strong></td> 
    <td><select name="privateauct" id="privateauct" class="contentfont"> 
        <option value="Y" <? echo (($_REQUEST['privateauct']=="Y")?"selected":"");?>> 
        <?=$lang[yes]?> 
        </option> 
        <option value="N" <? echo (($_REQUEST['privateauct']=="N"||$_REQUEST['privateauct']=="")?"selected":"");?>> 
        <?=$lang[no]?> 
        </option> 
      </select> 
      <a href="javascript:popUpSmall('popup_pa.php');"> 
      <?=$lang[whatsthis]?> 
      </a> </td> 
  </tr> 
  <? if ($setts['swap_items']==1) { ?>
  <tr class="c3"> 
    <td align="right"><strong> 
      <?=$lang[acceptswap]?> 
      </strong></td> 
    <td colspan><input name="isswap" type="radio" value="N" checked> 
      <?=$lang[no]?> 
      <input type="radio" name="isswap" value="Y" <? echo(($_REQUEST['isswap']=="Y")?"checked":"");?>> 
      <?=$lang[yes]?></td> 
  </tr> 
  <? } ?>
  <? 
  $mainCat_primary = getMainCat($_REQUEST['category']);
  $mainCat_secondary = getMainCat($_REQUEST['addlcategory']);
  
  $getFields = mysql_query("SELECT DISTINCT boxid, boxname, active FROM probid_fields 
  WHERE	(categoryid='".$mainCat_primary."' OR categoryid='".$mainCat_secondary."' OR categoryid='0') 
  ORDER BY fieldorder ASC") or die(mysql_error()); 
  $isFields = mysql_num_rows($getFields);
  if ($isFields) {
  ?> 
  <!-- Additional Custom Fields --> 
  <tr> 
    <td colspan=2 class="c1"><b><?=$lang[addfields]?></b></td> 
  </tr> 
  <tr class="c5"> 
    <td width="30%"><img src="themes/<?=$setts['default_theme'];?>/img/pixel.gif" width="1" height="1"></td> 
    <td width="70%"><img src="themes/<?=$setts['default_theme'];?>/img/pixel.gif" width="1" height="1"></td> 
  </tr> 
  <? 
	while ($fields=mysql_fetch_array($getFields)) { ?> 
  <tr class="<? echo (($count++)%2==0)?"c3":"c2"; ?>"> 
    <td align="right"><strong><?=$fields['boxname'];?></strong></td> 
    <td> <? echo createField($fields['boxid'],$_REQUEST['box'.$fields['boxid']]); ?> </td> 
  </tr> 
  <? 
  	} 
  } ?> 
  <tr> 
    <td colspan=2 class="c1"><b><?=$lang[aucimages]?></b></td> 
  </tr> 
  <tr class="c5"> 
    <td width="30%"><img src="themes/<?=$setts['default_theme'];?>/img/pixel.gif" width="1" height="1"></td> 
    <td width="70%"><img src="themes/<?=$setts['default_theme'];?>/img/pixel.gif" width="1" height="1"></td> 
  </tr> 
  <tr class="c3"> 
    <td align="right"><strong> 
      <?=$lang[uploadpic]?> 
      </strong><br><?=$lang[optfield]?>
    </td>
    
    <td><input type="file" name="file">      
	  <? echo "".(($_REQUEST['mainpic']!="")?"&nbsp;$lang[current_pic]: <img src=\"makethumb.php?pic=".$_REQUEST['mainpic']."&w=50&sq=Y&b=Y\" align=absmiddle>":"");?> 
		<br><b><?=$lang['orurl']?> </b>http://<input type="text" name="mainpicurl">
	  </td> 
  </tr> 
  <? if ($setts['pic_gal_active']==1) { ?> 
  <tr class="c2"> 
    <td align="right" valign="top"><strong> 
      <?=$lang[picturegallery]?> 
      .</strong><br> 
      <? echo ($fee['is_pic_fee']=="Y"&&$fee['val_pic_fee']>0&&!freeFees($_SESSION['memberid'])) ?"(+ ".displayAmount(applyVat(calcReduction($fee['val_pic_fee'],$prefSeller,trim($_REQUEST['voucher_code']),"pic"),$_SESSION['memberid']),$setts['currency'],TRUE).") ":""; ?>
      <br><?=$lang[youcanupload1]?> 
      <?=$setts['pic_gal_max_nb'];?> 
      <?=$lang[youcanupload2]?></td> 
    <td valign="top"><? 
	for ($i=0;$i<$setts['pic_gal_max_nb'];$i++) {
	  	echo "<input type=\"file\" name=\"addfile[]\">\n";
		echo "".(($_REQUEST['the_pic'][$i]!="")?"&nbsp;$lang[current_pic]: <img src=\"makethumb.php?pic=".$_REQUEST['the_pic'][$i]."&w=50&sq=Y&b=Y\" align=absmiddle>":"");
	  	echo '<br><b>'.$lang['orurl'].' </b>http://<input type="text" name="picurl['.$i.']"><br>';
	} 
	?> 
      <?=$lang[youcanupload3]?></td> 
  </tr> 
  <? } ?> 
  <tr class="c3">
    <td align="right" valign="top">&nbsp;</td>
    <td valign="top"><?=$lang[imgmax_note1]." ".$setts['pic_gal_max_size']."KB";?>
    <? echo ($fee['is_pic_fee']=="Y"&&$fee['val_pic_fee']>0&&!freeFees($_SESSION['memberid'])) ?"<br>$lang[picpaymentnote]":""; ?>
 	</td>
  </tr>
  <tr> 
    <td colspan="2" class="c1"><b><?=$lang[location]?></b></td> 
  </tr> 
  <tr class="c5"> 
    <td><img src="themes/<?=$setts['default_theme'];?>/img/pixel.gif" width="1" height="1"></td> 
    <td><img src="themes/<?=$setts['default_theme'];?>/img/pixel.gif" width="1" height="1"></td> 
  </tr> 
  <?
  	$userDets = getSqlRow("SELECT zip, country FROM probid_users WHERE id='".$_SESSION['memberid']."'");
	$country = ($_POST['country']=="") ? $userDets['country'] : $_POST['country'];
	$_REQUEST['zip'] = ($_REQUEST['zip']=="") ? $userDets['zip'] : $_REQUEST['zip'];
  ?>
  <tr class="c3"> 
    <td align="right"><strong><?=$lang[country]?></strong></td> 
    <td> <? echo "<SELECT name=\"country\" class=\"contentfont\">";
	  $getdurations=mysql_query("SELECT * FROM probid_countries ORDER BY theorder ASC, name ASC");
	  while ($row=mysql_fetch_array($getdurations)) {
		  echo "<OPTION value=\"".$row['name']."\" ".(($row['name']==$country)?"SELECTED":"").">".$row['name']."</option>";
	  }
	  echo "</SELECT>";
	  ?> </td> 
  </tr> 
  <tr class="c2"> 
    <td align="right"><strong><?=$lang[zip]?></strong></td> 
    <td><input name="zip" type="text" id="zip" value="<?=$_REQUEST['zip'];?>" size="12"></td> 
  </tr> 
  <tr class="c4"> 
    <td colspan="2" align="center"><input name="nextstep" type="submit" id="nextstep" value="<?=$lang[nextstep]?>"> 
&nbsp; 
      <input name="prevstep" type="submit" id="prevstep" value="<?=$lang[prevstep]?>"> </td> 
  </tr> 
</table> 
<? if ($_REQUEST['auction']=="dutch") {?> 
<input type="hidden" name="respr" value="N"> 
<input type="hidden" name="buynow" value="N"> 
<? } ?> 
<? } else { echo "<p align=center class=errorfont>$lang[err_relogin]</p><p>&nbsp;</p>"; } ?>

Open in new window

<? 
## v5.23 -> dec. 13, 2005

if ($_SESSION['membersarea']=="Active") { 
header5("$lang[sellitem]"); ?>
<table width="100%" border="0" cellpadding="2" cellspacing="2" class="sellsteptab">
	<tr align="center">
     <td class="c2" width="15%"><img src="themes/<?=$setts['default_theme'];?>/img/system/sell1.png"></td>
     <td class="c2" width="15%"><img src="themes/<?=$setts['default_theme'];?>/img/system/sell2.png"></td>
     <td class="c2" width="15%"><img src="themes/<?=$setts['default_theme'];?>/img/system/sell3.png"></td>
     <td class="c2" width="15%"><img src="themes/<?=$setts['default_theme'];?>/img/system/sell4.png"></td>
     <td class="c3" width="15%"><img src="themes/<?=$setts['default_theme'];?>/img/system/sell5.png"></td>
     <td class="c2" width="15%"><img src="themes/<?=$setts['default_theme'];?>/img/system/sell6.png"></td>
     <? if ($setts['secondcategory']) { ?>
     <td class="c2" width="10%"><img src="themes/<?=$setts['default_theme'];?>/img/system/sell7.png"></td>
	 <? } ?>
   </tr>
   <tr class="contentfont" align="center">
     <td class="c4"><?=$lang[sellstep1];?></td>
     <? if ($setts['secondcategory']) { ?>
     <td class="c4"><?=$lang[sellstep2];?></td>
	 <? } ?>
     <td class="c4"><?=$lang[sellstep3];?></td>
     <td class="c4"><?=$lang[sellstep4];?></td>
     <td class="c2" nowrap><?=$lang[sellstep5];?></td>
     <td class="c4"><?=$lang[sellstep6];?></td>
     <td class="c4"><?=$lang[sellstep7];?></td>
   </tr>
</table><br>
 <input type="hidden" name="step" value="step2"> 
<table width="100%" border="0" cellpadding="4" cellspacing="4" align="center" class="border"> 
  <tr> 
    <td colspan=2 class="c1"><b> 
      <?=$lang[shipping]?> 
& 
      <?=$lang[payment]?> 
      </b></td> 
  </tr> 
  <tr class="c5"> 
    <td width="35%"><img src="themes/<?=$setts['default_theme'];?>/img/pixel.gif" width="1" height="1"></td> 
    <td width="70%"><img src="themes/<?=$setts['default_theme'];?>/img/pixel.gif" width="1" height="1"></td> 
  </tr> 
  <tr class="c3"> 
    <td align="right" valign="top"><strong> 
      <?=$lang[shippingcond]?> 
      </strong></td> 
    <td><input type="radio" name="shipcond" value="BP" <? echo ($_REQUEST['shipcond']=="BP")?"checked":""; ?>> 
      <?=$lang[buyerpaysshipment]?> 
      <br> 
      <input type="radio" name="shipcond" value="SP" <? echo ($_REQUEST['shipcond']=="SP")?"checked":""; ?>> 
      <?=$lang[sellerpaysshipment]?> 
      <br> 
      <input name="shipint" type="checkbox" id="shipint" value="Y" <? echo ($_REQUEST['shipint']=="Y")?"checked":""; ?>> 
      <?=$lang[sellershipinternat]?> </td> 
  </tr> 
  <tr class="c2"> 
    <td align="right" valign="top"><strong> 
      <?=$lang[paymethods]?> 
      </strong></td> 
    <td><? 
	$getdurations=mysql_query("SELECT * FROM probid_payment_methods");
	$pct=0;
	while ($row=mysql_fetch_array($getdurations)) {
	  	$pm_name[$pct]=$row['name'];
		$pct++;
	}
	echo "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">";
	for ($i=0;$i<$pct;$i+=2) {
		$j=$i+1;
		echo "<tr>\n";
		echo "	<td width=\"130\" class=\"contentfont\"><input type=\"checkbox\" name=\"pmethod[]\" value=\"".$pm_name[$i]."\" ".((eregi($pm_name[$i],$_REQUEST['pm']))?"checked":"").">".$pm_name[$i]."</td>\n";
		echo "	<td width=\"130\" class=\"contentfont\">".(($pm_name[$j]!="")?"<input type=\"checkbox\" name=\"pmethod[]\" value=\"".$pm_name[$j]."\" ".((eregi($pm_name[$j],$_REQUEST['pm']))?"checked":"").">".$pm_name[$j]."":"")."</td>\n";
		echo "</tr>\n";
	}
	echo "</table>";
	?></td> 
  </tr> 
  <? 
	if ($setts['paypaldirectpayment']) {
		if ($_REQUEST['directpaymentemail'] == "") { 
  			$directpaymentemail = getSqlRow("SELECT email FROM probid_users WHERE id='".$_SESSION['memberid']."'","email");;
	} ?> 
  <tr class="c2"> 
    <td align="right" valign="top"><strong> 
      <?=$lang[directpayment]?> 
      </strong></td> 
    <td><table border="0" cellpadding="0" cellspacing="0"> 
        <tr> 
          <td valign="top"><input type="checkbox" value="1" name="acceptdirectpayment" <? if ($_REQUEST['acceptdirectpayment']||$_REQUEST['directpaymentemail']!="") echo " checked"; ?>></td> 
          <td width="5">&nbsp;</td> 
		  
          <td><?=$lang[directpaymentmsg]?></td> 
        </tr> 
      </table> 
	  
      <p><img src="http://images.paypal.com/images/x-click-but02.gif"><img src="themes/<?=$setts['default_theme'];?>/img/system/cards.gif"> </p>
      <p>
        <input size="22" name="directpaymentemail" value="<?=$_REQUEST['directpaymentemail'];?>">
        <?=$lang[directpaymentemail]?>	  
      </p></td>
    </td>
  </tr> 
  <? } ?> 
  <? if ($setts['shipping_costs']==1) { ?> 
  <tr class="c3"> 
    <td align="right" valign="top"><strong> 
      <?=$lang[postagecosts]?> 
      </strong></td> 
    <td><?=$_POST[currency];?> 
      <input class="contentfont" name="postage_costs" type="text" id="postage_costs" value="<?=$_REQUEST['postage_costs'];?>" size="15"></td> 
  </tr> 
  <tr class="c2"> 
    <td align="right" valign="top"><strong> 
      <?=$lang[insurance]?> 
      </strong></td> 
    <td><?=$_POST[currency];?>
	<input name="insurance" type="text" id="insurance" value="<?=$_REQUEST['insurance'];?>" class="contentfont" size="15"></td> 
  </tr> 
  <tr class="c3">
    <td align="right" valign="top"><strong><?=$lang[sp_details]?></strong></td>
    <td><textarea name="shipping_details" cols="50" rows="4"><?=$_REQUEST['shipping_details'];?></textarea></td>
  </tr>
  <tr class="c2"> 
    <td align="right" valign="top"><strong> 
      <?=$lang[servicetype]?> 
      </strong></td> 
    <td><? 
		echo "<SELECT name=\"type_service\" class=\"contentfont\">";
		echo "<option value=\"\" selected>".$lang[servicetypeselect]."</option>";
	 	$getShippingOptions=mysql_query("SELECT * FROM probid_shipping_options");
	  	while ($shOpt=mysql_fetch_array($getShippingOptions)) {
		  	echo "<OPTION value=\"".$shOpt['name']."\" ".(($shOpt['name']==$_REQUEST['type_service'])?"SELECTED":"").">".$shOpt['name']."</option>";
	  	}
	  	echo "</SELECT>"; ?></td> 
  </tr> 
  <? } ?> 
  <?
  	$prefSeller = "N";
	$voucher = checkSetupVoucher(trim($_REQUEST['voucher_code']));
	$reduction = 1;
	if ($setts['pref_sellers']=="Y") {
		$prefSeller = getSqlField("SELECT preferred_seller FROM probid_users 
		WHERE id='".$_SESSION['memberid']."'","preferred_seller");
		if ($prefSeller=="Y") $reduction = (100-$setts['pref_sellers_reduction'])/100;
	}
	$vatExempted = "Y";
	if ($setts['vat_rate']>0) $vatExempted = getSqlField("SELECT vat_exempted FROM probid_users
	WHERE id='".$_SESSION['memberid']."'","vat_exempted");
  ?>
  <tr> 
    <td colspan="2" class="c1"><b> 
      <? 
	  echo $lang[aucfees].(($prefSeller=="Y")?" [ ".$lang[pref_seller]." - ".$setts['pref_sellers_reduction']."% ".$lang[reduction]." ]":"")." ".(($vatExempted=="Y")?"":" [ ".$lang[all_fees_incl]." ".$setts['vat_rate']."% ".$lang[tax_vat]." ]");
	  echo ($voucher['valid']) ? "[ $lang[voucher_reduction] ]" : "" ;
	  ?> 
      </b></td> 
  </tr> 
  <? if (!freeFees($_SESSION['memberid'])&&$_REQUEST['listin']!="store") { ?>
  <tr class="c5"> 
    <td width="30%"><img src="themes/<?=$setts['default_theme'];?>/img/pixel.gif" width="1" height="1"></td> 
    <td width="70%"><img src="themes/<?=$setts['default_theme'];?>/img/pixel.gif" width="1" height="1"></td> 
  </tr> 
  <? 
  	$isListingFee = getSqlNumber("SELECT * FROM probid_fees_tiers WHERE 
  	fee_from<=".$_REQUEST['startprice']." AND fee_to>".$_REQUEST['startprice']." AND fee_type='setup'");
  	if ($fee['is_setup_fee']=="Y"&&$isListingFee>0) { ?> 
  <tr class="c2"> 
    <td align="right"><strong> 
      <?=$lang[listfee]?> 
      </strong></td> 
    <td> <? 
	$listingFee = getSqlRow("SELECT * FROM probid_fees_tiers WHERE 
	fee_from<=".$_REQUEST['startprice']." AND fee_to>".$_REQUEST['startprice']." AND fee_type='setup'");

	$voucher = checkSetupVoucher(trim($_REQUEST['voucher_code']),"setup");
	$total_reduction = $reduction - ($reduction * ($voucher['reduction']/100));

	$exchange_rate = 1;
	if (trim($setts['currency'])!=trim($_REQUEST['currency'])) {
		$converter = getSqlField("SELECT converter FROM probid_currencies WHERE symbol = '".trim($_REQUEST['currency'])."'","converter");
		$converter = ($converter == 0) ? 0.01 : $converter;
		$exchange_rate = 1/$converter;
	}			
	if($exchange_rate<=0) $exchange_rate = 1;

	if ($listingFee['calc_type']=="flat") echo displayAmount(applyVat($listingFee['fee_amount'],$_SESSION['memberid']))." ".(($prefSeller=="Y"||$voucher['valid']>0) ? "[ ".(($prefSeller=="Y") ? $setts['pref_sellers_reduction']."% ".$lang[off] : "")." ".(($voucher['valid']>0) ? (($prefSeller=="Y") ? $lang[and_msg] : "")." ".$voucher['reduction']."% ".$lang[voucher_reduct]."" : "")." = ".displayAmount(applyVat($listingFee['fee_amount']*$total_reduction,$_SESSION['memberid']),$setts['currency'],TRUE)." ]":"");
	else echo $listingFee['fee_amount']."% = ".displayAmount(applyVat($_REQUEST['startprice']*$listingFee['fee_amount']/100*$exchange_rate,$_SESSION['memberid']))." ".(($prefSeller=="Y"||$voucher['valid']>0) ? "[ ".(($prefSeller=="Y") ? $setts['pref_sellers_reduction']."% ".$lang[off] : "")." ".(($voucher['valid']>0) ? (($prefSeller=="Y") ? $lang[and_msg] : "")." ".$voucher['reduction']."% ".$lang[voucher_reduct]."" : "")." = ".displayAmount(applyVat(($_REQUEST['startprice']*$listingFee['fee_amount']/100)*$total_reduction,$_SESSION['memberid']),$setts['currency'],TRUE)." ]":""); 
	?> </td> 
  </tr> 
  <? } ?> 
  <? 
  if ($fee['second_cat_fee']>0&&$_REQUEST['addlcategory']>0) { 
	$voucher = checkSetupVoucher(trim($_REQUEST['voucher_code']),"seccat");
	$total_reduction = $reduction - ($reduction * ($voucher['reduction']/100)); ?> 
  <tr class="c2"> 
    <td align="right"><strong><?=$lang[second_cat_fee]?></strong></td> 
    <td> <? echo displayAmount(applyVat($fee['second_cat_fee'],$_SESSION['memberid']))." ".(($prefSeller=="Y"||$voucher['valid']>0) ? "[ ".(($prefSeller=="Y") ? $setts['pref_sellers_reduction']."% ".$lang[off] : "")." ".(($voucher['valid']>0) ? (($prefSeller=="Y") ? $lang[and_msg] : "")." ".$voucher['reduction']."% ".$lang[voucher_reduct]."" : "")." = ".displayAmount(applyVat($fee['second_cat_fee']*$total_reduction,$_SESSION['memberid']),$setts['currency'],TRUE)." ]":""); ?> </td> 
  </tr> 
  <? } ?> 
  <? if ($fee['is_pic_fee']=="Y"&&$fee['val_pic_fee']>0&&$_REQUEST['cnt1']>0) { 
	$voucher = checkSetupVoucher(trim($_REQUEST['voucher_code']),"pic");
	$total_reduction = $reduction - ($reduction * ($voucher['reduction']/100)); ?> 
  <tr class="c2"> 
    <td align="right"><strong><?=$lang[addpicfee]?></strong></td> 
    <td> <? echo displayAmount(applyVat($fee['val_pic_fee'],$_SESSION['memberid']))." ".(($prefSeller=="Y"||$voucher['valid']>0) ? "[ ".(($prefSeller=="Y") ? $setts['pref_sellers_reduction']."% ".$lang[off] : "")." ".(($voucher['valid']>0) ? (($prefSeller=="Y") ? $lang[and_msg] : "")." ".$voucher['reduction']."% ".$lang[voucher_reduct]."" : "")." = ".displayAmount(applyVat($fee['val_pic_fee']*$total_reduction,$_SESSION['memberid']),$setts['currency'],TRUE)." ]":""); ?> </td> 
  </tr> 
  <? } ?> 
  <? if ($fee['is_hlitem_fee']=="Y"&&$fee['val_hlitem_fee']>0&&$_REQUEST['hlitem']=="Y") {
	$voucher = checkSetupVoucher(trim($_REQUEST['voucher_code']),"hl");
	$total_reduction = $reduction - ($reduction * ($voucher['reduction']/100)); ?> 
  <tr class="c2"> 
    <td align="right"><strong><?=$lang[highlightfee]?></strong></td> 
    <td> <? echo displayAmount(applyVat($fee['val_hlitem_fee'],$_SESSION['memberid']))." ".(($prefSeller=="Y"||$voucher['valid']>0) ? "[ ".(($prefSeller=="Y") ? $setts['pref_sellers_reduction']."% ".$lang[off] : "")." ".(($voucher['valid']>0) ? (($prefSeller=="Y") ? $lang[and_msg] : "")." ".$voucher['reduction']."% ".$lang[voucher_reduct]."" : "")." = ".displayAmount(applyVat($fee['val_hlitem_fee']*$total_reduction,$_SESSION['memberid']),$setts['currency'],TRUE)." ]":""); ?></td> 
  </tr> 
  <? } ?> 
  <? if ($fee['is_bolditem_fee']=="Y"&&$fee['val_bolditem_fee']>0&&$_REQUEST['bolditem']=="Y") { 
	$voucher = checkSetupVoucher(trim($_REQUEST['voucher_code']),"bold");
	$total_reduction = $reduction - ($reduction * ($voucher['reduction']/100)); ?> 
  <tr class="c2"> 
    <td align="right"><strong><?=$lang[boldfee]?></strong></td> 
    <td> <? echo displayAmount(applyVat($fee['val_bolditem_fee'],$_SESSION['memberid']))." ".(($prefSeller=="Y"||$voucher['valid']>0) ? "[ ".(($prefSeller=="Y") ? $setts['pref_sellers_reduction']."% ".$lang[off] : "")." ".(($voucher['valid']>0) ? (($prefSeller=="Y") ? $lang[and_msg] : "")." ".$voucher['reduction']."% ".$lang[voucher_reduct]."" : "")." = ".displayAmount(applyVat($fee['val_bolditem_fee']*$total_reduction,$_SESSION['memberid']),$setts['currency'],TRUE)." ]":""); ?></td> 
  </tr> 
  <? } ?> 
  <? if ($fee['is_catfeat_fee']=="Y"&&$fee['val_catfeat_fee']>0&&$_REQUEST['catfeat']=="Y") { 
	$voucher = checkSetupVoucher(trim($_REQUEST['voucher_code']),"catfeat");
	$total_reduction = $reduction - ($reduction * ($voucher['reduction']/100)); ?> 
  <tr class="c2"> 
    <td align="right"><strong><?=$lang[catfee]?></strong></td> 
    <td> <? echo displayAmount(applyVat($fee['val_catfeat_fee'],$_SESSION['memberid']))." ".(($prefSeller=="Y"||$voucher['valid']>0) ? "[ ".(($prefSeller=="Y") ? $setts['pref_sellers_reduction']."% ".$lang[off] : "")." ".(($voucher['valid']>0) ? (($prefSeller=="Y") ? $lang[and_msg] : "")." ".$voucher['reduction']."% ".$lang[voucher_reduct]."" : "")." = ".displayAmount(applyVat($fee['val_catfeat_fee']*$total_reduction,$_SESSION['memberid']),$setts['currency'],TRUE)." ]":""); ?> 
      <? if ($_REQUEST['addlcategory']>0) echo " x 2 = " . displayAmount(applyVat($fee['val_catfeat_fee'] * 2,$_SESSION['memberid']))." ".(($prefSeller=="Y"||$voucher['valid']>0) ? "[ ".(($prefSeller=="Y") ? $setts['pref_sellers_reduction']."% ".$lang[off] : "")." ".(($voucher['valid']>0) ? (($prefSeller=="Y") ? $lang[and_msg] : "")." ".$voucher['reduction']."% ".$lang[voucher_reduct]."" : "")." = ".displayAmount(applyVat($fee['val_catfeat_fee']*2*$total_reduction,$_SESSION['memberid']),$setts['currency'],TRUE)." ]":""); ?> </td> 
  </tr> 
  <? } ?> 
  <? if ($fee['is_hpfeat_fee']=="Y"&&$fee['val_hpfeat_fee']>0&&$_REQUEST['hpfeat']=="Y") { 
	$voucher = checkSetupVoucher(trim($_REQUEST['voucher_code']),"hpfeat");
	$total_reduction = $reduction - ($reduction * ($voucher['reduction']/100)); ?> 
  <tr class="c2"> 
    <td align="right"><strong><?=$lang[homepagefee]?></strong></td> 
    <td> <? echo displayAmount(applyVat($fee['val_hpfeat_fee'],$_SESSION['memberid']))." ".(($prefSeller=="Y"||$voucher['valid']>0) ? "[ ".(($prefSeller=="Y") ? $setts['pref_sellers_reduction']."% ".$lang[off] : "")." ".(($voucher['valid']>0) ? (($prefSeller=="Y") ? $lang[and_msg] : "")." ".$voucher['reduction']."% ".$lang[voucher_reduct]."" : "")." = ".displayAmount(applyVat($fee['val_hpfeat_fee']*$total_reduction,$_SESSION['memberid']),$setts['currency'],TRUE)." ]":""); ?> </td> 
  </tr> 
  <? } ?> 
  <? if ($fee['is_rp_fee']=="Y"&&$fee['val_rp_fee']>0&&$_REQUEST['respr']=="Y") { 
	$voucher = checkSetupVoucher(trim($_REQUEST['voucher_code']),"rp");
	$total_reduction = $reduction - ($reduction * ($voucher['reduction']/100)); ?> 
  <tr class="c2"> 
    <td align="right"><strong><?=$lang[respricefee]?></strong></td> 
    <td> <? echo displayAmount(applyVat($fee['val_rp_fee'],$_SESSION['memberid']))." ".(($prefSeller=="Y"||$voucher['valid']>0) ? "[ ".(($prefSeller=="Y") ? $setts['pref_sellers_reduction']."% ".$lang[off] : "")." ".(($voucher['valid']>0) ? (($prefSeller=="Y") ? $lang[and_msg] : "")." ".$voucher['reduction']."% ".$lang[voucher_reduct]."" : "")." = ".displayAmount(applyVat($fee['val_rp_fee']*$total_reduction,$_SESSION['memberid']),$setts['currency'],TRUE)." ]":""); ?> </td> 
  </tr> 
  <? } ?> 
  <? if ($fee['bin_fee']>0&&$_REQUEST['buynow']=="Y") { 
	$voucher = checkSetupVoucher(trim($_REQUEST['voucher_code']),"bn");
	$total_reduction = $reduction - ($reduction * ($voucher['reduction']/100)); ?> 
  <tr class="c2"> 
    <td align="right"><strong><?=$lang[buyitnowfee]?></strong></td> 
    <td> <? echo displayAmount(applyVat($fee['bin_fee'],$_SESSION['memberid']))." ".(($prefSeller=="Y"||$voucher['valid']>0) ? "[ ".(($prefSeller=="Y") ? $setts['pref_sellers_reduction']."% ".$lang[off] : "")." ".(($voucher['valid']>0) ? (($prefSeller=="Y") ? $lang[and_msg] : "")." ".$voucher['reduction']."% ".$lang[voucher_reduct]."" : "")." = ".displayAmount(applyVat($fee['bin_fee']*$total_reduction,$_SESSION['memberid']),$setts['currency'],TRUE)." ]":""); ?> </td> 
  </tr> 
  <? } ?> 
  <? if ($fee['is_swap_fee']=="Y"&&$fee['val_swap_fee']>0&&$_REQUEST['isswap']=="Y") { ?> 
  <tr class="c2"> 
    <td align="right"><strong><?=$lang[swap_fee]?></strong></td> 
    <td><? echo displayAmount(applyVat($fee['val_swap_fee'],$_SESSION['memberid']))." ".(($prefSeller=="Y") ? "[ ".$setts['pref_sellers_reduction']."% ".$lang[off]." = ".displayAmount(applyVat($fee['val_swap_fee']*$reduction,$_SESSION['memberid']))." ]":""); ?> </td> 
  </tr> 
  <? } ?> 
  <?
  	$isListingFee = getSqlNumber("SELECT * FROM probid_fees_tiers WHERE 
  	fee_from<=".$_REQUEST['startprice']." AND fee_to>".$_REQUEST['startprice']." AND fee_type='setup'");
	if ($fee['is_setup_fee']=="Y"&&$isListingFee>0) $topay.="Auction Setup Fee; ";
	if ($fee['is_pic_fee']=="Y"&&$fee['val_pic_fee']>0&&$_REQUEST['cnt1']>0) $topay.="Image Gallery Fee; ";
	if ($fee['is_hlitem_fee']=="Y"&&$fee['val_hlitem_fee']>0&&$_REQUEST['hlitem']=="Y") {
		$topay.="Highlighted Item Fee; ";
		$ishl="Y";
	}
	if ($fee['is_bolditem_fee']=="Y"&&$fee['val_bolditem_fee']>0&&$_REQUEST['bolditem']=="Y") {
		$topay.="Bold Item Fee; ";
		$isbold="Y";
	}
	if ($fee['is_hpfeat_fee']=="Y"&&$fee['val_hpfeat_fee']>0&&$_REQUEST['hpfeat']=="Y") {
		$topay.="Home Page Featured Item Fee; ";
		$ishpfeat="Y";
	}
	if ($fee['is_catfeat_fee']=="Y"&&$fee['val_catfeat_fee']>0&&$_REQUEST['catfeat']=="Y") {
		$topay.="Category Page Featured Item Fee; ";
		$iscatfeat="Y";
	}
	if ($fee['is_rp_fee']=="Y"&&$fee['val_rp_fee']>0&&$_REQUEST['respr']=="Y") {
		$topay.="Reserve Price Fee; ";
		$isrpfee="Y";
	}
	if ($fee['second_cat_fee']>0&&$_REQUEST['addlcategory']>0) {
		$topay.="Second Category Fee; ";
		$issecondcatfee="Y";
	}
	if ($fee['bin_fee']>0&&$_REQUEST['buynow']=="Y") {
		$topay.="Buy It Now Fee; ";
		$isbnfee="Y";
	}
	$prefSeller = "N";
	if ($setts['pref_sellers']=="Y") {
		$prefSeller = getSqlField("SELECT preferred_seller FROM probid_users 
		WHERE id='".$_SESSION['memberid']."'","preferred_seller");
	}

  ?>
  <tr class="c5"> 
    <td width="30%"><img src="themes/<?=$setts['default_theme'];?>/img/pixel.gif" width="1" height="1"></td> 
    <td width="70%"><img src="themes/<?=$setts['default_theme'];?>/img/pixel.gif" width="1" height="1"></td> 
  </tr> 
  <tr class="c2"> 
    <td align="right"><strong><?=$lang[total_fees]?></strong>
    </td> 
    <td> <? 
	$setupFee = setupFee($_REQUEST['startprice'],$_REQUEST['currency'],$auctionid,$ishpfeat,$iscatfeat,$isbold,$ishl,$isrpfee,$_REQUEST['cnt1'],$issecondcatfee,$isbnfee,FALSE,TRUE,trim($_REQUEST['voucher_code']));
	echo displayAmount($setupFee,$setts['currency'],TRUE); ?> 
	</td> 
  </tr> 
  <? 
	$tmp = getSqlField("SELECT payment_mode FROM probid_users WHERE id='".$_SESSION['memberid']."'","payment_mode");
	$currentBalance = getSqlField("SELECT balance FROM probid_users WHERE id='".$_SESSION['memberid']."'","balance");
	if ($setts['account_mode_personal']==1) {
		$account_mode_local = ($tmp) ? 2 : 1;
	} else $account_mode_local = $setts['account_mode'];
	
	if ($account_mode_local==2&&$setts['max_credit']<=($setupFee+$currentBalance)) { ?>
  <tr class="c5"> 
    <td colspan="2" align="center"> <? echo $lang[warn_auct_over_credit]; ?> </td> 
  </tr> 
  <? } ?>
  <? if ($fee['is_endauction_fee']=="Y") { ?> 
  <tr class="c4"> 
    <td align="center" colspan="2"><strong><?=$lang[endaucfee]?></strong></td> 
  </tr> 
  <tr> 
    <td align="center" colspan="2"><table width="60%"  border="0" cellspacing="2" cellpadding="2" class="border"> 
	<? $getTiers = mysql_query("SELECT * FROM probid_fees_tiers WHERE fee_type='endauction'");
		while ($feeTiers = mysql_fetch_array($getTiers)) { ?>
        <tr class="<? echo (($count++)%2==0)?"c2":"c3"; ?>"> 
          <td width="100%"><? echo "$lang[from] ".displayAmount($feeTiers['fee_from'])." $lang[to] ".displayAmount($feeTiers['fee_to']);?></td> 
          <td nowrap><?
		  	if ($feeTiers['calc_type']=="flat") echo displayAmount($feeTiers['fee_amount'])." ".(($prefSeller=="Y") ? "[ ".$setts['pref_sellers_reduction']."% ".$lang[off]." = ".displayAmount($feeTiers['fee_amount']*$reduction)." ]":"");
		   	else echo $feeTiers['fee_amount']."%"." ".(($prefSeller=="Y") ? "[ ".$setts['pref_sellers_reduction']."% ".$lang[off]." = ".$feeTiers['fee_amount']*$reduction."% ]":""); ?></td> 
        </tr> 
		<? } ?>
      </table></td> 
  </tr> 
  <? } ?> 
  <? } ?>
  <? if ($layout['d_tc_text']==1) { ?> 
  <tr> 
    <td colspan="2" class="c1"><b><?=strtoupper($lang[reg_terms])?></b></td> 
  </tr> 
  <tr class="c5"> 
    <td width="30%"><img src="themes/<?=$setts['default_theme'];?>/img/pixel.gif" width="1" height="1"></td> 
    <td width="70%"><img src="themes/<?=$setts['default_theme'];?>/img/pixel.gif" width="1" height="1"></td> 
  </tr> 
  <tr class="c3"> 
    <td colspan="2" class="contentfont"><?=$lang[auc_terms]?></td> 
  </tr> 
  <tr align="center" class="c2"> 
    <td colspan="2" class="contentfont"> 
	<textarea name="textarea" readonly class="smallfont" style="width:500px; height=200px;"><? echo eregi_replace("<br>","\n",addSpecialChars($layout['tc_text']));?></textarea></td> 
  </tr> 
  <? } ?> 
  <tr class="c4"> 
    <td colspan="2" align="center"><input name="nextstep" type="submit" id="nextstep" value="<?=$lang[nextstep]?>"> 
&nbsp; 
      <input name="prevstep" type="submit" id="prevstep" value="<?=$lang[prevstep]?>"></td> 
  </tr> 
</table> 
<? if ($_REQUEST['auctiontype']=="dutch") {?> 
<input type="hidden" name="respr" value="N"> 
<? } ?> 
</form> 
<? } else { echo "<p align=center class=errorfont>$lang[err_relogin]</p>"; } ?>

Open in new window

<? 
## v5.23 -> dec. 15, 2005
if ($_SESSION['membersarea']=="Active") { 
header5("$lang[aucpreview]");
?>

<table width="100%" border="0" cellpadding="2" cellspacing="2" class="sellsteptab">
	<tr align="center">
     <td class="c2" width="15%"><img src="themes/<?=$setts['default_theme'];?>/img/system/sell1.png"></td>
     <td class="c2" width="15%"><img src="themes/<?=$setts['default_theme'];?>/img/system/sell2.png"></td>
     <td class="c2" width="15%"><img src="themes/<?=$setts['default_theme'];?>/img/system/sell3.png"></td>
     <td class="c2" width="15%"><img src="themes/<?=$setts['default_theme'];?>/img/system/sell4.png"></td>
     <td class="c2" width="15%"><img src="themes/<?=$setts['default_theme'];?>/img/system/sell5.png"></td>
     <td class="c3" width="15%"><img src="themes/<?=$setts['default_theme'];?>/img/system/sell6.png"></td>
     <? if ($setts['secondcategory']) { ?>
     <td class="c2" width="10%"><img src="themes/<?=$setts['default_theme'];?>/img/system/sell7.png"></td>
	 <? } ?>
   </tr>
   <tr class="contentfont" align="center">
     <td class="c4"><?=$lang[sellstep1];?></td>
     <? if ($setts['secondcategory']) { ?>
     <td class="c4"><?=$lang[sellstep2];?></td>
	 <? } ?>
     <td class="c4"><?=$lang[sellstep3];?></td>
     <td class="c4"><?=$lang[sellstep4];?></td>
     <td class="c4"><?=$lang[sellstep5];?></td>
     <td class="c2"><?=$lang[sellstep6];?></td>
     <td class="c4"><?=$lang[sellstep7];?></td>
   </tr>
  </table><br>
 <input type="hidden" name="step" value="step3"> 
<table width="100%" border="0" cellpadding="4" cellspacing="4" align="center" class="border"> 
  <tr> 
    <td colspan="2" class="c1"><b><? echo titleResize($_REQUEST['name']);?></b></td> 
  </tr> 
  <tr class="c5"> 
    <td><img src="themes/<?=$setts['default_theme'];?>/img/pixel.gif" width="1" height="1"></td> 
    <td><img src="themes/<?=$setts['default_theme'];?>/img/pixel.gif" width="1" height="1"></td> 
  </tr> 
  <tr class="errormessage border"> 
    <td class="contentfont" colspan="2"> <?
	if($_REQUEST['category'] > 0) {
	 	$croot = $_REQUEST['category'];
		$nav = "";
	 	$cntr = 0;
	 	while ($croot>0) {
	 		$sbcts = mysql_query("SELECT * FROM probid_categories WHERE id='$croot'") or die(mysql_error());
	 				
			$crw = mysql_fetch_array($sbcts);
			if($cntr == 0) {
				$nav = $c_lang[$crw['id']];
				$plain_email_link = $c_lang[$crw['id']];
			} else {
				if($parent != $croot) {
					$nav = $c_lang[$crw['id']]." > $nav";
					$plain_email_link = $c_lang[$crw['id']]." > ".$plain_email_link;
				}
			}
			$cntr++;
			$croot = $crw['parent'];
		}
		echo "$nav";
		echo "<input type=\"hidden\" name=\"emaillink\" value=\"".$plain_email_link."\">";
	}
	
	if($_REQUEST['addlcategory'] > 0) {
	 	$croot = $_REQUEST['addlcategory'];
		$nav = "";
	 	$cntr = 0;
	 	while ($croot>0) {
	 		$sbcts = mysql_query("SELECT * FROM probid_categories WHERE id='$croot'") or die(mysql_error());
	 				
			$crw = mysql_fetch_array($sbcts);
			if($cntr == 0) {
				$nav = $c_lang[$crw['id']];
				$plain_email_link = $c_lang[$crw['id']];
			} else {
				if($parent != $croot) {
					$nav = $c_lang[$crw['id']]." > $nav";
					$plain_email_link = $c_lang[$crw['id']]." > ".$plain_email_link;
				}
			}
			$cntr++;
			$croot = $crw['parent'];
		}
		echo "<br>$nav";
	} ?></td> 
  </tr> 
  <tr> 
    <td valign="top"> 
    	<table width="100%" border="0" cellpadding="2" cellspacing="2"> 
        <tr class="c3"> 
          <td class="contentfont"><b><?=$lang[quant]?>:</b></td> 
          <td class="contentfont"><b><?=$_REQUEST['quantity'];?></b></td> 
        </tr> 
        <tr class="c2"> 
          <td class="contentfont"><b><?=$lang[startbid]?>:</b></td> 
          <td class="contentfont"><b><? echo displayAmount($_REQUEST['startprice'],$_REQUEST['currency']);?></b> </td> 
        </tr> 
        <tr class="c3"> 
          <td class="contentfont"><b><?=$lang[duration]?>:</b></td> 
          <td class="contentfont"><?=$_REQUEST['duration'];?> <?=$lang[days];?></td> 
        </tr> 
		<?
		if ($_REQUEST['starttime']=="NOW") {
			$startDate = date( "Y-m-d H:i:s", time() );
			$closed = 0;
		} else {
			$diff = getSqlField("SELECT value FROM probid_timesettings WHERE active='selected'","value");
			$startDate = date("Y-m-d H:i:s", 
			mktime($_REQUEST['shour']-$diff,$_REQUEST['sminute'],0,$_REQUEST['dmonth'],$_REQUEST['ddate'],$_REQUEST['dyear'])); 
			$closed = 1;
		}
		$closingdate = closingdate($startDate,$_REQUEST['duration']);
		?>
        <tr class="c2"> 
          <td class="contentfont"><b><?=$lang[starts]?>:</b></td> 
          <td class="contentfont"><? echo displaydatetime($startDate,$setts['date_format']);?></td> 
        </tr> 
        <tr class="c3"> 
          <td><?=$lang[ends]?></td> 
          <td><? echo displaydatetime($closingdate,$setts['date_format']);?></td> 
        </tr> 
        <tr class="c2"> 
          <td class="contentfont"><b><?=$lang[zip]?>:</b></td> 
          <td class="contentfont"><?=$_REQUEST['zip'];?> </td> 
        </tr> 
        <tr class="c3"> 
          <td class="contentfont"><b><?=$lang[country]?>:</b></td> 
          <td class="contentfont"><?=$_REQUEST['country'];?> </td> 
        </tr> 
        <tr class="c2"> 
          <td class="contentfont" colspan="2"><? 
	  		$bnvalue=displayAmount($_REQUEST['bnprice'],$_REQUEST['currency']);
	  		echo "<b>".(($_REQUEST['buynow']=="Y")?"<img src=themes/".$setts['default_theme']."/img/system/buyitnow.gif border=0><br> $lang[bynow_for] ".$bnvalue."":"")."</b>";
		  ?></td> 
        </tr> 
        <tr class="c2"> 
          <td class="contentfont" nowrap="nowrap"><? if ($_REQUEST['respr']=="Y") { echo "<b>$lang[resprice]:</b>"; } ?> </td> 
          <td><? if ($_REQUEST['respr']=="Y") { echo displayAmount($_REQUEST['resprice'],$_REQUEST['currency']); } ?></td> 
        </tr> 
      </table>
    </td> 
    <td valign="top"> 
     <table width="100%" border="0" cellpadding="2" cellspacing="2"> 
        <tr valign="top" class="c3"> 
          <td class="contentfont"><b><?=ucwords($lang[payment])?>:</b></td> 
          <td class="c4"><?
			$pm_methods=explode("<br>",$_REQUEST['pm']);
			$nb_pm_methods=count($pm_methods);
			?> 
            <table border="0" cellspacing="2" cellpadding="2"> 
              <? for ($i=0;$i<$nb_pm_methods;$i+=2) { 
				$j=$i+1;
				?> 
              <tr class="contentfont "> 
                <td width="120" class="c3"><b><?=$pm_methods[$i];?></b></font></td> 
                <td width="120" class="c3"><b><?=$pm_methods[$j];?></b></font></td> 
              </tr> 
              <? } ?> 
            </table></td> 
        </tr> 
        <tr valign="top" class="c2"> 
          <td class="contentfont"><b><?=ucwords($lang[shipping])?>:</b></td> 
          <td class="contentfont"> <?
			if ($_REQUEST['shipcond']=="BP") echo "$lang[buyerpaysshipment]";
			else echo "$lang[sellerpaysshipment]";
			if ($_REQUEST['shipint']=="Y") echo "<br>$lang[sellershipinternat]";
		?> </td> 
        </tr> 
  		<? if ($setts['shipping_costs']==1) { ?> 
	    <tr valign="top" class="c2"> 
          <td class="contentfont"><b><?=$lang[postagecosts]?>:</b></td> 
          <td class="contentfont"><?=displayAmount($_REQUEST['postage_costs'],$_REQUEST['currency'],"YES");?></td> 
        </tr> 
        <tr valign="top" class="c2"> 
          <td class="contentfont"><b><?=$lang[insurance]?>:</b></td> 
          <td class="contentfont"><?=displayAmount($_REQUEST['insurance'],$_REQUEST['currency'],"YES");?> </td> 
        </tr> 
        <tr valign="top" class="c2"> 
          <td class="contentfont"><b><?=$lang[servicetype]?>:</b></td> 
          <td class="contentfont"><?=$_REQUEST['type_service'];?> </td> 
        </tr> 
		<? if ($_REQUEST['shipping_details']!="") { ?>
        <tr valign="top" class="c2"> 
          <td class="contentfont"><b><?=$lang[shipping_details]?>:</b></td> 
          <td class="contentfont"><?=$_REQUEST['shipping_details'];?> </td> 
        </tr> 
		<? } ?>
		<? } ?>
        <tr valign="top" class="c3"> 
          <td class="contentfont"><b><?=$lang[featuring]?>:</b></td> 
          <td class="contentfont"> <? 
		  	if ($_REQUEST['hpfeat']=="Y") echo "<li>$lang[sell_homepage]</li>";
			if ($_REQUEST['catfeat']=="Y") echo "<li>$lang[sell_category]</li>";
			if ($_REQUEST['bolditem']=="Y") echo "<li>$lang[sell_bold]</li>";
			if ($_REQUEST['hlitem']=="Y") echo "<li>$lang[sell_highlighted]</li>";
			if ($_REQUEST['hlitem']!="Y"&&$_REQUEST['bolditem']!="Y"&&$_REQUEST['catfeat']!="Y"&&$_REQUEST['hpfeat']!="Y") echo $lang[none];
		?> </td> 
        </tr> 
      </table></td> 
  </tr> 
  <tr> 
    <td colspan="2" class="c1"><b><?=strtoupper($lang[descr])?></b></td> 
  </tr> 
  <tr class="c5"> 
    <td colspan="2"><img src="themes/<?=$setts['default_theme'];?>/img/pixel.gif" width="1" height="1"></td> 
  </tr> 
  <tr> 
    <td colspan="2"> <? echo addSpecialChars($_REQUEST['description']);?> </td> 
  </tr> 
  <tr> 
    <td align="center" class="contentfont" colspan="2"> <? 
	if ($_REQUEST['mainpic']!="") echo "<img src=\"makethumb.php?pic=".$_REQUEST['mainpic']."&w=400\"><br>";  
		for ($i=0;$i<$_REQUEST['cnt1'];$i++) { 
			echo "<img src=\"makethumb.php?pic=".$_REQUEST['the_pic'][$i]."&w=100\">&nbsp;";
		} 
	?></td> 
  </tr> 
<?
$mainCat_primary = getMainCat($_REQUEST['category']);
$mainCat_secondary = getMainCat($_REQUEST['addlcategory']);
  
$getFields = mysql_query("SELECT DISTINCT boxid, boxname, boxtype FROM probid_fields 
WHERE (categoryid='".$mainCat_primary."' OR categoryid='".$mainCat_secondary."' OR categoryid='0') 
ORDER BY fieldorder ASC") or die(mysql_error()); 
$isFields = mysql_num_rows($getFields);
if ($isFields) { ?>
  <tr class="c1"> 
    <td colspan="2"><?=strtoupper($lang[addfields])?></td> 
  </tr> 
  <tr class="c5"> 
    <td colspan="2"><img src="themes/<?=$setts['default_theme'];?>/img/pixel.gif" width="1" height="1"></td> 
  </tr> 
<? while ($fields=mysql_fetch_array($getFields)) { $toDisp = ""; ?>
  <tr class="<? echo (($count++)%2==0)?"c3":"c2"; ?>"> 
    <td align="right" width="50%"><strong><?=$fields['boxname'];?></strong></td> 
    <td><?
	if ($fields['boxtype']=="checkbox") {
		for ($i=0; $i<count($_REQUEST['box'.$fields['boxid']]); $i++) { 
			$toDisp .= getSqlField("SELECT boxcaption FROM probid_fields WHERE boxid='".$fields['boxid']."' AND boxvalue='".$_REQUEST['box'.$fields['boxid']][$i]."'","boxcaption")."&nbsp; &nbsp;";
		}	
	} else if ($fields['boxtype']=="radio") {
		$toDisp = getSqlField("SELECT boxcaption FROM probid_fields WHERE boxid='".$fields['boxid']."' AND boxvalue='".$_REQUEST['box'.$fields['boxid']]."'","boxcaption")." ";
	} else if ($fields['boxtype']=="list") {
		$toDisp = getSqlField("SELECT boxcaption FROM probid_fields WHERE boxid='".$fields['boxid']."' AND boxvalue='".$_REQUEST['box'.$fields['boxid']]."'","boxcaption")." ";
	} else {
		$toDisp .= remSpecialChars($_REQUEST['box'.$fields['boxid']]);
	}
	echo $toDisp;
	?></td> 
  </tr> 
<? } 
} ?>
  <tr> 
    <td class="errormessage" align="center" colspan="2"><?=$lang[dontrefrest_note];?></td> 
  </tr> 
  <tr class="c4"> 
    <td class="contentfont" align="center" colspan="2"><input name="nextstep" type="submit" id="nextstep" value="<?=$lang[submit]?>"> 
&nbsp; 
      <input name="prevstep" type="submit" id="prevstep" value="<?=$lang[prevstep]?>"></td> 
  </tr> 
</table> 
<? } else { echo "<p align=center class=errorfont>$lang[err_relogin]</p>"; } ?>

Open in new window

<?
## v5.23 -> dec. 14, 2005
session_start();

## create a unique id for the images that are to be uploaded.

if (!$_SESSION['images_id']) $_SESSION['images_id'] = md5(uniqid(rand(2, 999999999)));

if ($_SESSION['membersarea']!="Active") {
	if ($_SESSION['accsusp']==2) echo "<script>document.location.href='membersarea.php'</script>";
	else echo "<script>document.location.href='login.php?redirect=sell'</script>";
} else { 

if ($_SESSION['is_seller']!="Y") header ("Location: membersarea.php");
if ($_SESSION['jmwdactive']!="Y") header ("Location: nbev.php");
include_once ("config/config.php");

include ("themes/".$setts['default_theme']."/header.php");

if ($_SESSION['accsusp']==2) {
	header5($lang[susp_title]);
	echo "<p class=contentfont align=center>$lang[susp_text]</p>";
} else {
	$getV = checkSetupVoucher(trim($_REQUEST['voucher_code']));
	
	if ($getV['valid']) {
		echo "<table cellpadding=4 width=100% class=errormessage><tr><td>$lang[voucher_valid]</td></tr></table>";
	} else if (!$getV['valid']&&trim($_REQUEST['voucher_code'])!="") {
		echo "<table cellpadding=4 width=100% class=errormessage><tr><td class=redfont>$lang[voucher_invalid]</td></tr></table>";
	}
	
	if ($_REQUEST['description_main']!="") $_REQUEST['description'] = $_REQUEST['description_main'];

	if (is_numeric($_REQUEST['resprice'])) {
		if ($_REQUEST['resprice'] == 0) $_REQUEST['respr'] = "N";
		else if ($_REQUEST['resprice'] < 0) $_REQUEST['respr'] = "N";
		else if ($_REQUEST['resprice'] > 0) $_REQUEST['respr'] = "Y";
	} else $_REQUEST['respr'] = "N";

	include ("formchecker.php");
	
	## get any prefilled fields
	if (trim($_REQUEST['step'])=="step1") {
		$prefilled = getSqlRow("SELECT * FROM probid_users WHERE id='".$_SESSION['memberid']."'");
		if (trim($prefilled['default_duration'])!="") $_REQUEST['duration'] = $prefilled['default_duration'];
		if (trim($prefilled['default_private'])!="") $_REQUEST['privateauct'] = $prefilled['default_private'];
		if (trim($prefilled['default_isswap'])!="") $_REQUEST['isswap'] = $prefilled['default_isswap'];
		if (trim($prefilled['default_sc'])!="") $_REQUEST['shipcond'] = $prefilled['default_sc'];
		if (trim($prefilled['default_scint'])!="") $_REQUEST['shipint'] = $prefilled['default_scint'];
		if (trim($prefilled['default_pm'])!="") $_REQUEST['pm'] = $prefilled['default_pm'];
		if ($prefilled['default_acceptdirectpayment']>0) $_REQUEST['acceptdirectpayment'] = $prefilled['default_acceptdirectpayment'];
		if (trim($prefilled['default_directpaymentemail'])!="") $_REQUEST['directpaymentemail'] = $prefilled['default_directpaymentemail'];
		if ($prefilled['default_postage_costs']>0) $_REQUEST['postage_costs'] = $prefilled['default_postage_costs'];
		if (trim($prefilled['default_insurance'])!="") $_REQUEST['insurance'] = $prefilled['default_insurance'];
		if (trim($prefilled['default_type_service'])!="") $_REQUEST['type_service'] = $prefilled['default_type_service'];
		if (trim($prefilled['default_shipping_details'])!="") $_REQUEST['shipping_details'] = $prefilled['default_shipping_details'];		
	}
	
	if ($_GET['option']=="sellsimilar") {
		$_REQUEST['relist_similar']="YES";
		$similar = getSqlRow("SELECT * FROM probid_auctions WHERE 
		id='".$_GET['similarid']."' AND ownerid='".$_SESSION['memberid']."'");
		$_REQUEST['name'] = $similar['itemname'];
  		$_REQUEST['category'] = $similar['category'];
		$_REQUEST['addlcategory'] = $similar['addlcategory'];

		$_REQUEST['description'] = $similar['description'];
  		$_REQUEST['mainpic'] = $similar['picpath']; 
  		$_REQUEST['quantity'] = $similar['quantity'];
  		$_REQUEST['auctiontype'] = $similar['auctiontype'];
  		$_REQUEST['startprice'] = $similar['bidstart'];
  		$_REQUEST['respr'] = $similar['rp'];
  		$_REQUEST['resprice'] = ($similar['rpvalue']>0)?$similar['rpvalue']:"";
  		$_REQUEST['buynow'] = $similar['bn'];
  		$_REQUEST['bnprice'] = ($similar['bnvalue']>0)?$similar['bnvalue']:"";
  		$_REQUEST['bidinc'] = $similar['bi'];
  		$_REQUEST['bidincvalue'] = $similar['bivalue'];
  		$_REQUEST['duration'] = $similar['duration'];
  		$_REQUEST['country'] = $similar['country'];
	  	$_REQUEST['zip'] = $similar['zip'];
  		$_REQUEST['hpfeat'] = $similar['hpfeat'];
  		$_REQUEST['hpfeat_desc'] = $similar['hpfeat_desc'];
  		$_REQUEST['catfeat'] = $similar['catfeat'];
  		$_REQUEST['currency'] = $similar['currency'];
  		$_REQUEST['privateauct'] = $similar['private'];
  		$_REQUEST['bolditem'] = $similar['bolditem'];
  		$_REQUEST['hlitem'] = $similar['hlitem'];
  		$_REQUEST['shipcond'] = $similar['sc'];
  		$_REQUEST['shipint'] = $similar['scint'];
  		$_REQUEST['pm'] = $similar['pm'];
  		$_REQUEST['postage_costs'] = $similar['postage_costs'];
  		$_REQUEST['insurance'] = $similar['insurance'];
  		$_REQUEST['shipping_details'] = $similar['shipping_details'];
  		$_REQUEST['isswap'] = $similar['isswap'];
		$_REQUEST['type_service'] = $similar['type_service'];
		$_REQUEST['acceptdirectpayment'] = $similar['acceptdirectpayment'];
		$_REQUEST['directpaymentemail'] = $similar['directpaymentemail'];
		$_REQUEST['listin'] = $similar['listin'];
		$_REQUEST['step']="step1";

		### add the custom fields 
	  	$getFields = mysql_query("SELECT DISTINCT f.boxid, d.boxvalue, f.boxtype FROM probid_fields_data d, probid_fields f WHERE 
		d.auctionid='".$_GET['similarid']."' AND d.ownerid='".$_SESSION['memberid']."' AND d.boxid=f.boxid") or die(mysql_error()); 
  		$isFields = mysql_num_rows($getFields);
  		if ($isFields) {
			while ($fields=mysql_fetch_array($getFields)) {
				if ($fields['boxtype']!="checkbox") $_REQUEST['box'.$fields['boxid']] = $fields['boxvalue'];
				else {
					$flds = explode(";",$fields['boxvalue']);
					for ($i=0; $i<count($flds); $i++) {
						if (trim($flds[$i])!="") $_REQUEST['box'.$fields['boxid']][$i] = $flds[$i];
					}
				}
			}
		}		
		
		$getAdditionalPics = mysql_query("SELECT * FROM probid_auction_images WHERE auctionid='".$_GET['similarid']."'"); 
		$_REQUEST['cnt1']= mysql_num_rows($getAdditionalPics);
	  	$addPicCnt=0;
		while ($addPic = mysql_fetch_array($getAdditionalPics)) {
			$_REQUEST['the_pic'][$addPicCnt] = $addPic['name'];
			$addPicCnt++;
		}
	}

	$_REQUEST['name'] = remSpecialChars($_REQUEST['name']);
	$_REQUEST['description'] = remSpecialChars($_REQUEST['description']);
	$_REQUEST['hpfeat_desc'] = remSpecialChars($_REQUEST['hpfeat_desc']);

	if ($_REQUEST['step'] == "step2") {
		$_REQUEST['pm']="";
		for ($i=0;$i<count($_REQUEST['pmethod']);$i++) {
			$_REQUEST['pm'].=$_REQUEST['pmethod'][$i]."<br>";
		}
	}
	
	if ($_REQUEST['step'] == "step12") {
		### this is the saver for the main image
		$tempNumber = $_SESSION['images_id'];
		if (($_FILES['file']['name']!=""||$_POST['mainpicurl'])||($_REQUEST['relist_similar']=="YES"&&$_REQUEST['mainpic']!="")) {
			if ($_POST['mainpicurl']) $_REQUEST['mainpic']="http://".str_replace("http://","",$_POST['mainpicurl']);
			else {
				$sourceFile = ($_REQUEST['relist_similar']=="YES"&&$_FILES['file']['name']=="") ? $_REQUEST['mainpic'] : $_FILES['file']['tmp_name'];
				$fileExtension = getFileExtension($sourceFile);
				$imageName = "mb".$_SESSION['memberid']."_".$tempNumber."_mainpic.".$fileExtension;
				$imgMaxSize = $setts['pic_gal_max_size']*1024;
				if ($_FILES['file']['size']<$imgMaxSize||$_REQUEST['relist_similar']=="YES") {
					$isUpload = uploadFile($sourceFile,$imageName,"uplimg/");
					if ($isUpload) {
						$_REQUEST['mainpic'] = "uplimg/".$imageName;
					}
				} else {
					$picerror.= "<strong>$lang[error_a]</strong> $lang[auc_errpicsize1] $setts[pic_gal_max_size] kb<br>";
				}			
			}
		}

		### this is the saver for the additional images
		for ($i=0;$i<$setts['pic_gal_max_nb'];$i++) {
			if (($_FILES['addfile']['name'][$i]!=""||$_POST['picurl'][$i])||($_REQUEST['relist_similar']=="YES"&&$_REQUEST['the_pic'][$i]!="")) {
				$_REQUEST['cnt1']=0;
				$cnt1=0;	
			}
		}
		if ($_FILES['file']['name']!="") {
			$_REQUEST['cnt1']=0;
			$cnt1=0;
		}
		for ($i=0;$i<$setts['pic_gal_max_nb'];$i++) {
			$imgMaxSize = $setts['pic_gal_max_size']*1024;
			if ($_FILES['addfile']['size'][$i]<$imgMaxSize||$_REQUEST['relist_similar']=="YES") {
				if(($_FILES['addfile']['name'][$i]!=""||$_POST['picurl'][$i])||($_REQUEST['relist_similar']=="YES"&&$_REQUEST['the_pic'][$i]!="")) {
					if ($_POST['picurl'][$i]) {
						$_REQUEST['the_pic'][$cnt1]="http://".str_replace("http://","",$_POST['picurl'][$i]);
						$_REQUEST['cnt1']++;
						$cnt1++;
					} else {
						$sourceFile = ($_REQUEST['relist_similar']=="YES"&&$_FILES['addfile']['name'][$i]=="") ? $_REQUEST['the_pic'][$i] : $_FILES['addfile']['tmp_name'][$i];
						$fileExtension = getFileExtension($sourceFile);
						$addImageName = "mb".$_SESSION['memberid']."_".$tempNumber."_addpic".$i.".".$fileExtension;
						$isUpload = uploadFile($sourceFile,$addImageName,"uplimg/");
						if ($isUpload) {
							$_REQUEST['the_pic'][$cnt1]="uplimg/".$addImageName;
							$_REQUEST['cnt1']++;
							$cnt1++;
						}
					}
				} 
			} else {
				$picerror .= "<strong>$lang[error_a]</strong> $lang[auc_errpicsize3] #".($i+1)." $lang[auc_errpicsize4] $setts[pic_gal_max_size] kb<br>";
			}
		}
		
		if (trim($picerror)) { 
			$picerrormsg = "<table width=100% class=border cellspacing=4 cellpadding=4><tr><td class=\"c3 contentfont\">$picerror<br><br>$lang[auc_errpicsize2]</td></tr></table>";
			echo $picerrormsg;
		}
		$cnt_temp = $_REQUEST['cnt1'];
		for ($i=0; $i<$_REQUEST['cnt1']; $i++) {
			if ($_REQUEST['the_pic'][$i] == "") $cnt_temp--;
		}
		$_REQUEST['cnt1'] = $cnt_temp;
		$cnt1 = $cnt_temp;
	}
	
	//if ($_REQUEST['catname']=="") $_REQUEST['catname'] = getSqlField("SELECT name FROM probid_categories WHERE id='".$_REQUEST['category']."'","name");
	//if ($_REQUEST['addlcatname']==""&&$_REQUEST['addlcategory']>0) $_REQUEST['addlcatname'] = getSqlField("SELECT name FROM probid_categories WHERE id='".$_REQUEST['addlcategory']."'","name");
	if ($_REQUEST['date17_year']!="") $_REQUEST['dyear']=$_REQUEST['date17_year'];
	if ($_REQUEST['date17_date']!="") $_REQUEST['ddate']=$_REQUEST['date17_date'];
	if ($_REQUEST['date17_month']!="") $_REQUEST['dmonth']=$_REQUEST['date17_month'];
	
	
	echo "<form action=\"sellitem.php\" method=\"post\" enctype=\"multipart/form-data\" name=\"sistep1\">\n";
  	echo "	<input type=\"hidden\" name=\"relist_similar\" value=\"".$_REQUEST['relist_similar']."\">\n";
  	echo "	<input type=\"hidden\" name=\"category\" value=\"".$_REQUEST['category']."\">		\n";
  	//echo "	<input type=\"hidden\" name=\"catname\" value=\"".$_REQUEST['catname']."\">	 		\n";
  	//echo "	<input type=\"hidden\" name=\"catid\" value=\"".$_REQUEST['catid']."\"> 			\n";
	echo " 	<input type=\"hidden\" name=\"name\" value=\"".$_REQUEST['name']."\">				\n";
  	echo "	<input type=\"hidden\" name=\"description\" value=\"".$_REQUEST['description']."\">	\n";
  	echo "  <input type=\"hidden\" name=\"mainpic\" value=\"".$_REQUEST['mainpic']."\">			\n"; 
  	echo "  <input type=\"hidden\" name=\"quantity\" value=\"".$_REQUEST['quantity']."\">		\n"; 
  	echo "  <input type=\"hidden\" name=\"auctiontype\" value=\"".$_REQUEST['auctiontype']."\">	\n"; 
  	echo "  <input type=\"hidden\" name=\"startprice\" value=\"".$_REQUEST['startprice']."\">	\n";
  	echo "  <input type=\"hidden\" name=\"respr\" value=\"".$_REQUEST['respr']."\">				\n";				
  	echo "  <input type=\"hidden\" name=\"resprice\" value=\"".$_REQUEST['resprice']."\">		\n"; 
  	echo "  <input type=\"hidden\" name=\"buynow\" value=\"".$_REQUEST['buynow']."\">			\n"; 
  	echo "  <input type=\"hidden\" name=\"bnprice\" value=\"".$_REQUEST['bnprice']."\">			\n"; 
  	echo "  <input type=\"hidden\" name=\"bidinc\" value=\"".$_REQUEST['bidinc']."\"> 			\n";
  	echo "  <input type=\"hidden\" name=\"bidincvalue\" value=\"".$_REQUEST['bidincvalue']."\">	\n"; 
  	echo "  <input type=\"hidden\" name=\"duration\" value=\"".$_REQUEST['duration']."\">		\n"; 
  	echo "  <input type=\"hidden\" name=\"country\" value=\"".$_REQUEST['country']."\"> 		\n";
  	echo "	<input type=\"hidden\" name=\"zip\" value=\"".$_REQUEST['zip']."\"> 				\n";
  	echo "  <input type=\"hidden\" name=\"currency\" value=\"".$_REQUEST['currency']."\">		\n"; 
  	echo "  <input type=\"hidden\" name=\"privateauct\" value=\"".$_REQUEST['privateauct']."\">	\n"; 
  	echo "  <input type=\"hidden\" name=\"shipcond\" value=\"".$_REQUEST['shipcond']."\">		\n";
  	echo "  <input type=\"hidden\" name=\"shipint\" value=\"".$_REQUEST['shipint']."\">			\n";
  	echo "  <input type=\"hidden\" name=\"pm\" value=\"".$_REQUEST['pm']."\">					\n";
  	echo "  <input type=\"hidden\" name=\"hpfeat_desc\" value=\"".$_REQUEST['hpfeat_desc']."\">	\n";
  	echo "  <input type=\"hidden\" name=\"postage_costs\" value=\"".$_REQUEST['postage_costs']."\">\n";
  	echo "  <input type=\"hidden\" name=\"insurance\" value=\"".$_REQUEST['insurance']."\">		\n";
  	echo "  <input type=\"hidden\" name=\"shipping_details\" value=\"".$_REQUEST['shipping_details']."\">\n";
  	echo "  <input type=\"hidden\" name=\"type_service\" value=\"".$_REQUEST['type_service']."\">\n";
  	echo "  <input type=\"hidden\" name=\"isswap\" value=\"".$_REQUEST['isswap']."\">			\n";
  	echo "  <input type=\"hidden\" name=\"addlcategory\" value=\"".$_REQUEST['addlcategory']."\">\n"; 
  	//echo "  <input type=\"hidden\" name=\"addlcatname\" value=\"".$_REQUEST['addlcatname']."\">	\n"; 
  	//echo "	<input type=\"hidden\" name=\"addlcatid\" value=\"".$_REQUEST['addlcatid']."\"> 	\n";
  	echo "  <input type=\"hidden\" name=\"directpaymentemail\" value=\"".$_REQUEST['directpaymentemail']."\"> \n";
  	echo "	<input type=\"hidden\" name=\"starttime\" value=\"".$_REQUEST['starttime']."\">		\n";
  	echo "	<input type=\"hidden\" name=\"dmonth\" value=\"".$_REQUEST['dmonth']."\">\n";
  	echo "	<input type=\"hidden\" name=\"ddate\" value=\"".$_REQUEST['ddate']."\">	\n";
  	echo "	<input type=\"hidden\" name=\"dyear\" value=\"".$_REQUEST['dyear']."\">	\n";
  	echo "	<input type=\"hidden\" name=\"dmonth\" value=\"".$_REQUEST['dmonth']."\">\n";
  	echo "	<input type=\"hidden\" name=\"ddate\" value=\"".$_REQUEST['ddate']."\">	\n";
  	echo "	<input type=\"hidden\" name=\"dyear\" value=\"".$_REQUEST['dyear']."\">	\n";
  	echo "	<input type=\"hidden\" name=\"shour\" value=\"".$_REQUEST['shour']."\">				\n";
  	echo "	<input type=\"hidden\" name=\"sminute\" value=\"".$_REQUEST['sminute']."\">			\n";
  	echo "	<input type=\"hidden\" name=\"listin\" value=\"".$_REQUEST['listin']."\">			\n";
  	echo "	<input type=\"hidden\" name=\"voucher_code\" value=\"".$_REQUEST['voucher_code']."\">\n";
	
	if (isset($_REQUEST['nextstep'])) $next_step = 1;
	else if ($_REQUEST['relist_similar']=="YES") $next_step = 1;
	else $next_step=0;
	
	if (($_REQUEST['step'] != "step11"&&$next_step)||($_REQUEST['step'] != "step2"&&isset($_REQUEST['prevstep']))) {
  		echo "<input type=\"hidden\" name=\"hpfeat\" value=\"".$_REQUEST['hpfeat']."\"> 		\n";
  		echo "<input type=\"hidden\" name=\"catfeat\" value=\"".$_REQUEST['catfeat']."\">		\n"; 
  		echo "<input type=\"hidden\" name=\"bolditem\" value=\"".$_REQUEST['bolditem']."\"> 	\n";
  		echo "<input type=\"hidden\" name=\"hlitem\" value=\"".$_REQUEST['hlitem']."\">			\n";
		
		$mainCat_primary = getMainCat($_REQUEST['category']);
		$mainCat_secondary = getMainCat($_REQUEST['addlcategory']);
		### add the custom fields 
	  	$getFields = mysql_query("SELECT DISTINCT boxid, boxname, boxtype, active FROM probid_fields WHERE 
		(categoryid='".$mainCat_primary."' OR categoryid='".$mainCat_secondary."' OR categoryid='0')") or die(mysql_error()); 
  		$isFields = mysql_num_rows($getFields);
  		if ($isFields) {
			while ($fields=mysql_fetch_array($getFields)) {
				if ($fields['boxtype']=="checkbox") {
					for ($i=0; $i<count($_REQUEST['box'.$fields['boxid']]); $i++) 
						echo "<input type=\"hidden\" name=\"box".$fields['boxid']."[]\" value=\"".remSpecialChars($_REQUEST['box'.$fields['boxid']][$i])."\">\n";	
				} else { 
					echo "<input type=\"hidden\" name=\"box".$fields['boxid']."\" value=\"".remSpecialChars($_REQUEST['box'.$fields['boxid']])."\">\n";
				}
			}
		}		
    }
	if (($_REQUEST['step'] != "step12"&&isset($_REQUEST['nextstep']))||($_REQUEST['step'] != "step3"&&isset($_REQUEST['prevstep']))) {
  		echo "<input type=\"hidden\" name=\"acceptdirectpayment\" value=\"".$_REQUEST['acceptdirectpayment']."\">\n";
    }
  	for ($i=0;$i<$_REQUEST['cnt1'];$i++) { 
  		echo "<input type=\"hidden\" name=\"the_pic[]\" value=\"".$_REQUEST['the_pic'][$i]."\">	\n";
  	} 
  	echo "<input type=\"hidden\" name=\"cnt1\" value=\"".$_REQUEST['cnt1']."\"> 				\n";
	
		#### if store is enabled for the user first step is step 0
		$userStore = getSqlRow("SELECT aboutpage_type, store_active, store_account_type FROM probid_users WHERE id='".$_SESSION['memberid']."'");
		$nbStoreItems = getSqlNumber("SELECT id FROM probid_auction WHERE ownerid='".$_SESSION['memberid']."' AND 
		active='1' AND closed='0' AND deleted!='1' AND listin!='auction'");
		$storeActive = FALSE;
		if ($userStore['aboutpage_type']==2&&$userStore['store_active']==1) {
			if ($userStore['store_account_type']==0) $storeActive = TRUE;
			else {
				$maxStoreItems = getSqlField("SELECT store_nb_items FROM probid_fees_tiers WHERE id='".$userStore['store_account_type']."'","store_nb_items");
				if ($maxStoreItems!="n/a"&&$maxStoreItems!=""&&$maxStoreItems>$nbStoreItems) $storeActive=TRUE;
			}
		}
		
		if (!$storeActive&&trim($_REQUEST['step'])=="") { 
			$_REQUEST['step']="step0";
			$_REQUEST['listin']="auction";
		}
			
		switch ($_REQUEST['step']) {
			case "step3": 
				if (isset($_REQUEST['nextstep'])) {
					echo "</form>";
					include ("sellitem-final.php");
					echo "<form>";
				}
				else if (isset($_REQUEST['prevstep'])) include ("sellitem-step12.php");
				break;
			case "step2": 
				if (isset($_REQUEST['nextstep'])) include ("sellitem-step2.php");
				else if (isset($_REQUEST['prevstep'])) include ("sellitem-step11.php");
				break;
			case "step12":
				if (isset($_REQUEST['nextstep'])) include ("sellitem-step12.php");
				else if (isset($_REQUEST['prevstep'])) include ("sellitem-step1.php");
				break;
			case "step11":
				if (isset($_REQUEST['nextstep'])||$_REQUEST['curchange']=="yes") include ("sellitem-step11.php");
				else if (isset($_REQUEST['prevstep'])) include ("sellitem-step0.php");
				break;
			case "step1":
				include ("sellitem-step1.php");
				break;
			case "step01":
				include ("sellitem-step01.php");
				break;
			case "step0":
				include ("sellitem-step0.php");
				break;
			default:
				include ("sellitem-step00.php");
				
		}  
	echo "</form>";
}		
include ("themes/".$setts['default_theme']."/footer.php"); 
} 

?>

Open in new window

Bildschirmfoto-2011-10-02-um-12..png
0
 
LVL 11

Author Comment

by:mcnute
Comment Utility
I discovered another thing the function which should output the fileextension fails. The code is attached, all image links are without its extension though. Maybe this cause the browser to have problems first?

function getFileExtension($input_file) {
	$file_array = explode(".",$input_file);
	
	$nb_array = count($file_array);
	$ext_cnt = count($file_array) - 1;
	
	$extension = ($nb_array<=1) ? "" : $file_array[$ext_cnt];
	
	return $extension;
}

Open in new window

0
 
LVL 108

Expert Comment

by:Ray Paseur
Comment Utility
I tested the function getFileExtension() on my server, using the script here.  Click the link to see the output.  Depending on what you give it, it seems to be OK.
http://www.laprbass.com/RAY_temp_mcnute.php
<?php // RAY_temp_mcnute.php
error_reporting(E_ALL);
echo "<pre>" . PHP_EOL;


// CREATE SOME TEST DATA
$arr = array
( 'dog.txt'
, 'cat.dog.txt'
, 'www.laprbass.com/RAY_EE_images/goose.jpg'
, 'nothing'
)
;

// SHOW THE ARRAY
var_dump($arr);

// THE FUNCTION COPIED FROM http://www.experts-exchange.com/Software/Server_Software/Web_Servers/Apache/Q_27375230.html?cid=1572#a36899140
function getFileExtension($input_file) {
	$file_array = explode(".",$input_file);

	$nb_array = count($file_array);
	$ext_cnt = count($file_array) - 1;

	$extension = ($nb_array<=1) ? "" : $file_array[$ext_cnt];

	return $extension;
}

// TEST THE FUNCTION WITH THE TEST DATA STRINGS
foreach ($arr as $str)
{
    var_dump( getfileExtension($str) );
}

Open in new window

0
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 
LVL 11

Author Comment

by:mcnute
Comment Utility
Thank you for the response. The images has still no extension, but this doesn't seem to be the problem. The images are not being displayed in the auctiondetail.php which I attach here.

If anybody want to see the script in action I can give a Login to the system via private message to mcnutello(at)yahoo.it
<?
## v5.23 -> dec. 13, 2005
session_start();
if ($_SESSION['membersarea']!="Active") {
	echo "<script>document.location.href='login.php?auctionid=".$_GET['id']."'</script>";
} else {
include_once ("config/config.php");


if ($setts['cron_job']==2) {
	$manualCron = TRUE;
	include_once ("cron/cron1.php");
}

include ("themes/".$setts['default_theme']."/header.php");

if ($_SESSION['counted'][$_GET['id']]!="cntd") {
	$addClick = mysql_query("UPDATE probid_auctions SET clicks=clicks+1 WHERE id='".$_GET['id']."'");
	$_SESSION['counted'][$_GET['id']]="cntd";
}

##if ($_SESSION['adminarea']!="Active") $addPattern = " AND deleted!=1";
##else
$addPattern = "";

$auctionDetails = getSqlRow("SELECT * FROM probid_auctions WHERE id='".$_GET['id']."' AND active=1".$addPattern);
$isAuction = getSqlNumber("SELECT * FROM probid_auctions WHERE id='".$_GET['id']."' AND active=1".$addPattern);
if ($isAuction > 0) {
	$sellerDetails = getSqlRow("SELECT * FROM probid_users WHERE id='".$auctionDetails['ownerid']."'");

	include_once("formchecker.php");


 
	### add the messaging function
	if ($action=="submit_question") {
		if ($_GET['question_type']=="private") {			
			$ownerId = $auctionDetails['ownerid'];
			$senderId = $_SESSION['memberid'];
			$auctionId = $_GET['id'];
			$message = $_GET['message'];
			include ("mails/askquestion.php");
			$msgSys_msg = "<p align=center><strong>$lang[askquestionokmsg]</strong></p>";
		} else if ($_GET['question_type']=="public") {
			if (trim($_GET['message'])!="") {
				$currentTime = time();
				$message = remSpecialChars(trim($_GET['message']));
				## we check if an exact message hasnt been posted yet
				$ismsg = getSqlRow("SELECT id FROM probid_public_msg WHERE auctionid='".$_GET['id']."' AND 
				ownerid='".$auctionDetails['ownerid']."' AND posterid='".$_SESSION['memberid']."' AND 
				msgtype='Q' AND content='".$message."'");
				
				if (!$ismsg&&$_SESSION['memberid']>0) {
					$addMsg = mysql_query("INSERT INTO probid_public_msg 
					(auctionid, ownerid, posterid, msgtype, content, regdate) VALUES
					('".$_GET['id']."', '".$auctionDetails['ownerid']."', '".$_SESSION['memberid']."', 
					'Q', '".$message."', '".$currentTime."')"); 
					$answerid = mysql_insert_id();
					$prepareSellerMsg = mysql_query("INSERT INTO probid_public_msg 
					(auctionid, ownerid, posterid, msgtype, content, regdate, answerid) VALUES
					('".$_GET['id']."', '".$auctionDetails['ownerid']."', '".$auctionDetails['ownerid']."', 
					'A', '', '', '".$answerid."')"); 
					$msgSys_msg = "<p align=center><strong>$lang[askquestionokmsg2]</strong></p>";
					$sellerId = $auctionDetails['ownerid'];
					$auctionId = $auctionDetails['id'];
					include ("mails/notifysellerquestionposted.php");
				}
			} else {
				$msgSys_msg = "<p align=center><strong>$lang[askquestionokmsg3]</strong></p>";
			}
		}
		echo "<script>document.location.href='auctiondetails.php?id=".$_GET['id']."'</script>";
	}
	
	if ($action=="submit_answer") {
		$currentTime = time();
		$message = remSpecialChars(trim($_GET['content']));
		$addSellerMsg = mysql_query("UPDATE probid_public_msg SET
		content='".$message."', regdate='".$currentTime."' WHERE 
		answerid='".$_GET['answerid']."' AND ownerid='".$_SESSION['memberid']."' 
		AND posterid='".$_SESSION['memberid']."'") or die(mysql_error());

		$questionUserId = getSqlField("SELECT posterid FROM probid_public_msg WHERE id='".$_GET['answerid']."'","posterid");
		$auctionId = $auctionDetails['id'];
		include ("mails/notifybuyeranswerposted.php");

		$msgSys_msg = "<p align=center><strong>$lang[askquestionokmsg4]</strong></p>";
		echo "<script>document.location.href='auctiondetails.php?id=".$_GET['id']."'</script>";
	}
	### end of messaging function
	
	$binAuction=FALSE;
	if ($auctionDetails['bidstart']==$auctionDetails['bnvalue']&&$auctionDetails['bn']=="Y") $binAuction=TRUE;	
	### We decide if the auction is about to start, if it didnt, then only the owner can see it.
	$notStarted=FALSE;
	if (strtotime($auctionDetails['startdate'])>time()) $notStarted=TRUE;
	if ($auctionDetails['ownerid']==$_SESSION['memberid']) $notStarted=FALSE;
	if ($notStarted==TRUE) {
		headerdetails($lang[auctdetserror]);
		echo "<p class=contentfont align=center>$lang[auctiondidntstart]</p>";
	} else { ?>

<table width="100%"  border="0" cellspacing="0" cellpadding="4">
  <tr>
    <td class="topitempage" width="100%"><?
	 	$nav = "";
	 	$nav2 = "";
		$parent=$auctionDetails['category'];
	 	if($parent > 0) {
	 		$croot = $parent;
	 		$cntr = 0;
	 		while ($croot>0) {
	 			$sbcts = mysql_query(" SELECT id,parent FROM probid_categories WHERE id='".$croot."' ") or die(mysql_error());
				$crw = mysql_fetch_array($sbcts);
	 			if($cntr == 0) {
	 				$nav = $c_lang[$crw['id']];
	 			} else {
	 				if($parent != $croot) {
	 					$nav = "<a href=\"categories.php?parent=".$crw[id]."\">".$c_lang[$crw['id']]."</a> > ".$nav;
	 				}
	 			}
	 			$cntr++;
	 			$croot = $crw['parent'];
	 		}
	 	} 
		$parent=$auctionDetails['addlcategory'];
	 	if($parent > 0) {
	 		$croot = $parent;
	 		$cntr = 0;
	 		while ($croot>0) {
	 			$sbcts = mysql_query("SELECT id,parent FROM probid_categories WHERE id='".$croot."'") or die(mysql_error());
	 			
				$crw = mysql_fetch_array($sbcts);
	 			if($cntr == 0) {
	 				$nav2 = $c_lang[$crw['id']];
	 			} else {
	 				if($parent != $croot) {
	 					$nav2 = "<a href=\"categories.php?parent=".$crw[id]."\">".$c_lang[$crw['id']]."</a> > ".$nav2;
	 				}
	 			}
	 			$cntr++;
	 			$croot = $crw['parent'];
	 		}
	 	} 
		if (strlen($nav) || strlen($nav2)) {
			echo "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">
						<tr class=\"topitem\" valign=\"top\">
						<td nowrap><b>$lang[itemlistedon]:</b></td>
						
						<td width=\"100%\">$nav";
			if (strlen($nav2) && strlen($nav)) echo "&nbsp";
			echo "$nav2</td></tr></table>";
		} ?></td>
  </tr>
</table>
<div><img src="themes/<?=$setts['default_theme'];?>/img/pixel.gif" width="1" height="5"></div>
<? headerdetails("<table cellpadding=0 cellspacing=0 border=0 width=100%><tr><td class='itemid'>".$imgarritem.$auctionDetails['itemname']."</td><td align=right class='itemidend'><b>$lang[itemid]: ".$_GET['id']."</b>&nbsp;&nbsp;</td></tr></table>");?>
<?    
$fields=array(); 
$getPics=mysql_query("SELECT * FROM probid_auction_images WHERE auctionid='".$auctionDetails['id']."'"); 
$nbPics=mysql_num_rows($getPics); 
if ($nbPics>0) { 
while ($addlPicture=mysql_fetch_array ($getPics)) { 
array_push($fields, $addlPicture['name']); 
}} 
?>
<SCRIPT LANGUAGE = "JavaScript">
function WinOpen1(amount) {
venster = window.open("currency_converter.php?AMOUNT=<?=$auctionDetails['bidstart'];?>","popDialog","height=220,width=650,toolbar=no,resizable=yes,scrollbars=yes,left=10,top=10")
}
function WinOpen2(amount) {
venster = window.open("currency_converter.php?AMOUNT=<?=$auctionDetails['bnvalue'];?>","popDialog","height=220,width=650,toolbar=no,resizable=yes,scrollbars=yes,left=10,top=10")
}
function WinOpen3() {
venster = window.open("currency_converter.php?AMOUNT=<?=$auctionDetails['minbidcurr'];?>","popDialog","height=220,width=650,toolbar=no,resizable=yes,scrollbars=yes,left=10,top=10")
}
function WinOpen4() {
venster = window.open("currency_converter.php","popDialog","height=220,width=650,toolbar=no,resizable=yes,scrollbars=yes,left=10,top=10")
}
// end hide -->
</SCRIPT>
<SCRIPT LANGUAGE="JavaScript"> 
<!-- Begin 
NewImg = new Array ( 
"makethumb.php?pic=<?=$auctionDetails['picpath']?>&w=100&sq=Y" 
<? foreach($fields as $field) {?> 
,"makethumb.php?pic=<?=$field;?>&w=100&sq=Y" 
<?}?> 
); 
var ImgNum = 0; 
var ImgLength = NewImg.length - 1; 

//Time delay between Slides in milliseconds 
var delay = 2000; 

var lock = false; 
var run; 
function chgImg(direction) { 
if (document.images) { 
ImgNum = ImgNum + direction; 
if (ImgNum > ImgLength) { 
ImgNum = 0; 
} 
if (ImgNum < 0) { 
ImgNum = ImgLength; 
} 
document.slideshow.src = NewImg[ImgNum]; 
} 
} 
function auto() { 
if (lock == true) { 
lock = false; 
window.clearInterval(run); 
} 
else if (lock == false) { 
lock = true; 
run = setInterval("chgImg(1)", delay); 
   } 
}

</script>
<!-- Table for subhead -->
<table width="100%" border="0" cellpadding="3" cellspacing="2" class="subitem">
  <tr class="contentfont" >
    <td width="25%" class="contentfont">
	<? if ($_SESSION['membersarea']=="Active"||$_SESSION['accsusp']==2) { 
	  echo "<img src='themes/".$setts['default_theme']."/img/system/User48.png' vspace=5 style='float:left'>";
	  } else { echo "<img src='themes/".$setts['default_theme']."/img/system/status.gif' vspace=5>"; }?>
	<? if ($_SESSION['membersarea']=="Active"||$_SESSION['accsusp']==2) { ?>
      <?=$lang[welcome];?>
      , <br>
      <b><? echo $_SESSION['membername']; ?></b>
      <? } else { echo $lang[status_bidder_seller]; }?>
    </td>
    <td align="center" class="c3" width="25%"><a href="javascript:popUp('auction.printview.php?id=<?=$_REQUEST['id'];?>');"><img src="themes/<?=$setts['default_theme'];?>/img/system/File48.png" align="absmiddle" border="0" hspace="5" style="float:left">
      <?=$lang[printview]?>
      </a></td>
    <td align="center" class="" width="25%"><a href="itemwatch.php?id=<?=$auctionDetails['id'];?>&itemname=<?=$auctionDetails['itemname'];?>"><img src="themes/<?=$setts['default_theme'];?>/img/system/Faq48.png" align="absmiddle" border="0" hspace="5" style="float:left">
      <?=$lang[watchthisitem]?>
      </a></td>
    <td align="center" class="c3" width="25%"><a href="auctionfriend.php?owner=<?=$auctionDetails['ownerid'];?>&auctionid=<?=$auctionDetails['id'];?>"><img src="themes/<?=$setts['default_theme'];?>/img/system/UserRef48.png" align="absmiddle" border="0" hspace="5" style="float:left">
      <?=$lang[sendtofriend]?>
      </a>&nbsp;&nbsp;</td>
  </tr>
  <?
$winnerLogged = getSqlNumber("SELECT id FROM probid_winners WHERE buyerid='".$_SESSION['memberid']."' AND auctionid='".$_GET['id']."' AND directpayment_paid=0"); 
if ($auctionDetails['acceptdirectpayment']&&($auctionDetails['closed']!=0||$auctionDetails['auctiontype']=="dutch")&&$auctionDetails['ownerid']!=$_SESSION['memberid']&&$winnerLogged) { 
	## new function, calculate payment, it's intended for dutch auctions especially
	$getDpPayment = mysql_query("SELECT amount, quant_req, quant_offered FROM probid_winners WHERE
	buyerid='".$_SESSION['memberid']."' AND auctionid='".$_GET['id']."' AND directpayment_paid=0"); 
	$dpQuant = 0;
	$paymentAmount = 0;
	$postageC = 0;
	while ($dpPayment = mysql_fetch_array($getDpPayment)) {
		$dpQuant = ($dpPayment['quant_offered']>0) ? $dpPayment['quant_offered'] : 1;
		$paymentAmount += $dpQuant * $dpPayment['amount'];
		$postageC += $dpQuant * $auctionDetails['postage_costs'];
	}
	$paymentAmount += $postageC;

	if ($paymentAmount!="n/a"&&$paymentAmount!=""&&$paymentAmount>0) { ?>
  <!-- Header Direct Payment -->
  <tr height="21">
    <td colspan="5" class="c4"><b>&raquo; <? echo (strtoupper($lang[headdirectpayment]));?></b></td>
  </tr>
  <tr>
    <td colspan="5" class="c5"><img src="themes/<?=$setts['default_theme'];?>/img/pixel.gif" width="1" height="1"></td>
  </tr>
  <tr>
    <td colspan="5"><!-- End Header Direct Payment -->
      <table width="100%" border="0" cellspacing="1" cellpadding="0" class="c2">
        <tr valign="top">
          <td width="100%"><?
	if ($auctionDetails['paidwithdirectpayment']) {
		echo "<center>" . $lang[paiddirectpayment] . "</center>";
	} else {
		echo "<div style='padding: 6px;'>".$lang[you_won_item]."";
		echo "<b>".$auctionDetails[itemname]."</b>!<br>";
		echo "".$lang[you_won_item2]."</div>";
		$paymentAmount=number_format($paymentAmount,2,'.','');
		$returnUrl=$path."paymentdone.php";
		$failureUrl=$path."paymentfailed.php";
		$notifyUrl=$path."paymentprocess.php?table=100";
		paypalForm($auctionDetails['id']."_".$_SESSION['memberid'],$auctionDetails['directpaymentemail'],$paymentAmount,$auctionDetails['currency'],$returnUrl,$failureUrl,$notifyUrl,100,TRUE);
	} ?>
          </td>
        </tr>
      </table></td>
  </tr>
  <? 	}  } ?>
</table>
<br>
<!-- 3 cell table -->
<table width="100%" border="0" align="center" cellpadding="1" cellspacing="3">
  <tr valign="top">
    <td width="20%" align="center" class="contentfont"><? 
   if ($auctionDetails['picpath']!="") 
      echo    "                       \n". 
            "<table width=\"100%\" border=\"0\" cellspacing=\"5\" cellpadding=\"3\" class=\"border\">\n". 
            "   <tr>                                             \n". 
            "      <td height=\"110\" align=\"center\" class=\"c2\">         \n". 
            "         <img src=\"makethumb.php?pic=".$auctionDetails['picpath']."&w=100&sq=Y\" name=\"slideshow\" id=\"mainpic1\"> \n". 
            "      </td>                                          \n". 
            "   </tr>                                             \n". 
            "   <tr class=\"contentfont\">                                             \n". 
            "      <td align=center class=\"c3\">                        \n". 
            "         <a href=\"javascript:chgImg(-1)\"><img src=\"themes/".$setts['default_theme']."/img/system/left-arr.png\" width=\"15\" height=\"15\" border=\"0\" align=\"absmiddle\"></a>&nbsp;&nbsp;<a href=\"javascript:auto()\" align=\"absmiddle\">$lang[autostop]</a>&nbsp;&nbsp;<a href=\"javascript:chgImg(1)\"><img src=\"themes/".$setts['default_theme']."/img/system/right-arr.png\" width=\"15\" height=\"15\" border=\"0\" align=\"absmiddle\"></a>                          \n". 
             
            "      </td>                                          \n". 
            "   </tr>                                             \n". 
            "</table>                                             \n". 
            "";  
      $getpics=mysql_query("SELECT * FROM probid_auction_images WHERE auctionid='".$_GET['id']."'"); ?>
      <? 
	$daysLeft = daysleft($auctionDetails['enddate'],$setts['date_format']);
	$timeLeft = timeleft($auctionDetails['enddate'],$setts['date_format']);
	$currentBid = getSqlField("SELECT * FROM probid_bids WHERE auctionid='".$_GET['id']."' AND bidderid='".$_SESSION['memberid']."' ORDER BY bidamount DESC","bidamount") or die(mysql_error());
	$isCurrentBid = getSqlNumber("SELECT * FROM probid_bids WHERE auctionid='".$_GET['id']."' AND bidderid='".$_SESSION['memberid']."'"); 
	$showBN = showBuyNow($auctionDetails['rp'],$auctionDetails['rpvalue'],$auctionDetails['maxbid'],$auctionDetails['nrbids']);
?>
      <? if ($auctionDetails['closed']==0&&$auctionDetails['ownerid']!=$_SESSION['memberid']&&$daysLeft>0&&!$binAuction) { ?>
      <? if ($_SESSION['membersarea']!="Active") { ?>
      <p align="center"><b><font class='redfont'>  
        <?=$lang[bid_errreg]?>
        </font></b><br>
        <br>
        <a href="login.php?auctionid=<?=$_REQUEST['id'];?>">
        <?=$lang[memberlogin];?>
        </a> </p>
      <? } else {  ?>
      <?	if (!$binAuction) { ?>
	  
	  <? if($_SESSION['jmwdactive']=="Y") { ?>
      <br> 
      <table width="100%" border="0" cellspacing="1" cellpadding="1" class="border">
        <form action="bid.php" method="post">
          <? if ($auctionDetails['auctiontype']=="dutch") { ?>
          <tr>
            <td rowspan="3" valign="top" class="c2"><img src="themes/<?=$setts['default_theme'];?>/img/system/Tools48.png" align="absmiddle" border="0" hspace="1" vspace="1"></td>
            <td class="c2"><?=$lang[quant]?>
              :
              <input name="quantity" type="text" id="quantity" value="1" size="3"></td>
          </tr>
           
		  <? } ?>
          <tr>
            <? if ($auctionDetails['auctiontype']=="dutch") { } else {?>
            <td rowspan="2" class="c2"><img src="themes/<?=$setts['default_theme'];?>/img/system/Tools48.png" align="absmiddle" border="0" hspace="1" vspace="1"></td>
            <?    } ?>
            <td width="100%"  class="c3"><strong>
              <?=$auctionDetails['currency'];?>
              </strong>
              <input name="maxbid" type="text" id="maxbid" size="7">
              <? 
		if ($auctionDetails['auctiontype']=="standard") {
			if ($auctionDetails['maxbid']==0) $minimumBid = $auctionDetails['bidstart'];
			else $minimumBid = setMinBid($auctionDetails['maxbid'],$auctionDetails['bi'],$auctionDetails['bivalue'],$auctionDetails['auctiontype']);
		} else {
			$maximumBid = $auctionDetails['maxbid'];
			$getBids = mysql_query("SELECT * FROM probid_bids WHERE 
			bidamount='".$maximumBid."' AND auctionid='".$auctionDetails['id']."'");
			$quantity = 0;
			while ($bids = mysql_fetch_array($getBids)) {
				$quantity += $bids['quantity'];
			}
			if ($auctionDetails['maxbid']==0) $minimumBid=$auctionDetails['bidstart'];
			else if ($quantity<$auctionDetails['quantity']) $minimumBid=$auctionDetails['maxbid'];
			else $minimumBid=setMinBid($auctionDetails['maxbid'],$auctionDetails['bi'],$auctionDetails['bivalue'],$auctionDetails['auctiontype']);
		} ?>
              <input type="hidden" name="itemname" value="<?=$auctionDetails['itemname'];?>">
              <input type="hidden" name="auctionid" value="<?=$auctionDetails['id'];?>">
              <input type="hidden" name="action" value="bid_CONF">
              <input type="hidden" name="quant_avail" value="<?=$auctionDetails['quantity'];?>">
            </td>
          </tr>
          <tr class="c4">
            <td width="100%"><input name="placebidok" type="submit" id="placebidok" value="<?=$lang[placebid]?>"></td>
          </tr>
        </form>
      </table><? } else { ?><div align="left">Wir kˆnnen nur bevorzugten Mitglieder das Bieten auf Auktionen gestatten. Wie Sie ein bevorzugtes Mitglied werden erfahren Sie in unserer <a href="/help.php">Hilfe</a>.</div> <? } ?>
      <? 				} }}


		else if ($auctionDetails['ownerid']==$_SESSION['memberid']&&$auctionDetails['closed']==0&&!$binAuction) 
		echo "<table width=100% border=0 cellspacing=0 cellpadding=0><tr><td align='center' class='topitempage alertfont'>$lang[biderr_youpost]</td></tr></table>";
		else if ($auctionDetails['closed']!=0&&!$binAuction) echo "<br><table width=100% border=0 cellspacing=0 cellpadding=0><tr><td align='center' class='topitempage alertfont'>$lang[biderr_bidclosed]</td></tr></table>";
		else if ($daysleft<=0&&!$binAuction) echo "<br><table width=100% border=0 cellspacing=0 cellpadding=0><tr><td align='center' class='topitempage alertfont'>$lang[biderr_bidclosed]</td></tr></table>";
		else if ($binAuction) echo "<br><table width=100% border=0 cellspacing=0 cellpadding=0><tr><td align='center' class='topitempage alertfont'>$lang[buynowonlyauctionalalert]</td></tr></table>";

?>
    </td>
    <td width="50%"><!-- Start Table for item details -->
      <table width="100%" border="0" cellspacing="1" cellpadding="3">
        <tr class="c5">
          <td><img src="themes/<?=$setts['default_theme'];?>/img/pixel.gif" width="1" height="1"></td>
          <td><img src="themes/<?=$setts['default_theme'];?>/img/pixel.gif" width="1" height="1"></td>
        </tr>
        <? if (!$binAuction) { ?>
        <tr valign="top" class="c3">
          <td nowrap><b>
            <?=$lang[currbid]?>
            :</b></td>
          <td><b><? echo displayAmount($auctionDetails['maxbid'],$auctionDetails['currency']);?></b></td>
        </tr>
        <tr valign="top" class="c2">
          <td nowrap><b>
            <?=$lang[startbid]?>
            :</b></td>
          <td><b><font class="redfont"><? echo displayAmount($auctionDetails['bidstart'],$auctionDetails['currency']);?></font></b> [ <span class="contentfont"><a href="JavaScript:WinOpen1()">
            <?=$lang[convert];?>
            </a></span> ]</td>
        </tr>
        <? 
		if ($_SESSION['membersarea']=="Active") { 
		  	$currentBid = getSqlField("SELECT * FROM probid_bids WHERE 
		  	auctionid='".$_GET['id']."' AND bidderid='".$_SESSION['memberid']."' ORDER BY bidamount DESC","bidamount") or die(mysql_error());
		  	$isCurrentBid = getSqlNumber("SELECT * FROM probid_bids WHERE auctionid='".$_GET['id']."' AND bidderid='".$_SESSION['memberid']."'");
		  	if ($isCurrentBid>0) { ?>
        <tr valign="top" class="c3">
          <td><b>
            <?=$lang[yourbid]?>
            :</b></td>
          <td><font class='greenfont'><b><? echo displayAmount($currentBid,$auctionDetails['currency']);?></b></font></td>
        </tr>
        <? 	}
		} ?>
        <? } ?>
        <tr valign="top" class="c2">
          <td><b>
            <?=$lang[quant]?>
            :</b></td>
          <td><b>
            <?=$auctionDetails['quantity'];?>
            </b></td>
        </tr>
        <? if (!$binAuction) { ?>
        <tr valign="top" class="c3">
          <td nowrap><b>
            <?=$lang[num_bids]?>
            :</b></td>
          <td class="contentfont"><?=$auctionDetails['nrbids'];?>
            <? 
		  	if ($auctionDetails['nrbids']>0) { 
            	echo "<a href=\"bidhistory.php?id=".$auctionDetails['id']."&name=".$auctionDetails['itemname']."&quantity=".$auctionDetails['quantity']."\">".$lang[viewhistory]."</a>";
			} ?></td>
        </tr>
        <? } ?>
        <tr valign="top" class="c2">
          <td><b>
            <?=$lang[timeleft]?>
            :</b></td>
          <td><? 
			$daysLeft = daysleft($auctionDetails['enddate'],$setts['date_format']);
			$timeLeft = timeleft($auctionDetails['enddate'],$setts['date_format']);
			echo ($daysLeft>0) ? $timeLeft : $lang[bidclosed]; ?>
          </td>
        </tr>
        <tr valign="top" class="c3">
          <td><b>
            <?=$lang[location]?>
            :</b></td>
          <td><? echo $auctionDetails['zip'].", ".$sellerDetails['city'].", ".$sellerDetails['state'];?></td>
        </tr>
        <tr valign="top" class="c2">
          <td><b>
            <?=$lang[country]?>
            :</b></td>
          <td><?=$auctionDetails['country'];?></td>
        </tr>
        <tr valign="top" class="c3">
          <td><b>
            <?=$lang[started]?>
            :</b></td>
          <td><? echo displaydatetime($auctionDetails['startdate'],$setts['date_format']);?></td>
        </tr>
        <tr valign="top" class="c2">
          <td><b>
            <?=$lang[ends]?>
            :</b></td>
          <td><? echo displaydatetime($auctionDetails['enddate'],$setts['date_format']);?></td>
        </tr>
        <tr class="c2">
          <td><b>
            <?=$lang[status]?>
            :</b></td>
          <td><? echo ($auctionDetails['closed']==0)?"<font class='greenfont'><b>".$lang[open]."</b></font>":"<font class='redfont'><b>".$lang[closed]."</b></font>";?></td>
        </tr>
        <tr class="c3">
          <td colspan="2" class="contentfont"><table border="0" width="100%" cellpadding="0" cellspacing="0">
              <tr>
                <?
				## if there is a reserve price, the BIN will exist until maxbid<resprice
				## otherwise it will exist only until a bid is placed
				$showBN = showBuyNow($auctionDetails['rp'],$auctionDetails['rpvalue'],$auctionDetails['maxbid'],$auctionDetails['nrbids']);
				if ($showBN&&$auctionDetails['closed']==0) { 
					$bnValue=displayAmount($auctionDetails['bnvalue'],$auctionDetails['currency']);
					echo "<td align=\"center\">";
					if ($auctionDetails['ownerid']!=$_SESSION['memberid']&&$auctionDetails['closed']!=1) { 
					
					 if($_SESSION['jmwdactive']=="Y") { 
					
						echo (($auctionDetails['bn']=="Y"&&$auctionDetails['active']==1&&$layout['act_buynow']==1)?"<strong><a href=\"buynow.php?id=".$auctionDetails['id']."\"><img src=themes/".$setts['default_theme']."/img/system/buyitnow.gif border=0 alt=\"".$lang[buynow]."\"><br> ".$lang[bynow_for]." ".$bnValue."</a></strong> [ <span class=contentfont><a href=\"JavaScript:WinOpen2()\">$lang[convert]</a></span> ]":"");
					}
					else
					{
					echo "<div align=\"left\">Wir kˆnnen nur bevorzugten Mitglieder die Soforkauf-Funktion gestatten. Wie Sie ein bevorzugtes Mitglied werden erfahren Sie in unserer <a href=\"/help.php\">Hilfe</a>.</div>";
					}
					
					} else if ($auctionDetails['ownerid']==$_SESSION['memberid']&&$auctionDetails['closed']!=1) { 
						echo $lang[cantusebuyout];
					} else {
						echo "<strong>".(($auctionDetails['bn']=="Y"&&$auctionDetails['active']==1&&$layout['act_buynow']==1)?"<img src=themes/".$setts['default_theme']."/img/system/buyitnow.gif border=0 alt=\"".$lang[buynow]."\"><br> ".$lang[bynow_for]." ".$bnValue."":"")."</strong>";
					}
					echo "</td>";
				} 
				echo "<td width=\"10\"></td>"; ?>
              </tr>
            </table></td>
        </tr>
        <tr class="c2">
          <td colspan="2"><font class='bluefont'>
            <? 
			if ($auctionDetails['rp']=="Y") { 
				if ($auctionDetails['rpwinner']==0) echo ($auctionDetails['rpvalue']>$auctionDetails['maxbid']) ? $lang[reservenotmet] : $lang[reservemet]; 
				echo ($auctionDetails['closed']==1&&$auctionDetails['rpvalue']>$auctionDetails['maxbid']&&$_SESSION['memberid']==$auctionDetails['ownerid']&&$auctionDetails['nrbids']>0&&$auctionDetails['rpwinner']==0) ? "&nbsp; <span class=\"contentfont\">[ <a href=\"reserveoffers.php?id=".$auctionDetails['id']."\"><strong>$lang[makeresoffer]</strong></a> ]</span>" : "";
			} ?>
            </font> </td>
        </tr>
        <tr class="c3">
          <td colspan="2" class="contentfont"><? 
		  	if ($setts['swap_items']==1&&$auctionDetails['ownerid']!=$_SESSION['memberid']&&$auctionDetails['closed']!=1&&$auctionDetails['isswap']=="Y"&&$auctionDetails['deleted']!=1) {
				echo "<a href=\"swapitems.php?id=".$auctionDetails['id']."\">".$lang[offerswap]."</a>";
			} ?>
          </td>
        </tr>
        <? if (!$binAuction||$auctionDetails['closed']==1) { ?>
        <tr class="c2">
          <td><b>
            <? echo ($auctionDetails['closed']==1) ? $lang[winnerss] : $lang[highbid]; ?>
            :</b></td>
          <td class="contentfont"><b>
            <? 
			if ($auctionDetails['closed'] == 1) { 
				$getAuctionWinner = mysql_query("SELECT buyerid, bnpurchase, amount FROM probid_winners WHERE auctionid='".$auctionDetails['id']."'") or die(mysql_error());
				//echo "SELECT buyerid, bnpurchase, amount FROM probid_winners WHERE auctionid='".$auctionDetails['id']."'";
				$nbWinners = mysql_num_rows($getAuctionWinner);
				while ($auctionWinner = mysql_fetch_array($getAuctionWinner)) {
					$bidderName = getSqlField("SELECT username FROM probid_users WHERE id='".$auctionWinner['buyerid']."'","username");
					echo "<font class='greenfont'>".displayAmount($auctionWinner['amount'],$auctionDetails['currency'])."</font> - ".$bidderName." <a href=\"viewfeedback.php?owner=".$auctionWinner['buyerid']."&auction=".$auctionDetails['id']."\">".getFeedback($auctionWinner['buyerid'])."</a>";
					if ($auctionWinner['bnpurchase']==1) echo "</b> [ ".$lang[purchasedwithbn]." ] <b>";
					if ($nbWinners>0) echo "<br>";
					$foundWinner = TRUE;
				}
				if (!$foundWinner) echo $lang[na];
			} else { 
				echo ($auctionDetails['rpvalue']<=$auctionDetails['maxbid'])?"<font class='greenfont'><b>":"";
				echo displayAmount($auctionDetails['maxbid'],$auctionDetails['currency']);
				echo ($auctionDetails['rpvalue']<=$auctionDetails['maxbid'])?"</b></font><br>":"";
					  
				if ($auctionDetails['maxbid']>0) {
					echo " - ";
					if ($auctionDetails['private']!="Y") {
					
					
						$getBidderId=mysql_query("SELECT * FROM probid_bids WHERE auctionid='".$auctionDetails['id']."' AND 'out'=0 AND invalid=0 ORDER BY id DESC");
						$nbBidders = mysql_num_rows($getBidderId);
						## display only one high bidder, and a (more...) link to a popup if there are more high bidders
						$highBidder=mysql_fetch_array($getBidderId);
							
						$bidderName = getSqlField("SELECT username FROM probid_users WHERE id='".$highBidder['bidderid']."'","username");
						echo $bidderName." <a href=\"viewfeedback.php?owner=".$highBidder['bidderid']."&auction=".$auctionDetails['id']."\">".getFeedback($highBidder['bidderid'])."</a>";
							
						if ($nbBidders>1) echo " [ <a href=\"javascript:popUpSmall('popup_allbidders.php?id=$_GET[id]');\">".$lang[more_bidders]."</a> ]";
					} else { 
						echo $lang[bidderhidden]; 
					}
				} 
			} ?></b></td>
        </tr>
        <? } ?>
        <tr class="c5">
          <td colspan="2"><img src="themes/<?=$setts['default_theme'];?>/img/pixel.gif" width="1" height="1"></td>
        </tr>
        <tr>
          <td colspan="2"><strong>
            <?=$lang[item_is_watched_by];?>
            <?=getSqlNumber("SELECT DISTINCT userid FROM probid_auction_watch WHERE auctionid='".$_GET['id']."'"); ?>
            <?=$lang[people];?>
            </strong></td>
        </tr>
      </table></td>
    <td width="30%"><table width="100%" border="0" cellspacing="1" cellpadding="3" class="contentfont">
        <tr>
          <td class="bg-28"><?=$lang[sellerinfo]?></td>
        </tr>
        <tr class="c5">
          <td><img src="themes/<?=$setts['default_theme'];?>/img/pixel.gif" width="1" height="1"></td>
        </tr>
        <tr>
          <td class="c3"><? echo $sellerDetails['username'];?> <a href="viewfeedback.php?owner=<?=$sellerDetails['id'];?>&auction=<?=$auctionDetails['id'];?>"> <? echo getFeedback($sellerDetails['id']);?> </a> </td>
        </tr>
        <tr class="c2">
          <td><b>&raquo;</b>
            <? if ($sellerDetails['regdate']!=0) echo $lang[regsince]." ".date(substr($setts['date_format'],0,7),$sellerDetails['regdate'])." ".$lang[inthe]." ".$sellerDetails['country']; ?>
          </td>
        </tr>
        <tr class="c3">
          <td><b>&raquo;</b> <a href="otheritems.php?owner=<?=$auctionDetails['ownerid'];?>&nick=<?=$sellerDetails['username'];?>">
            <?=$lang[seeallauctsseller]?>
            </a></td>
        </tr>
        <?
		$shopDets = getSqlRow("SELECT aboutpage_type, store_active FROM probid_users WHERE id='".$sellerDetails['id']."'");
		if ($shopDets['aboutpage_type']==2&&$shopDets['store_active']==1) { ?>
        <tr class="c2">
          <td><b>&raquo;</b> <a href="shop.php?userid=<?=$auctionDetails['ownerid'];?>">
            <?=$lang[seeshop]?>
            </a></td>
        </tr>
        <? } ?>
        <tr class="c2">
          <td align="center"><table width="100%" cellpadding="2" cellspacing="1" border="0" class="c4" >
              <tr class="c3">
                <td nowrap>&nbsp;<b>
                  <?=$lang[feedback_rating];?>
                  </b>:</td>
                <td width="100%"><? echo calcFeedback($sellerDetails['id']);?></td>
              </tr>
              <tr class="c2 positive">
                <td nowrap><img src="images/5stars.gif"></td>
                <td><? echo getSqlNumber("SELECT userid FROM probid_feedbacks WHERE userid='".$auctionDetails['ownerid']."' AND submitted=1 AND rate=5"); ?></td>
              </tr>
              <tr class="c3 positive">
                <td nowrap><img src="images/4stars.gif"></td>
                <td><? echo getSqlNumber("SELECT userid FROM probid_feedbacks WHERE userid='".$auctionDetails['ownerid']."' AND submitted=1 AND rate=4"); ?></td>
              </tr>
              <tr class="c2 neutral">
                <td nowrap><img src="images/3stars.gif"></td>
                <td><? echo getSqlNumber("SELECT userid FROM probid_feedbacks WHERE userid='".$auctionDetails['ownerid']."' AND submitted=1 AND rate=3"); ?></td>
              </tr>
              <tr class="c3 negative">
                <td nowrap><img src="images/2stars.gif"></td>
                <td><? echo getSqlNumber("SELECT userid FROM probid_feedbacks WHERE userid='".$auctionDetails['ownerid']."' AND submitted=1 AND rate=2"); ?></td>
              </tr>
              <tr class="c2 negative">
                <td nowrap><img src="images/1stars.gif"></td>
                <td><? echo getSqlNumber("SELECT userid FROM probid_feedbacks WHERE userid='".$auctionDetails['ownerid']."' AND submitted=1 AND rate=1"); ?></td>
              </tr>
              <tr class="c3">
                <td colspan="2" align="center"><a href="viewfeedback.php?owner=<?=$sellerDetails['id'];?>&auction=<?=$auctionDetails['id'];?>">
                  <?=$lang[view_fb];?>
                  </a></td>
              </tr>
            </table></td>
        </tr>
      </table></td>
  </tr>
</table>
<br>
<!-- Descriptions -->
<? header1(strtoupper($lang[descr]));?>
<!-- End Header Descriptions -->
<table width="100%" border="0" cellspacing="0" cellpadding="5">
  <tr> <a name="descr"></a>
    <td class="contentfont"><?	echo addSpecialChars($auctionDetails['description']); ?>
    </td>
  </tr>
  <tr>
    <td><? $getPics=mysql_query("SELECT * FROM probid_auction_images WHERE auctionid='".$auctionDetails['id']."'"); 
$nbPics=mysql_num_rows($getPics); 
 if ($auctionDetails['picpath']!="") { ?>
      <table width="100%" cellpadding="6" cellspacing="1" border="0">
        <tr align="center">
          <td valign="top" class="picselect"><table cellpadding="3" cellspacing="1" border="0">
              <tr align="center">
                <td><b>
                  <?=$lang[selectapicture];?>
                  </b></td>
              </tr>
              <tr align="center">
                <td><a href="javascript:doPic('makethumb.php?pic=<?=$auctionDetails['picpath'];?>&w=500&sq=Y');"> <img src="makethumb.php?pic=<?=$auctionDetails['picpath'];?>&w=60&sq=Y" border="1" id="slide"></a> </td>
              </tr>
              <?
if ($nbPics>0) { 
while ($addlPicture=mysql_fetch_array($getPics)) { ?>
              <tr>
                <td><a href="javascript:doPic('makethumb.php?pic=<?=$addlPicture['name'];?>&w=500&sq=Y');"> <img src="makethumb.php?pic=<?=$addlPicture['name'];?>&w=60&sq=Y" border="1" id="select"></a> </td>
              </tr>
              <? }} ?>
            </table></td>
          <td width="100%" class="picselectmain" align="center"><img id="mainpic" src="makethumb.php?pic=<?=$auctionDetails['picpath'];?>&w=500&sq=Y" border="1" alt="<?=$auctionDetails['itemname'];?>"></td>
        </tr>
      </table>
      <? } ?>
    </td>
  </tr>
  <tr>
    <td align="center"><table cellpadding="3" cellspacing="1" border="0" class="counter">
        <tr>
          <td nowrap><?=$lang[itemviewed]?>
            <strong>
            <?=$auctionDetails['clicks'];?>
            </strong>
            <?=$lang[times]?>
          </td>
        </tr>
      </table></td>
  </tr>
</table>
<div class="boxend"></div>
<? if ($setts['enable_asq']=="Y") { ?>
<!-- Header Ask Seller a Question Section (Public and Private questions) -->
<? header1(strtoupper($lang[askseller]));?>
<? $getPublicMsg = mysql_query("SELECT * FROM probid_public_msg WHERE auctionid='".$_GET['id']."' AND msgtype='Q'") or die(mysql_error());
$isPublicMsg = mysql_num_rows($getPublicMsg); 
if ($isPublicMsg>0) { ?>
<table width="100%" border="0" cellspacing="2" cellpadding="2">
  <? while ($publicMsg = mysql_fetch_array($getPublicMsg)) { ?>
  <tr class="c3">
    <td width="11" align="center"><img src="themes/<?=$setts['default_theme'];?>/img/system/Faq48.png"></td>
    <td width="60"><strong>
      <?=$lang[question];?>
      </strong></td>
    <td><?=$publicMsg['content'];?></td>
  </tr>
  <? 
	$answer = getSqlField("SELECT content FROM probid_public_msg WHERE answerid='".$publicMsg['id']."'","content");
  	if ($_SESSION['memberid']!=$auctionDetails['ownerid']) {
	  	if ($answer!=""&&$answer!="n/a") { ?>
  <tr class="c2">
    <td width="11" align="center"><img src="themes/<?=$setts['default_theme'];?>/img/system/a.gif"></td>
    <td width="60"><strong>
      <?=$lang[answer];?>
      </strong></td>
    <td><?=$answer;?></td>
  </tr>
  <? 
  		}
	} else { ?>
  <form action="auctiondetails.php" method="get">
    <input type="hidden" name="id" value="<?=$_GET['id'];?>">
    <input type="hidden" name="answerid" value="<?=$publicMsg['id'];?>">
    <tr class="c2">
      <td width="11" align="center"></td>
      <td><strong>
        <?=$lang[answer];?>
        </strong></td>
      <td><textarea name="content" cols="60" rows="2" class="contentfont"><?=$answer;?>
</textarea>
        &nbsp;
        <input type="submit" value="<?=$lang[answer];?>" name="postanswerok"></td>
    </tr>
  </form>
  <? } ?>
  <tr>
    <td align="center" colspan="3" class="c4"><img src="themes/<?=$setts['default_theme'];?>/img/pixel.gif" width="1" height="1"></td>
  </tr>
  <? } ?>
</table>
<? } ?>
<table width="100%" border="0" cellspacing="0" cellpadding="5">
  <? if ($_SESSION['membersarea']=="Active"&&$_SESSION['accsusp']!=2) { ?>
  <? if ($_SESSION['memberid']==$auctionDetails['ownerid']) { ?>
  <tr class="c2">
    <td align="center"><?=$lang[plsanswerqs];?></td>
  </tr>
  <? } else if ($auctionDetails['closed']==1) { ?>
  <tr class="c2">
    <td align="center"><?=$lang[errorauctclosednoq];?></td>
  </tr>
  <? } else { ?>
  <form action="auctiondetails.php" method="get">
    <input type="hidden" name="id" value="<?=$_GET['id'];?>">
    <tr>
      <td><table width="100%" border="0" cellpadding="2" cellspacing="2" align="center" class="border">
          <tr class="contentfont" valign="top">
            <td class="c2" style="vertical-align: middle" width="10"><img src="themes/<?=$setts['default_theme'];?>/img/system/Faq48.png"></td>
            <td class="c2" align="right" width="20%"><strong>
              <?=$lang[askseller];?>
              </strong></td>
            <td class="c3"><textarea name="message" cols="40" rows="3" class="contentfont"></textarea></td>
            <td class="c3" width="80%"><div style="padding: 2px;">
                <select name="question_type">
                  <? $publicQ = getSqlField("SELECT default_public_questions FROM probid_users WHERE id='".$auctionDetails['ownerid']."'","default_public_questions");
			if ($publicQ == "Y"&&$setts['enable_asq']=="Y") { ?>
                  <option value="public" selected>
                  <?=$lang[postqpublic];?>
                  </option>
                  <? } ?>
                  <option value="private">
                  <?=$lang[postqprivate];?>
                  </option>
                </select>
              </div>
              <div style="padding: 2px;">
                <input name="postquestionok" type="submit" id="postquestionok" value="<?=$lang[submit]?>">
              </div></td>
          </tr>
        </table></td>
    </tr>
  </form>
  <? } ?>
  <? } else { ?>
  <tr class="c2">
    <td align="center" class="contentfont">[ <a href="login.php?auctionid=<?=$_GET['id'];?>">
      <?=$lang[logintopostqs];?>
      </a> ]</td>
  </tr>
  <? } ?>
</table>
<div class="boxend"></div>
<? }

$mainCat_primary = getMainCat($auctionDetails['category']);
$mainCat_secondary = getMainCat($auctionDetails['addlcategory']);

$getFields = mysql_query("SELECT DISTINCT f.boxid, f.boxname, f.boxtype, d.boxvalue FROM 
probid_fields_data d, probid_fields f WHERE d.auctionid='".$_GET['id']."' AND f.active='1' AND d.boxid = f.boxid AND 
(f.categoryid='".$mainCat_primary."' OR f.categoryid='".$mainCat_secondary."' OR f.categoryid='0') ORDER BY f.fieldorder ASC") or die(mysql_error()); 
$isFields = mysql_num_rows($getFields);
if ($isFields) { ?>
<!-- Header Additional Custom Fields -->
<? header1(strtoupper($lang[addfields]));?>
<!-- End Header Additional Custom Fields -->
<table width="90%" border="0" cellspacing="1" cellpadding="4" align="center">
  <? while ($fields=mysql_fetch_array($getFields)) { $toDisp = ""; ?>
  <tr class="<? echo (($count++)%2==0)?"c3":"c2"; ?>">
    <td align="right" width="50%"><strong>
      <?=$fields['boxname'];?>
      </strong></td>
    <td><?
	if ($fields['boxtype']=="checkbox") {
		$chkValues = explode(";",$fields['boxvalue']);
		for ($i=0; $i<count($chkValues); $i++) { 
			$chkRes = getSqlField("SELECT boxcaption FROM probid_fields WHERE boxid='".$fields['boxid']."' AND boxvalue='".trim($chkValues[$i])."'","boxcaption");
			$toDisp .= ((trim($chkRes)!="n/a") ? $chkRes : "")."&nbsp; &nbsp; ";
		}	
	} else if ($fields['boxtype']=="radio") {
		$toDisp = getSqlField("SELECT boxcaption FROM probid_fields WHERE boxid='".$fields['boxid']."' AND boxvalue='".$fields['boxvalue']."'","boxcaption")." ";
	} else if ($fields['boxtype']=="list") {
		$toDisp = getSqlField("SELECT boxcaption FROM probid_fields WHERE boxid='".$fields['boxid']."' AND boxvalue='".$fields['boxvalue']."'","boxcaption")." ";
	} else {
		$toDisp = $fields['boxvalue'];
	}
	echo $toDisp;
	?>
    </td>
  </tr>
  <? } ?>
</table>
<div class="boxend"></div>
<? } ?>
<!-- Header Payment -->
<? header1(strtoupper($lang[payment]));?>
<!-- End Header Payment -->
<table width="100%" border="0" cellspacing="0" cellpadding="10">
  <? if ($auctionDetails['acceptdirectpayment']) { ?>
  <tr valign="top">
    <td class="c2" align="center"><strong>
      <?=$lang[sellerpreferspaypal];?>
      </strong><br>
      <br>
      <img src="http://images.paypal.com/images/x-click-but02.gif" align="absmiddle"> <img src="themes/<?=$setts['default_theme'];?>/img/system/cards.gif" width="280" height="30" align="absmiddle"></td>
  </tr>
  <? } ?>
  <tr valign="top">
    <td><?
		$paymentMethods=explode("<br>",$auctionDetails['pm']);
		$nbPaymentMethods=count($paymentMethods);
		?>
      <table border="0" cellspacing="4" cellpadding="4" align="center">
        <? 
	  	for ($i=0;$i<$nbPaymentMethods;$i+=4) { 
			$j=$i+1;
			$k=$i+2;
			$l=$i+3; ?>
        <tr valign="top" align="center" style="font: bold;">
          <td><? 
		  	$paymentLogo=getSqlField("SELECT * FROM probid_payment_methods WHERE name='".$paymentMethods[$i]."'","logourl"); 
            echo $paymentMethods[$i].(($paymentLogo!=""&&$paymentLogo!="n/a")?"<br><img src=\"".$paymentLogo."\" border=0>":"");?></td>
          <td><? 
		  	$paymentLogo=getSqlField("SELECT * FROM probid_payment_methods WHERE name='".$paymentMethods[$j]."'","logourl");
			echo $paymentMethods[$j].(($paymentLogo!=""&&$paymentLogo!="n/a")?"<br><img src=\"".$paymentLogo."\" border=0>":"");?></td>
          <td><? 
		  	$paymentLogo=getSqlField("SELECT * FROM probid_payment_methods WHERE name='".$paymentMethods[$k]."'","logourl");
            echo $paymentMethods[$k].(($paymentLogo!=""&&$paymentLogo!="n/a")?"<br><img src=\"".$paymentLogo."\" border=0>":"");?></td>
          <td><? 
		  	$paymentLogo=getSqlField("SELECT * FROM probid_payment_methods WHERE name='".$paymentMethods[$l]."'","logourl");
            echo $paymentMethods[$l].(($paymentLogo!=""&&$paymentLogo!="n/a")?"<br><img src=\"".$paymentLogo."\" border=0>":"");?></td>
        </tr>
        <? } ?>
      </table></td>
  </tr>
</table>
<div class="boxend"></div>
<a name="payment"></a>
<!-- Header SHIPPING -->
<? header1(strtoupper($lang[shipping]));?>
<!-- End Header SHIPPING -->
<table width="100%" border="0" cellspacing="1" cellpadding="10">
  <tr valign="top">
    <td><?
	if ($auctionDetails['sc']=="BP") echo "<li>".$lang[buyerpaysshipment]."</li>";
	else echo "<li>".$lang[sellerpaysshipment]."</li>";
  	if ($auctionDetails['scint']=="Y") echo "<li>".$lang[sellershipinternat]."</li>"; 
	else echo "<li>".$lang[seller_not_shipinternat]."</li>";?>
    </td>
  </tr>
  <? if ($setts['shipping_costs']==1) { ?>
  <tr valign="top">
    <td class="contentfont"><strong>
      <?=$lang[postagecosts]?>
      :</strong>
      <?=$auctionDetails['currency'];?>
      <?=$auctionDetails['postage_costs'];?>
      <br>
      <strong>
      <?=$lang[insurance]?>
      :</strong>
      <?=$auctionDetails['insurance'];?>
      <br>
      <strong>
      <?=$lang[servicetype]?>
      :</strong>
      <?=$auctionDetails['type_service'];?>
      <? if ($auctionDetails['shipping_details']!="") 
	  	echo "<br><br><strong>$lang[sp_details]</strong><br>".$auctionDetails['shipping_details'];
	  ?></td>
  </tr>
  <? } ?>
</table>
<? 
$getOtherItems = mysql_query("SELECT * FROM probid_auctions WHERE id!='".$auctionDetails['id']."' AND 
active=1 AND closed=0 AND deleted!=1 AND listin!='store' AND ownerid='".$auctionDetails['ownerid']."' ORDER BY rand()"); 
$nbOtherItems = mysql_num_rows($getOtherItems);


if ($setts['nb_other_items_adp']>0&&$nbOtherItems>0) { 
	$numb = 0;
	$name = array();
	$id = array();
	$pic = array();
	$currency = array();
	$maxbid = array();
	$enddate = array();
	$bidstart = array();
	while ($otherItems = mysql_fetch_array($getOtherItems)) {
		$id[$numb] = $otherItems['id'];
		$name[$numb] = $otherItems['itemname'];
		$pic[$numb] = $otherItems['picpath'];
		$maxbid[$numb] = $otherItems['maxbid'];
		$enddate[$numb] = $otherItems['enddate'];
		$bidstart[$numb] = $otherItems['bidstart'];
		$currency[$numb] = $otherItems['currency'];
		$numb++;
	} ?>
<br>
<table width=100% border=0 cellspacing=0 cellpadding=0>
  <tr>
    <td align='center' class='topitempage alertfont'><?=$lang[seller_assumes_resp1];?>
      <strong>
      <?=getSqlField("SELECT username FROM probid_users WHERE id='".$auctionDetails['ownerid']."'","username");?>
      </strong>,
      <?=$lang[seller_assumes_resp2];?>
    </td>
  </tr>
</table>
<div class="boxend"></div>
<!-- Header Other Items -->
<? header1(strtoupper($lang[otheritems]));?>
<table width="100%" border="0" cellspacing="1" cellpadding="10">
  <tr valign="top">
    <td class="contentfont"><table width="100%" border="0" cellpadding="0" cellspacing="0">
        <tr>
          <? 
	 $fct = 0;
	 for ($k=0;$k<$setts['nb_other_items_adp'];$k++) { 
			$w=100/$setts['nb_other_items_adp'];
			$width=$w."%"; ?>
          <td width="<?=$width;?>" align="center" valign="top"><? if ($name[$fct]!="") { ?>
            <table width="100%" border="0" cellspacing="5" cellpadding="3">
              <tr>
                <td height="110" align="center" class="gradient"><a href="<?=$site_url;?>auctiondetails.php?id=<?=$id[$fct];?>"><img src="<? echo (($pic[$fct]!="")?"makethumb.php?pic=".$pic[$fct]."&w=".$layout['w_feat_hp']."&sq=Y":"images/noimg.gif");?>" border="0"></a> </td>
              </tr>
              <tr class="c1">
                <td class="sell"><img src="themes/default/img/arrow1.gif" width="9" height="9" vspace="0" hspace="4" align="absmiddle"><a href="<?=$site_url;?>auctiondetails.php?id=<?=$id[$fct];?>"> <? echo titleResize($name[$fct]);?> </a></td>
              </tr>
              <tr class="c2">
                <td valign="top" class="smallfont"><strong>
                  <?=$lang[startbid];?>
                  :</strong> <? echo displayAmount($bidstart[$fct],$currency[$fct]);?><br>
                  <strong>
                  <?=$lang[currbid]?>
                  :</strong> <? echo displayAmount($maxbid[$fct],$currency[$fct]);?><br>
                  <strong>
                  <?=$lang[ends]?>
                  :</strong> <? echo displaydatetime($enddate[$fct],$setts['date_format']); $fct++; ?> </td>
              </tr>
            </table>
            <? } ?></td>
          <? } ?>
        </tr>
      </table></td>
  </tr>
</table>
<? } ?>
<? if ($auctionDetails['closed']==0&&$auctionDetails['ownerid']!=$_SESSION['memberid']&&$daysLeft>0&&!$binAuction) { ?>
<!-- Header BID ON THIS ITEM -->
<div class="boxend"></div>
<a name="bid"></a>
<? header1(strtoupper($lang[bidthisitem]));?>
<!-- End Header BID ON THIS ITEM -->
<!-- Body BID ON THIS ITEM -->
<? if ($_SESSION['membersarea']!="Active") { ?>
<p align="center"><b><font class='redfont'>
  <?=$lang[bid_errreg]?>
  </font></b></p>
<? header1($lang[memberlogin]); ?>
<form action="login.php" method="post">
  <input type="hidden" name="auctionid" value="<?=$auctionDetails['id'];?>">
  <table width="400" border="0" cellpadding="4" cellspacing="4" align="center" class="border">
    <tr class="c3">
      <td width="50%" align="right"><?=$lang[username]?></td>
      <td width="50%"><input name="username" type="text" id="state4" class="contentfont"></td>
    </tr>
    <tr class="c2">
      <td width="50%" align="right"><?=$lang[pass]?></td>
      <td width="50%"><input name="password" type="password" id="state5" class="contentfont"></td>
    </tr>
    <tr>
      <td colspan="2" align="center" class="c4"><input name="loginok" type="submit" id="loginok" value="<?=$lang[memberlogin]?>"></td>
    </tr>
    <tr class="c2">
      <td colspan="2" align="center" class="contentfont"><a href="register.php">
        <?=$lang[signupnow]?>
        </a></td>
    </tr>
  </table>
</form>
<? } else { 
	if (!$binAuction) { ?>
<table width="100%" border="0" cellspacing="1" cellpadding="3">
  <form action="bid.php" method="post">
    <tr class="c4">
      <td colspan="2"><b>
        <?=$auctionDetails['itemname'];?>
        </b></td>
    </tr>
    <tr class="c5">
      <td colspan="2"><img src="themes/<?=$setts['default_theme'];?>/img/pixel.gif" width="1" height="1"></td>
    </tr>
    <tr class="c3">
      <td><?=$lang[currbid]?>
        :</td>
      <td width="100%"><font class='redfont'><b><? echo displayAmount($auctionDetails['maxbid'],$auctionDetails['currency']);?></b></font></td>
    </tr>
    <? if ($auctionDetails['auctiontype']=="dutch") { ?>
    <tr class="c2">
      <td><?=$lang[quant]?>
        :</td>
      <td><input name="quantity" type="text" id="quantity" value="1" size="8"></td>
    </tr>
    <? } ?>
   <? if($_SESSION['jmwdactive']=="Y") { ?> <tr class="c2">
      <td nowrap><?=$lang[yourmaxbid]?>
        :</td>
      <td width="100%"><strong>
        <?=$auctionDetails['currency'];?>
         </strong>
       
	    <input name="maxbid" type="text" id="maxbid" size="15">
        &nbsp;&nbsp;
        <?=$lang[minbid]?>
        :
        <? 
		if ($auctionDetails['auctiontype']=="standard") {
			if ($auctionDetails['maxbid']==0) $minimumBid = $auctionDetails['bidstart'];
			else $minimumBid = setMinBid($auctionDetails['maxbid'],$auctionDetails['bi'],$auctionDetails['bivalue'],$auctionDetails['auctiontype']);
			echo displayAmount($minimumBid,$auctionDetails['currency']);
		} else {
			$maximumBid = $auctionDetails['maxbid'];
			$getBids = mysql_query("SELECT * FROM probid_bids WHERE 
			bidamount='".$maximumBid."' AND auctionid='".$auctionDetails['id']."'");
			$quantity = 0;
			while ($bids = mysql_fetch_array($getBids)) {
				$quantity += $bids['quantity'];
			}
			if ($auctionDetails['maxbid']==0) $minimumBid=$auctionDetails['bidstart'];
			else if ($quantity<$auctionDetails['quantity']) $minimumBid=$auctionDetails['maxbid'];
			else $minimumBid=setMinBid($auctionDetails['maxbid'],$auctionDetails['bi'],$auctionDetails['bivalue'],$auctionDetails['auctiontype']);
  			echo displayAmount($minimumBid,$auctionDetails['currency']);
		} ?>
        <input type="hidden" name="itemname" value="<?=$auctionDetails['itemname'];?>">
        <input type="hidden" name="auctionid" value="<?=$auctionDetails['id'];?>">
        <input type="hidden" name="action" value="bid_CONF">
        <input type="hidden" name="quant_avail" value="<?=$auctionDetails['quantity'];?>">
      </td>
    </tr>
    <tr class="c3">
      <td>&nbsp;</td>
      <td width="100%"><input name="placebidok" type="submit" id="placebidok" value="<?=$lang[placebid]?>"></td>
    </tr>
	<? } ?>
  </form>
</table>
<? 				}  
			} 
		} 
		else if ($auctionDetails['ownerid']==$_SESSION['memberid']&&$auctionDetails['closed']==0&&!$binAuction) echo $lang[biderr_youpost];
		else if ($auctionDetails['closed']!=0&&!$binAuction) echo $lang[biderr_bidclosed];
		else if ($daysleft<=0&&!$binAuction) echo $lang[biderr_bidclosed];
		else if ($binAuction) echo $lang[buynowonlyauctionalalert];
	}?>
<? } else { 
	header5($lang[auctdetserror]);
	echo "<p align=center><strong>$lang[aucterrormsg]</strong></p>";
	$auctionSusp = getSqlNumber("SELECT id FROM probid_auctions WHERE id='".$_GET['id']."' AND active='0'");
	if ($auctionSusp)
		echo "<p align=center><strong>$lang[aucterrorsellermsg]</strong></p>";
}
include ("themes/".$setts['default_theme']."/footer.php"); 
}?>

Open in new window

0
 
LVL 108

Expert Comment

by:Ray Paseur
Comment Utility
You have my sympathy.

There are thousands of lines of very poorly written PHP code in the snippet associated with this question, and line 2 of the most recent snippet seems to indicate that the programming is almost six years old.  A lot has changed in PHP since 2005, much of it related to security.  

Respecting the fact that your time is worth money, your best approach may be to hire a professional developer to help you get out of this mess.  But if you do not want to do that, please isolate the problem, create some test data and show us the smaller isolated test case and your test data so that we can get this issue winnowed down to a question with an answer.   Thanks, ~Ray
0
 
LVL 11

Author Comment

by:mcnute
Comment Utility
I don't want to bother you to much, but I'm not very good at debugging and narrowing down PHP Programming language problems. How would I do that more precislely. I tried to enable the Error Reporting to a maximum of sensibility and got a bunch of notices unrelated to the problem.

I really would like to learn how to debug PHP better, due I have to deal with it almost every day.
I'll try to isolate the makethumb.php file later on and post the results here as soon as possible.
0
 
LVL 108

Accepted Solution

by:
Ray Paseur earned 500 total points
Comment Utility
If you elevate error reporting to error_reporting(E_ALL); at the start of program development, you will find that the Notices will help you catch typographical errors, accidental reliance on undefined variables, assumed constants, and other potentially dangerous things like that.  But if you have written programming that relies on some of PHP's "loose" programming style it will be time-consuming (though not at all hard) to correct all the places that cause Notice messages.  

When I first started using PHP, I used to let PHP run with Notice messages set off, just relying on undefined variables to evaluate the same as FALSE.  I thought "How cool - I don't have to declare my variables any more, so I will save a lot of time!"  Now I know better, and I am back to the old programming habits of good form and good style.  I am afraid that the authors of PHP tried to make PHP "too easy" by allowing programmers to omit all sorts of things that were standard parts of the basic computer science curriculum.  The result was a language that is plagued by security holes and ambiguous data definitions.  So while it is easy to use and very popular, there is risk lurking around every corner if you do not follow those computer science guidelines.  Many languages will force you to follow the guidelines.  PHP, for better or worse, does not impose that much structure.
0
 
LVL 11

Author Closing Comment

by:mcnute
Comment Utility
He deserved the points only for his disposition to help. I will have to find the problem on myself in the end.
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Use these top 10 tips to master the art of email signature design. Create an email signature design that will easily wow recipients, promote your brand and highlight your professionalism.
These days socially coordinated efforts have turned into a critical requirement for enterprises.
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now