Re: Multi Lingual Sites

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



listmail@shoan.net wrote:

>
> > Hi again Shoan
> >
> >
> > One way that I have used to separate the HTML from the PHP code is to
> > create HTML snippets and include selected scripts as determined by the
> > QUERY_STRING.
> >
> >   $ifiles = explode('&', $QUERY_STRING);
> >   $urlpath = "http://www.xxx/";; // Or whatever your base URL happens 
> to be
> >   foreach ( $ifiles as $ifile )
> >   {
> >     $ifile = $urlpath.$ifile;
> >     include( $ifile );
> >   }
> >
> >
> >  The selection of HTML snippets can then be controlled by a PHP script
> > that picks out HTML snippets according to the language settings.
> > Also, you can manage the site more easily if you can isolate individual
> > "scriptlets" rather than wading through very long listing.
> > It also lends itself to re-use of HTML code.
> > You could, for example, hold HTML snippets in different directories
> > according to the language and pass the subdirectory in the QueryString
> > as well.
> > It's just a thought.
>
> Could you explain this a little more? maybe with some really small 
> sample code
> (I don't want to take too much of your time.)
>
> Peace,
> Shoan.
>
>
> PHP Data object relational mapping generator - 
> http://www.meta-language.net/
>
>
> *Yahoo! Groups Sponsor*
> ADVERTISEMENT
> click here 
> <http://us.ard.yahoo.com/SIG=1297fl4nk/M=315388.5497957.6576270.3001176/D=groups/S=1705006764:HM/EXP=1097763941/A=2372354/R=0/SIG=12id813k2/*https://www.orchardbank.com/hcs/hcsapplication?pf=PLApply&media=EMYHNL40F21004SS> 
>
>
>
> ------------------------------------------------------------------------
> *Yahoo! Groups Links*
>
>     * To visit your group on the web, go to:
>       http://groups.yahoo.com/group/php-objects/
>        
>     * To unsubscribe from this group, send an email to:
>       php-objects-unsubscribe@yahoogroups.com
>       <mailto:php-objects-unsubscribe@yahoogroups.com?subject=Unsubscribe>
>        
>     * Your use of Yahoo! Groups is subject to the Yahoo! Terms of
>       Service <http://docs.yahoo.com/info/terms/>.
>
>
Hi Shoan

It's no problem at all.

The PHP variable $_SERVER['QUERY_STRING'] (which I think used to be 
$HTTP_SERVER_VARS['QUERY_STRING']  in older versions of PHP) refers all 
of the text following a '?' character in a URL.

For example, in 
"http://cgi.ppltd.plus.com/php/precision/precision.php?index_body.htm&TB=1"; 
the query string reads as "index_body.htm&TB=1".
In this case it is used to tell the "precision.php" script to include 
the file "index_body.htm" after the HTML code embedded in itself that 
displays the headings common to all of the pages on the site.

It also tells the new "instance" of 'precision.php' that the Tab 1 in 
the Tab View is the currently selected one.

'precision.php' then highlights the first tab when it builds the 
"header" section of the page is highlighted and the contents of the rest 
of the page is read word for word from the HTML snippet in "index_body.htm".

Exploding the QUERY_STRING using '&', creates an array of two strings, 
"index_body.htm" and "TB=1".

In the 'precision.php' script, I just look for the string that doesn't 
contain "TB=" and include the HTM file named in the other string.
I did it that way so that the order in which the query string elements 
didn't matter.
As far as the client browser is concerned, the HTML code in 
'index_body.htm' is output as if it seamlessly followed the HTML code in 
the PHP embedded header.

It means that if I amend the page header HTML code embedded in the PHP 
script it will automatically apply to all of the pages in the site.
I only have one copy of the "body" of each page as an HTML snippet.
I don't have to use frames to get this effect as search engines 
generally don't like frames.

To see it in action take a look at www.precisionproductions.com.

If it still doesn't make sense, I can post a full working example on my 
website in a few hours time.

Best wishes

Andy Clark





------------------------ Yahoo! Groups Sponsor --------------------~--> 
Make a clean sweep of pop-up ads. Yahoo! Companion Toolbar.
Now with Pop-Up Blocker. Get it for free!
http://us.click.yahoo.com/L5YrjA/eSIIAA/yQLSAA/saFolB/TM
--------------------------------------------------------------------~-> 

PHP Data object relational mapping generator - http://www.meta-language.net/ 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/php-objects/

<*> To unsubscribe from this group, send an email to:
    php-objects-unsubscribe@yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 




[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Soap]     [Kernel Newbies]     [Yosemite]     [Yosemite Campsites]

  Powered by Linux