Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

infobox


Digerdoo

Recommended Posts

<!-- information //-->

<tr>

<td>

<?php

$info_box_contents = array();

$info_box_contents[] = array('align' => 'center',

'text' => NEW_FILE

);

new infoBoxHeading($info_box_contents, false, false);

 

$info_box_contents = array();

$info_box_contents[] = array('align' => 'center',

'text' => '

 

 

 

how i can put here php code ?

 

:'(

 

 

'

);

 

 

new infoBox($info_box_contents);

?>

Link to comment
Share on other sites

<!-- information //-->

          <tr>

            <td>

<?php

  $info_box_contents = array();

  $info_box_contents[] = array('align' => 'center',

                              'text'  => NEW_FILE

                              );

  new infoBoxHeading($info_box_contents, false, false);

 

  $info_box_contents = array();

  $info_box_contents[] = array('align' => 'center',

                              'text'  => '

how i can put here php code ?

 

:'(

'

);

  new infoBox($info_box_contents);

?>

 

you shouldn't

Treasurer MFC

Link to comment
Share on other sites

you shouldn't

 

 

i want put this code in infobox how i can do it:

 

here is the code:

 

<td><table border="0" width="100%" cellspacing="0" cellpadding="2">

<tr>

<?php

if (isset($cPath) && strpos('_', $cPath)) {

// check to see if there are deeper categories within the current category

$category_links = array_reverse($cPath_array);

for($i=0, $n=sizeof($category_links); $i<$n; $i++) {

$categories_query = tep_db_query("select count(*) as total from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . (int)$category_links[$i] . "' and c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "'");

$categories = tep_db_fetch_array($categories_query);

if ($categories['total'] < 1) {

// do nothing, go through the loop

} else {

$categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.categories_image, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . (int)$category_links[$i] . "' and c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "' order by sort_order, cd.categories_name");

break; // we've found the deepest category the customer is in

}

}

} else {

$categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.categories_image, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . (int)$current_category_id . "' and c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "' order by sort_order, cd.categories_name");

}

 

$number_of_categories = tep_db_num_rows($categories_query);

 

$rows = 0;

while ($categories = tep_db_fetch_array($categories_query)) {

$rows++;

$cPath_new = tep_get_path($categories['categories_id']);

$width = (int)(100 / MAX_DISPLAY_CATEGORIES_PER_ROW) . '%';

echo '<td align="center" class="smallText" width="' . $width . '" valign="top">

 

 

<a href="' . tep_href_link(FILENAME_DEFAULT, $cPath_new) . '">' . tep_image(DIR_WS_IMAGES . $categories['categories_image'], $categories['categories_name'], SUBCATEGORY_IMAGE_WIDTH, SUBCATEGORY_IMAGE_HEIGHT) . '<br>' . $categories['categories_name'] . '</a></td>' . "\n";

if ((($rows / MAX_DISPLAY_CATEGORIES_PER_ROW) == floor($rows / MAX_DISPLAY_CATEGORIES_PER_ROW)) && ($rows != $number_of_categories)) {

echo ' </tr>' . "\n";

echo ' <tr>' . "\n";

}

}

 

// needed for the new products module shown below

$new_products_category_id = $current_category_id;

?>

</tr>

</table></td>

</tr>

 

 

:'(

Link to comment
Share on other sites

you shouldn't

 

however, you can put data in there by concatenating strings and variables:

 

$the_text = 'This is a new product with id : ' . $products_id . ' which I just added to the store.';

 

 

$info_box_contents[] = array('align' => 'center',

'text' => $the_text);

Treasurer MFC

Link to comment
Share on other sites

i want put this code in infobox how i can do it:

 

here is the code:

 

<td><table border="0" width="100%" cellspacing="0" cellpadding="2">

              <tr>

<?php

    if (isset($cPath) && strpos('_', $cPath)) {

// check to see if there are deeper categories within the current category

      $category_links = array_reverse($cPath_array);

      for($i=0, $n=sizeof($category_links); $i<$n; $i++) {

        $categories_query = tep_db_query("select count(*) as total from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . (int)$category_links[$i] . "' and c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "'");

        $categories = tep_db_fetch_array($categories_query);

        if ($categories['total'] < 1) {

          // do nothing, go through the loop

        } else {

          $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.categories_image, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . (int)$category_links[$i] . "' and c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "' order by sort_order, cd.categories_name");

          break; // we've found the deepest category the customer is in

        }

      }

    } else {

      $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.categories_image, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . (int)$current_category_id . "' and c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "' order by sort_order, cd.categories_name");

    }

 

    $number_of_categories = tep_db_num_rows($categories_query);

 

    $rows = 0;

    while ($categories = tep_db_fetch_array($categories_query)) {

    $rows++;

    $cPath_new = tep_get_path($categories['categories_id']);

    $width = (int)(100 / MAX_DISPLAY_CATEGORIES_PER_ROW) . '%';

    echo '<td align="center" class="smallText" width="' . $width . '" valign="top">         

<a href="' . tep_href_link(FILENAME_DEFAULT, $cPath_new) . '">' . tep_image(DIR_WS_IMAGES . $categories['categories_image'], $categories['categories_name'], SUBCATEGORY_IMAGE_WIDTH, SUBCATEGORY_IMAGE_HEIGHT) . '<br>' . $categories['categories_name'] . '</a></td>' . "\n";

      if ((($rows / MAX_DISPLAY_CATEGORIES_PER_ROW) == floor($rows / MAX_DISPLAY_CATEGORIES_PER_ROW)) && ($rows != $number_of_categories)) {

        echo '              </tr>' . "\n";

        echo '              <tr>' . "\n";

      }

    }

 

// needed for the new products module shown below

    $new_products_category_id = $current_category_id;

?>

              </tr>

            </table></td>

          </tr>

:'(

 

same thing, you do this :

 

$the text = '';

 

then you put your code here ........

but instead of echo commands you add it to the variable like :

 

$the_text .= '<td align="center" class="smallText" width="' . $width . '" valign="top">

<a href="' . tep_href_link(FILENAME_DEFAULT, $cPath_new) . '">' . tep_image(DIR_WS_IMAGES . $categories['categories_image'], $categories['categories_name'], SUBCATEGORY_IMAGE_WIDTH, SUBCATEGORY_IMAGE_HEIGHT) . '<br>' . $categories['categories_name'] . '</a></td>' . "\n";

 

 

and then at the end :

 

$info_box_contents[] = array('align' => 'center',

'text' => $the_text);

Treasurer MFC

Link to comment
Share on other sites

however, you can put data in there by concatenating strings and variables:

 

$the_text = 'This is a new product with id : ' . $products_id . ' which I just added to the store.';

$info_box_contents[] = array('align' => 'center',

                              'text'  => $the_text);

 

 

thanks i try it ..

 

:'(

Link to comment
Share on other sites

however, you can put data in there by concatenating strings and variables:

 

$the_text = 'This is a new product with id : ' . $products_id . ' which I just added to the store.';

$info_box_contents[] = array('align' => 'center',

                              'text'  => $the_text);

 

 

too complicated can you give me the code ?

 

 

:'(

Link to comment
Share on other sites

same thing, you do this :

 

$the text = '';

 

then you put your code here ........

but instead of echo commands you add it to the variable like :

 

$the_text .= '<td align="center" class="smallText" width="' . $width . '" valign="top">         

<a href="' . tep_href_link(FILENAME_DEFAULT, $cPath_new) . '">' . tep_image(DIR_WS_IMAGES . $categories['categories_image'], $categories['categories_name'], SUBCATEGORY_IMAGE_WIDTH, SUBCATEGORY_IMAGE_HEIGHT) . '<br>' . $categories['categories_name'] . '</a></td>' . "\n";

and then at the end :

 

$info_box_contents[] = array('align' => 'center',

'text' => $the_text);

 

 

 

How i put this code in infobox ?

 

Can i do it like this :

 

$the text = ''

 

<td><table border="0" width="100%" cellspacing="0" cellpadding="2">

<tr>

<?php

if (isset($cPath) && strpos('_', $cPath)) {

// check to see if there are deeper categories within the current category

$category_links = array_reverse($cPath_array);

for($i=0, $n=sizeof($category_links); $i<$n; $i++) {

$categories_query = tep_db_query("select count(*) as total from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . (int)$category_links[$i] . "' and c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "'");

$categories = tep_db_fetch_array($categories_query);

if ($categories['total'] < 1) {

// do nothing, go through the loop

} else {

$categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.categories_image, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . (int)$category_links[$i] . "' and c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "' order by sort_order, cd.categories_name");

break; // we've found the deepest category the customer is in

}

}

} else {

$categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.categories_image, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . (int)$current_category_id . "' and c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "' order by sort_order, cd.categories_name");

}

 

$number_of_categories = tep_db_num_rows($categories_query);

 

$rows = 0;

while ($categories = tep_db_fetch_array($categories_query)) {

$rows++;

$cPath_new = tep_get_path($categories['categories_id']);

$width = (int)(100 / MAX_DISPLAY_CATEGORIES_PER_ROW) . '%';

echo '<td align="center" class="smallText" width="' . $width . '" valign="top">

 

 

<a href="' . tep_href_link(FILENAME_DEFAULT, $cPath_new) . '">' . tep_image(DIR_WS_IMAGES . $categories['categories_image'], $categories['categories_name'], SUBCATEGORY_IMAGE_WIDTH, SUBCATEGORY_IMAGE_HEIGHT) . '<br>' . $categories['categories_name'] . '</a></td>' . "\n";

if ((($rows / MAX_DISPLAY_CATEGORIES_PER_ROW) == floor($rows / MAX_DISPLAY_CATEGORIES_PER_ROW)) && ($rows != $number_of_categories)) {

echo ' </tr>' . "\n";

echo ' <tr>' . "\n";

}

}

 

// needed for the new products module shown below

$new_products_category_id = $current_category_id;

?>

</tr>

</table></td>

</tr>

 

;

 

 

:'(

Link to comment
Share on other sites

How i put this code in infobox ?

 

Can i do it like this :

 

$the text = ''

 

<td><table border="0" width="100%" cellspacing="0" cellpadding="2">

<tr>

<?php

if (isset($cPath) && strpos('_', $cPath)) {

// check to see if there are deeper categories within the current category

$category_links = array_reverse($cPath_array);

for($i=0, $n=sizeof($category_links); $i<$n; $i++) {

$categories_query = tep_db_query("select count(*) as total from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . (int)$category_links[$i] . "' and c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "'");

$categories = tep_db_fetch_array($categories_query);

if ($categories['total'] < 1) {

// do nothing, go through the loop

} else {

$categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.categories_image, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . (int)$category_links[$i] . "' and c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "' order by sort_order, cd.categories_name");

break; // we've found the deepest category the customer is in

}

}

} else {

$categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.categories_image, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . (int)$current_category_id . "' and c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "' order by sort_order, cd.categories_name");

}

 

$number_of_categories = tep_db_num_rows($categories_query);

 

$rows = 0;

while ($categories = tep_db_fetch_array($categories_query)) {

$rows++;

$cPath_new = tep_get_path($categories['categories_id']);

$width = (int)(100 / MAX_DISPLAY_CATEGORIES_PER_ROW) . '%';

echo '<td align="center" class="smallText" width="' . $width . '" valign="top">

<a href="' . tep_href_link(FILENAME_DEFAULT, $cPath_new) . '">' . tep_image(DIR_WS_IMAGES . $categories['categories_image'], $categories['categories_name'], SUBCATEGORY_IMAGE_WIDTH, SUBCATEGORY_IMAGE_HEIGHT) . '<br>' . $categories['categories_name'] . '</a></td>' . "\n";

if ((($rows / MAX_DISPLAY_CATEGORIES_PER_ROW) == floor($rows / MAX_DISPLAY_CATEGORIES_PER_ROW)) && ($rows != $number_of_categories)) {

echo ' </tr>' . "\n";

echo ' <tr>' . "\n";

}

}

 

// needed for the new products module shown below

$new_products_category_id = $current_category_id;

?>

</tr>

</table></td>

</tr>

 

;

:'(

 

 

something like :

 

<!-- information //-->

<tr>

<td>

<?php

$info_box_contents = array();

$info_box_contents[] = array('align' => 'center',

'text' => NEW_FILE

);

new infoBoxHeading($info_box_contents, false, false);

 

 

$the_text = '';

$the_text .= '<td><table border="0" width="100%" cellspacing="0" cellpadding="2"><tr>';

 

if (isset($cPath) && strpos('_', $cPath)) {

// check to see if there are deeper categories within the current category

$category_links = array_reverse($cPath_array);

for($i=0, $n=sizeof($category_links); $i<$n; $i++) {

$categories_query = tep_db_query("select count(*) as total from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . (int)$category_links[$i] . "' and c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "'");

$categories = tep_db_fetch_array($categories_query);

if ($categories['total'] < 1) {

// do nothing, go through the loop

} else {

$categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.categories_image, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . (int)$category_links[$i] . "' and c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "' order by sort_order, cd.categories_name");

break; // we've found the deepest category the customer is in

}

}

} else {

$categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.categories_image, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . (int)$current_category_id . "' and c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "' order by sort_order, cd.categories_name");

}

 

$number_of_categories = tep_db_num_rows($categories_query);

 

$rows = 0;

while ($categories = tep_db_fetch_array($categories_query)) {

$rows++;

$cPath_new = tep_get_path($categories['categories_id']);

$width = (int)(100 / MAX_DISPLAY_CATEGORIES_PER_ROW) . '%';

 

$the_text .= '<td align="center" class="smallText" width="' . $width . '" valign="top">

<a href="' . tep_href_link(FILENAME_DEFAULT, $cPath_new) . '">' . tep_image(DIR_WS_IMAGES . $categories['categories_image'], $categories['categories_name'], SUBCATEGORY_IMAGE_WIDTH, SUBCATEGORY_IMAGE_HEIGHT) . '<br>' . $categories['categories_name'] . '</a></td>' . "\n";

 

if ((($rows / MAX_DISPLAY_CATEGORIES_PER_ROW) == floor($rows / MAX_DISPLAY_CATEGORIES_PER_ROW)) && ($rows != $number_of_categories)) {

$the_text .= ' </tr>' . "\n";

$the_text .= ' <tr>' . "\n";

}

}

 

// needed for the new products module shown below

$new_products_category_id = $current_category_id;

$the_text .= '</tr></table></td></tr>';

 

$info_box_contents = array();

$info_box_contents[] = array('align' => 'center',

'text' => $the_text);

new infoBox($info_box_contents);

?>

</td>

</tr>

Treasurer MFC

Link to comment
Share on other sites

something like :

 

<!-- information //-->

<tr>

<td>

<?php

  $info_box_contents = array();

  $info_box_contents[] = array('align' => 'center',

                              'text'  => NEW_FILE

                              );

  new infoBoxHeading($info_box_contents, false, false);

$the_text = '';

$the_text .= '<td><table border="0" width="100%" cellspacing="0" cellpadding="2"><tr>';

 

if (isset($cPath) && strpos('_', $cPath)) {

// check to see if there are deeper categories within the current category

$category_links = array_reverse($cPath_array);

for($i=0, $n=sizeof($category_links); $i<$n; $i++) {

$categories_query = tep_db_query("select count(*) as total from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . (int)$category_links[$i] . "' and c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "'");

$categories = tep_db_fetch_array($categories_query);

if ($categories['total'] < 1) {

// do nothing, go through the loop

} else {

$categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.categories_image, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . (int)$category_links[$i] . "' and c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "' order by sort_order, cd.categories_name");

break; // we've found the deepest category the customer is in

}

}

} else {

$categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.categories_image, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . (int)$current_category_id . "' and c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "' order by sort_order, cd.categories_name");

}

 

$number_of_categories = tep_db_num_rows($categories_query);

 

$rows = 0;

while ($categories = tep_db_fetch_array($categories_query)) {

$rows++;

$cPath_new = tep_get_path($categories['categories_id']);

$width = (int)(100 / MAX_DISPLAY_CATEGORIES_PER_ROW) . '%';

 

$the_text .=  '<td align="center" class="smallText" width="' . $width . '" valign="top">

<a href="' . tep_href_link(FILENAME_DEFAULT, $cPath_new) . '">' . tep_image(DIR_WS_IMAGES . $categories['categories_image'], $categories['categories_name'], SUBCATEGORY_IMAGE_WIDTH, SUBCATEGORY_IMAGE_HEIGHT) . '<br>' . $categories['categories_name'] . '</a></td>' . "\n";

 

if ((($rows / MAX_DISPLAY_CATEGORIES_PER_ROW) == floor($rows / MAX_DISPLAY_CATEGORIES_PER_ROW)) && ($rows != $number_of_categories)) {

$the_text .=  ' </tr>' . "\n";

$the_text .=  ' <tr>' . "\n";

}

}

 

// needed for the new products module shown below

$new_products_category_id = $current_category_id;

$the_text .= '</tr></table></td></tr>';

 

  $info_box_contents = array();

  $info_box_contents[] = array('align' => 'center',

                                            'text'  => $the_text);

  new infoBox($info_box_contents);

?>

</td>

</tr>

 

 

Thousand thanks

 

:thumbsup:

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...