Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [HTML][PHP]Problem w ustawieniu stylu css dla $data[$row][]
sylwekb
post
Post #1





Grupa: Zarejestrowani
Postów: 124
Pomógł: 0
Dołączył: 12.01.2006

Ostrzeżenie: (0%)
-----


Witam, mam problem z poprawnym dodaniem stylu css dla $data[$row][] chciałem ustawić bacground czyli białe tło #FFFFFF o wielkości 150 px na 150px dla fragmentu $data[$row][] = '<a href="'.$product['product_flypage'].'" title="'.$product['product_name'].'">'
. ps_product::image_tag( $product['product_thumb_image'] )
. '</a>';
if( _SHOW_PRICES && $auth['show_prices'] ) {.
Jak można coś takiego wstawić do tego kodu php aby nie generowało błędów składni? Cały kod poniżej

  1. <?php if( !defined( '_VALID_MOS' ) && !defined( '_JEXEC' ) ) die( 'Direct Access to '.basename(__FILE__).' is not allowed.' );
  2. mm_showMyFileName(__FILE__); ?>
  3.  
  4. <?php echo $buttons_header // The PDF, Email and Print buttons ?>
  5. <?php echo $browsepage_header // The heading, the category description ?>
  6. <?php echo $parameter_form // The Parameter search form ?>
  7. <?php echo $orderby_form // The sort-by, order-by form PLUS top page navigation ?>
  8.  
  9. <?php
  10. $data =array(); // Holds the rows of products
  11. $i = 1; $row = 0; // Counters
  12.  
  13. // Creates a new HTML_Table object that will help us
  14. // to build a table holding all the products
  15. $table =& new HTML_Table('width="100%"');
  16.  
  17. foreach( $products as $product ) {
  18.  
  19. foreach( $product as $attr => $val ) {
  20. // Using this we make all the variables available in the template
  21. // translated example: $this->set( 'product_name', $product_name );
  22. $this->set( $attr, $val );
  23. }
  24. $data[$row][] = '<a href="'.$product['product_flypage'].'" title="'.$product['product_name'].'">'
  25. . ps_product::image_tag( $product['product_thumb_image'] )
  26. . '</a>';
  27. if( _SHOW_PRICES && $auth['show_prices'] ) {
  28. $data[$row][] = '<a href="'.$product['product_flypage'].'" title="'.$product['product_name'].'">'.$product['product_name'].'</a>';
  29. $data[$row][] = $product['product_price'];
  30. }
  31. if( $product['has_addtocart'] ) {
  32. $data[$row][] = $product['form_addtocart'];
  33. }
  34. else {
  35. $data[$row][] = '<a href="'.$product['product_flypage'].'" title="'.$product['product_name'].'">'
  36. . $product['product_details']
  37. . '</a>';
  38. }
  39.  
  40. $row++;
  41.  
  42. }
  43.  
  44.  
  45. // Loop through each row and build the table
  46. foreach($data as $key => $value) {
  47.  
  48. $table->addRow( $data[$key], 'class="sectiontableentry'.$i.'"', 'td', true );
  49. $i = $i == 1 ? 2 : 1;
  50. }
  51. // Display the table
  52. echo $table->toHtml();
  53. ?>
  54. <br class="clr" /><br />
  55. <?php echo $browsepage_footer ?>
  56. <?php
  57. // Show Featured Products
  58. if( $this->get_cfg( 'showFeatured', 1 )) {
  59. /* featuredproducts(random, no_of_products,category_based) no_of_products 0 = all else numeric amount
  60. edit featuredproduct.tpl.php to edit layout */
  61. echo $ps_product->featuredProducts(true,10,true);
  62. } ?>
  63. <?php echo $recent_products ?>


Ten post edytował sylwekb 19.10.2009, 08:49:25
Powód edycji: [nospor]:
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 15.09.2025 - 12:27