Pagina 1 di 1

AGGIUNGERE MENU INFORMAZIONI NELLA COLONNA SINISTRA

Inviato: 05/12/2007, 13:01
da claudioapex84
Ciao,
ho un problema. Sto cercando in tutti i modi di inserire un menu laterale di informazione nel quale ci siano pagine aggiuntive tipo : "chi siamo", "condizioni", ecc.. Sono i grado si fare una cosa del genere se ho appena installato oscommerce, ma purtroppo il mio sito è stato creato da una persona a cui glielo avevo chiesto ed è stato montato un template che mi ha modificato parecchio i file di base. Ho provato da solo ad aggiungere questo menu laterale ma mi succede un casino tipo che la pagine centrale mi va a finire tutta a sinistra oppure tutto in basso.
Quindi il mio obiettivo è:
- aggiungere un menu laterale sotto o al posto dell immagine "our solution, for buisness & education" (guardate nel sito www.emca4.com)
- oppure aggiungere solamente una pagina "chi siamo".


questa è la colonna di sinistra da modificare,premetto che ho già provato a mettere:
require(DIR_WS_BOXES . 'information.php');
dentro la prima apertura di php ma la pagina centrale va a puttane.

COLUMN_LEFT:
<?php

/*

$Id: column_left.php,v 1.1.1.1 2006/08/14 09:44:15 User Exp $



osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com



Copyright (c) 2003 osCommerce



Released under the GNU General Public License

*/



?>

<table border="0" cellspacing="0" cellpadding="0">

<tr><td><?=tep_image(DIR_WS_IMAGES.'m15.gif')?></td></tr>

<tr><td width="153" height="42" class="bg1" style="padding-left:20px;"><span class="tx1"><?=HEADER_TITLE_CATALOG?></span></td></tr>

<tr><td bgcolor="#2D2D2D">

<table border="0" cellspacing="0" cellpadding="0" width="130" align="center">

<tr><td height="13"></td></tr>

<tr><td><ul>

<?

function tep_show_category($counter) {

global $tree, $categories_string, $cPath_array, $ii;





$ii++;

if(!$tree[$counter]['level']){



$categories_string .= $categories_string ? '' : '';



$categories_string .= '<li><a href=';



if ($tree[$counter]['parent'] == 0) {

$cPath_new = 'cPath=' . $counter;

} else {

$cPath_new = 'cPath=' . $tree[$counter]['path'];

}

$categories_string .= tep_href_link('index.php', $cPath_new) . '>';

// display categry name

$categories_string .= $tree[$counter]['name'];

$categories_string .= '</a></li>';



}else{ // SUBCATEGORY



$categories_string .= '';



for($i=0;$i<$tree[$counter]['le vel'];$i++)

$categories_string .= '';



$categories_string .= '<li class="mysubcat"><a href=';

if ($tree[$counter]['parent'] == 0) {

$cPath_new = 'cPath=' . $counter;

} else {

$cPath_new = 'cPath=' . $tree[$counter]['path'];

}

$categories_string .= tep_href_link('index.php', $cPath_new) . '>';

// display category name

$categories_string .= $tree[$counter]['name'];

$categories_string .= '</a></li>';

}



if ($tree[$counter]['next_id'] != false && $ii < 20) {

tep_show_category($tree[$counter]['next_id']);

}

}







define(TABLE_CATEGORIES, "categories");

define(TABLE_CATEGORIES_DESCRIPTION, "categories_description");

$categories_string = '';

$tree = array();



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

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

$tree[$categories['categories_id']] = array('name' => $categories['categories_name'],

'parent' => $categories['parent_id'],

'level' => 0,

'path' => $categories['categories_id'],

'next_id' => false);



if (isset($parent_id)) {

$tree[$parent_id]['next_id'] = $categories['categories_id'];

}



$parent_id = $categories['categories_id'];



if (!isset($first_element)) {

$first_element = $categories['categories_id'];

}

}



//------------------------

if ($cPath) {

$new_path = '';

reset($cPath_array);

while (list($key, $value) = each($cPath_array)) {

unset($parent_id);

unset($first_id);

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

if (tep_db_num_rows($categories_query)) {

$new_path .= $value;

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

$tree[$row['categories_id']] = array('name' => $row['categories_name'],

'parent' => $row['parent_id'],

'level' => $key+1,

'path' => $new_path . '_' . $row['categories_id'],

'next_id' => false);



if (isset($parent_id)) {

$tree[$parent_id]['next_id'] = $row['categories_id'];

}



$parent_id = $row['categories_id'];



if (!isset($first_id)) {

$first_id = $row['categories_id'];

}



$last_id = $row['categories_id'];

}

$tree[$last_id]['next_id'] = $tree[$value]['next_id'];

$tree[$value]['next_id'] = $first_id;

$new_path .= '_';

} else {

break;

}

}

}

$categories_string .= '';

tep_show_category($first_element);

$categories_string .= '';



echo $categories_string;

?>



</ul></td></tr>

<tr><td height="24"></td></tr>

</table>

</td></tr>

<tr><td id="zxc1"><a href="<?=tep_href_link('index.php?cPath=21')?>"><?=tep_image(DIR_WS_IMAGES.'m17.gif')?></a></td></tr>

</table>


-----------------------------------------------------------------------------
questo è il file information.php originale da modificare: (ho un file information.php ma non utilizzato):

<?php
/*
$Id: information.php,v 1.6 2003/02/10 22:31:00 hpdl Exp $

osCommerce, Open Source E-Commerce Solutions
http://www.oscommerce.com

Copyright (c) 2003 osCommerce

Released under the GNU General Public License
*/
?>
<!-- information //-->
<tr>
<td>
<?php
$info_box_contents = array();
$info_box_contents[] = array('text' => BOX_HEADING_INFORMATION);

new infoBoxHeading($info_box_contents, false, false);

$info_box_contents = array();
$info_box_contents[] = array('text' => '<a href="' . tep_href_link(FILENAME_SHIPPING) . '">' . BOX_INFORMATION_SHIPPING . '</a><br>' .
'<a href="' . tep_href_link(FILENAME_PRIVACY) . '">' . BOX_INFORMATION_PRIVACY . '</a><br>' .
'<a href="' . tep_href_link(FILENAME_CONDITIONS) . '">' . BOX_INFORMATION_CONDITIONS . '</a><br>' .
'<a href="' . tep_href_link(FILENAME_CONTACT_US) . '">' . BOX_INFORMATION_CONTACT . '</a>');

new infoBox($info_box_contents);
?>
</td>
</tr>
<!-- information_eof //-->


spero che abbiate capito il mio problema, perche sono ormai 2 giorni che provo a fare tentativi su tentativi ma niente

HELPPP :)

Inviato: 06/12/2007, 13:00
da claudioapex84
cè quelcuno che puo aiutarmi?

Aggiungere Box

Inviato: 12/12/2007, 15:57
da mauro
Ciao, per aggiungere un qualsiasi box devi editare il file

column_left.php (Che trovi sotto la dir INCLUDES)

all'interno del file editato dovresti avere la seguente riga:

require(DIR_WS_BOXES . 'menu.php'); (Se non c'è inseriscila prima di tutto il resto, subito dopo il tag <?php

a questo punto sotto la directory INCLUDES/BOXES dovresti avere il file menu.php, se non c'è crealo con il seguente contenuto:

Codice: Seleziona tutto

<?php
/*
  $Id: information.php,v 1.6 2003/02/10 22:31:00 hpdl Exp $

  osCommerce, Open Source E-Commerce Solutions
  http://www.oscommerce.com

  Copyright (c) 2003 osCommerce

  Released under the GNU General Public License
*/
?>
<!-- information //-->
          <tr>
            <td>
<?php
  $info_box_contents = array();
  $info_box_contents[] = array('text' => BOX_HEADING_MENU);

  new infoBoxHeading($info_box_contents, false, false);

  $info_box_contents = array();
  $info_box_contents[] = array('text' => '<a href="' . tep_href_link(FILENAME_CHISIAMO) . '">' . BOX_MENU_CHISIAMO . '</a><br>' .
                                         '<a href="' . tep_href_link(FILENAME_DOVESIAMO) . '">' . BOX_MENU_DOVESIAMO . '</a><br>' .
                                         '<a href="' . tep_href_link(FILENAME_CONTACT) . '">' . BOX_MENU_CONTACT. '</a><br>'.
                                         '<a href="' . tep_href_link(FILENAME_CONTATTI) . '">' . BOX_MENU_CONTATTI. '</a><br>'.
                                         '<a href="' . tep_href_link(FILENAME_LINK) . '">' . BOX_MENU_LINK. '</a><br>'.
                                         '<a href="' . tep_href_link(FILENAME_LINKUTILI) . '">' . BOX_MENU_LINKUTILI. '</a>');
  new infoBox($info_box_contents);
?>
a questo punto devi editare il file filenames.php (che trovi sotto INCLUDES) e inserire all'inizio di tutto, sempre subito dopo il TAG <?php il seguente codice:

Codice: Seleziona tutto

  define('FILENAME_MENU', 'menu.php');
  define('FILENAME_DOVESIAMO', 'dovesiamo.php');
  define('FILENAME_CHISIAMO', 'chisiamo.php');
  define('FILENAME_CONTACT', 'contact_us.php');
  define('FILENAME_CONTATTI', 'servizi.php');
  define('FILENAME_LINK', 'link.php');
  define('FILENAME_LINKUTILI', 'link-utili.php');
  define('FILENAME_BANNER', 'banner.php');
  define('FILENAME_CONTACT_US', 'contact_us.php');
Ora non ti resta nient'altro da fare che aggiungere al file italian.php (in INCLUDES/LANGUAGE) i vari BOX_MENU_XXXX con le varie traduzioni, praticamente questi sono i nomi dei link che ti compariranno all'interno del nuovo box creato.

Successivamente dovrai creare sotto la DIR Madre i vari File:
chisiamo.php
dovesiamo.php etc.etc.

Spero di essere stato chiaro e utile, se dovessi avere ancora problemi rispondi a questo mesaggio.
Ciao
Mauro