TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 04-17-2008, 02:03 PM   #1 (permalink)
The Contributor
 
Join Date: Jan 2008
Posts: 50
Thanks: 0
khile is on a distinguished road
Default Section

im having a few problems

i want to create a script that can show status to people of a given projects so like this

status.php?check_status_lang=en - displays infomation in the en page
status.php?check_status_lang=de - shows infomation in german

how can i do this what do i needc to put in the status.php to make it show de or en i have querie setup to check infomation just dont know how to put the de or en in a php document and ask it to get it
khile is offline  
Reply With Quote
Old 04-17-2008, 04:20 PM   #2 (permalink)
Orc
The Prestige
 
Orc's Avatar
 
Join Date: Dec 2007
Posts: 1,044
Thanks: 193
Orc is on a distinguished road
Default

ask it to get it? Umm, okay? If you're talking about how to keep it set for the user, just do a session, if you're trying to put the actually words of the language in there, then just make a function, which check the $_GET array and if its en or de then which one, you can load a list of words in either language. Sorry but I don't know what else you mean.
__________________
VillageIdiot can have my babbies ;d
Orc is offline  
Reply With Quote
Old 04-17-2008, 04:56 PM   #3 (permalink)
The Contributor
 
Join Date: Jan 2008
Posts: 50
Thanks: 0
khile is on a distinguished road
Default

well basicaly i want the program im making to use launage packs and i know both english and german and i have made the function that puts the launage on end of url but not sure of the code i should put in to show either English (en) or German(de)

like

on the status.php if its en it goes to en section of that and displays infomation thats under the en part of the document
khile is offline  
Reply With Quote
Old 04-17-2008, 05:01 PM   #4 (permalink)
Orc
The Prestige
 
Orc's Avatar
 
Join Date: Dec 2007
Posts: 1,044
Thanks: 193
Orc is on a distinguished road
Default

Quote:
Originally Posted by khile View Post
well basicaly i want the program im making to use launage packs and i know both english and german and i have made the function that puts the launage on end of url but not sure of the code i should put in to show either English (en) or German(de)

like

on the status.php if its en it goes to en section of that and displays infomation thats under the en part of the document
I think you should make an array of words for both languages, so you can do a string replacement using a foreach on the whole document.or a preg replace, whatever. Cause a foreach takes all the words from that array, and replaces the document's characters with the arrays one. whatever, understand me? :P

You can do this by functions aswell, so you can do for exmaple in mysql:
PHP Code:


lang
($row->msg); 
And this would replace it with whatever is in the $GET var, so if it isn't even defined in the $GET var yet, you can do

PHP Code:

if (empty($_GET['check_status_lang'])) $_GET['check_status_lang'] = 'en'
This sets the session, now if it's different, then it changes the session to german, thus it's back and forth.

default session to english. and if it's changed, then it changes the session.
__________________
VillageIdiot can have my babbies ;d
Orc is offline  
Reply With Quote
Old 04-17-2008, 05:10 PM   #5 (permalink)
Orc
The Prestige
 
Orc's Avatar
 
Join Date: Dec 2007
Posts: 1,044
Thanks: 193
Orc is on a distinguished road
Default

I dunno, in the function you could say that you want to replace what is ever in the functions args to whatever is in the array. :/ I hope you understand what I mean by that >.<
__________________
VillageIdiot can have my babbies ;d
Orc is offline  
Reply With Quote
Old 04-17-2008, 05:36 PM   #6 (permalink)
The Contributor
 
Join Date: Jan 2008
Posts: 50
Thanks: 0
khile is on a distinguished road
Default

well i have been working on this for a while and would really like to do it this way could anyone give me hints or tips how to do this as this will proberbly be easyist in long run and plus i have all ready made functions on my script
khile is offline  
Reply With Quote
Old 04-17-2008, 05:38 PM   #7 (permalink)
Orc
The Prestige
 
Orc's Avatar
 
Join Date: Dec 2007
Posts: 1,044
Thanks: 193
Orc is on a distinguished road
Default

Quote:
Originally Posted by khile View Post
well i have been working on this for a while and would really like to do it this way could anyone give me hints or tips how to do this as this will proberbly be easyist in long run and plus i have all ready made functions on my script
I gave you tips. :/
__________________
VillageIdiot can have my babbies ;d
Orc is offline  
Reply With Quote
Old 04-17-2008, 05:47 PM   #8 (permalink)
The Contributor
 
Join Date: Jan 2008
Posts: 50
Thanks: 0
khile is on a distinguished road
Default

i am evry thankful for that but i really want to do it this way could you possibly help me with doing it this way
khile is offline  
Reply With Quote
Old 04-17-2008, 05:54 PM   #9 (permalink)
Orc
The Prestige
 
Orc's Avatar
 
Join Date: Dec 2007
Posts: 1,044
Thanks: 193
Orc is on a distinguished road
Default

Quote:
Originally Posted by khile View Post
i am evry thankful for that but i really want to do it this way could you possibly help me with doing it this way
what way? ??? I'm confused. :S
__________________
VillageIdiot can have my babbies ;d
Orc is offline  
Reply With Quote
Old 04-17-2008, 06:53 PM   #10 (permalink)
The Contributor
 
Join Date: Jan 2008
Posts: 50
Thanks: 0
khile is on a distinguished road
Default

i want it so if a user goes and its status.php?check_status_lang=en it goes to english section of the document and displays all the infomation in en what ever that may be
khile is offline  
Reply With Quote
Old 04-17-2008, 06:54 PM   #11 (permalink)
Orc
The Prestige
 
Orc's Avatar
 
Join Date: Dec 2007
Posts: 1,044
Thanks: 193
Orc is on a distinguished road
Default

Quote:
Originally Posted by khile View Post
i want it so if a user goes and its status.php?check_status_lang=en it goes to english section of the document and displays all the infomation in en what ever that may be
So you don't want it to replace the text on the document with whatever language is in the $GET var? Or do you want separate pages? :/ I don't get it, cause I told you what to do. :S
__________________
VillageIdiot can have my babbies ;d
Orc is offline  
Reply With Quote
Old 04-17-2008, 07:00 PM   #12 (permalink)
The Contributor
 
Join Date: Jan 2008
Posts: 50
Thanks: 0
khile is on a distinguished road
Default

one document with x many lauages and once a user visit an area in admin panel and click the status bar a window popup and then the infomation is displayed now i have programed all of that apart from the status.php

<script src="http://www.site.com/status.php?check_status_lang=$check_status_lang"></script>

is what im using with $check_status_lang adding the lauange on the end such as en or de
khile is offline  
Reply With Quote
Old 04-17-2008, 07:03 PM   #13 (permalink)
Orc
The Prestige
 
Orc's Avatar
 
Join Date: Dec 2007
Posts: 1,044
Thanks: 193
Orc is on a distinguished road
Default

Quote:
Originally Posted by khile View Post
one document with x many lauages and once a user visit an area in admin panel and click the status bar a window popup and then the infomation is displayed now i have programed all of that apart from the status.php

<script src="http://www.site.com/status.php?check_status_lang=$check_status_lang"></script>

is what im using with $check_status_lang adding the lauange on the end such as en or de
what information?
__________________
VillageIdiot can have my babbies ;d
Orc is offline  
Reply With Quote
Old 04-17-2008, 07:11 PM   #14 (permalink)
The Contributor
 
Join Date: Jan 2008
Posts: 50
Thanks: 0
khile is on a distinguished road
Default

well what ever is in the EN or DE section of that document
khile is offline  
Reply With Quote
Old 04-17-2008, 07:12 PM   #15 (permalink)
Orc
The Prestige
 
Orc's Avatar
 
Join Date: Dec 2007
Posts: 1,044
Thanks: 193
Orc is on a distinguished road
Default

Quote:
Originally Posted by khile View Post
well what ever is in the EN or DE section of that document
So you want a translator?
__________________
VillageIdiot can have my babbies ;d
Orc is offline  
Reply With Quote
Old 04-17-2008, 07:17 PM   #16 (permalink)
The Contributor
 
Join Date: Jan 2008
Posts: 50
Thanks: 0
khile is on a distinguished road
Default

no like i said if user status.php?check_status_lang=en what ever infomaton is stored in en part of the document is displayed and if de is displayed in look in the document till it finds the de section
khile is offline  
Reply With Quote
Old 04-17-2008, 07:19 PM   #17 (permalink)
Orc
The Prestige
 
Orc's Avatar
 
Join Date: Dec 2007
Posts: 1,044
Thanks: 193
Orc is on a distinguished road
Default

Quote:
Originally Posted by khile View Post
no like i said if user status.php?check_status_lang=en what ever infomaton is stored in en part of the document is displayed and if de is displayed in look in the document till it finds the de section
do you mean if you put in de of the site, it grabs whatever part of the iis in german and gives it to the user?
__________________
VillageIdiot can have my babbies ;d
Orc is offline  
Reply With Quote
Old 04-17-2008, 07:36 PM   #18 (permalink)
The Contributor
 
Join Date: Jan 2008
Posts: 50
Thanks: 0
khile is on a distinguished road
Default

sort of it greabs what ever is in the DE section of status.php
khile is offline  
Reply With Quote
Old 04-17-2008, 07:37 PM   #19 (permalink)
Orc
The Prestige
 
Orc's Avatar
 
Join Date: Dec 2007
Posts: 1,044
Thanks: 193
Orc is on a distinguished road
Default

Quote:
Originally Posted by khile View Post
sort of it greabs what ever is in the DE section of status.php
yeah, is this mysql or flat file or...?
__________________
VillageIdiot can have my babbies ;d
Orc is offline  
Reply With Quote
Old 04-17-2008, 07:51 PM   #20 (permalink)
The Contributor
 
Join Date: Jan 2008
Posts: 50
Thanks: 0
khile is on a distinguished road
Default

just in a php file
khile is offline  
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT. The time now is 02:43 PM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design