Kryptronic Software Support Forum

You are viewing this forum as a guest. Login to an existing account, or create a new account, to reply to topics and to create new topics.

#1 03-17-2006 01:18:00

Jess
Member
Registered: 08-09-2004
Posts: 54

Need Help With Mod Script

Hi,

My website has a mod (still getting bugs worked out) that allows affiliates to design their own pages to display on my site. If you go to you will see an example (please ignore the debugging code at the top).

I had an idea that it would be great to make these pages printer friendly so that the affiliates could print them out to give to their customers. I did figure most of the details in making that work, but I need to have their product choices (up to 12) show up all on one page. I think I could do that if the products were in two columns instead of one, but I can't seem to modify the code for this page to get it to work (I am REALLY not a programmer). I feel like this is probably simple and I was hoping that someone would be kind enough to point me in the right direction.

Here is the current code for the page:

Code:


#
# usage: (CGIGET TYPE="SUB" VALUE="ste_expertPageProducts")
#
sub ste_expertPageProducts {

##  WHERE affacct_id ='$fd_affiliate'

     ($table_width, $border_color, $border_width) = @_;

     $sql_statement = "

     SELECT *
     FROM affacct
     WHERE affacct_id LIKE '$common_expert_id' 

     ";

     my @disp1 = database_call('affacct','SELECT',$sql_statement);
     @products;
     ## get selected products for affiliate from database
     foreach $value (@disp1) {
  for ($i = 32; $i < 44; $i++)
  {
       push(@products, @$value[$i]);
  } ## End for.
     } ## End foreach.
     foreach $line(@products)
     {
  if(length($line) > 3)
  {
       # split database var into category & product description
       ($c_id, $p_id, $p_xcat, $p_name) = split(/\^/, $line);
       # build product link suffix
       $prod_link =  $common_url . '&pg=prod&ref=' . $p_id . '&cat=' . $c_id . '&catstr=HOME:' . $c_id;
       # lets display the product
       display_product($p_id, $dbh, $prod_link);
  } ## End if.
     } ## End foreach.
} ## End ste_expertPageProducts.

sub display_product {
     ($prod_id, $dbh, $prodlink) = @_;
     $sql_statement = "

     SELECT product_name, product_pricestatus, product_regprice, product_saleprice, product_imgsm, product_descshort
     FROM product 
     WHERE product_id = '$prod_id' 

     ";
     my @disp1 = database_call('product','SELECT',$sql_statement);
     foreach $value (@disp1) {
  ($name, $status, $price, $saleprice, $imgurl, $desc) = @$value;
     } ## End foreach.
     $image_path = 'http://www.petexpertise.com/product_images/' . $imgurl . '.jpg';
     $desc_col_width = $table_width - $store_small_image_width;
print "<div style='border: " . $border_width . "px " . $border_color . " solid; width:" . $table_width . "px'>";
print "<table width='" . $table_width . "' cellpadding='8' bgcolor='#fff7ef'>\n<tr>\n";
print "<td width='" . $desc_col_width . "' valign='top'>";
print <<HTML;
     <a href='$prodlink'>
     <font size='$html_base_font_size' face='$html_base_font_face'><b>
     $name
     </b></font>
     </a><p />
     <font size='$html_small_font_size' face='$html_small_font_face' color='$html_small_font_color'>
     $desc
     </font> <br />
     <font size='$html_small_font_size' face='$html_base_font_face'>
HTML
     if($price eq '0' || $price eq '0.00')
     {
     } else {
  print 'Price: $' . $price;
     }
     if($status eq 'S')
     {
  print '<br /><b>On Sale: $' . $saleprice . '</b>';
     }

print <<HTML;
     </font>
    </td>
    <td width='*'>
     <a href='$prodlink'>
<!--
     <img border='0' src='$image_path' width='$store_small_image_width' height='$store_small_image_width' align='center' alt='No image'>
-->
<img border='0' src='$image_path' align='center' alt='No image'>

     </a>
    </td>
  </tr>
</table>
</div>
<br />
HTML
} ## End display product.

1;

Thanks in advance for any suggestions.

Jess

Offline

 

Board footer