View previous topic :: View next topic |
Author |
Message |
gog
Joined: 18 Jun 2004 Posts: 679 Location: zagreb
|
Posted: 02.12.2004 13:31 Post subject: višejezičnosti i php |
|
|
Bio sam siguran da je već bila dosta opširna i zanimljiva tema o implementiranju višejezičnih site-ova u kombinaciji sa PHP-om, pretraživanjem nisam uspio ništa naći pa bih bio zahvalan ako bi me netko uputio na pravi thread.... |
|
|
Back to top |
|
|
retro_one
Joined: 16 Sep 2003 Posts: 880 Location: DUBRAVA.
|
|
Back to top |
|
|
gog
Joined: 18 Jun 2004 Posts: 679 Location: zagreb
|
Posted: 03.12.2004 03:16 Post subject: |
|
|
glup
Ma išao sam searchati višejezični, multilanguage, itd i nije mi ništa pljunuo van, tnx na linku... |
|
|
Back to top |
|
|
silence
Joined: 24 Apr 2004 Posts: 890 Location: .....ni na nebu, ni na zemlji.....
|
Posted: 03.12.2004 04:00 Post subject: |
|
|
evo kak ja to rješavam....
Code: |
if ( !isset ( $_SESSION['jezik'] )) {
session_register("jezik");
$_SESSION['jezik'] = "hr";
} else if ( $_GET['jezik'] ){
$_SESSION['jezik'] = $_GET['jezik'];
}
$jezik = $_SESSION['jezik'];
|
Code: |
$naslov = "naslov".$jezik;
$text = "tekst".$jezik;
|
Code: |
$upit = "SELECT datum, $naslov, $text FROM vijesti WHERE id='1'";
|
možda nije najelegantnije rješenje, ali je jako lagano za implementirat....
samo kod unosa u bazu treba omogućit da upisuju na kolko god jezika hoće i da držiš izabrani jezik u sessionu....
totalno jednostavno.....naravno ovo je za content.....
za sam layout....
Code: |
<img src="elementi/".$jezik."/header.gif">
|
uglavnom, od kad sam otkrio sessione, zaljubio sam se |
_________________ This End-User License is an agreement between Microsoft Corporation (hereafter referred to as "Microsoft") and you, the end-user (hereafter referred to as "our bitch"). |
|
Back to top |
|
|
che.UP mi3.crew
Joined: 07 Sep 2003 Posts: 2320 Location: zagreb
|
Posted: 03.12.2004 11:41 Post subject: |
|
|
silence wrote: | evo kak ja to rješavam....
Code: |
if ( !isset ( $_SESSION['jezik'] )) {
session_register("jezik");
$_SESSION['jezik'] = "hr";
} else if ( $_GET['jezik'] ){
$_SESSION['jezik'] = $_GET['jezik'];
}
$jezik = $_SESSION['jezik'];
|
|
damn dude,
php.net wrote: | Caution
if you are using $_SESSION (or $HTTP_SESSION_VARS), do not use session_register(), session_is_registered(), and session_unregister(). |
|
_________________ UP | TypeTester | Accommodations App
Meni u Firefox-u ne radi AJAX |
|
Back to top |
|
|
silence
Joined: 24 Apr 2004 Posts: 890 Location: .....ni na nebu, ni na zemlji.....
|
Posted: 05.12.2004 05:11 Post subject: |
|
|
che.UP wrote: |
damn dude,
php.net wrote: | Caution
if you are using $_SESSION (or $HTTP_SESSION_VARS), do not use session_register(), session_is_registered(), and session_unregister(). |
|
ekčli....EDIT ::
Quote: | If you are using $_SESSION and disable register_globals, do not use session_register(), session_is_registered() and session_unregister(), if your scripts shall work in PHP 4.2 and earlier. You can use these functions in 4.3 and later.
If you enable register_globals, session_unregister() should be used since session variables are registered as global variables when session data is deserialized. Disabling register_globals is recommended for both security and performance reasons.
] |
|
_________________ This End-User License is an agreement between Microsoft Corporation (hereafter referred to as "Microsoft") and you, the end-user (hereafter referred to as "our bitch"). |
|
Back to top |
|
|
silence
Joined: 24 Apr 2004 Posts: 890 Location: .....ni na nebu, ni na zemlji.....
|
Posted: 05.12.2004 05:18 Post subject: |
|
|
ovo je sa zadnjeg php manuala koji sam skinuo prije par dana..idem baš na php.net pogledat, sad si me zaintrigirao.... |
_________________ This End-User License is an agreement between Microsoft Corporation (hereafter referred to as "Microsoft") and you, the end-user (hereafter referred to as "our bitch"). |
|
Back to top |
|
|
silence
Joined: 24 Apr 2004 Posts: 890 Location: .....ni na nebu, ni na zemlji.....
|
Posted: 05.12.2004 05:26 Post subject: |
|
|
evo....
Quote: | Before PHP 4.3, if you are using $_SESSION and you have disabled register_globals, don't use session_register(), session_is_registered() or session_unregister(). |
Quote: |
register_globals On On
|
dakle, tam di je to hostano, nema problema.....
baš si mi povuko za jezik
znači za svaki server koji je ima update iznad 4.3 ono nije problem....
dapače...looky at this!!!!!!
Quote: | If you enable register_globals, session_unregister() should be used since session variables are registered as global variables when session data is deserialized. Disabling register_globals is recommended for both security and performance reasons. |
jesam opet nekaj krivo shvatio? (stvarno, ozbiljno te pitam, pošto poštujem one za koje smatram da znaju više, ali morao sam ić provjerit ovo, znam da sam nedavno čitao drugačije).... |
_________________ This End-User License is an agreement between Microsoft Corporation (hereafter referred to as "Microsoft") and you, the end-user (hereafter referred to as "our bitch"). |
|
Back to top |
|
|
|