Pagina 1 di 2

modificare box login

Inviato: 15/08/2007, 18:42
da berte
non riesco a modificare il tema di sfondo del box login....

il box è cosi:
Immagine

e io lo vorrei cosi:
Immagine

come posso fare??
grazie mille

Inviato: 15/08/2007, 21:54
da Spiderweb
Devi modificare il codice che genera il box... io uso una contribution diversa dalla tua, prova a postare il tuo codice oppure il nome della contribution che usi e si vede dove bisogna cambiarla.

Ciao!

Inviato: 15/08/2007, 21:58
da berte
la contrib è loginbox v2.2c

Codice: Seleziona tutto

<?php
/*
  $Id: information.php,v 1.5 2002/01/11 22:04:06 dgw_ Exp $

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

  Copyright (c) 2001 osCommerce

  Released under the GNU General Public License
*/
?>
<!-- information //-->
          <tr>
            <td>
<?php

 require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_LOGIN_WELCOME);

 if (tep_session_is_registered('customer_id')) {

	 $info_box_contents = array();
	  $info_box_contents[] = array('align' => 'left',
								   'text'  => BOX_HEADING_MEMBERLOGGED_IN
								  );

	$db=DB_DATABASE;
	
	$select="select customers_firstname from customers where customers_id=\"$customer_id\"";
	$result=mysql_db_query($db,$select);
	$res=mysql_fetch_object($result);
	
		 $in_out_action = "<center>";
		 $in_out_action.= LOGIN_BOX_WELCOME_TEXT;
		 $in_out_action.= "<br>$res->customers_firstname <br><br>";
		 $in_out_action.='<a href="'.tep_href_link(FILENAME_ACCOUNT, '', 'SSL').'">';
		 $in_out_action.= LOGIN_BOX_WELCOME_MYACCOUNT;
		 $in_out_action.="</a><br>";
		 $in_out_action.='<a href="'.tep_href_link(FILENAME_LOGOFF, '', 'NONSSL').'">';
		 $in_out_action.= LOGIN_BOX_WELCOME_LOGOUT;
		 $in_out_action.="</a></center>";
     	} else {

		  $info_box_contents = array();
		  $info_box_contents[] = array('align' => 'left',
									   'text'  => BOX_HEADING_MEMBERLOGIN
									  	);
		
		  $in_out_action = '		
		<form name="login" action="login.php?action=process" method="post">
			 <center>
		  <table border="0" cellpadding="0" cellspacing="0" class="smallText" >
			<tr >
			  <td width="100%" height="16" class="smallText">
			  <p align="center">';
		  $in_out_action.= LOGIN_BOX_WELCOME_EMAILADDRESS;
		  $in_out_action.= '</td>
			</tr>
			<tr>
			  <td width="100%" height="16" class="smallText">
			  <p align="center">
			 <input maxLength="96" name="email_address"size="12">
			 </td>
			</tr>
			<tr>
			  <td width="100%" height="16" class="smallText">
			  <p align="center">';
		  $in_out_action.=LOGIN_BOX_WELCOME_PASSWORD;
		  $in_out_action.='</font></td>
			</tr>
			<tr>
			  <td width="100%" height="19">
			  <p align="center"><b>
				<font size="1" class="smallText"> <input type="password" maxLength="40" value name="password" size="12"></b>
				</td>
			</tr>
			<tr>
			  <td width="100%" height="1" class="smallText">
			  <p align="center">';
		
		  $in_out_action.='<br><input type="submit" value="';
		  $in_out_action.=LOGIN_BOX_WELCOME_LOGIN;
		  $in_out_action.='" name="Submit">';
		//Forgotten Password
		  $in_out_action.= '<br>';
		  $in_out_action.='<a class="smallText" href="';
		  $in_out_action.=tep_href_link(FILENAME_PASSWORD_FORGOTTEN);
		  $in_out_action.='">';
		  $in_out_action.= LOGIN_BOX_PASSWORD_FORGOTTEN;
		  $in_out_action.='</a>
		</td>
			</tr>
<tr>
			  <td width="100%" height="1" class="smallText">
			  <p align="center">';
//create account
		  $in_out_action.= '<br>';
		  $in_out_action.='<a class="smallText" href="';
		  $in_out_action.=tep_href_link(FILENAME_CREATE_ACCOUNT);
		  $in_out_action.='">';
		  $in_out_action.= LOGIN_BOX_CREATE_ACCOUNT;
		  $in_out_action.='</a>
		
		</td>
			</tr>
		  </table>
		</form>
		';
     }

  new infoBoxHeading($info_box_contents, false, false);


  $info_box_contents = array();
  $info_box_contents[] = array('align' => 'left',
							   'params' => 'class="smallText" valign="top"',
                               'text'  => $in_out_action                           			
								);

  new infoBox($info_box_contents);

?></td></tr>
<!-- information_eof //-->

Inviato: 15/08/2007, 22:43
da Spiderweb
Per togliere la scritta Login basta che cancelli la riga in rosso, per quanto riguarda il bordo del box bisogna trovare la voce da modificare nel file stylesheet.css.
Il problema è che sicuramente quella parte modifica tutti gli infobox e non solo quello, se vuoi togliere il bordo solo al login devi creare una voce nel css dedicata a quello e poi richiamarla nel file memberlogin.php


<?php
/*
$Id: information.php,v 1.5 2002/01/11 22:04:06 dgw_ Exp $

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

Copyright (c) 2001 osCommerce

Released under the GNU General Public License
*/
?>
<!-- information //-->
<tr>
<td>
<?php

require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_LOGIN_WELCOME);

if (tep_session_is_registered('customer_id')) {

$info_box_contents = array();
$info_box_contents[] = array('align' => 'left',
'text' => BOX_HEADING_MEMBERLOGGED_IN
);

$db=DB_DATABASE;

$select="select customers_firstname from customers where customers_id=\"$customer_id\"";
$result=mysql_db_query($db,$select);
$res=mysql_fetch_object($result);

$in_out_action = "<center>";
$in_out_action.= LOGIN_BOX_WELCOME_TEXT;
$in_out_action.= "<br>$res->customers_firstname <br><br>";
$in_out_action.='<a href="'.tep_href_link(FILENAME_ACCOUNT, '', 'SSL').'">';
$in_out_action.= LOGIN_BOX_WELCOME_MYACCOUNT;
$in_out_action.="</a><br>";
$in_out_action.='<a href="'.tep_href_link(FILENAME_LOGOFF, '', 'NONSSL').'">';
$in_out_action.= LOGIN_BOX_WELCOME_LOGOUT;
$in_out_action.="</a></center>";
} else {

$info_box_contents = array();
$info_box_contents[] = array('align' => 'left',
'text' => BOX_HEADING_MEMBERLOGIN
);

$in_out_action = '
<form name="login" action="login.php?action=process" method="post">
<center>
<table border="0" cellpadding="0" cellspacing="0" class="smallText" >
<tr >
<td width="100%" height="16" class="smallText">
<p align="center">';
$in_out_action.= LOGIN_BOX_WELCOME_EMAILADDRESS;
$in_out_action.= '</td>
</tr>
<tr>
<td width="100%" height="16" class="smallText">
<p align="center">
<input maxLength="96" name="email_address"size="12">
</td>
</tr>
<tr>
<td width="100%" height="16" class="smallText">
<p align="center">';
$in_out_action.=LOGIN_BOX_WELCOME_PASSWORD;
$in_out_action.='</font></td>
</tr>
<tr>
<td width="100%" height="19">
<p align="center"><b>
<font size="1" class="smallText"> <input type="password" maxLength="40" value name="password" size="12"></b>
</td>
</tr>
<tr>
<td width="100%" height="1" class="smallText">
<p align="center">';

$in_out_action.='<br><input type="submit" value="';
$in_out_action.=LOGIN_BOX_WELCOME_LOGIN;
$in_out_action.='" name="Submit">';
//Forgotten Password
$in_out_action.= '<br>';
$in_out_action.='<a class="smallText" href="';
$in_out_action.=tep_href_link(FILENAME_PASSWORD_FORGOTTEN);
$in_out_action.='">';
$in_out_action.= LOGIN_BOX_PASSWORD_FORGOTTEN;
$in_out_action.='</a>
</td>
</tr>
<tr>
<td width="100%" height="1" class="smallText">
<p align="center">';
//create account
$in_out_action.= '<br>';
$in_out_action.='<a class="smallText" href="';
$in_out_action.=tep_href_link(FILENAME_CREATE_ACCOUNT);
$in_out_action.='">';
$in_out_action.= LOGIN_BOX_CREATE_ACCOUNT;
$in_out_action.='</a>

</td>
</tr>
</table>
</form>
';
}

new infoBoxHeading($info_box_contents, false, false);


$info_box_contents = array();
$info_box_contents[] = array('align' => 'left',
'params' => 'class="smallText" valign="top"',
'text' => $in_out_action
);

new infoBox($info_box_contents);

?></td></tr>

Inviato: 15/08/2007, 23:06
da berte
si infatti se vado a modificare il .infobox nel file css modifica tutto...ed ho provato a mettere una voce .infoboxx ne css e fare new infoBoxx($info_box_contents); nel file ma mi da 1 errore :

Fatal error: Cannot instantiate non-existent class: infoboxx

cosa è ke sbaglio??

Inviato: 15/08/2007, 23:13
da Spiderweb
Sono sincero, su questa cosa non ci capisco niente e anch'io vado per prove :wink:

M'è venuto il dubbio che per fare modifiche all'infobox oltre che al css bisogna mettere mano pure al file boxes in includes-classes.... e li se non si sa dove mettere le mani è un po' un casino :roll:
Il tuo errore vedrai viene fuori proprio perchè nel file infobox in classes non c'è traccia del nuovo box che vorresti dichiarare.

Nel tuo caso forse la cosa più semplice è creare un box con del semplice codice html e poi richiamarlo come si fa con gli altri, non ho mai provato ma dovrebbe funzionare.

Inviato: 17/08/2007, 22:57
da berte
cioe??nn ho capito cosa dovrei fare....

cmq ho provato a smanettare col codice dentro il file boxes in classes ma nn sono riuscito a far nulla....

come posso risolvere questa cosa?

Inviato: 22/08/2007, 17:16
da Simona67
berte ha scritto:cioe??nn ho capito cosa dovrei fare....

cmq ho provato a smanettare col codice dentro il file boxes in classes ma nn sono riuscito a far nulla....

come posso risolvere questa cosa?
Ciao,

Il tutto stà in questa riga di codice che trovi verso la fine del file login.php che hai visualizzato in precedenza:

Codice: Seleziona tutto

  new infoBoxHeading($info_box_contents, false, false); 
ora non ricordo con preciso quale dei due false fa sparire la cornice comunque prova a giocare con questa riga e fammi sapere.

Ciao Simona

Inviato: 22/08/2007, 18:14
da berte
io avevo provato a modificare il codice nel file boxes. sotto la cartella classes

Codice: Seleziona tutto

class infoBox extends tableBox {
    function infoBox($contents) {
      $info_box_contents = array();
      $info_box_contents[] = array('text' => $this->infoBoxContents($contents));
      $this->table_cellpadding = '1';
      $this->table_parameters = 'class="infoBox"';
      $this->tableBox($info_box_contents, true);
    }

    function infoBoxContents($contents) {
      $this->table_cellpadding = '3';
      $this->table_parameters = 'class="infoBoxContents"';
      $info_box_contents = array();
      $info_box_contents[] = array(array('text' => tep_draw_separator('pixel_trans.gif', '100%', '1')));
      for ($i=0, $n=sizeof($contents); $i<$n; $i++) {
        $info_box_contents[] = array(array('align' => (isset($contents[$i]['align']) ? $contents[$i]['align'] : ''),
                                           'form' => (isset($contents[$i]['form']) ? $contents[$i]['form'] : ''),
                                           'params' => 'class="boxText"',
                                           'text' => (isset($contents[$i]['text']) ? $contents[$i]['text'] : '')));
      }
      $info_box_contents[] = array(array('text' => tep_draw_separator('pixel_trans.gif', '100%', '1')));
      return $this->tableBox($info_box_contents);
    }
  }
avevo messo sotto a questo codice questo

Codice: Seleziona tutto

class infoBoxx extends tableBox {
    function infoBoxx($contents) {
      $info_boxx_contents = array();
      $info_boxx_contents[] = array('text' => $this->infoBoxxContents($contents));
      $this->table_cellpadding = '1';
      $this->table_parameters = 'class="infoBox"';
      $this->tableBox($info_boxx_contents, true);
    }

    function infoBoxxContents($contents) {
      $this->table_cellpadding = '3';
      $this->table_parameters = 'class="infoBoxxContents"';
      $info_boxx_contents = array();
      $info_boxx_contents[] = array(array('text' => tep_draw_separator('pixel_trans.gif', '100%', '1')));
      for ($i=0, $n=sizeof($contents); $i<$n; $i++) {
        $info_box_contents[] = array(array('align' => (isset($contents[$i]['align']) ? $contents[$i]['align'] : ''),
                                           'form' => (isset($contents[$i]['form']) ? $contents[$i]['form'] : ''),
                                           'params' => 'class="boxText"',
                                           'text' => (isset($contents[$i]['text']) ? $contents[$i]['text'] : '')));
      }
      $info_boxx_contents[] = array(array('text' => tep_draw_separator('pixel_trans.gif', '100%', '1')));
      return $this->tableBox($info_boxx_contents);
    }
  }
in pratica volevo farmi un css solo x il box del login andando a chiamare al classe infoboxx nel file di stylesheet.

ma nn va..cosa ho sbagliato secodno te?

Inviato: 22/08/2007, 18:18
da Simona67
berte ha scritto:la contrib è loginbox v2.2c

Codice: Seleziona tutto

<?php
/*
  $Id: information.php,v 1.5 2002/01/11 22:04:06 dgw_ Exp $

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

  Copyright (c) 2001 osCommerce

  Released under the GNU General Public License
*/
?>
<!-- information //-->
          <tr>
            <td>
<?php

 require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_LOGIN_WELCOME);

 if (tep_session_is_registered('customer_id')) {

	 $info_box_contents = array();
	  $info_box_contents[] = array('align' => 'left',
								   'text'  => BOX_HEADING_MEMBERLOGGED_IN
								  );

	$db=DB_DATABASE;
	
	$select="select customers_firstname from customers where customers_id="$customer_id"";
	$result=mysql_db_query($db,$select);
	$res=mysql_fetch_object($result);
	
		 $in_out_action = "<center>";
		 $in_out_action.= LOGIN_BOX_WELCOME_TEXT;
		 $in_out_action.= "<br>$res->customers_firstname <br><br>";
		 $in_out_action.='<a href="'.tep_href_link(FILENAME_ACCOUNT, '', 'SSL').'">';
		 $in_out_action.= LOGIN_BOX_WELCOME_MYACCOUNT;
		 $in_out_action.="</a><br>";
		 $in_out_action.='<a href="'.tep_href_link(FILENAME_LOGOFF, '', 'NONSSL').'">';
		 $in_out_action.= LOGIN_BOX_WELCOME_LOGOUT;
		 $in_out_action.="</a></center>";
     	} else {

		  $info_box_contents = array();
		  $info_box_contents[] = array('align' => 'left',
									   'text'  => BOX_HEADING_MEMBERLOGIN
									  	);
		
		  $in_out_action = '		
		<form name="login" action="login.php?action=process" method="post">
			 <center>
		  <table border="0" cellpadding="0" cellspacing="0" class="smallText" >
			<tr >
			  <td width="100%" height="16" class="smallText">
			  <p align="center">';
		  $in_out_action.= LOGIN_BOX_WELCOME_EMAILADDRESS;
		  $in_out_action.= '</td>
			</tr>
			<tr>
			  <td width="100%" height="16" class="smallText">
			  <p align="center">
			 <input maxLength="96" name="email_address"size="12">
			 </td>
			</tr>
			<tr>
			  <td width="100%" height="16" class="smallText">
			  <p align="center">';
		  $in_out_action.=LOGIN_BOX_WELCOME_PASSWORD;
		  $in_out_action.='</font></td>
			</tr>
			<tr>
			  <td width="100%" height="19">
			  <p align="center"><b>
				<font size="1" class="smallText"> <input type="password" maxLength="40" value name="password" size="12"></b>
				</td>
			</tr>
			<tr>
			  <td width="100%" height="1" class="smallText">
			  <p align="center">';
		
		  $in_out_action.='<br><input type="submit" value="';
		  $in_out_action.=LOGIN_BOX_WELCOME_LOGIN;
		  $in_out_action.='" name="Submit">';
		//Forgotten Password
		  $in_out_action.= '<br>';
		  $in_out_action.='<a class="smallText" href="';
		  $in_out_action.=tep_href_link(FILENAME_PASSWORD_FORGOTTEN);
		  $in_out_action.='">';
		  $in_out_action.= LOGIN_BOX_PASSWORD_FORGOTTEN;
		  $in_out_action.='</a>
		</td>
			</tr>
<tr>
			  <td width="100%" height="1" class="smallText">
			  <p align="center">';
//create account
		  $in_out_action.= '<br>';
		  $in_out_action.='<a class="smallText" href="';
		  $in_out_action.=tep_href_link(FILENAME_CREATE_ACCOUNT);
		  $in_out_action.='">';
		  $in_out_action.= LOGIN_BOX_CREATE_ACCOUNT;
		  $in_out_action.='</a>
		
		</td>
			</tr>
		  </table>
		</form>
		';
     }

  new infoBoxHeading($info_box_contents, false, false);


  $info_box_contents = array();
  $info_box_contents[] = array('align' => 'left',
							   'params' => 'class="smallText" valign="top"',
                               'text'  => $in_out_action                           			
								);

  new infoBox($info_box_contents);

?></td></tr>
<!-- information_eof //-->
Controlla in questo file lo trovi nelle ultime 20 righe.

Ciao Simona

Inviato: 22/08/2007, 18:25
da berte
ho modificato il post di prima mi ero accorto dell errore :P:P

Inviato: 22/08/2007, 18:30
da Simona67
berte ha scritto:ho modificato il post di prima mi ero accorto dell errore :P:P
E la modifica che hai fatto al file boxes.php qui sopra riportata che errore ti da?

Ciao Simona

Inviato: 22/08/2007, 18:33
da berte
nn mi fa vedere il box se metto

.infoBoxx {
background: #ffffff;
}

se lo metto

.infoBox {
background: #3366FF;
}

vedo solo il quadratino ma nulla dentro..

Inviato: 22/08/2007, 18:35
da Simona67
berte ha scritto:nn mi fa vedere il box
e la class nel file css l'hai creata regolarmente?

Ciao Simona

Inviato: 22/08/2007, 18:40
da berte
allora nel file boxes.php ho aggiunto questo codice

Codice: Seleziona tutto

class infoBoxx extends tableBox {
    function infoBoxx($contents) {
      $info_boxx_contents = array();
      $info_boxx_contents[] = array('text' => $this->infoBoxxContents($contents));
      $this->table_cellpadding = '1';
      $this->table_parameters = 'class="infoBox"';
      $this->tableBox($info_boxx_contents, true);
    }

    function infoBoxxContents($contents) {
      $this->table_cellpadding = '3';
      $this->table_parameters = 'class="infoBoxxContents"';
      $info_boxx_contents = array();
      $info_boxx_contents[] = array(array('text' => tep_draw_separator('pixel_trans.gif', '100%', '1')));
      for ($i=0, $n=sizeof($contents); $i<$n; $i++) {
        $info_box_contents[] = array(array('align' => (isset($contents[$i]['align']) ? $contents[$i]['align'] : ''),
                                           'form' => (isset($contents[$i]['form']) ? $contents[$i]['form'] : ''),
                                           'params' => 'class="boxText"',
                                           'text' => (isset($contents[$i]['text']) ? $contents[$i]['text'] : '')));
      }
      $info_boxx_contents[] = array(array('text' => tep_draw_separator('pixel_trans.gif', '100%', '1')));
      return $this->tableBox($info_boxx_contents);
    }
  }

il file memberlogin.php nel 3 post lho modificato aggiungendo la x sia a $info_box_contents sia a new infoBox($info_box_contents);

e nello stylesheet ho aggiunt questo

Codice: Seleziona tutto

.infoBoxx {
  background: #ffffff;
}