Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

HOW I CAN CHANGING HEADERS WHILE CHANGING LANGUAGE?


icon

Recommended Posts

I AM TRYING TO DO THAT...

TO MAKE NEEDABLE MODIFICATIONS IN HEADER.PHP, SO (TO CHECK THRUE IF..ELSEIF... ) IF THE LANGUAGE IS CHANGING AUTOMATICALY TO BRING THE HEADER SECTION IS SUITABLE WITH.

 

IF SOMEBODY OF U HAVE WORKED WITH POSTNUKE PROBABLY WILL UNDESTAND WHAT IAM TRYING TO DO ... BECAUSE POSTNUKE SOLVE THIS WITH MULTISITE MODULE.

 

 

ALSO I WOULD PLEASANT IF SOMEBODY HAVE RUN osc FOR TOURIST MARKET PRODUCTS SUCH AS TICKETS , PACKAGES ETC.... I AM SEARCHING SOME RUNNING SITES ... IS STH THERE ABOUT??

 

THANKS

ICON FROM GREECE

Link to comment
Share on other sites

THERE IS NO NEED TO SHOUT WE HEAR YOU!! :shock:
aaah, my ears :lol:

 

tep_image(DIR_WS_LANGUAGES . $language . '/images/yourpicture.gif', '')

Put this in place of the default oscommerce.gif in includes/header.php

 

hth

 

Marcel

 

Thanks Marcel but i need help a litle bit more...

cause i want to change not one pic but a table with rollover images constructed in dreamweaver...

 

sth like that...

 

<BODY LEFTMARGIN="0" TOPMARGIN="0" ONLOAD="MM_preloadImages('images/rm2.jpg','images/rm3.jpg','images/rm4.jpg','images/rm5.jpg','images/rm6.jpg','images/rm7.jpg','images/rm8.jpg')">

<table width="100%" border="0" cellpadding="0" cellspacing="0" height="23%"> <tr>

<td valign="top" rowspan="3" background="images/l_bg.jpg" width="9">  </td><td valign="top" width="744" HEIGHT="180"><img src="images/top.jpg" border="0" width="744" height="122" alt=""><br>

<img src="images/name.jpg" border="0" width="237" height="66" alt=""><img src="images/c2.jpg" border="0" width="507" height="66" alt=""></td><td valign="top" rowspan="3" background="images/r_bg.jpg" width="9">  </td><td valign="top" rowspan="3" background="images/r.jpg" width="50%"> </td></tr>

<tr> <td valign="top" width="744" HEIGHT="74"><P><A HREF="#" ONMOUSEOUT="MM_swapImgRestore()" ONMOUSEOVER="MM_swapImage('Image10','','images/rm2.jpg',1)"><IMG NAME="Image10" BORDER="0" SRC="images/m2.jpg" WIDTH="138" HEIGHT="52"></A><A HREF="#" ONMOUSEOUT="MM_swapImgRestore()" ONMOUSEOVER="MM_swapImage('Image11','','images/rm3.jpg',1)"><IMG NAME="Image11" BORDER="0" SRC="images/m3.jpg" WIDTH="99" HEIGHT="52"></A><A HREF="#" ONMOUSEOUT="MM_swapImgRestore()" ONMOUSEOVER="MM_swapImage('Image12','','images/rm4.jpg',1)"><IMG NAME="Image12" BORDER="0" SRC="images/m4.jpg" WIDTH="84" HEIGHT="52"></A><A HREF="#" ONMOUSEOUT="MM_swapImgRestore()" ONMOUSEOVER="MM_swapImage('Image13','','images/rm5.jpg',1)"><IMG NAME="Image13" BORDER="0" SRC="images/m5.jpg" WIDTH="89" HEIGHT="52"></A><A HREF="#" ONMOUSEOUT="MM_swapImgRestore()" ONMOUSEOVER="MM_swapImage('Image14','','images/rm6.jpg',1)"><IMG NAME="Image14" BORDER="0" SRC="images/m6.jpg" WIDTH="86" HEIGHT="52"></A><A HREF="#" ONMOUSEOUT="MM_swapImgRestore()" ONMOUSEOVER="MM_swapImage('Image15','','images/rm7.jpg',1)"><IMG NAME="Image15" BORDER="0" SRC="images/m7.jpg" WIDTH="104" HEIGHT="52"></A><A HREF="#" ONMOUSEOUT="MM_swapImgRestore()" ONMOUSEOVER="MM_swapImage('Image16','','images/rm8.jpg',1)"><IMG NAME="Image16" BORDER="0" SRC="images/m8.jpg" WIDTH="144" HEIGHT="52"></A><table border="0" width="100%" cellspacing="0" cellpadding="0" HEIGHT="1">

<tr class="header"> <P> </P><td valign="middle" HEIGHT="1" WIDTH="12%">

Link to comment
Share on other sites

icon,

 

It can be done!

 

I don't know PHP or osCommerce well but I wanted to do exactly the same thing. I can only tell you the logic and you'll have to work it out or wait until I've done my header.php. I did modify the logoff page so that it now goes to respective languages log off page. So the logic is same here.

 

You will need to create header.php in the separate language folder (English, Spanish etc) and modify the osCommerce/includes/header.php as your main header.php file.

 

If you are lost, just have a look at an example like login page.

There are two files:

osCommerce/includes/login.php AND

osCommerce/includes/languages/English/login.php

 

AG

Link to comment
Share on other sites

Forgot to say, the key is also to add the following just before the html code starts. FILENAME_HEADER can be added in the file (includes/application_top.php)

 

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

?>

<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">

<html <?php echo HTML_PARAMS; ?>>

<head>

Link to comment
Share on other sites

Hi all:

I'm still working on this....a different header which includes f.e. 8 categories....with a mouse-over. I hope this helps you a bit:

 

A lot of work has to be done. I also posted some time ago...because I needed help for this prob. I hope someone reads this...and we could make it possible...that osc does change the textlinks if the User changes the language;;;;;;

 

go to catalog/includes/header.php

 

put this into the html-part:

(there are absolut paths...and osc won't change your main cats...in your new header!!!!!! - you also have to create a folder named"navigation" in the images-folder. There you need the pictures: 01_01.gif...etc.)

 

<!-- start header with mouse over 8 kategories //-->

 

<table border="0" width="100%" cellspacing="0" cellpadding="0" align="center" bgcolor="#dddddd">

<script language="JavaScript">

<!--

function MM_swapImgRestore() { //v3.0

var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a)&&x.oSrc;i++) x.src=x.oSrc;

}

 

function MM_preloadImages() { //v3.0

var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();

var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)

if (a.indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a;}}

}

 

function MM_findObj(n, d) { //v4.0

var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {

d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}

if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[n];

for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers.document);

if(!x && document.getElementById) x=document.getElementById(n); return x;

}

 

function MM_swapImage() { //v3.0

var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)

if ((x=MM_findObj(a))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}

}

//-->

</script>

 

<tr class="header">

<td>

 

 

<table border="0" width="100%" cellspacing="0" cellpadding="1" class="infoBox" bgcolor="#cccccc">

<tr>

<td align="center" class="boxText" height="81"><a href="http://www.yourdomain.com/catalog/default.php?cPath=1" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('kat01','','http://www.yourdomain.com/catalog/images/navigation/01_02.gif',1)"><img name="kat01" border="0" src="http://www.yourdomain.com/catalog/images/navigation/01_01.gif" width="97" height="81"></a></td>

<td align="center" class="boxText" height="81"><a href="http://www.yourdomain.com/catalog/default.php?cPath=2" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('kat02','','http://www.yourdomain.com/catalog/images/navigation/02_02.gif',1)"><img name="kat02" border="0" src="http://www.yourdomain.com/catalog/images/navigation/02_01.gif" width="93" height="81"></a></td>

<td align="center" class="boxText" height="81"><a href="http://www.yourdomain.com/catalog/default.php?cPath=3" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('kat03','','http://www.yourdomain.com/catalog/images/navigation/03_02.gif',1)"><img name="kat03" border="0" src="http://www.yourdomain.com/catalog/images/navigation/03_01.gif" width="93" height="81"></a></td>

<td align="center" class="boxText" height="81"><a href="http://www.yourdomain.com/catalog/default.php?cPath=4" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('kat04','','http://www.yourdomain.com/catalog/images/navigation/04_02.gif',1)"><img name="kat04" border="0" src="http://www.yourdomain.com/catalog/images/navigation/04_01.gif" width="96" height="81"></a></td>

<td align="center" class="boxText" height="81"><a href="http://www.yourdomain.com/catalog/default.php?cPath=5" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('kat05','','http://www.yourdomain.com/catalog/images/navigation/05_02.gif',1)"><img name="kat05" border="0" src="http://www.yourdomain.com/catalog/images/navigation/05_01.gif" width="97" height="81"></a></td>

<td align="center" class="boxText" height="81"><a href="http://www.yourdomain.com/catalog/default.php?cPath=6" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('kat06','','http://www.yourdomain.com/catalog/images/navigation/06_02.gif',1)"><img name="kat06" border="0" src="http://www.yourdomain.com/catalog/images/navigation/06_01.gif" width="98" height="81"></a></td>

<td align="center" class="boxText" height="81"><a href="http://www.yourdomain.com/catalog/default.php?cPath=7" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('kat07','','http://www.yourdomain.com/catalog/images/navigation/07_02.gif',1)"><img name="kat07" border="0" src="http://www.yourdomain.com/catalog/images/navigation/07_01.gif" width="92" height="81"></a></td>

<td align="center" class="boxText" height="81"><a href="http://www.yourdomain.com/catalog/default.php?cPath=8" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('kat08','','http://www.yourdomain.com/catalog/images/navigation/08_02.gif',1)"><img name="kat08" border="0" src="http://www.yourdomain.com/catalog/images/navigation/08_01.gif" width="91" height="81"></a></td>

</tr>

<tr>

<td align="center" class="boxText" height="24">  <a href="http://www.yourdomain.com/catalog/default.php?cPath=1" ><b>Str?u?e</b></a>  </td>

<td align="center" class="boxText" height="24">  <a href="http://www.yourdomain.com/catalog/default.php?cPath=2" >Sonnenblumen</a>  </td>

<td align="center" class="boxText" height="24">  <a href="http://www.yourdomain.com/catalog/default.php?cPath=3" >X-Mas</a>  </td>

<td align="center" class="boxText" height="24">  <a href="http://www.yourdomain.com/catalog/default.php?cPath=4" >Deko-Trends</a>  </td>

<td align="center" class="boxText" height="24">  <a href="http://www.yourdomain.com/catalog/default.php?cPath=5" >Topfpflanzen</a>  </td>

<td align="center" class="boxText" height="24">  <a href="http://www.yourdomain.com/catalog/default.php?cPath=6" >Greenery</a>  </td>

<td align="center" class="boxText" height="24">  <a href="http://www.yourdomain.com/catalog/default.php?cPath=7" >Bl?ten</a>  </td>

<td align="center" class="boxText" height="24">  <a href="http://www.yourdomain.com/catalog/default.php?cPath=8" >Neuheiten</a>  </td>

</tr>

 

</table>

 

 

</td>

</tr>

</table>

 

<!-- end header with mouse over 8 kategories //-->

just create...and sell..sell...sell.....

Link to comment
Share on other sites

icon,

 

It can be done!

 

I don't know PHP or osCommerce well but I wanted to do exactly the same thing. I can only tell you the logic and you'll have to work it out or wait until I've done my header.php. I did modify the logoff page so that it now goes to respective languages log off page. So the logic is same here.

 

You will need to create header.php in the separate language folder (English, Spanish etc) and modify the osCommerce/includes/header.php as your main header.php file.

 

If you are lost, just have a look at an example like login page.

There are two files:

osCommerce/includes/login.php AND

osCommerce/includes/languages/English/login.php

 

AG

 

good idea... i will try that today...and i will tell u if i 'll makeit

Link to comment
Share on other sites

Forgot to say, the key is also to add the following just before the html code starts. FILENAME_HEADER can be added in the file (includes/application_top.php)

 

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

?>

<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">

<html <?php echo HTML_PARAMS; ?>>

<head>

 

 

:P :P It works... yeah :P :P

 

first i put next phrase to aplication_top.php

 

// define the filenames used in the project

define('FILENAME_HEADER','lang_header.php');

 

Second i create lang_header.php in all languages directories english,spanish etc and i copy there the next code ....

 

--- for english iam using images as it seems but for other languages i change the name of images ending with (gr) for greek , (sp) for spanish etc for having different images depend on current language.!!

---

 

<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">

<html <?php echo HTML_PARAMS; ?>>

<script language="JavaScript">

<!--

function MM_swapImgRestore() { //v3.0

var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a)&&x.oSrc;i++) x.src=x.oSrc;

}

 

function MM_preloadImages() { //v3.0

var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();

var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)

if (a.indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a;}}

}

 

function MM_findObj(n, d) { //v4.0

var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {

d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}

if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[n];

for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers.document);

if(!x && document.getElementById) x=document.getElementById(n); return x;

}

 

function MM_swapImage() { //v3.0

var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)

if ((x=MM_findObj(a))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}

}

//-->

</script>

<BODY LEFTMARGIN="0" TOPMARGIN="0" ONLOAD="MM_preloadImages('images/rm2.jpg','images/rm3.jpg','images/rm4.jpg','images/rm5.jpg','images/rm6.jpg','images/rm7.jpg','images/rm8.jpg')">

<table width="100%" border="0" cellpadding="0" cellspacing="0" height="23%"> <tr>

<td valign="top" rowspan="3" background="images/l_bg.jpg" width="9">  </td><td valign="top" width="744" HEIGHT="180"><img src="images/top.jpg" border="0" width="744" height="122" alt=""><br>

<img src="images/name.jpg" border="0" width="237" height="66" alt=""><img src="images/c2.jpg" border="0" width="507" height="66" alt=""></td><td valign="top" rowspan="3" background="images/r_bg.jpg" width="9">  </td><td valign="top" rowspan="3" background="images/r.jpg" width="50%"> </td></tr>

<tr> <td valign="top" width="744" HEIGHT="74"><P><A HREF="#" ONMOUSEOUT="MM_swapImgRestore()" ONMOUSEOVER="MM_swapImage('Image10','','images/rm2.jpg',1)"><IMG NAME="Image10" BORDER="0" SRC="images/m2.jpg" WIDTH="138" HEIGHT="52"></A><A HREF="#" ONMOUSEOUT="MM_swapImgRestore()" ONMOUSEOVER="MM_swapImage('Image11','','images/rm3.jpg',1)"><IMG NAME="Image11" BORDER="0" SRC="images/m3.jpg" WIDTH="99" HEIGHT="52"></A><A HREF="#" ONMOUSEOUT="MM_swapImgRestore()" ONMOUSEOVER="MM_swapImage('Image12','','images/rm4.jpg',1)"><IMG NAME="Image12" BORDER="0" SRC="images/m4.jpg" WIDTH="84" HEIGHT="52"></A><A HREF="#" ONMOUSEOUT="MM_swapImgRestore()" ONMOUSEOVER="MM_swapImage('Image13','','images/rm5.jpg',1)"><IMG NAME="Image13" BORDER="0" SRC="images/m5.jpg" WIDTH="89" HEIGHT="52"></A><A HREF="#" ONMOUSEOUT="MM_swapImgRestore()" ONMOUSEOVER="MM_swapImage('Image14','','images/rm6.jpg',1)"><IMG NAME="Image14" BORDER="0" SRC="images/m6.jpg" WIDTH="86" HEIGHT="52"></A><A HREF="#" ONMOUSEOUT="MM_swapImgRestore()" ONMOUSEOVER="MM_swapImage('Image15','','images/rm7.jpg',1)"><IMG NAME="Image15" BORDER="0" SRC="images/m7.jpg" WIDTH="104" HEIGHT="52"></A><A HREF="#" ONMOUSEOUT="MM_swapImgRestore()" ONMOUSEOVER="MM_swapImage('Image16','','images/rm8.jpg',1)"><IMG NAME="Image16" BORDER="0" SRC="images/m8.jpg" WIDTH="144" HEIGHT="52"></A><table border="0" width="100%" cellspacing="0" cellpadding="0" HEIGHT="1">

<tr class="header"> <P> </P><td valign="middle" HEIGHT="1" WIDTH="12%">

 

<?php //echo tep_image(DIR_WS_IMAGES . 'oscommerce.gif', 'osCommerce');

?> </td><td align="right" valign="bottom" HEIGHT="1" WIDTH="44%"> <?php

if ($HTTP_GET_VARS['error_message'] != '') {

?> <?php echo urldecode($HTTP_GET_VARS['error_message']); ?><?php

}

 

if ($HTTP_GET_VARS['info_message'] != '') {

?><?php echo $HTTP_GET_VARS['info_message']; ?><?php

}

?> </td><td align="right" valign="bottom" HEIGHT="1" WIDTH="44%"><?php //echo '<a href="' . tep_href_link(FILENAME_ACCOUNT, '', 'SSL') . '">' . tep_image(DIR_WS_IMAGES . 'header_account.gif', HEADER_TITLE_MY_ACCOUNT) . '</a>  <a href="' . tep_href_link(FILENAME_SHOPPING_CART, '', 'NONSSL') . '">' . tep_image(DIR_WS_IMAGES . 'header_cart.gif', HEADER_TITLE_CART_CONTENTS) . '</a>  <a href="' . tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL') . '">' . tep_image(DIR_WS_IMAGES . 'header_checkout.gif', HEADER_TITLE_CHECKOUT) . '</a>';

?></td></tr> </table><table border="0" width="100%" cellspacing="0" cellpadding="0">

</table></table>

 

 

next after this core

 

// check session.auto_start is disabled

if ( (function_exists('ini_get')) && (WARN_SESSION_AUTO_START == 'true') ) {

if (ini_get('session.auto_start') == '1') {

tep_output_warning(WARNING_SESSION_AUTO_START);

}

}

 

in header.php file i put next phrase

 

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

?>

 

and it works perfect....

 

iam still keping rollover images in catalog/images/directory

 

thanks for help

I apriciate

icon greece

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...