Advanced search  

News:

cpg1.5.46 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter recently discovered vulnerabilities. It is important that all users who run version cpg1.5.44 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: Header.php code by language selection  (Read 27585 times)

0 Members and 1 Guest are viewing this topic.

Sebastyne

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 26
Header.php code by language selection
« on: March 01, 2010, 02:27:04 am »

Hello everyone,

I have a problem which I imagine to be an easy fix for people who actually know what they're doing, unlike me. :p I have a bilingual site, which is built as a combination of Joomla, SMF and Coppermine. They are all designed to look alike, and they use the same menu, which I have included in the header.php in Coppermine. Now, what I would like to do, is make the header.php pull the menu code depending on the language the user has selected. I only need a static piece of html pulled into it's place based on the language selection.

Can anyone tell me how I could do this?

To see what I mean, I have the gallery set up here: http://www.theBdoll.com/gallery and the header looks like this on it's own: http://www.thebdoll.com/gallery/include/header.php


Sebbie
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47844
  • aka "GauGau"
    • gaugau.de
Re: Header.php code by language selection
« Reply #1 on: March 01, 2010, 09:15:53 am »

$USER['lang'] contains the language of the current visitor as far as Coppermine is concerned. Use a simple if/then construct for custom menu entries, like
Code: [Select]
<?php
if ($USER['lang'] == 'german') {
    echo 
'Mein Deutsches Menü hier';
} elseif (
$USER['lang'] == 'french') {
    echo 
'mon menu en Francais';
} else {
    echo 
'My default menu here';
}
?>
Logged

Sebastyne

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 26
Re: Header.php code by language selection
« Reply #2 on: March 01, 2010, 10:03:49 am »

$USER['lang'] contains the language of the current visitor as far as Coppermine is concerned. Use a simple if/then construct for custom menu entries, like
Code: [Select]
<?php
if ($USER['lang'] == 'german') {
    echo 
'Mein Deutsches Menü hier';
} elseif (
$USER['lang'] == 'french') {
    echo 
'mon menu en Francais';
} else {
    echo 
'My default menu here';
}
?>

Fantastic, thank you! :) *cheers*
Logged

Sebastyne

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 26
Re: Header.php code by language selection
« Reply #3 on: March 01, 2010, 10:20:09 am »

That's exactly what I was after, but I'm doing something wrong. It seems to skip the code to the last option, is there a special formatting for the language names that I should take into consideration?
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47844
  • aka "GauGau"
    • gaugau.de
Re: Header.php code by language selection
« Reply #4 on: March 01, 2010, 12:57:22 pm »

You need to take into account the scope: within a function, you need to make $USER global. That's of course not specific to coppermine, but a general PHP requirement.
Post the code you use in your custom menu file.
Try
Code: [Select]
<?php
print_r
($USER);
?>
from within that file.
Logged

Sebastyne

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 26
Re: Header.php code by language selection
« Reply #5 on: March 01, 2010, 10:52:34 pm »

I don't think I put it into the right place - I don't know php much at all, as you can tell. I mostly just edit the html parts in between and sometimes remove bits (very carefully) but that's about it.

Here's what I have so far, without the actual code - in practicality I would only need "If Finnish, show this heading, if something else, show this" now there's one extra step because I wanted to play it safe and get it working before removing stuff.


Code: [Select]
<?php


print_r
($USER);


if (
$USER['lang'] == 'finnish') {
    echo 
'<!----CUSTOM FINNISH TEMPLATE HEADING STARTS HERE----->




  <!----CUSTOM FINNISH TEMPLATE HEADING ENDS HERE----->'
;
} elseif (
$USER['lang'] == 'english_gb') {
    echo 
'<!----CUSTOM BRITTISH ENGLISH TEMPLATE HEADING STARTS HERE----->





  <!----CUSTOM BRITTISH ENGLISH TEMPLATE HEADING ENDS HERE----->'
;
} else {
    echo 
'<!----CUSTOM INTERNATIONAL TEMPLATE HEADING STARTS HERE----->





  <!----CUSTOM NTERNATIONAL TEMPLATE HEADING ENDS HERE----->'
;
}
?>
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47844
  • aka "GauGau"
    • gaugau.de
Re: Header.php code by language selection
« Reply #6 on: March 02, 2010, 10:38:37 am »

Is that supposed to be the code of http://www.thebdoll.com/gallery/include/header.php ?
Obviously not. Post the URL of the code you just refered to where we can see it in action and post how you actually attempt to include it into your gallery.
Logged

Sebastyne

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 26
Re: Header.php code by language selection
« Reply #7 on: March 02, 2010, 01:24:40 pm »

Is that supposed to be the code of http://www.thebdoll.com/gallery/include/header.php ?
Obviously not. Post the URL of the code you just refered to where we can see it in action and post how you actually attempt to include it into your gallery.

No that's it... Well, the stripped down version of it. The code was too long (and pretty confusing) to paste on the forum, so I just took the html out.

It's in action on http://www.thebdoll.com/gallery/ and the one language that should make a difference is Finnish.
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47844
  • aka "GauGau"
    • gaugau.de
Re: Header.php code by language selection
« Reply #8 on: March 02, 2010, 03:32:46 pm »

and post how you actually attempt to include it into your gallery.
Logged

Sebastyne

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 26
Re: Header.php code by language selection
« Reply #9 on: March 03, 2010, 11:48:18 pm »

I'll have to cut it into parts:

Quote
The following error or errors occurred while posting this message:
The message exceeds the maximum allowed length (25000 characters).
Code: [Select]
<?php


print_r
($USER);


if (
$USER['lang'] == 'finnish') {
    echo 
'<!----CUSTOM FINNISH TEMPLATE HEADING STARTS HERE----->

<div id="art-page-background-simple-gradient">
    </div>
    <div id="art-page-background-glare">
        <div id="art-page-background-glare-image"></div>
    </div>
    <div id="art-main">
        <div class="art-Sheet">
            <div class="art-Sheet-tl"></div>
            <div class="art-Sheet-tr"></div>
            <div class="art-Sheet-bl"></div>
            <div class="art-Sheet-br"></div>
            <div class="art-Sheet-tc"></div>
            <div class="art-Sheet-bc"></div>
            <div class="art-Sheet-cl"></div>
            <div class="art-Sheet-cr"></div>
            <div class="art-Sheet-cc"></div>
            <div class="art-Sheet-body">
                <div class="art-Header">
                    <div class="art-Header-jpeg"></div>
                    <div class="art-Logo">
                        <h1 id="name-text" class="art-Logo-name"><a href="#">TheBdoll International</a></h1>
                        <div id="slogan-text" class="art-Logo-text">Where the grown up girls play Barbie</div>
                    </div>
                </div>


<!----START NAVIGATION----->    


                <div class="art-nav">
<div class="l"></div>
<div class="r"></div>
<ul class="art-menu">
<li id="current" class="parent active item71">
<a href="/index.php?option=com_content&amp;view=frontpage&amp;Itemid=71&amp;lang=fi"><span class="l"> </span><span class="r"> </span><span class="t">Koti</span></a><ul><li class="item113"><a href="/index.php?option=com_content&amp;view=article&amp;id=44&amp;Itemid=113&amp;lang=fi">About theBdoll.com</a></li><li class="item114"><a href="http://www.thebdoll.com/int/forum/">theBdoll International</a></li></ul></li><li class="parent item88"><a href="/index.php?option=com_content&amp;view=section&amp;layout=blog&amp;id=7&amp;Itemid=88&amp;lang=fi"><span class="l"> </span><span class="r"> </span><span class="t">Jutut</span></a><ul><li class="item74"><a href="/index.php?option=com_content&amp;view=category&amp;layout=blog&amp;id=34&amp;Itemid=74&amp;lang=fi">Kustomointi</a></li><li class="item76"><a href="/index.php?option=com_content&amp;view=category&amp;layout=blog&amp;id=36&amp;Itemid=76&amp;lang=fi">Tunnistus</a></li><li class="item73"><a href="/index.php?option=com_content&amp;view=category&amp;layout=blog&amp;id=41&amp;Itemid=73&amp;lang=fi">Keräilijät</a></li><li class="item75"><a href="/index.php?option=com_content&amp;view=category&amp;layout=blog&amp;id=40&amp;Itemid=75&amp;lang=fi">Yleistä</a></li><li class="item72"><a href="/index.php?option=com_content&amp;view=category&amp;layout=blog&amp;id=38&amp;Itemid=72&amp;lang=fi">Keräily</a></li></ul></li><li class="parent item94"><a href="/index.php?option=com_phocagallery&amp;view=categories&amp;Itemid=94&amp;lang=fi"><span class="l"> </span><span class="r"> </span><span class="t">Barbiet</span></a><ul><li class="parent item85"><a href="http://www.thebdoll.com/forum/index.php?board=2.0">Myytävänä</a><ul><li class="item109"><a href="http://www.thebdoll.com/htmlpages/ebay-uk.html">for Sale on eBay UK</a></li><li class="item110"><a href="http://www.thebdoll.com/htmlpages/ebay-au.html">for sale on eBay Australia</a></li></ul></li><li class="parent item84"><a href="/index.php?option=com_sobi2&amp;catid=0&amp;Itemid=84&amp;lang=fi">Tunnistus</a><ul><li class="item89"><a href="/index.php?option=com_sobi2&amp;catid=16&amp;Itemid=89&amp;lang=fi">Tuntemattomat</a></li><li class="item90"><a href="http://www.thebdoll.com/index.php?option=com_sobi2&amp;sobi2Task=addNew&amp;Itemid=65&amp;itemetype=IDGuide">Lisää kohde</a></li><li class="item91"><a href="/index.php?option=com_sobi2&amp;sobi2Task=search&amp;catid=0&amp;Itemid=91&amp;lang=fi">Etsi nukke</a></li><li class="item92"><a href="/index.php?option=com_sobi2&amp;sobi2Task=usersListing&amp;catid=0&amp;Itemid=92&amp;lang=fi">Omat listaukset</a></li><li class="item97"><a href="/index.php?option=com_phocagallery&amp;view=category&amp;id=1&amp;Itemid=97&amp;lang=fi">Päämuotit (tytöt)</a></li><li class="item98"><a href="/index.php?option=com_phocagallery&amp;view=category&amp;id=2&amp;Itemid=98&amp;lang=fi">Päämuotit (pojat)</a></li><li class="item102"><a href="/index.php?option=com_sobi2&amp;sobi2Task=showNew&amp;catid=0&amp;Itemid=102&amp;lang=fi">Viimeiset lisäykset</a></li><li class="item103"><a href="/index.php?option=com_sobi2&amp;sobi2Task=updated&amp;catid=0&amp;Itemid=103&amp;lang=fi">Viimeksi päivitetyt</a></li><li class="item104"><a href="/index.php?option=com_sobi2&amp;sobi2Task=popularListing&amp;catid=0&amp;Itemid=104&amp;lang=fi">Suosituimmat</a></li></ul></li></ul></li><li class="parent item93"><a href="/index.php?option=com_comprofiler&amp;task=userslist&amp;listid=4&amp;searchmode=&amp;Itemid=93&amp;lang=fi"><span class="l"> </span><span class="r"> </span><span class="t">Ihmiset</span></a><ul><li class="item87"><a href="/index.php?option=com_seminar&amp;Itemid=87&amp;lang=fi">Tapahtumat</a></li><li class="item99"><a href="/index.php?option=com_comprofiler&amp;Itemid=99&amp;lang=fi">Oma profiili</a></li><li class="item106"><a href="/index.php?option=com_alphauserpoints&amp;view=account&amp;Itemid=106&amp;lang=fi">Omat Pisteet</a></li><li class="item111"><a href="/administrator/">administrator</a></li></ul></li><li class="parent item100"><a href="/index.php?option=com_weblinks&amp;view=categories&amp;Itemid=100&amp;lang=fi"><span class="l"> </span><span class="r"> </span><span class="t">Linkit</span></a><ul><li class="item101"><a href="/index.php?option=com_weblinks&amp;view=weblink&amp;layout=form&amp;Itemid=101&amp;lang=fi">Lisää Linkki</a></li></ul></li><li class="item82"><a href="http://www.theBdoll.com/forum/" ><span class="l"> </span><span class="r"> </span><span class="t">Keskustelu</span></a></li><li class="item83"><a href="http://www.theBdoll.com/gallery/" class="active"><span class="l"> </span><span class="r"> </span><span class="t">Kuvat</span></a></li><li class="item108"><a href="/index.php?option=com_contact&amp;view=contact&amp;id=2&amp;Itemid=108&amp;lang=fi"><span class="l"> </span><span class="r"> </span><span class="t">Ota yhteytt&auml;</span></a></li></ul></div>




<!----ENDING NAVIGATION----->    




                <div class="art-contentLayout">
             






   <!----BEGINNING OF PROJECT WONDERFUL BOX----->       
             

<center>

<table width="100%" border="0" align="center" cellpadding="0" bgcolor="#7a803b">
  <tr><td align="center" valign="middle">

<!-- Beginning of Project Wonderful ad code: -->
<!-- Ad box ID: 45554 -->
<script type="text/javascript">
<!--
var pw_d=document;
pw_d.projectwonderful_adbox_id = "45554";
pw_d.projectwonderful_adbox_type = "2";
pw_d.projectwonderful_foreground_color = "";
pw_d.projectwonderful_background_color = "";
//-->
</script>
<script type="text/javascript" src="http://www.projectwonderful.com/ad_display.js"></script>
<noscript><map name="admap45554" id="admap45554"><area href="http://www.projectwonderful.com/out_nojs.php?r=0&amp;c=0&amp;id=45554&amp;type=2" shape="rect" coords="0,0,117,30" title="" alt="" target="_blank" /><area href="http://www.projectwonderful.com/out_nojs.php?r=0&amp;c=1&amp;id=45554&amp;type=2" shape="rect" coords="137,0,254,30" title="" alt="" target="_blank" /><area href="http://www.projectwonderful.com/out_nojs.php?r=0&amp;c=2&amp;id=45554&amp;type=2" shape="rect" coords="274,0,391,30" title="" alt="" target="_blank" /><area href="http://www.projectwonderful.com/out_nojs.php?r=0&amp;c=3&amp;id=45554&amp;type=2" shape="rect" coords="411,0,528,30" title="" alt="" target="_blank" /><area href="http://www.projectwonderful.com/out_nojs.php?r=0&amp;c=4&amp;id=45554&amp;type=2" shape="rect" coords="548,0,665,30" title="" alt="" target="_blank" /></map>
<table cellpadding="0" border="0" cellspacing="0" width="685" bgcolor=""><tr><td><img src="http://www.projectwonderful.com/nojs.php?id=45554&amp;type=2" width="685" height="33" usemap="#admap45554" border="0" alt="" /></td></tr></table>
</noscript>

<!-- End of Project Wonderful ad code. -->

</td>
    <td align="center" valign="middle"><span class="art-page-footer"><a href="https://www.projectwonderful.com/advertisehere.php?id=45554&type=2">Advertise here for <script type="text/javascript" src="http://www.projectwonderful.com/mycurrentbidrate.php?id=45554"></script> a day</a></span></td>
  </tr></table>

</center>

             <!-----END OF PROJECTWONDERFUL BOX----->







  <!----CUSTOM FINNISH TEMPLATE HEADING ENDS HERE----->'
;




Logged

Sebastyne

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 26
Re: Header.php code by language selection
« Reply #10 on: March 03, 2010, 11:48:40 pm »

Code: [Select]


elseif ($USER['lang'] == 'english_gb') {
    echo '<!----CUSTOM ENGLISH TEMPLATE HEADING STARTS HERE----->

<div id="art-page-background-simple-gradient">

</div>
<div id="art-page-background-glare">
  <div id="art-page-background-glare-image"></div>
</div>
<div id="art-main">
  <div class="art-Sheet">
<div class="art-Sheet-tl"></div>
<div class="art-Sheet-tr"></div>
<div class="art-Sheet-bl"></div>

<div class="art-Sheet-br"></div>
<div class="art-Sheet-tc"></div>
<div class="art-Sheet-bc"></div>
<div class="art-Sheet-cl"></div>
<div class="art-Sheet-cr"></div>
<div class="art-Sheet-cc"></div>
<div class="art-Sheet-body">
<div class="art-Header">
  <div class="art-Header-jpeg"></div>

  <div class="art-Logo">
<h1 id="name-text" class="art-Logo-name"><a href="#">TheBdoll International</a></h1>
<div id="slogan-text" class="art-Logo-text">Where the grown up girls play Barbie</div>
  </div>
</div>
<div class="art-nav"><div class="l"></div><div class="r"></div><ul class="art-menu"><li id="current" class="parent active item71"><a href="/index.php?option=com_content&amp;view=frontpage&amp;Itemid=71&amp;lang=en"><span class="l"> </span><span class="r"> </span><span class="t">Home</span></a><ul><li class="item113"><a href="/index.php?option=com_content&amp;view=article&amp;id=44&amp;Itemid=113&amp;lang=en">About theBdoll.com</a></li><li class="item114"><a href="http://www.thebdoll.com/int/forum/">theBdoll International</a></li></ul></li><li class="parent item88"><a href="/index.php?option=com_content&amp;view=section&amp;layout=blog&amp;id=7&amp;Itemid=88&amp;lang=en"><span class="l"> </span><span class="r"> </span><span class="t">Articles</span></a><ul><li class="item74"><a href="/index.php?option=com_content&amp;view=category&amp;layout=blog&amp;id=34&amp;Itemid=74&amp;lang=en">Customising</a></li><li class="item76"><a href="/index.php?option=com_content&amp;view=category&amp;layout=blog&amp;id=36&amp;Itemid=76&amp;lang=en">Identification</a></li><li class="item73"><a href="/index.php?option=com_content&amp;view=category&amp;layout=blog&amp;id=41&amp;Itemid=73&amp;lang=en">Collectors</a></li><li class="item75"><a href="/index.php?option=com_content&amp;view=category&amp;layout=blog&amp;id=40&amp;Itemid=75&amp;lang=en">General</a></li><li class="item72"><a href="/index.php?option=com_content&amp;view=category&amp;layout=blog&amp;id=38&amp;Itemid=72&amp;lang=en">Collecting</a></li></ul></li><li class="parent item94"><a href="/index.php?option=com_phocagallery&amp;view=categories&amp;Itemid=94&amp;lang=en"><span class="l"> </span><span class="r"> </span><span class="t">Barbie dolls</span></a><ul><li class="parent item85"><a href="http://www.thebdoll.com/forum/index.php?board=2.0">For Sale</a><ul><li class="item109"><a href="http://www.thebdoll.com/htmlpages/ebay-uk.html">for Sale on eBay UK</a></li><li class="item110"><a href="http://www.thebdoll.com/htmlpages/ebay-au.html">for sale on eBay Australia</a></li></ul></li><li class="parent item84"><a href="/index.php?option=com_sobi2&amp;catid=0&amp;Itemid=84&amp;lang=en">ID Guide</a><ul><li class="item89"><a href="/index.php?option=com_sobi2&amp;catid=16&amp;Itemid=89&amp;lang=en">Unknown</a></li><li class="item90"><a href="http://www.thebdoll.com/index.php?option=com_sobi2&amp;sobi2Task=addNew&amp;Itemid=65&amp;itemetype=IDGuide">Add a doll</a></li><li class="item91"><a href="/index.php?option=com_sobi2&amp;sobi2Task=search&amp;catid=0&amp;Itemid=91&amp;lang=en">Search a doll</a></li><li class="item92"><a href="/index.php?option=com_sobi2&amp;sobi2Task=usersListing&amp;catid=0&amp;Itemid=92&amp;lang=en">My listings</a></li><li class="item97"><a href="/index.php?option=com_phocagallery&amp;view=category&amp;id=1&amp;Itemid=97&amp;lang=en">Female face sculpts</a></li><li class="item98"><a href="/index.php?option=com_phocagallery&amp;view=category&amp;id=2&amp;Itemid=98&amp;lang=en">Male head sculpts</a></li><li class="item102"><a href="/index.php?option=com_sobi2&amp;sobi2Task=showNew&amp;catid=0&amp;Itemid=102&amp;lang=en">Latest entries</a></li><li class="item103"><a href="/index.php?option=com_sobi2&amp;sobi2Task=updated&amp;catid=0&amp;Itemid=103&amp;lang=en">Recently updated</a></li><li class="item104"><a href="/index.php?option=com_sobi2&amp;sobi2Task=popularListing&amp;catid=0&amp;Itemid=104&amp;lang=en">Most popular entries</a></li></ul></li></ul></li><li class="parent item93"><a href="/index.php?option=com_comprofiler&amp;task=userslist&amp;listid=4&amp;searchmode=&amp;Itemid=93&amp;lang=en"><span class="l"> </span><span class="r"> </span><span class="t">People</span></a><ul><li class="item87"><a href="/index.php?option=com_seminar&amp;Itemid=87&amp;lang=en">Events</a></li><li class="item99"><a href="/index.php?option=com_comprofiler&amp;Itemid=99&amp;lang=en">My Profile</a></li><li class="item106"><a href="/index.php?option=com_alphauserpoints&amp;view=account&amp;Itemid=106&amp;lang=en">My Points</a></li><li class="item111"><a href="/administrator/">administrator</a></li></ul></li><li class="parent item100"><a href="/index.php?option=com_weblinks&amp;view=categories&amp;Itemid=100&amp;lang=en"><span class="l"> </span><span class="r"> </span><span class="t">Links</span></a><ul><li class="item101"><a href="/index.php?option=com_weblinks&amp;view=weblink&amp;layout=form&amp;Itemid=101&amp;lang=en">Add a link</a></li></ul></li><li class="item82"><a href="http://www.theBdoll.com/int/forum/"><span class="l"> </span><span class="r"> </span><span class="t">Forum</span></a></li><li class="item83"><a href="http://www.theBdoll.com/gallery/" class="active"><span class="l"> </span><span class="r"> </span><span class="t">Gallery</span></a></li><li class="item108"><a href="/index.php?option=com_contact&amp;view=contact&amp;id=2&amp;Itemid=108&amp;lang=en"><span class="l"> </span><span class="r"> </span><span class="t">Contact us</span></a></li></ul></div>

<div class="art-contentLayout">







<!----BEGINNING OF PROJECT WONDERFUL BOX----->


<center>

<table width="100%" border="0" align="center" cellpadding="0" bgcolor="#7a803b">
  <tr><td align="center" valign="middle">

<!-- Beginning of Project Wonderful ad code: -->
<!-- Ad box ID: 45554 -->
<script type="text/javascript">
<!--
var pw_d=document;
pw_d.projectwonderful_adbox_id = "45554";
pw_d.projectwonderful_adbox_type = "2";
pw_d.projectwonderful_foreground_color = "";
pw_d.projectwonderful_background_color = "";
//-->
</script>
<script type="text/javascript" src="http://www.projectwonderful.com/ad_display.js"></script>

<noscript><map name="admap45554" id="admap45554"><area href="http://www.projectwonderful.com/out_nojs.php?r=0&amp;c=0&amp;id=45554&amp;type=2" shape="rect" coords="0,0,117,30" title="" alt="" target="_blank" /><area href="http://www.projectwonderful.com/out_nojs.php?r=0&amp;c=1&amp;id=45554&amp;type=2" shape="rect" coords="137,0,254,30" title="" alt="" target="_blank" /><area href="http://www.projectwonderful.com/out_nojs.php?r=0&amp;c=2&amp;id=45554&amp;type=2" shape="rect" coords="274,0,391,30" title="" alt="" target="_blank" /><area href="http://www.projectwonderful.com/out_nojs.php?r=0&amp;c=3&amp;id=45554&amp;type=2" shape="rect" coords="411,0,528,30" title="" alt="" target="_blank" /><area href="http://www.projectwonderful.com/out_nojs.php?r=0&amp;c=4&amp;id=45554&amp;type=2" shape="rect" coords="548,0,665,30" title="" alt="" target="_blank" /></map>
<table cellpadding="0" border="0" cellspacing="0" width="685" bgcolor=""><tr><td><img src="http://www.projectwonderful.com/nojs.php?id=45554&amp;type=2" width="685" height="33" usemap="#admap45554" border="0" alt="" /></td></tr></table>
</noscript>
<!-- End of Project Wonderful ad code. -->

</td>
<td align="center" valign="middle"><span class="art-page-footer"><a href="https://www.projectwonderful.com/advertisehere.php?id=45554&type=2">Advertise here for <script type="text/javascript" src="http://www.projectwonderful.com/mycurrentbidrate.php?id=45554"></script> a day</a></span></td>
  </tr></table>

</center>

<!-----END OF PROJECTWONDERFUL BOX----->







  <!----CUSTOM TEMPLATE HEADING ENDS HERE----->';
}




Logged

Sebastyne

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 26
Re: Header.php code by language selection
« Reply #11 on: March 03, 2010, 11:49:03 pm »

Code: [Select]



 else {
    echo '<!----CUSTOM ENGLISH TEMPLATE HEADING STARTS HERE----->

<div id="art-page-background-simple-gradient">

</div>
<div id="art-page-background-glare">
  <div id="art-page-background-glare-image"></div>
</div>
<div id="art-main">
  <div class="art-Sheet">
<div class="art-Sheet-tl"></div>
<div class="art-Sheet-tr"></div>
<div class="art-Sheet-bl"></div>

<div class="art-Sheet-br"></div>
<div class="art-Sheet-tc"></div>
<div class="art-Sheet-bc"></div>
<div class="art-Sheet-cl"></div>
<div class="art-Sheet-cr"></div>
<div class="art-Sheet-cc"></div>
<div class="art-Sheet-body">
<div class="art-Header">
  <div class="art-Header-jpeg"></div>

  <div class="art-Logo">
<h1 id="name-text" class="art-Logo-name"><a href="#">TheBdoll International</a></h1>
<div id="slogan-text" class="art-Logo-text">Where the grown up girls play Barbie</div>
  </div>
</div>
<div class="art-nav"><div class="l"></div><div class="r"></div><ul class="art-menu"><li id="current" class="parent active item71"><a href="/index.php?option=com_content&amp;view=frontpage&amp;Itemid=71&amp;lang=en"><span class="l"> </span><span class="r"> </span><span class="t">Home</span></a><ul><li class="item113"><a href="/index.php?option=com_content&amp;view=article&amp;id=44&amp;Itemid=113&amp;lang=en">About theBdoll.com</a></li><li class="item114"><a href="http://www.thebdoll.com/int/forum/">theBdoll International</a></li></ul></li><li class="parent item88"><a href="/index.php?option=com_content&amp;view=section&amp;layout=blog&amp;id=7&amp;Itemid=88&amp;lang=en"><span class="l"> </span><span class="r"> </span><span class="t">Articles</span></a><ul><li class="item74"><a href="/index.php?option=com_content&amp;view=category&amp;layout=blog&amp;id=34&amp;Itemid=74&amp;lang=en">Customising</a></li><li class="item76"><a href="/index.php?option=com_content&amp;view=category&amp;layout=blog&amp;id=36&amp;Itemid=76&amp;lang=en">Identification</a></li><li class="item73"><a href="/index.php?option=com_content&amp;view=category&amp;layout=blog&amp;id=41&amp;Itemid=73&amp;lang=en">Collectors</a></li><li class="item75"><a href="/index.php?option=com_content&amp;view=category&amp;layout=blog&amp;id=40&amp;Itemid=75&amp;lang=en">General</a></li><li class="item72"><a href="/index.php?option=com_content&amp;view=category&amp;layout=blog&amp;id=38&amp;Itemid=72&amp;lang=en">Collecting</a></li></ul></li><li class="parent item94"><a href="/index.php?option=com_phocagallery&amp;view=categories&amp;Itemid=94&amp;lang=en"><span class="l"> </span><span class="r"> </span><span class="t">Barbie dolls</span></a><ul><li class="parent item85"><a href="http://www.thebdoll.com/forum/index.php?board=2.0">For Sale</a><ul><li class="item109"><a href="http://www.thebdoll.com/htmlpages/ebay-uk.html">for Sale on eBay UK</a></li><li class="item110"><a href="http://www.thebdoll.com/htmlpages/ebay-au.html">for sale on eBay Australia</a></li></ul></li><li class="parent item84"><a href="/index.php?option=com_sobi2&amp;catid=0&amp;Itemid=84&amp;lang=en">ID Guide</a><ul><li class="item89"><a href="/index.php?option=com_sobi2&amp;catid=16&amp;Itemid=89&amp;lang=en">Unknown</a></li><li class="item90"><a href="http://www.thebdoll.com/index.php?option=com_sobi2&amp;sobi2Task=addNew&amp;Itemid=65&amp;itemetype=IDGuide">Add a doll</a></li><li class="item91"><a href="/index.php?option=com_sobi2&amp;sobi2Task=search&amp;catid=0&amp;Itemid=91&amp;lang=en">Search a doll</a></li><li class="item92"><a href="/index.php?option=com_sobi2&amp;sobi2Task=usersListing&amp;catid=0&amp;Itemid=92&amp;lang=en">My listings</a></li><li class="item97"><a href="/index.php?option=com_phocagallery&amp;view=category&amp;id=1&amp;Itemid=97&amp;lang=en">Female face sculpts</a></li><li class="item98"><a href="/index.php?option=com_phocagallery&amp;view=category&amp;id=2&amp;Itemid=98&amp;lang=en">Male head sculpts</a></li><li class="item102"><a href="/index.php?option=com_sobi2&amp;sobi2Task=showNew&amp;catid=0&amp;Itemid=102&amp;lang=en">Latest entries</a></li><li class="item103"><a href="/index.php?option=com_sobi2&amp;sobi2Task=updated&amp;catid=0&amp;Itemid=103&amp;lang=en">Recently updated</a></li><li class="item104"><a href="/index.php?option=com_sobi2&amp;sobi2Task=popularListing&amp;catid=0&amp;Itemid=104&amp;lang=en">Most popular entries</a></li></ul></li></ul></li><li class="parent item93"><a href="/index.php?option=com_comprofiler&amp;task=userslist&amp;listid=4&amp;searchmode=&amp;Itemid=93&amp;lang=en"><span class="l"> </span><span class="r"> </span><span class="t">People</span></a><ul><li class="item87"><a href="/index.php?option=com_seminar&amp;Itemid=87&amp;lang=en">Events</a></li><li class="item99"><a href="/index.php?option=com_comprofiler&amp;Itemid=99&amp;lang=en">My Profile</a></li><li class="item106"><a href="/index.php?option=com_alphauserpoints&amp;view=account&amp;Itemid=106&amp;lang=en">My Points</a></li><li class="item111"><a href="/administrator/">administrator</a></li></ul></li><li class="parent item100"><a href="/index.php?option=com_weblinks&amp;view=categories&amp;Itemid=100&amp;lang=en"><span class="l"> </span><span class="r"> </span><span class="t">Links</span></a><ul><li class="item101"><a href="/index.php?option=com_weblinks&amp;view=weblink&amp;layout=form&amp;Itemid=101&amp;lang=en">Add a link</a></li></ul></li><li class="parent item82"><a href="http://www.theBdoll.com/int/forum/"><span class="l"> </span><span class="r"> </span><span class="t">Forum</span></a><ul><li class="item115"><a href="http://www.thebdoll.com/forum/">Finnish Forum</a></li></ul></li><li class="item83"><a href="http://www.theBdoll.com/gallery/" class="active"><span class="l"> </span><span class="r"> </span><span class="t">Gallery</span></a></li><li class="item108"><a href="/index.php?option=com_contact&amp;view=contact&amp;id=2&amp;Itemid=108&amp;lang=en"><span class="l"> </span><span class="r"> </span><span class="t">Contact us</span></a></li></ul></div>


<div class="art-contentLayout">







<!----BEGINNING OF PROJECT WONDERFUL BOX----->


<center>

<table width="100%" border="0" align="center" cellpadding="0" bgcolor="#7a803b">
  <tr><td align="center" valign="middle">

<!-- Beginning of Project Wonderful ad code: -->
<!-- Ad box ID: 45554 -->
<script type="text/javascript">
<!--
var pw_d=document;
pw_d.projectwonderful_adbox_id = "45554";
pw_d.projectwonderful_adbox_type = "2";
pw_d.projectwonderful_foreground_color = "";
pw_d.projectwonderful_background_color = "";
//-->
</script>
<script type="text/javascript" src="http://www.projectwonderful.com/ad_display.js"></script>

<noscript><map name="admap45554" id="admap45554"><area href="http://www.projectwonderful.com/out_nojs.php?r=0&amp;c=0&amp;id=45554&amp;type=2" shape="rect" coords="0,0,117,30" title="" alt="" target="_blank" /><area href="http://www.projectwonderful.com/out_nojs.php?r=0&amp;c=1&amp;id=45554&amp;type=2" shape="rect" coords="137,0,254,30" title="" alt="" target="_blank" /><area href="http://www.projectwonderful.com/out_nojs.php?r=0&amp;c=2&amp;id=45554&amp;type=2" shape="rect" coords="274,0,391,30" title="" alt="" target="_blank" /><area href="http://www.projectwonderful.com/out_nojs.php?r=0&amp;c=3&amp;id=45554&amp;type=2" shape="rect" coords="411,0,528,30" title="" alt="" target="_blank" /><area href="http://www.projectwonderful.com/out_nojs.php?r=0&amp;c=4&amp;id=45554&amp;type=2" shape="rect" coords="548,0,665,30" title="" alt="" target="_blank" /></map>
<table cellpadding="0" border="0" cellspacing="0" width="685" bgcolor=""><tr><td><img src="http://www.projectwonderful.com/nojs.php?id=45554&amp;type=2" width="685" height="33" usemap="#admap45554" border="0" alt="" /></td></tr></table>
</noscript>
<!-- End of Project Wonderful ad code. -->

</td>
<td align="center" valign="middle"><span class="art-page-footer"><a href="https://www.projectwonderful.com/advertisehere.php?id=45554&type=2">Advertise here for <script type="text/javascript" src="http://www.projectwonderful.com/mycurrentbidrate.php?id=45554"></script> a day</a></span></td>
  </tr></table>
</center>
<!-----END OF PROJECTWONDERFUL BOX----->
  <!----CUSTOM TEMPLATE HEADING ENDS HERE----->';
}
?>
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47844
  • aka "GauGau"
    • gaugau.de
Re: Header.php code by language selection
« Reply #12 on: March 04, 2010, 07:47:15 am »

Your previous postings do not answer my question
post how you actually attempt to include it into your gallery.
Please specify how you include the file http://www.thebdoll.com/gallery/include/header.php, i.e. in what line of coppermine's core code you perform the include. If you're using the custom header include feature in coppermine's config, please attach a screenshot of the corresponding section to your next posting.

I'll have to cut it into parts
Hehe, no: in the future, just rename foobar.php to foobar.php.txt or put the file you want to post into a zip archive. Then attach it to your posting - that's fine. The supporters here are used to that.

Anyway, your approach looks OK (although a bit complicated). Here are some explanations: the dev team is using American English as default, so English (US) is represented by english.php, while British English is represented by english_gb.php. Most browsers will default to US English, and you haven't specified a default case. That's why I suggest that you do the following:
Code: [Select]
<?php
global $USER;

if (
$USER['lang'] == 'finnish') {
    echo <<< EOT
<!----CUSTOM FINNISH TEMPLATE HEADING STARTS HERE----->
...
<!----CUSTOM FINNISH TEMPLATE HEADING ENDS HERE----->
EOT;
} else {
    echo <<< EOT
<!----CUSTOM ENGLISH TEMPLATE HEADING STARTS HERE----->
...
<!----CUSTOM TEMPLATE HEADING ENDS HERE----->
EOT;
}
Logged

Sebastyne

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 26
Re: Header.php code by language selection
« Reply #13 on: March 06, 2010, 03:22:38 am »

I removed the second English option there, as attached, I didn't think you'd go into the nitty gritty of it.  ;D I can always tinker with it after it works as intended. (And return to the first working version if it doesn't.)

The include is the custom header include feature in Coppermine, and it fetches the heading from the correct path, as I haven't added the code anywhere else and it displays it correctly, only doesn't change languages. Anyway, here's the screenshot if I understand what you need...
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47844
  • aka "GauGau"
    • gaugau.de
Re: Header.php code by language selection
« Reply #14 on: March 07, 2010, 09:52:54 am »

What about the global command that I suggested to use above?
Logged

Sebastyne

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 26
Re: Header.php code by language selection
« Reply #15 on: March 08, 2010, 08:48:55 am »

What about the global command that I suggested to use above?

Well, as I said, I don't know php, what I have in the code is what I could gather up from the responses. I have no idea how to implement a "global command" so if it's too much trouble to write down the code as it should be, just tell me and I'll forget the whole thing or wait until I find someone who knows enough to help me out.

Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47844
  • aka "GauGau"
    • gaugau.de
Logged

Sebastyne

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 26
Re: Header.php code by language selection
« Reply #17 on: March 10, 2010, 02:14:34 am »

Such a small piece of code and it makes all the difference. I didn't see it in the earlier code you posted... Hard to keep track when you don't know much of what you're doing in the first place.

Thank you so much for your help and patience - even when I was losing mine (along with my focus)!
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47844
  • aka "GauGau"
    • gaugau.de
Re: Header.php code by language selection
« Reply #18 on: March 10, 2010, 08:45:45 am »

So that fixed your issue? If yes, please resolve your thread as suggested in http://forum.coppermine-gallery.net/index.php/topic,55415.msg270631.html#msg270631
Logged
Pages: [1]   Go Up
 

Page created in 0.034 seconds with 21 queries.